Public report of metalbear-co/mirrord, published 14 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 14 November 2026, 19:13 UTC · Survey ID cd_4ca060440bbf401aa63afe78ae7dd025

metalbear-co/mirrord

Measured 14 November 2026, 19:12 UTC, at code version 77c2d33

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

CAI score 58out of 100 At risk Up 3 since the last survey

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

A large codebase: 243,436 lines of product code in 48 projects, tests not counted · Estimated rebuild effort: about 1.9 person-years · Weakest lens: Code Health, 52

Findings by how serious they are

62 critical 934 serious 125 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 19:12 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

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

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

72of 72 dimensions measured by tools.
1046of 1121 findings point to an exact file and line, so you can open each one in the code. The other 75 concern the repository as a whole, such as missing documentation.
72dimensions across 8 lenses, read from 243,436 lines of product code in 48 projects.
Chapters

Executive summary

metalbear-co/mirrord is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 58 out of 100, which the At risk rating leaves unchanged.

Code Health, at 52, is the weakest lens and counts most in the score. The best first step is replacing the two exposed passwords or keys and switching the old ones off, worth about 3 points. Turning on missing-value checks would lift Code Health itself, also worth about 3. Raising Code Health to 70 would lift the score to about 62.

Seventeen settings leave the servers or containers unsafe. Fourteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and twelve secrets can leak from the build pipeline. Correcting the unsafe settings, pinning each tool to an exact version and limiting each secret to its own step would close these risks. Setting a waiting period for automatic updates would fix the two automatic dependency updates that take new releases at once, and the three pipeline steps that install packages without pinning their versions need the packages they install pinned to exact versions. The three form fields without a label need a label.

The product code is 243,436 lines, about €280,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 52 · counts for 45%Production Readiness 57 · counts for 25%Security and Compliance 61 · counts for 14%Accessibility 64 · counts for 8%Performance 70 · counts for 4%Maturity 79 · counts for 2%Architecture 92 · counts for 1%Event Sourcing 100 · counts for 1%

If Code Health rose from 52 to 70, the lowest score rated Strong, the score would rise from 58 to about 62.

Code composition: what the lines of code are
Product code 91%Tests 9%
New since the last survey: 253 findings

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

  • Cyclomatic Complexity · mirrord::preview::wait_until_started (cyclomatic 32) mirrord/cli/src/preview.rs
  • Cyclomatic Complexity · ServiceConfig::assemble (cyclomatic 30) mirrord/up/src/config.rs
  • Cyclomatic Complexity · mirrord::up::checks::check_db_branches (cyclomatic 26) mirrord/cli/src/up/checks.rs
  • Cyclomatic Complexity · TargetStep.TargetStep (cyclomatic 26) packages/wizard/src/components/steps/TargetStep.tsx
  • Cyclomatic Complexity · OperatorApi::should_copy_target (cyclomatic 21) mirrord/operator/src/client.rs
  • Cyclomatic Complexity · LayerManagedProcess::execute_with_closure (cyclomatic 18) mirrord/layer-lib/src/process/windows/execution/mod.rs
  • Cyclomatic Complexity · UpConfig::select_preview_images (cyclomatic 18) mirrord/up/src/config.rs
  • Cyclomatic Complexity · PreviewSyncConfig::check (cyclomatic 17) mirrord/operator/src/crd/preview/sync_config.rs
  • Cyclomatic Complexity · mirrord_operator::client::preview_sync::pack_changes (cyclomatic 16) mirrord/operator/src/client/preview_sync.rs
  • Cyclomatic Complexity · UpConfig::collect_analytics (cyclomatic 16) mirrord/up/src/config.rs
  • Cyclomatic Complexity · (anonymous) (cyclomatic 16) REDACTED
  • Cognitive Complexity · mirrord::preview::wait_until_started (cognitive 49) mirrord/cli/src/preview.rs
  • Cognitive Complexity · mirrord::up::checks::check_db_branches (cognitive 36) mirrord/cli/src/up/checks.rs
  • Cognitive Complexity · OperatorApi::should_copy_target (cognitive 25) mirrord/operator/src/client.rs
  • Cognitive Complexity · mirrord_operator::client::preview_sync::pack_changes (cognitive 23) mirrord/operator/src/client/preview_sync.rs
  • Cognitive Complexity · TargetStep.TargetStep (cognitive 23) packages/wizard/src/components/steps/TargetStep.tsx
  • Cognitive Complexity · LayerManagedProcess::execute_with_closure (cognitive 22) mirrord/layer-lib/src/process/windows/execution/mod.rs
  • Cognitive Complexity · PreviewSyncConfig::check (cognitive 21) mirrord/operator/src/crd/preview/sync_config.rs
  • Cognitive Complexity · Changes::merge (cognitive 20) mirrord/cli/src/preview/sync.rs
  • Cognitive Complexity · OperatorApi::should_copy_target_mc (cognitive 17) mirrord/operator/src/client.rs
  • Cognitive Complexity · mirrord::connection::create_and_connect (cognitive 16) mirrord/cli/src/connection.rs
  • Cognitive Complexity · mirrord::preview::sync::list_entries (cognitive 16) mirrord/cli/src/preview/sync.rs
  • God Classes · FunctionTooLong: TargetStep.TargetStep packages/wizard/src/components/steps/TargetStep.tsx
  • God Classes · FunctionTooLong: mirrord::up::checks::check_db_branches mirrord/cli/src/up/checks.rs
  • God Classes · FileTooLong: preview/sync.rs mirrord/cli/src/preview/sync.rs
  • God Classes · FunctionTooLong: ExportStep.ExportStep packages/wizard/src/components/steps/ExportStep.tsx
  • God Classes · FunctionTooLong: mirrord::preview::wait_until_started mirrord/cli/src/preview.rs
  • God Classes · FunctionTooLong: TrafficStep.TrafficStep packages/wizard/src/components/steps/TrafficStep.tsx
  • God Classes · MethodTooLong: ServiceConfig.assemble mirrord/up/src/config.rs
  • God Classes · MethodTooLong: LayerManagedProcess.execute_with_closure mirrord/layer-lib/src/process/windows/execution/mod.rs
  • God Classes · FileTooLong: feature/split_queues.rs mirrord/config/src/feature/split_queues.rs
  • God Classes · FunctionTooLong: mirrord::port_forward mirrord/cli/src/main.rs
  • Code Duplication · Near-duplicate member family (4 members, 35 shared lines) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Near-duplicate member family (3 members, 36 shared lines) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Near-duplicate member pair (74 shared lines) mirrord/operator/src/client.rs
  • Code Duplication · Near-duplicate member pair (54 shared lines) mirrord/cli/src/execution.rs
  • Code Duplication · Near-duplicate member pair (36 shared lines) mirrord/cli/src/ci.rs
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) mirrord/layer/src/file/ops.rs
  • Code Duplication · Edited copy of a member (80 corresponding lines) mirrord/layer/macro/src/lib.rs
  • Code Duplication · Edited copy of a member (61 corresponding lines) mirrord/layer-lib/src/error.rs
  • Code Duplication · Edited copy of a member (56 corresponding lines) mirrord/cli/src/execution.rs
  • Code Duplication · Edited copy of a member (47 corresponding lines) mirrord/tui/src/screens/databases.rs
  • Code Duplication · Edited copy of a member (42 corresponding lines) mirrord/tui/src/screens/databases.rs
  • Code Duplication · Edited copy of a member (41 corresponding lines) mirrord/cli/src/config.rs
  • Code Duplication · Edited copy of a member (34 corresponding lines) mirrord/intproxy/src/proxies/files.rs
  • Code Duplication · Edited copy of a member (42 corresponding lines) mirrord/agent/iptables/src/lib.rs
  • Code Duplication · Edited copy of a member (48 corresponding lines) mirrord/layer-lib/src/socket/ops.rs
  • Code Duplication · Edited copy of a member (22 corresponding lines) mirrord/tui/src/screens/preview_envs/view.rs
  • Code Duplication · Edited copy of a member (40 corresponding lines) mirrord/layer-win/src/hooks/socket/mod.rs
  • Code Duplication · Edited copy of a member (41 corresponding lines) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Edited copy of a member (30 corresponding lines) mirrord/cli/src/config.rs
  • Code Duplication · Edited copy of a member (33 corresponding lines) mirrord/protocol-api/src/client/outgoing.rs
  • Code Duplication · Edited copies of one member (4 members, 20+ corresponding lines) mirrord/config/src/feature/database_branches.rs
  • Code Duplication · Edited copy of a member (33 corresponding lines) mirrord/tui/src/screens/databases.rs
  • Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) mirrord/agent/src/outgoing/seqpacket.rs
  • Code Duplication · Edited copies of one member (3 members, 39+ corresponding lines) xtask/src/tasks/cli.rs
  • Code Duplication · Edited copy of a member (26 corresponding lines) mirrord/agent/src/outgoing/seqpacket.rs
  • Code Duplication · Edited copy of a member (26 corresponding lines) mirrord/cli/src/extract.rs
  • Code Duplication · Edited copy of a member (36 corresponding lines) mirrord/intproxy/src/proxies/outgoing/interceptor/read_queue.rs
  • Code Duplication · Edited copy of a member (36 corresponding lines) mirrord/vpn/src/packet.rs
  • Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) mirrord/kube/src/resolved.rs
  • Code Duplication · Edited copy of a member (41 corresponding lines) mirrord/kube/src/api/kubernetes/rollout.rs
  • Code Duplication · Edited copy of a member (30 corresponding lines) mirrord/tui/src/screens/preview_envs/view.rs
  • Code Duplication · Edited copy of a member (26 corresponding lines) mirrord/cli/src/data/global_config.rs
  • Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Edited copy of a member (22 corresponding lines) mirrord/protocol-api/src/client/retrying.rs
  • Code Duplication · Edited copy of a member (20 corresponding lines) mirrord/tui/src/screens/preview_envs/view.rs
  • Code Duplication · Edited copy of a member (22 corresponding lines) mirrord/layer/src/file/hooks.rs
  • Code Duplication · Edited copies of one member (4 members, 21+ corresponding lines) mirrord/layer/src/file/hooks.rs
  • Code Duplication · Edited copy of a member (26 corresponding lines) mirrord/agent/src/file.rs
  • Code Duplication · Edited copy of a member (76 corresponding lines) mirrord/layer-go/src/linux_x64.rs
  • Code Duplication · Edited copy of a member (18 corresponding lines) mirrord/protocol-io/src/websocket.rs
  • Code Duplication · Edited copy of a member (29 corresponding lines) mirrord/operator/src/client.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) mirrord/config/src/feature/database_branches.rs
  • Code Duplication · Edited copy of a member (36 corresponding lines) mirrord/layer-go/src/linux_aarch64.rs
  • Code Duplication · Edited copy of a member (18 corresponding lines) mirrord/agent/src/outgoing/seqpacket.rs
  • Code Duplication · Edited copy of a member (24 corresponding lines) mirrord/agent/src/incoming/mirror_handle.rs
  • Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) mirrord/agent/src/util/io/timeout.rs
  • Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) mirrord/operator/src/crd/db_branching/mongodb.rs
  • Code Duplication · Edited copy of a member (26 corresponding lines) mirrord/layer/src/file/hooks.rs
  • Code Duplication · Edited copy of a member (27 corresponding lines) mirrord/agent/src/steal/subscriptions.rs
  • Code Duplication · Edited copy of a member (23 corresponding lines) mirrord/layer/src/file/hooks.rs
  • Code Duplication · Edited copy of a member (33 corresponding lines) mirrord/operator/src/crd/db_branching/branch_database.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) mirrord/agent/src/file.rs
  • Code Duplication · Edited copy of a member (24 corresponding lines) mirrord/cli/src/connection.rs
  • Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) mirrord/layer-win/src/hooks/socket/mod.rs
  • Code Duplication · Edited copy of a member (18 corresponding lines) mirrord/tls-util/src/secure_channel.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) mirrord/utils-win/src/modules.rs
  • Code Duplication · Edited copy of a member (23 corresponding lines) mirrord/analytics/src/lib.rs
  • Code Duplication · Edited copy of a member (22 corresponding lines) mirrord/layer/src/file/open_dirs.rs
  • Code Duplication · Edited copy of a member (19 corresponding lines) mirrord/auth/src/credentials.rs
  • Code Duplication · Edited copies of one member (4 members, 22+ corresponding lines) mirrord/operator/src/crd/db_branching/branch_database.rs
  • Code Duplication · Edited copy of a member (20 corresponding lines) mirrord/layer-win/src/managed/sharded_map.rs
  • Code Duplication · Edited copies of one member (4 members, 37+ corresponding lines) mirrord/layer/src/socket/dns_sd.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) mirrord/cli/src/config.rs
  • Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) mirrord/agent/src/file.rs
  • Code Duplication · Edited copy of a member (18 corresponding lines) mirrord/cli/src/ui/server.rs
  • Code Duplication · Edited copy of a member (18 corresponding lines) mirrord/layer/src/file/open_dirs.rs
  • Code Duplication · Edited copy of a member (16 corresponding lines) mirrord/config/src/feature/fs/mode.rs

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 131 findings

These 131 critical or serious findings were in the previous survey, on 28 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · TargetTab.TargetTab (cyclomatic 47) packages/wizard/src/components/steps/TargetTab.tsx
  • Cyclomatic Complexity · JsonUtils.readCurrentFilters (cyclomatic 33) packages/wizard/src/components/JsonUtils.tsx
  • Cyclomatic Complexity · JsonUtils.updateConfigFilter (cyclomatic 24) packages/wizard/src/components/JsonUtils.tsx
  • Cyclomatic Complexity · mirrord::up::db_branches::check_db_branches (cyclomatic 18) mirrord/cli/src/up/db_branches.rs
  • Cyclomatic Complexity · JsonUtils.updateConfigPorts (cyclomatic 17) packages/wizard/src/components/JsonUtils.tsx
  • Cognitive Complexity · TargetTab.TargetTab (cognitive 32) packages/wizard/src/components/steps/TargetTab.tsx
  • Cognitive Complexity · mirrord::up::db_branches::check_db_branches (cognitive 27) mirrord/cli/src/up/db_branches.rs
  • Cognitive Complexity · JsonUtils.updateConfigFilter (cognitive 22) packages/wizard/src/components/JsonUtils.tsx
  • Cognitive Complexity · MirrordCi::prepare_container_command (cognitive 21) mirrord/cli/src/ci.rs
  • Cognitive Complexity · JsonUtils.readCurrentFilters (cognitive 17) packages/wizard/src/components/JsonUtils.tsx
  • God Classes · FunctionTooLong: NetworkTab.NetworkTab packages/wizard/src/components/steps/NetworkTab.tsx
  • God Classes · FunctionTooLong: ConfigTabs.ConfigTabs packages/wizard/src/components/steps/ConfigTabs.tsx
  • God Classes · FunctionTooLong: mirrord::up::db_branches::check_db_branches mirrord/cli/src/up/db_branches.rs
  • God Classes · FileTooLong: components/JsonUtils.tsx packages/wizard/src/components/JsonUtils.tsx
  • Code Duplication · Near-duplicate member family (3 members, 35 shared lines) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Near-duplicate member pair (73 shared lines) mirrord/operator/src/client.rs
  • Code Duplication · Near-duplicate member pair (56 shared lines) mirrord/cli/src/execution.rs
  • Code Duplication · Near-duplicate member pair (43 shared lines) mirrord/cli/src/ci.rs
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) mirrord/layer/src/file/ops.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) mirrord/operator/src/client.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Duplicated block (49 lines × 2) mirrord/tui/src/screens/databases.rs
  • Code Duplication · Duplicated block (25 lines × 2) mirrord/cli/src/ci.rs
  • Code Duplication · Duplicated block (25 lines × 2) mirrord/tui/src/screens/databases.rs
  • Code Duplication · Duplicated block (20–22 lines × 2) mirrord/cli/src/preview.rs
  • Code Duplication · Duplicated block (21 lines × 2) mirrord/tui/src/screens/databases.rs
  • Code Duplication · Duplicated block (17 lines × 2) mirrord/layer/macro/src/lib.rs
  • Code Duplication · Duplicated block (15 lines × 2) mirrord/kube/src/resolved.rs
  • Code Duplication · Duplicated block (14–15 lines × 2) mirrord/layer/macro/src/lib.rs
  • Code Duplication · Duplicated block (14–15 lines × 2) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Duplicated block (15 lines × 2) xtask/src/tasks/layer.rs
  • Code Duplication · Duplicated block (13–14 lines × 4) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Duplicated block (14 lines × 2) mirrord/tui/src/screens/databases.rs
  • Code Duplication · Duplicated block (14 lines × 2) xtask/src/tasks/cli.rs
  • Code Duplication · Duplicated block (12–13 lines × 4) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Duplicated block (13 lines × 2) mirrord/agent/src/steal/api.rs
  • Code Duplication · Duplicated block (11 lines × 2) mirrord/operator/src/client.rs
  • Code Duplication · Duplicated block (11 lines × 2) mirrord/operator/src/client.rs
  • Code Duplication · Duplicated block (10 lines × 2) mirrord/cli/src/port_forward.rs
  • Code Duplication · Duplicated block (10 lines × 2) mirrord/layer/src/file/hooks.rs
  • Code Duplication · Duplicated block (8–10 lines × 2) mirrord/tui/src/screens/preview_envs/view.rs
  • Code Duplication · Duplicated block (10 lines × 2) mirrord/tui/src/screens/targets/browser.rs
  • Code Duplication · Duplicated block (9 lines × 3) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Duplicated block (8 lines × 3) mirrord/operator/src/client.rs
  • Code Duplication · Duplicated block (8 lines × 2) mirrord/cli/src/execution.rs
  • Code Duplication · Duplicated block (7 lines × 2) mirrord/cli/src/config.rs
  • Code Duplication · Duplicated block (7 lines × 2) mirrord/protocol-api/src/client/simple_request.rs
  • Code Duplication · Duplicated block (7 lines × 2) mirrord/tui/src/screens/databases.rs
  • Code Duplication · Duplicated block (6 lines × 2) mirrord/kube/src/error.rs
  • Code Duplication · Duplicated block (6 lines × 2) mirrord/protocol-api/src/client/simple_request.rs
  • Code Duplication · Duplicated block (6 lines × 2) mirrord/tui/src/screens/databases.rs
  • Code Duplication · Duplicated block (13 lines × 2) mirrord/operator/src/crd.rs
  • Code Duplication · Duplicated block (15 lines × 3) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Duplicated block (10 lines × 2) mirrord/cli/src/extension.rs
  • Code Duplication · Duplicated block (9 lines × 3) mirrord/operator/src/client/database_branches.rs
  • Code Duplication · Duplicated block (9 lines × 2) mirrord/cli/src/config.rs
  • Code Duplication · Duplicated block (8 lines × 3) mirrord/tui/src/screens/preview_envs/view.rs
  • Code Duplication · Duplicated block (5 lines × 2) mirrord/cli/src/config.rs
  • Code Duplication · Duplicated block (5 lines × 2) mirrord/cli/src/container/sidecar.rs
  • Code Duplication · Duplicated block (6 lines × 2) mirrord/layer/src/file/hooks.rs
  • Churn × Complexity Hotspots · Hotspot: mirrord/operator/src/crd.rs mirrord/operator/src/crd.rs
  • Churn × Complexity Hotspots · Hotspot: mirrord/cli/src/error.rs mirrord/cli/src/error.rs
  • Churn × Complexity Hotspots · Hotspot: mirrord/config/src/target.rs mirrord/config/src/target.rs
  • Churn × Complexity Hotspots · Hotspot: mirrord/operator/src/crd/db_branching/branch_database.rs mirrord/operator/src/crd/db_branching/branch_database.rs
  • Churn × Complexity Hotspots · Hotspot: mirrord/agent/src/entrypoint.rs mirrord/agent/src/entrypoint.rs
  • Churn × Complexity Hotspots · Hotspot: mirrord/cli/src/up/db_branches.rs mirrord/cli/src/up/db_branches.rs
  • Churn × Complexity Hotspots · Hotspot: mirrord/layer/src/go.rs mirrord/layer/src/go.rs
  • Churn × Complexity Hotspots · Hotspot: mirrord/intproxy/src/layer_initializer.rs mirrord/intproxy/src/layer_initializer.rs
  • Churn × Complexity Hotspots · Hotspot: packages/monitor/src/components/OperatorSessionDetail.tsx packages/monitor/src/components/OperatorSessionDetail.tsx
  • Churn × Complexity Hotspots · Hotspot: mirrord/cli/src/queue_splitting.rs mirrord/cli/src/queue_splitting.rs
  • Churn × Complexity Hotspots · Repeated repair: mirrord/cli/src/pitm.rs mirrord/cli/src/pitm.rs
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: watchdog-secret-into-unpinned-action REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: watchdog-secret-into-unpinned-action REDACTED
  • Static Analysis (SAST) · Medium: watchdog-regex-match-index-beyond-capture-groups-js REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: RUSTSEC-2026-0367 REDACTED
  • Change Coupling · Change coupling: incoming.rs ↔ outgoing.rs mirrord/config/src/feature/network/incoming.rs
  • Code Duplication · Duplication concentrated across 3 sibling directories (5 clone groups) packages/monitor/eslint.config.js
  • Code Duplication · Duplicated block (26 lines × 3 locations) packages/wizard/src/components/JsonUtils.tsx
  • Code Duplication · Duplicated block (26 lines × 2 locations) packages/wizard/src/components/steps/TargetTab.tsx
  • Code Duplication · Duplicated block (17 lines × 2 locations) packages/wizard/src/components/steps/TargetTab.tsx
  • Code Duplication · Duplicated block (16 lines × 2 locations) packages/wizard/src/components/JsonUtils.tsx
  • Code Duplication · Duplicated block (14 lines × 2 locations) packages/wizard/src/components/JsonUtils.tsx
  • Code Duplication · Duplicated block (14 lines × 2 locations) packages/wizard/src/components/steps/ConfigTabs.tsx
  • Code Duplication · Duplicated block (13 lines × 4 locations) packages/wizard/src/components/JsonUtils.tsx
  • Code Duplication · Duplicated block (12 lines × 2 locations) packages/wizard/src/components/JsonUtils.tsx
  • Code Duplication · Duplicated block (12 lines × 3 locations) packages/wizard/src/components/steps/LearningSteps.tsx
  • Code Duplication · Duplicated block (11 lines × 2 locations) packages/wizard/src/components/JsonUtils.tsx
  • Code Duplication · Duplicated block (10 lines × 2 locations) packages/wizard/src/components/steps/TargetTab.tsx
  • Code Duplication · Duplicated block (9 lines × 2 locations) packages/wizard/src/components/JsonUtils.tsx
  • Code Duplication · Duplicated block (8 lines × 3 locations) packages/wizard/src/components/JsonUtils.tsx
  • Cyclomatic Complexity · Complex function TargetTab (cyclomatic 30, cognitive 28) packages/wizard/src/components/steps/TargetTab.tsx
  • Cyclomatic Complexity · Complex function updateConfigFilter (cyclomatic 22, cognitive 23) packages/wizard/src/components/JsonUtils.tsx
  • Cyclomatic Complexity · Complex function Wizard (cyclomatic 19, cognitive 16) packages/wizard/src/components/Wizard.tsx
  • Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 17, cognitive 14) packages/wizard/src/components/JsonUtils.tsx
  • Cyclomatic Complexity · Complex function updateConfigPorts (cyclomatic 17, cognitive 14) packages/wizard/src/components/JsonUtils.tsx
  • Cyclomatic Complexity · Complex function NetworkTab (cyclomatic 14, cognitive 13) packages/wizard/src/components/steps/NetworkTab.tsx
Rebuild cost: about €280,000 · Estimate
Cost to rebuild€92,000 to €460,000, for 1,535 to 4,869 hours of work, about 1.9 person-years for 1 to 4 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 58. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 243,436 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

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

1
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.
Raises the score by about 3 points · Low effort · Secret Scanning
2
The findings name the configuration each number was taken from and, for the assertions, the files that hold them.
Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Raises the score by about 3 points · Medium effort · Nullable reference types
3
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Raises the score by about 3 points · Medium effort · Cancellation propagation

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €280,000 to build again, about 1.9 person-years of work. Its weakest lens is Code Health, at 52 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 2 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 3 points for low effort, because it clears the 2 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

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

arch mirrord mirrord mirrord-analytics mirrord-analytics mirrord->mirrord-analytics mirrord-command mirrord-command mirrord->mirrord-command mirrord-config mirrord-config mirrord->mirrord-config mirrord-intproxy mirrord-intproxy mirrord->mirrord-intproxy mirrord-intproxy-protocol mirrord-intproxy-protocol mirrord->mirrord-intproxy-protocol mirrord-kube mirrord-kube mirrord->mirrord-kube mirrord-layer-lib mirrord-layer-lib mirrord->mirrord-layer-lib mirrord-operator mirrord-operator mirrord->mirrord-operator mirrord-operator-websocket mirrord-operator-websocket mirrord->mirrord-operator-websocket mirrord-progress mirrord-progress mirrord->mirrord-progress mirrord-protocol mirrord-protocol mirrord->mirrord-protocol mirrord-protocol-io mirrord-protocol-io mirrord->mirrord-protocol-io mirrord-sessions-manager-client mirrord-sessions-manager-client mirrord->mirrord-sessions-manager-client mirrord-tui mirrord-tui mirrord->mirrord-tui mirrord-up mirrord-up mirrord->mirrord-up utils-win utils-win mirrord->utils-win mirrord-agent mirrord-agent mirrord-agent->mirrord-protocol mirrord-agent->mirrord-protocol-io mirrord-agent->mirrord-sessions-manager-client mirrord-config->mirrord-analytics mirrord-config->mirrord-command mirrord-config->mirrord-protocol mirrord-intproxy->mirrord-analytics mirrord-intproxy->mirrord-config mirrord-intproxy->mirrord-intproxy-protocol mirrord-intproxy->mirrord-kube mirrord-intproxy->mirrord-operator mirrord-intproxy->mirrord-progress mirrord-intproxy->mirrord-protocol mirrord-intproxy->mirrord-protocol-io mirrord-intproxy->mirrord-sessions-manager-client mirrord-intproxy->utils-win mirrord-intproxy-protocol->mirrord-protocol mirrord-kube->mirrord-config mirrord-kube->mirrord-progress mirrord-layer mirrord-layer mirrord-layer->mirrord-config mirrord-layer->mirrord-intproxy-protocol mirrord-layer->mirrord-layer-lib mirrord-layer->mirrord-progress mirrord-layer->mirrord-protocol mirrord-layer-lib->mirrord-config mirrord-layer-lib->mirrord-intproxy-protocol mirrord-layer-lib->mirrord-progress mirrord-layer-lib->mirrord-protocol mirrord-layer-lib->utils-win mirrord-layer-win mirrord-layer-win mirrord-layer-win->mirrord-config mirrord-layer-win->mirrord-intproxy-protocol mirrord-layer-win->mirrord-layer-lib mirrord-layer-win->mirrord-progress mirrord-layer-win->mirrord-protocol mirrord-layer-win->utils-win mirrord-operator->mirrord-analytics mirrord-operator->mirrord-command mirrord-operator->mirrord-config mirrord-operator->mirrord-kube mirrord-operator->mirrord-operator-websocket mirrord-operator->mirrord-progress mirrord-operator-websocket->mirrord-protocol mirrord-operator-websocket->mirrord-protocol-io mirrord-protocol-io->mirrord-protocol mirrord-sessions-manager-client->mirrord-operator-websocket mirrord-sessions-manager-client->mirrord-protocol-io mirrord-tui->mirrord-analytics mirrord-tui->mirrord-command mirrord-tui->mirrord-config mirrord-tui->mirrord-kube mirrord-tui->mirrord-operator mirrord-up->mirrord-analytics mirrord-up->mirrord-command mirrord-up->mirrord-config mirrord-up->mirrord-kube utils-win->mirrord-config __more__ +27 more projects

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

738 modules, with 1260 dependencies between them. 14 loops run through 51 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 698 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 mirrord.config2 mirrord.data.user_data3 mirrord_agent.incoming.task4 mirrord_analytics5 mirrord_config.config.context6 mirrord_progress7 mirrord_protocol.outgoing8 mirrord_protocol.tcp9 mirrord_protocol_io10 mirrord_tui.context11 packages.monitor.src.types12 mirrord_config.config13 mirrord_intproxy_protocol14 packages.monitor.src.components15 mirrord.error16 mirrord_config.feature.split_queues17 mirrord_config.target18 mirrord_protocol.codec19 mirrord_agent.entrypoint20 mirrord_config.feature.database_branches21 mirrord_config.util22 mirrord_intproxy.background_tasks23 mirrord_operator.crd.session24 mirrord_protocol_api.client.outgoing25 mirrord.ci26 mirrord_config.feature27 mirrord_config.feature.network.incoming28 mirrord_intproxy29 mirrord_intproxy.proxies.outgoing30 mirrord_operator.crd.db_branching.branch_database31 mirrord_config32 mirrord_operator.client.database_branches33 mirrord_operator.crd.preview34 mirrord_layer_lib.setup35 mirrord_operator.crd36 mirrord_up.config37 mirrord.ui.server38 mirrord_operator.client39 mirrord.connector40 mirrord.preview
1 mirrord.config
2 mirrord.data.user_data
3 mirrord_agent.incoming.task
4 mirrord_analytics
5 mirrord_config.config.context
6 mirrord_progress
7 mirrord_protocol.outgoing
8 mirrord_protocol.tcp
9 mirrord_protocol_io
10 mirrord_tui.context
11 packages.monitor.src.types
12 mirrord_config.config1
13 mirrord_intproxy_protocol32
14 packages.monitor.src.components2
15 mirrord.error11
16 mirrord_config.feature.split_queues222
17 mirrord_config.target212
18 mirrord_protocol.codec1
19 mirrord_agent.entrypoint12
20 mirrord_config.feature.database_branches2121
21 mirrord_config.util231
22 mirrord_intproxy.background_tasks21
23 mirrord_operator.crd.session2
24 mirrord_protocol_api.client.outgoing21
25 mirrord.ci11
26 mirrord_config.feature211
27 mirrord_config.feature.network.incoming2122
28 mirrord_intproxy125
29 mirrord_intproxy.proxies.outgoing3912
30 mirrord_operator.crd.db_branching.branch_database12
31 mirrord_config22121
32 mirrord_operator.client.database_branches5415
33 mirrord_operator.crd.preview22111
34 mirrord_layer_lib.setup1122
35 mirrord_operator.crd11
36 mirrord_up.config42213
37 mirrord.ui.server113
38 mirrord_operator.client1112322
39 mirrord.connector121
40 mirrord.preview81231112124113
Uses a module listed above itPart of a loopThe module itself
1 mirrord.config2 mirrord.data.user_data3 mirrord_agent.incoming.task4 mirrord_analytics5 mirrord_config.config.context6 mirrord_progress7 mirrord_protocol.outgoing8 mirrord_protocol.tcp9 mirrord_protocol_io10 mirrord_tui.context11 packages.monitor.src.types12 mirrord_config.config13 mirrord_intproxy_protocol14 packages.monitor.src.components15 mirrord.error16 mirrord_config.feature.split_queues17 mirrord_config.target18 mirrord_protocol.codec19 mirrord_agent.entrypoint20 mirrord_config.feature.database_branches21 mirrord_config.util22 mirrord_intproxy.background_tasks23 mirrord_operator.crd.session24 mirrord_protocol_api.client.outgoing25 mirrord.ci26 mirrord_config.feature27 mirrord_config.feature.network.incoming28 mirrord_intproxy29 mirrord_intproxy.proxies.outgoing30 mirrord_operator.crd.db_branching.branch_database31 mirrord_config32 mirrord_operator.client.database_branches33 mirrord_operator.crd.preview34 mirrord_layer_lib.setup35 mirrord_operator.crd36 mirrord_up.config37 mirrord.ui.server38 mirrord_operator.client39 mirrord.connector40 mirrord.previewmirrord.config1mirrord.data.user_data2mirrord_agent.incoming.task3mirrord_analytics4mirrord_config.config.context5mirrord_progress6mirrord_protocol.outgoing7mirrord_protocol.tcp8mirrord_protocol_io9mirrord_tui.context10packages.monitor.src.types11mirrord_config.config12mirrord_intproxy_protocol13packages.monitor.src.components14mirrord.error15mirrord_config.feature.split_queues16mirrord_config.target17mirrord_protocol.codec18mirrord_agent.entrypoint19mirrord_config.feature.database_branches20mirrord_config.util21mirrord_intproxy.background_tasks22mirrord_operator.crd.session23mirrord_protocol_api.client.outgoing24mirrord.ci25mirrord_config.feature26mirrord_config.feature.network.incoming27mirrord_intproxy28mirrord_intproxy.proxies.outgoing29mirrord_operator.crd.db_branching.branch_database30mirrord_config31mirrord_operator.client.database_branches32mirrord_operator.crd.preview33mirrord_layer_lib.setup34mirrord_operator.crd35mirrord_up.config36mirrord.ui.server37mirrord_operator.client38mirrord.connector39mirrord.preview401322112222121122121231212211121121221253912122212154152211111221142213113111232212181231112124113+698 more modules (most-connected shown)

At a glance — Code Health · 52% · Adequate · gated by X5 ·

At a glance — Architecture · 92% · Exemplary ·

At a glance — Maturity · 79% · Strong ·

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

At a glance — Security · 61% · Adequate · gated by D29, D31 ·

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

At a glance — Accessibility · 64% · Adequate · gated by AC6 ·

At a glance — Performance · 70% · Strong ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection38High / Critical
A02:2025 — Security Misconfiguration33High / Critical
A03:2025 — Software Supply Chain Failures15High / Critical
A07:2025 — Authentication Failures2High / Critical

Roadmap

Top priorities: The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`); Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED; Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.

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

Do thisHelpsEffortDimension
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED.+2.7 ptsLowSecret Scanning
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).+3.5 ptsMediumNullable reference types
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.+2.6 ptsMediumCancellation propagation
Interpolated log message defeats structured logging+2.2 ptsMediumStructured logging
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.+1.7 ptsMediumOutbound HTTP resilience
Add tests that import the unreached modules (directly or through their public entry).+1.5 ptsMediumTest Coverage
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.+1.0 ptsMediumWeb-Security Posture
Bring the 4 bodies over 60 down to 60 or less in Cognitive Complexity — start with OperatorApi::prepare_branch_dbs (cognitive 131), LayerConfig::verify (cognitive 75), OutgoingProxy::run (cognitive 72).+0.9 ptsHighCognitive Complexity

File quality

Per-file score 0–10 — a quality signature. Of 264 files carrying findings, judged against the Production bar: 3% slop · 56% mixed · 41% near-clean.

FileScoreBandWorst signal
REDACTED1.6SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
mirrord/cli/src/connection.rs4.8MixedCyclomatic Complexity: mirrord::connection::try_connect_using_operator (cyclomatic 25)
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
mirrord/agent/src/outgoing/seqpacket.rs5.5MixedCode Duplication: Edited copies of one member (3 members, 35+ corresponding lines)
mirrord/cli/src/internal_proxy/db_portforwards.rs5.6MixedCyclomatic Complexity: mirrord::internal_proxy::db_portforwards::extract_portforward_configs (cyclomatic 20)
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
mirrord/intproxy/src/lib.rs6.0MixedExplicit Debt: TodoComment
mirrord/layer/src/socket/ops.rs6.0MixedExplicit Debt: TodoComment
mirrord/layer-lib/src/debugger_ports.rs6.0MixedExplicit Debt: TodoComment
mirrord/layer-win/src/hooks/files/ops/open.rs6.0MixedExplicit Debt: TodoComment

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

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

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

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

Could not be resolved — 16

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

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 72 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 72 dimensions across the health lenses
D1D2D3D4D5D6D10D12D13D14D15D16D17D19D20D24D26D28D29D30D31D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AX10AX2AX3AX4AX8AX9C2ES2M1M2M3M4P1P10P2P3P4P6P7PF3R1R10R2R3R4R6R7R8R9S1X1X14X15X2X21X29X30X4X5

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1db79-736e-7b2e-abf9-ee219ce8526a.

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

Run transparency — what happened this run

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

  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 60 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 216 test source file(s) (.py, .go, .rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/monitor/ (51 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/wizard/ (32 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (the repository): package.json has no "dev" script, so `npm run dev` could not start the app. Last output: "npm error Missing script: "dev" / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'mongodb' is imported (mirrord/operator/src/client.rs:89), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'mongodb' is imported (mirrord/operator/src/client.rs:89), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'mongodb' is imported (mirrord/operator/src/client.rs:89), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'mongodb' is imported (mirrord/operator/src/client.rs:89), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Rust, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Rust, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 10 further occurrence(s) are not listed individually; the score already reflects all 50.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X26 Unsynchronised callback handoff — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Kotlin, Scala, Go, Swift, Python and Ruby source only, and no C# was loaded, no Java, Kotlin, Scala, Go, Swift, Python or Ruby was found, and this repository's C is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 263 further occurrence(s) are not listed individually; the score already reflects all 303.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity6.3 / 10Adequate✓ Tool-verified

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

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

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

87 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was OperatorApi::prepare_branch_dbs at 73. A further 19 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being NewOperatorFeature::fmt at 75 — they are counted neither in the figure above nor in this dimension's score. 12 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: mirrord/operator/src/crd.rs (NewOperatorFeature::fmt at 75), mirrord/cli/src/error.rs (CliError::from at 43), mirrord/layer-lib/src/error.rs (mirrord_layer_lib::error::get_platform_errno at 40), mirrord/protocol/src/error.rs (ErrorKindInternal::from at 40), mirrord/agent/src/file.rs (FileManager::handle_message at 30), and 7 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

mirrord::main (cyclomatic 43) · ×13mirrord/cli/src/main.rs:1203
mirrord_layer_win::hooks::files::ops::query_info::info (cyclomatic 23) · ×4mirrord/layer-win/src/hooks/files/ops/query_info.rs:76
TargetsScreen::handle_event (cyclomatic 28) · ×3mirrord/tui/src/screens/targets.rs:664
OperatorApi::prepare_branch_dbs (cyclomatic 73) · ×2mirrord/operator/src/client.rs:1158
LayerConfig::verify (cyclomatic 66) · ×2mirrord/config/src/lib.rs:1109

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

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with OperatorApi::prepare_branch_dbs (cyclomatic 73), LayerConfig::verify (cyclomatic 66). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 6.3 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D2 · Cognitive Complexity5.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 5.7 / 10 · rule-coverage 100% · ceiling Prevented

132 method(s) exceeded the cognitive complexity threshold of 15; the worst was OperatorApi::prepare_branch_dbs at 131.

mirrord::preview::wait_until_started (cognitive 49) · ×16mirrord/cli/src/preview.rs:918
mirrord_tui::screens::preview_envs::view::card_content (cognitive 32) · ×7mirrord/tui/src/screens/preview_envs/view.rs:1003
OperatorApi::prepare_branch_dbs (cognitive 131) · ×6mirrord/operator/src/client.rs:1158
mirrord_layer_win::hooks::files::ops::query_info::info (cognitive 55) · ×6mirrord/layer-win/src/hooks/files/ops/query_info.rs:76
mirrord_layer_lib::socket::ops::connect_common (cognitive 28) · ×5mirrord/layer-lib/src/socket/ops.rs:306

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

What to do

  1. Bring the 4 bodies over 60 down to 60 or less in Cognitive Complexity — start with OperatorApi::prepare_branch_dbs (cognitive 131), LayerConfig::verify (cognitive 75), OutgoingProxy::run (cognitive 72). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cognitive Complexity from 5.7 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

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

139 god class(es) detected.

FunctionTooLong: App.App · ×46packages/monitor/src/App.tsx:55
FileTooLong: src/client.rs · ×45mirrord/operator/src/client.rs
MethodTooLong: OperatorApi.prepare_branch_dbs · ×31mirrord/operator/src/client.rs:1158
ClassTooLong: OperatorApi · ×14mirrord/operator/src/client.rs:410
TooManyMethods: OperatorApi · ×2mirrord/operator/src/client.rs:410

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

What to do

  1. Resolve the 46 FunctionTooLong finding(s) in God Classes — start with mod.rs (5), main.rs (4), preview.rs (3). — One of this dimension's main actionable groups (46 warning-level).
  2. Resolve the 45 FileTooLong finding(s) in God Classes — start with lib.rs (5), database_branches.rs (2), preview.rs (2). — One of this dimension's main actionable groups (45 warning-level).
  3. Resolve the 31 MethodTooLong finding(s) in God Classes — start with client.rs (4), lib.rs (2), preview.rs (2). — One of this dimension's main actionable groups (31 warning-level).

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

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

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

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

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

174 duplicated block group(s) detected. 3.6 % of the production lines (8,864 of 243,436) are in a reported copy. A further 142 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 5 of the 316 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (11 lines × 2) · ×13mirrord/agent/src/entrypoint.rs:1078
Duplicated block (8 lines × 2) · ×13mirrord/agent/src/file.rs:380
Duplicated block (6 lines × 2) · ×12mirrord/kube/src/error.rs:161
Duplicated block (7 lines × 2) · ×11mirrord/cli/src/ci.rs:113
Duplicated block (10 lines × 2) · ×10mirrord/cli/src/ci.rs:556

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

What to do

  1. Resolve the 13 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with seqpacket.rs (2), client.rs (2), entrypoint.rs. — One of this dimension's main actionable groups (13 warning-level).
  2. Resolve the 13 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with view.rs (2), file.rs, task.rs. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 12 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with error.rs, mod.rs, lib.rs. — One of this dimension's main actionable groups (12 warning-level).

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

D5 · Coupling8.0 / 10Strong✓ Tool-verified

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

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

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

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

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

Off the main sequence: mirrord-jaq · ×12

What to do

  1. Resolve the 12 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (12 warning-level).

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

D6 · Cohesion (LCOM4)9.8 / 10Stronggated by 7 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.8 / 10 · rule-coverage 100% · ceiling Verified

7 of 372 classes have LCOM4 above 3.

Low cohesion: IncomingIoWrapper (LCOM4 5) · ×7mirrord/agent/src/incoming/connection.rs:169

What to do

  1. Resolve the 7 Low cohesion finding(s) in Cohesion (LCOM4) — start with connection.rs, seqpacket.rs, udp.rs. — One of this dimension's main actionable groups (7 warning-level).

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

D10 · Test Quality10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

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

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

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

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

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

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

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

Outdated: actix-codec · ×37

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

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

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

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

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

2 secret(s) detected.

REDACTED

What to do

  1. Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).

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

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

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

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

0 of 962 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 14 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: mirrord/operator/src/client.rs (82×73=5986); mirrord/config/src/lib.rs (38×66=2508); mirrord/up/src/config.rs (78×30=2340) Repeated repair below the complexity floor: mirrord/layer-lib/src/file/filter.rs (5 of 7 changes were fixes); mirrord/layer-win/src/hooks/mod.rs (4 of 5 changes were fixes); mirrord/layer-win/src/hooks/process/mod.rs (3 of 5 changes were fixes)

Hotspot: mirrord/operator/src/client.rs · ×29mirrord/operator/src/client.rs:1158
Repeated repair: mirrord/layer-lib/src/file/filter.rs · ×12mirrord/layer-lib/src/file/filter.rs:175

What to do

  1. Resolve the 29 Hotspot finding(s) in Churn × Complexity Hotspots — start with main.rs (2), database_branches.rs (2), mod.rs (2). — One of this dimension's main actionable groups (29 warning-level).
  2. Resolve the 12 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mod.rs (2), filter.rs, crash.rs. — One of this dimension's main actionable groups (12 warning-level).

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

D16 · Bus Factor8.5 / 10Strong✓ 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 8.5 / 10 · rule-coverage 100% · ceiling Documented

88 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is mirrord/tui/src/screens/targets/form.rs. Counted over 610 of the 831 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

What to do

  1. Resolve the 9 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (9 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D17 · Explicit Debt10.0 / 10Stronggated by 52 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

52 deducted task-comment markers across 243436 LoC (0.0/KLoC) → score 10.0. 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 · ×47tests/src/traffic.rs:75
FixmeComment · ×4mirrord/intproxy/src/session_monitor/chaos/rules.rs:421
HackCommentmirrord/cli/src/prefetch.rs:439

What to do

  1. Resolve the 47 TodoComment finding(s) in Explicit Debt — start with lib.rs (6), hooks.rs (4), file.rs (3). — One of this dimension's main actionable groups (47 warning-level).
  2. Resolve the 4 FixmeComment finding(s) in Explicit Debt — start with rules.rs (2), chaos.rs (2). — One of this dimension's main actionable groups (4 warning-level).
  3. Resolve the 1 HackComment finding(s) in Explicit Debt — start with prefetch.rs. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

2 of 2 documentation facets pass in full. 148 document(s) read across 4 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs foundpackages/ui/package.json:7

What to do

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

D24 · Comment Value10.0 9.8 / 10Exemplary○ Nothing flagged

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

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

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

0 of 104 judged comments only repeat the code they sit on (0.0 %). 2 comment(s) in another language or script were not judged.

✓ On the Gold path — maintain.

Detailed fixes: d24_recommendation.md.

D26 · Project Cohesion7.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.

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

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

Projects may be oversized for their cohesion

What to do

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

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

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.2 / 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.2 / 10 · rule-coverage 100% · ceiling Documented

38 finding(s): 0 critical, 36 high, 2 medium, 0 low. 13 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 13 file(s) — `.github/scripts/ci-duration.sh` (line 57, line 120), `mirrord/agent/src/entrypoint.rs` (line 1475), `mirrord/agent/src/steal/test.rs` (line 503, line 590), `mirrord/cli/src/preview.rs` (line 949, line 2868), `mirrord/cli/src/preview/sync/tests.rs` (line 344, line 707), … (+8 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 10 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

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

What to do

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

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

D30 · Dependency Vulnerabilities8.4 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 5 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 recommendation-level).
  3. Resolve the 2 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).

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

D31 · IaC & Container Security3.1 / 10Weak✓ 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 3.1 / 10 · rule-coverage 100% · ceiling Documented

33 finding(s): 0 critical, 17 high, 11 medium, 5 low.

REDACTED
REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness9.9 / 10Exemplary✓ 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 9.9 / 10 · rule-coverage 100% · ceiling Documented

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

Orphaned file · ×3medschool/src/types.rs:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.8 / 10Stronggated by 8 serious findings✓ Tool-verified

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: execution.rs↔vpn.rs 65%; diagnose.rs↔execution.rs 63%; connection.rs↔session.rs 62%

Change coupling: connection.rs ↔ session.rs · ×7mirrord/cli/src/connection.rs:1
Change coupling clique: diagnose.rs, execution.rs, vpn.rsmirrord/cli/src/diagnose.rs

What to do

  1. Resolve the 7 Change coupling finding(s) in Change Coupling — start with connection.rs (2), ops.rs, ephemeral.rs. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with diagnose.rs. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

AC2 · Forms & labels5.2 / 10Adequate✓ Tool-verified

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

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

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

  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×3) — packages/monitor/src/components/ContextNamespacePicker.tsx:148, packages/monitor/src/components/chaos/ChaosRuleForm.tsx:261, packages/monitor/src/components/events/EventSearchBar.tsx:35
  • This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×4) — packages/monitor/src/components/SessionSidebar.tsx:213, packages/monitor/src/components/SubscribeEventsTable.tsx:196, packages/monitor/src/components/chaos/RequestChaosTypeDialog.tsx:60, …
  • This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. — packages/monitor/src/components/SubscribeEventsTable.tsx:202
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×2) — packages/wizard/src/components/Wizard.tsx:204, packages/wizard/src/components/steps/LearningSteps.tsx:186

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure6.6 / 10Adequate✓ Tool-verified

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

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

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

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — REDACTED:2

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

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

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

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

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

AC6 · Visual & motion safety3.5 / 10Weak✓ Tool-verified

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

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

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

  • <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×4) — packages/monitor/src/components/ContextNamespacePicker.tsx:148, packages/monitor/src/components/chaos/BreakPopover.tsx:114, packages/monitor/src/components/chaos/BreakPopover.tsx:126, …
  • `.focus-ring` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/index.css:229
  • `.event-row-animate` moves (`animation: eventFadeIn 0.2s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/index.css:109
  • `.detail-fade-in` moves (`animation: detailFadeIn 0.18s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/index.css:156
  • `.sidebar-item-animate` moves (`animation: sidebarItemFadeIn 0.16s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/index.css:171
  • `.animate-fade-in` moves (`animation: fadeIn 0.3s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/index.css:277
  • `.animate-slide-in` moves (`animation: slideIn 0.3s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/index.css:281
  • `.animate-scale-in` moves (`animation: scaleIn 0.2s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/index.css:285
  • `.animate-dialog-in` moves (`animation: dialogFadeIn 0.2s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/index.css:304
  • `.animate-tab-in` moves (`animation: tabFadeIn 0.2s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/index.css:327
  • `.spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/index.css:334

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition8.3 / 10Strong✓ 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.

AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

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.

C2 · Access Controls7.0 / 10Strong✓ Tool-verified

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

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

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

What to do

  • Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.
ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.

Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.

M1 · Documentation (README)8.5 / 10Strong✓ Tool-verified

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

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

M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

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

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

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

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

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

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

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

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

P10 · Library API & versioning9.9 / 10Exemplary✓ 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's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

  • 7 public types in `mirrord_progress.implementations` are marked as implementation by their own namespace, folder or name: `JsonProgress` (mirrord/progress/src/implementations.rs:15, `implementations`), `SimpleProgress` (mirrord/progress/src/implementations.rs:112, `implementations`), `SpinnerProgress` (mirrord/progress/src/implementations.rs:165, `implementations`), `PrefixedProgress` (mirrord/progress/src/implementations.rs:291, `implementations`), `NotificationLevel` (mirrord/progress/src/implementations.rs:359, `implementations`), `IdeAction` (mirrord/progress/src/implementations.rs:371, `implementations`), `IdeMessage` (mirrord/progress/src/implementations.rs:378, `implementations`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — mirrord/progress/src/implementations.rs:15

What to do

  • Hide `mirrord_progress.implementations` (`JsonProgress`, `SimpleProgress`, `SpinnerProgress`, `PrefixedProgress`, `NotificationLevel`, `IdeAction`, `IdeMessage`) (Rust: `pub(crate)`, or keep the module private): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability9.7 / 10Exemplary✓ 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 30/33 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `mirrord/layer-tests`, `packages/wizard`, `xtask`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

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

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

  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `github-actions`, `npm`, `gomod`, `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — REDACTED:4

What to do

  • Dependabot is configured but does not watch `github-actions`, `npm`, `gomod`, `pip` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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

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

P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

  • `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — mirrord/cli/src/operator/install.rs:248, mirrord/cli/src/operator/install/signup.rs:59
  • `hyper_util::client::legacy::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — mirrord/cluster-auth/src/client.rs:214
  • `reqwest::blocking::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — xtask/src/tasks/sip_binaries.rs:30

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
PF3 · Async & latency hygiene7.0 / 10Strong✓ Tool-verified

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

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `spawn` 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. — mirrord/agent/src/task.rs:47
  • `start` 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. — mirrord/cli/src/local_redis.rs:116

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

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

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

R10 · Code Duplication7.8 / 10Strong✓ Tool-verified

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

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

  • packages/wizard/src/components/steps/TargetStep.tsx:105 · packages/wizard/src/components/steps/TrafficStep.tsx:29 — the two spans are one implementation copied and then locally edited — 330 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. — packages/wizard/src/components/steps/TargetStep.tsx:105
  • packages/monitor/src/components/ContextNamespacePicker.tsx:40 · packages/monitor/src/components/ContextNamespacePicker.tsx:129 — the two spans are one implementation copied and then locally edited — 95 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/monitor/src/components/ContextNamespacePicker.tsx:40
  • packages/wizard/src/components/steps/ExportStep.tsx:45 · packages/wizard/src/components/steps/TrafficStep.tsx:22 — 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. — packages/wizard/src/components/steps/ExportStep.tsx:45
  • packages/monitor/src/components/AppHeader.tsx:61 · packages/monitor/src/components/ContextNamespacePicker.tsx:237 — the two spans are one implementation copied and then locally edited — 97 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. — packages/monitor/src/components/AppHeader.tsx:61
  • packages/monitor/src/components/FunnelHero.tsx:95 · packages/monitor/src/components/SessionSidebar.tsx:525 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/monitor/src/components/FunnelHero.tsx:95
  • packages/monitor/src/api.ts:171 · packages/monitor/src/api.ts:190 — 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. — packages/monitor/src/api.ts:171
  • packages/monitor/src/components/EmptySessionState.tsx:59 · packages/monitor/src/components/EmptySessionState.tsx:74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/monitor/src/components/EmptySessionState.tsx:59
  • packages/monitor/src/extensionBridge.ts:66 · packages/monitor/src/extensionBridge.ts:94 — 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. — packages/monitor/src/extensionBridge.ts:66
  • packages/monitor/src/hooks/useChaosRules.ts:237 · packages/monitor/src/hooks/useChaosRules.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. — packages/monitor/src/hooks/useChaosRules.ts:237
  • packages/monitor/src/components/ConnectOperatorModal.tsx:161 · packages/monitor/src/components/ConnectOperatorModal.tsx:227 — 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. — packages/monitor/src/components/ConnectOperatorModal.tsx:161
  • packages/monitor/src/components/chaos/BreakPopover.tsx:113 · packages/monitor/src/components/chaos/BreakPopover.tsx:125 — 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. — packages/monitor/src/components/chaos/BreakPopover.tsx:113
  • packages/wizard/src/components/steps/RunStep.tsx:24 · packages/wizard/src/components/steps/RunStep.tsx:39 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/wizard/src/components/steps/RunStep.tsx:24
  • packages/monitor/src/api.ts:270 · packages/monitor/src/api.ts:285 — 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. — packages/monitor/src/api.ts:270
  • packages/monitor/src/components/SubscribeEventsTable.tsx:230 · packages/wizard/src/components/steps/ExportStep.tsx:54 · packages/wizard/src/components/steps/RunStep.tsx:18 · packages/wizard/src/components/steps/TargetStep.tsx:107 · +1 more site(s) not listed — the 5 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. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — packages/monitor/src/components/SubscribeEventsTable.tsx:230
  • packages/monitor/src/components/chaos/ChaosRuleForm.tsx:208 · packages/monitor/src/components/chaos/ChaosRuleForm.tsx:217 · packages/monitor/src/components/chaos/ChaosRuleForm.tsx:226 · packages/monitor/src/components/chaos/ChaosRuleForm.tsx:266 — all 4 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. — packages/monitor/src/components/chaos/ChaosRuleForm.tsx:208
  • packages/monitor/src/components/OperatorSessionDetail.tsx:42 · packages/monitor/src/utils.ts:102 — 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. — packages/monitor/src/components/OperatorSessionDetail.tsx:42
  • packages/wizard/src/components/steps/RunStep.tsx:47 · packages/wizard/src/components/steps/TrafficStep.tsx:78 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/wizard/src/components/steps/RunStep.tsx:47
  • packages/monitor/src/components/chaos/ChaosRuleForm.tsx:230 · packages/monitor/src/components/chaos/ChaosRuleForm.tsx:270 — 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. — packages/monitor/src/components/chaos/ChaosRuleForm.tsx:230
  • packages/monitor/src/hooks/useChaosRules.ts:222 · packages/monitor/src/hooks/useChaosRules.ts:246 — 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. — packages/monitor/src/hooks/useChaosRules.ts:222

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity8.7 / 10Strong✓ 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.

  • TargetStep has cyclomatic complexity 25 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — packages/wizard/src/components/steps/TargetStep.tsx:31
  • Wizard has cyclomatic complexity 25 and cognitive complexity 19; 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. — packages/wizard/src/components/Wizard.tsx:52
  • SessionSidebar has cyclomatic complexity 23 and cognitive complexity 22; 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. — packages/monitor/src/components/SessionSidebar.tsx:88
  • PreviewDiagnostics has cyclomatic complexity 20 and cognitive complexity 20; 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. — packages/monitor/src/components/PreviewDiagnostics.tsx:40
  • OperatorSessionDetail has cyclomatic complexity 19 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 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. — packages/monitor/src/components/OperatorSessionDetail.tsx:74
  • EventRow has cyclomatic complexity 16 and cognitive complexity 14; 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. — packages/monitor/src/components/events/EventRow.tsx:22
  • EventStream has cyclomatic complexity 15 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. — packages/monitor/src/components/EventStream.tsx:58
  • NamespaceCombobox has cyclomatic complexity 14 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. — packages/monitor/src/components/ContextNamespacePicker.tsx:96
  • TrafficStep has cyclomatic complexity 12 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. — packages/wizard/src/components/steps/TrafficStep.tsx:9
  • timeout has cyclomatic complexity 11 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 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. — packages/monitor/src/App.tsx:254
  • Widget 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. — packages/monitor/src/components/Widget.tsx:17
  • App has cyclomatic complexity 11 and cognitive complexity 9; 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. — packages/monitor/src/App.tsx:55
R3 · Large Files9.0 / 10Exemplary✓ Tool-verified

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

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

  • packages/monitor/src/components/SessionSidebar.tsx has 515 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/monitor/src/components/SessionSidebar.tsx:1
  • packages/monitor/src/App.tsx has 488 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/monitor/src/App.tsx:1

What to do

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

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — packages/monitor/src/components/SessionSidebar.tsx:1, packages/monitor/src/App.tsx:1, packages/monitor/src/components/ContextNamespacePicker.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
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.3 / 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.

  • Unreachable from the 9 application, 12 tooling and 29 test entry point(s) detected in this repo. Gate removals on `pnpm run typecheck` — an undetected custom entry would make these reachable.
  • no import path from any entry point (9 application, 12 tooling, 29 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 — REDACTED

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 Hygiene8.0 / 10Strong✓ Tool-verified

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

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

  • Declared in 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 packages/monitor/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
  • Declared in packages/wizard/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 Imports10.0 / 10Exemplary✓ 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.

S1 · Web-Security Posture5.5 / 10Adequate✓ Tool-verified

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

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

  • a rustls `ServerCertVerifier` that accepts every certificate (`DangerousNoVerifierServer`) is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on. — mirrord/intproxy/src/proxies/incoming/tls.rs:379
  • Set: Content-Security-Policy, Referrer-Policy, X-Content-Type-Options, X-Frame-Options. Missing: Strict-Transport-Security — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−0.5 on this card.) The server: `axum::serve(` (mirrord/intproxy/src/session_monitor/api.rs:234).

What to do

  • Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
  • Add Strict-Transport-Security beside the headers the Rust server already sets.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X15 · Unvalidated length from an untrusted reader3.5 / 10Weak✓ Tool-verified

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

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

  • `len` is read from the bytes being parsed at line 149 (`u32::from_be_bytes`), then used to size a `.resize` at line 151 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating. — mirrord/intproxy/protocol/src/codec.rs:151

What to do

  • Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
X2 · Cancellation propagation4.0 / 10Weak✓ Tool-verified

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

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

  • Only 0/16 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×6) — packages/wizard/src/lib/queries.ts:43, packages/wizard/src/lib/queries.ts:65, packages/wizard/src/lib/queries.ts:82, …
  • `listSessions` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/api.ts:50
  • `getSession` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/api.ts:61
  • `killSession` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/api.ts:85
  • `listChaosRules` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/api.ts:129
  • `createChaosRule` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/api.ts:140
  • `updateChaosRule` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/api.ts:162
  • `deleteChaosRule` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/api.ts:187
  • `getPreviewDetail` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/api.ts:228
  • `listContexts` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/api.ts:267
  • `resolveToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/monitor/src/extensionConfigure.ts:17

What to do

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

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

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

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.

X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X4 · Structured logging4.7 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `warn!` at line 296 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/utils-win/src/diagnostics/report.rs:296
  • `error!` at line 212 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/tui/src/app.rs:212
  • `debug!` at line 111 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/tui/src/screens/databases.rs:111
  • `warn!` at line 118 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/tui/src/screens/databases.rs:118
  • `debug!` at line 110 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/tui/src/screens/queues.rs:110
  • `warn!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/tui/src/screens/queues.rs:113
  • `warn!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/tls-util/src/root_store.rs:93
  • `warn!` at line 496 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/sip/src/lib.rs:496
  • `trace!` at line 689 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/sip/src/lib.rs:689
  • `trace!` at line 700 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/sip/src/lib.rs:700
  • `trace!` at line 967 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/sip/src/lib.rs:967
  • `trace!` at line 978 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/sip/src/lib.rs:978
  • `warn!` at line 200 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/sessions-manager/client/src/client/agent.rs:200
  • `warn!` at line 187 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/diagnostics.rs:187
  • `info!` at line 224 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/diagnostics.rs:224
  • `warn!` at line 235 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/diagnostics.rs:235
  • `warn!` at line 250 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/diagnostics.rs:250
  • `info!` at line 260 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/diagnostics.rs:260
  • `error!` at line 258 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/lib.rs:258
  • `error!` at line 343 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/lib.rs:343
  • `error!` at line 391 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/lib.rs:391
  • `debug!` at line 78 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/subprocess.rs:78
  • `debug!` at line 94 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/subprocess.rs:94
  • `debug!` at line 103 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/subprocess.rs:103
  • `debug!` at line 59 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/process/elevation.rs:59
  • `info!` at line 53 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/mod.rs:53
  • `info!` at line 61 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/mod.rs:61
  • `debug!` at line 88 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/hostname.rs:88
  • `debug!` at line 180 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/hostname.rs:180
  • `debug!` at line 196 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/hostname.rs:196
  • `debug!` at line 206 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/hostname.rs:206
  • `debug!` at line 232 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/hostname.rs:232
  • `debug!` at line 244 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/hostname.rs:244
  • `debug!` at line 254 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/hostname.rs:254
  • `trace!` at line 352 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/mod.rs:352
  • `error!` at line 364 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/mod.rs:364
  • `debug!` at line 370 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/mod.rs:370
  • `debug!` at line 378 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/mod.rs:378
  • `debug!` at line 391 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/mod.rs:391
  • `debug!` at line 417 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — mirrord/layer-win/src/hooks/socket/mod.rs:417

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

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

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

  • 0/2 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.

What to do

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

WCAG coverage — what static analysis assessed

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

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

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

Reference — by lens

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

LensScoreRatingImpact
Code Health52%Adequate — gated by X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture92%ExemplarySolid.
Maturity79%StrongSolid.
Readiness57%Adequate — gated by D13, R4, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security61%Adequate — gated by D29, D31Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Accessibility64%Adequate — gated by AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance70%StrongSolid.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 7 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: this repository stores data through 'mongodb' (mirrord/operator/src/client.rs:89) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'mongodb' (mirrord/operator/src/client.rs:89) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'mongodb' (mirrord/operator/src/client.rs:89) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 52 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.

  • 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.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — AX6 reached only 4% of this repository's production lines — rust (233,113 lines), c (11 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server (`npm run dev`) exited before it served a page. Likely cause (the repository): package.json has no "dev" script, so `npm run dev` could not start the app. Last output: "npm error Missing script: "dev" / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered. 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: this repository stores data through 'mongodb' (mirrord/operator/src/client.rs:89) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 2 candidate(s) found and not reported.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — packages/monitor/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 97 value object(s); 6 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Fold determinism — not applicable — the code was read and holds no event-replay fold, so there is nothing for this check to judge
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X12 Unreachable branch — X12 reached only 4% of this repository's production lines — rust (233,113 lines), c (11 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 4% of this repository's production lines — rust (233,113 lines), c (11 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 4% of this repository's production lines — rust (233,113 lines), c (11 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • 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 — 62 finding(s)
D31 · IaC & Container Security · High IaC · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×3
  • <input> without a programmatic label packages/monitor/src/components/ContextNamespacePicker.tsx:148 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/monitor/src/components/chaos/ChaosRuleForm.tsx:261 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/monitor/src/components/events/EventSearchBar.tsx:35 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <button> with no accessible text · ×2
  • <button> with no accessible text packages/wizard/src/components/Wizard.tsx:204 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text packages/wizard/src/components/steps/LearningSteps.tsx:186 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
D13 · Secret Scanning · Leaked secret · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
S1 · Web-Security Posture · TLS certificate validation disabled · ×1
  • TLS certificate validation disabled mirrord/intproxy/src/proxies/incoming/tls.rs:379 — a rustls `ServerCertVerifier` that accepts every certificate (`DangerousNoVerifierServer`) is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on.
Serious — 934 finding(s)
D17 · Explicit Debt · TodoComment · ×47
  • TodoComment tests/src/traffic.rs:75 — // TODO: change outgoing TCP tests to use the same setup as in the outgoing UDP test so that — 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 mirrord/up/src/process.rs:77 — // TODO(areg) downgrade to a debug_assert once the feature stabilizes. — 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 mirrord/tui/src/local_sessions.rs:13 — // TODO: Implement — 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 mirrord/tui/src/screens/sessions.rs:72 — // TODO: Filter list by local-only — 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 mirrord/sip/src/lib.rs:824 — // TODO: Change output to be with hash of the contents, so that old versions of changed — 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 mirrord/protocol/src/error.rs:303 — /// TODO(alex): We need a windows equivalent for this at some point. — 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 mirrord/protocol/src/file.rs:319 — // TODO: We're not handling `custom_flags` here, if we ever need to do so, add them here (it's an OS — 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 mirrord/protocol/src/file.rs:322 — // TODO: Should probably live in a separate place (same reasoning as `AddrInfoHint`). — 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 mirrord/layer-win/src/hooks/files/ops/open.rs:216 — // TODO(gabriela): edit when supported! — 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 mirrord/layer-win/src/hooks/files/ops/open.rs:254 — // TODO(gabriela): update when write mode supported. — 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 mirrord/layer-tests/tests/issue1458.rs:70 — /// TODO(alex): When we fully implement proper UDP handling, this test will fail with some missing — 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 mirrord/layer-tests/tests/issue1776.rs:71 — /// TODO(alex): When we fully implement proper UDP handling, this test will fail with some missing — 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 mirrord/layer-tests/tests/outgoing.rs:26 — // TODO: add a test for when DNS lookup is unsuccessful, to make sure the layer returns a valid — 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 mirrord/layer-tests/src/intproxy.rs:324 — // TODO(alex): Add a wait time here, we can end up in the "Close request success" error. — 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 mirrord/layer-lib/src/debugger_ports.rs:607 — // TODO: Audit that the environment access only happens in single-threaded code. — 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 mirrord/layer-lib/src/debugger_ports.rs:611 — // TODO: Audit that the environment access only happens in single-threaded code. — 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 mirrord/layer-lib/src/debugger_ports.rs:614 — // TODO: Audit that the environment access only happens in single-threaded code. — 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 mirrord/layer/src/lib.rs:495 — // TODO: Audit that the environment access only happens in single-threaded code. — 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 mirrord/layer/src/lib.rs:499 — // TODO: Audit that the environment access only happens in single-threaded code. — 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 mirrord/layer/src/lib.rs:507 — // TODO: Audit that the environment access only happens in single-threaded code. — 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 mirrord/cli/src/util.rs:130 — // TODO: Audit that the environment access only happens in single-threaded code. — 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 mirrord/layer-lib/src/error.rs:611 — // TODO: Add more error kinds, next time we break protocol compatibility. — 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 mirrord/layer-lib/src/proxy_connection.rs:29 — // TODO: We don't really need a lock, we just need a type that: — 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 mirrord/layer-lib/src/socket.rs:203 — // TODO(alex): We could treat `sockfd` as being the same as `&self` for socket ops, we currently — 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 mirrord/layer-lib/src/socket/dns/unix.rs:80 — // TODO: according to the man page, service could also be a service name, it doesn't have to — 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.
  • + 22 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×46
  • FunctionTooLong: App.App packages/monitor/src/App.tsx:55 — FunctionTooLong — App runs 358 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 258 over it, 3.58× 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: mirrord_layer::file::hooks::enable_file_hooks mirrord/layer/src/file/hooks.rs:1624 — FunctionTooLong — mirrord_layer::file::hooks::enable_file_hooks runs 318 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 218 over it, 3.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.
  • FunctionTooLong: SessionSidebar.SessionSidebar packages/monitor/src/components/SessionSidebar.tsx:88 — FunctionTooLong — SessionSidebar runs 258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 158 over it, 2.58× 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: mirrord_layer_win::hooks::socket::initialize_hooks mirrord/layer-win/src/hooks/socket/mod.rs:2121 — FunctionTooLong — mirrord_layer_win::hooks::socket::initialize_hooks runs 241 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 141 over it, 2.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChaosRuleForm.ChaosRuleForm packages/monitor/src/components/chaos/ChaosRuleForm.tsx:57 — FunctionTooLong — ChaosRuleForm runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: EventStream.EventStream packages/monitor/src/components/EventStream.tsx:58 — FunctionTooLong — EventStream runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
  • FunctionTooLong: TargetStep.TargetStep packages/wizard/src/components/steps/TargetStep.tsx:31 — FunctionTooLong — TargetStep runs 196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× 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: Wizard.Wizard packages/wizard/src/components/Wizard.tsx:52 — FunctionTooLong — Wizard runs 187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mirrord::up::checks::check_db_branches mirrord/cli/src/up/checks.rs:236 — FunctionTooLong — mirrord::up::checks::check_db_branches runs 186 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 86 over it, 1.86× 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: mirrord_layer_win::hooks::files::ops::query_info::info mirrord/layer-win/src/hooks/files/ops/query_info.rs:76 — FunctionTooLong — mirrord_layer_win::hooks::files::ops::query_info::info runs 182 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 82 over it, 1.82× 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: mirrord::main mirrord/cli/src/main.rs:1203 — FunctionTooLong — mirrord::main runs 173 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 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SessionDetail.SessionDetail packages/monitor/src/components/SessionDetail.tsx:35 — FunctionTooLong — SessionDetail runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mirrord::preview::up::run_preview_up mirrord/cli/src/preview/up.rs:122 — FunctionTooLong — mirrord::preview::up::run_preview_up 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.
  • FunctionTooLong: mirrord_layer::socket::hooks::enable_socket_hooks mirrord/layer/src/socket/hooks.rs:685 — FunctionTooLong — mirrord_layer::socket::hooks::enable_socket_hooks runs 162 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 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mirrord::connection::try_connect_using_operator mirrord/cli/src/connection.rs:208 — FunctionTooLong — mirrord::connection::try_connect_using_operator 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: useChaosRules.useChaosRules packages/monitor/src/hooks/useChaosRules.ts:102 — FunctionTooLong — useChaosRules runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× 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: mirrord::preview::preview_status mirrord/cli/src/preview.rs:1444 — FunctionTooLong — mirrord::preview::preview_status runs 154 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ExportStep.ExportStep packages/wizard/src/components/steps/ExportStep.tsx:14 — FunctionTooLong — ExportStep runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mirrord::exec_process mirrord/cli/src/main.rs:409 — FunctionTooLong — mirrord::exec_process 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.
  • FunctionTooLong: mirrord::preview::wait_until_started mirrord/cli/src/preview.rs:918 — FunctionTooLong — mirrord::preview::wait_until_started 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.
  • FunctionTooLong: SubscribeEventsTable.SubscribeEventsTable packages/monitor/src/components/SubscribeEventsTable.tsx:145 — FunctionTooLong — SubscribeEventsTable runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
  • FunctionTooLong: PreviewDiagnostics.PreviewDiagnostics packages/monitor/src/components/PreviewDiagnostics.tsx:40 — FunctionTooLong — PreviewDiagnostics runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
  • FunctionTooLong: mirrord_layer_win::hooks::files::ops::open::handle mirrord/layer-win/src/hooks/files/ops/open.rs:105 — FunctionTooLong — mirrord_layer_win::hooks::files::ops::open::handle runs 144 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 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mirrord::external_proxy::proxy mirrord/cli/src/external_proxy.rs:73 — FunctionTooLong — mirrord::external_proxy::proxy runs 143 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mirrord_layer_win::hooks::files::initialize_hooks mirrord/layer-win/src/hooks/files/mod.rs:388 — FunctionTooLong — mirrord_layer_win::hooks::files::initialize_hooks runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 21 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×45
  • FileTooLong: src/client.rs mirrord/operator/src/client.rs — FileTooLong — 2467 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: OperatorApi (6 blocks, 410-3773). The bar is 500 significant lines; this is 1967 over it, 4.93× 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: client/database_branches.rs mirrord/operator/src/client/database_branches.rs — FileTooLong — 1920 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 34 free functions. The bar is 500 significant lines; this is 1420 over it, 3.84× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/preview.rs mirrord/cli/src/preview.rs — FileTooLong — 1702 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 36 free functions. The bar is 500 significant lines; this is 1202 over it, 3.40× 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: socket/mod.rs mirrord/layer-win/src/hooks/socket/mod.rs — FileTooLong — 1556 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 1056 over it, 3.11× 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: file/hooks.rs mirrord/layer/src/file/hooks.rs — FileTooLong — 1328 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 80 free functions. The bar is 500 significant lines; this is 828 over it, 2.66× 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: feature/database_branches.rs mirrord/config/src/feature/database_branches.rs — FileTooLong — 1300 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 800 over it, 2.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/config.rs mirrord/up/src/config.rs — FileTooLong — 1230 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 730 over it, 2.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/config.rs mirrord/cli/src/config.rs — FileTooLong — 1202 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 702 over it, 2.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/error.rs mirrord/cli/src/error.rs — FileTooLong — 1103 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 76% of them inside a single declaration: CliError (8 blocks, 309-1498). The bar is 500 significant lines; this is 603 over it, 2.21× 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/entrypoint.rs mirrord/agent/src/entrypoint.rs — FileTooLong — 1027 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 527 over it, 2.05× 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: db_branching/branch_database.rs mirrord/operator/src/crd/db_branching/branch_database.rs — FileTooLong — 935 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 435 over it, 1.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/crd.rs mirrord/operator/src/crd.rs — FileTooLong — 910 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 410 over it, 1.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/main.rs mirrord/cli/src/main.rs — FileTooLong — 886 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 386 over it, 1.77× 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: socket/ops.rs mirrord/layer/src/socket/ops.rs — FileTooLong — 861 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 361 over it, 1.72× 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: ui/server.rs mirrord/cli/src/ui/server.rs — FileTooLong — 858 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 39 free functions. The bar is 500 significant lines; this is 358 over it, 1.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/lib.rs mirrord/config/src/lib.rs — FileTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 80% of them inside a single declaration: LayerConfig (3 blocks, 372-1797). The bar is 500 significant lines; this is 324 over it, 1.65× 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: proxies/files.rs mirrord/intproxy/src/proxies/files.rs — FileTooLong — 794 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 67% of them inside a single declaration: FilesProxy (4 blocks, 438-1258). The bar is 500 significant lines; this is 294 over it, 1.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: preview/sync.rs mirrord/cli/src/preview/sync.rs — FileTooLong — 776 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 276 over it, 1.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: preview_envs/view.rs mirrord/tui/src/screens/preview_envs/view.rs — FileTooLong — 744 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 244 over it, 1.49× 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: monitor/server.rs mirrord/utils-win/src/diagnostics/monitor/server.rs — FileTooLong — 743 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 243 over it, 1.49× 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: screens/databases.rs mirrord/tui/src/screens/databases.rs — FileTooLong — 734 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 234 over it, 1.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/port_forward.rs mirrord/cli/src/port_forward.rs — FileTooLong — 728 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 228 over it, 1.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: targets/form.rs mirrord/tui/src/screens/targets/form.rs — FileTooLong — 713 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 213 over it, 1.43× 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: preview/resources.rs mirrord/cli/src/preview/resources.rs — FileTooLong — 699 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 199 over it, 1.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/lib.rs mirrord/intproxy/src/lib.rs — FileTooLong — 698 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 72% of them inside a single declaration: IntProxy (2 blocks, 130-1055). The bar is 500 significant lines; this is 198 over it, 1.40× 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.
  • + 20 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file packages/monitor/src/components/SessionSidebar.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/App.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/ContextNamespacePicker.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/hooks/useChaosRules.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/SubscribeEventsTable.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/ConnectOperatorModal.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/chaos/ChaosRuleForm.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/SessionDetail.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/types.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/OperatorSessionDetail.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/OperatorList.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/PreviewDiagnostics.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/ui/src/App.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/chaos/ChaosPane.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/eventsStore.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/AppHeader.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/JoinBar.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/chaos/ChaosRuleCard.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/extensionBridge.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/FunnelHero.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/SidePane.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/ResizableSplit.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/components/SettingsDialog.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/monitor/src/extensionTransport.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 15 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×31
  • MethodTooLong: OperatorApi.prepare_branch_dbs mirrord/operator/src/client.rs:1158 — MethodTooLong — prepare_branch_dbs runs 513 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 413 over it, 5.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LayerConfig.verify mirrord/config/src/lib.rs:1109 — MethodTooLong — verify runs 314 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 214 over it, 3.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: PreparedPreview.prepare mirrord/cli/src/preview.rs:285 — MethodTooLong — prepare runs 244 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FilesProxy.file_request mirrord/intproxy/src/proxies/files.rs:604 — MethodTooLong — file_request 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: FilesProxy.file_response mirrord/intproxy/src/proxies/files.rs:900 — MethodTooLong — file_response runs 178 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 78 over it, 1.78× 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: UnifiedDatabaseBranchParams.new mirrord/operator/src/client/database_branches.rs:1583 — MethodTooLong — new runs 175 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 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: StatusCommandHandler.handle mirrord/cli/src/operator/status.rs:203 — MethodTooLong — handle runs 171 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 71 over it, 1.71× 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: PreparedPreview.start mirrord/cli/src/preview.rs:646 — MethodTooLong — start 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: LayerManagedProcess.inject_and_resume mirrord/layer-lib/src/process/windows/execution/mod.rs:752 — MethodTooLong — inject_and_resume 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: TrafficTunnels.handle_event mirrord/protocol-api/src/client/tunnels.rs:400 — MethodTooLong — handle_event runs 143 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OperatorApi.prepare_session mirrord/operator/src/client.rs:2351 — MethodTooLong — prepare_session runs 141 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PreviewEnvsScreen.handle_event mirrord/tui/src/screens/preview_envs.rs:118 — MethodTooLong — handle_event runs 141 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PortForwarder.handle_msg_from_agent mirrord/cli/src/port_forward.rs:215 — MethodTooLong — handle_msg_from_agent runs 130 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 30 over it, 1.30× 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: MirrordExecution.spawn_agent_and_intproxy mirrord/cli/src/execution.rs:794 — MethodTooLong — spawn_agent_and_intproxy runs 123 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 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RuntimeData.from_pod mirrord/kube/src/api/runtime.rs:121 — MethodTooLong — from_pod runs 121 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 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PidWatch.run mirrord/utils-win/src/diagnostics/monitor/server.rs:1037 — MethodTooLong — run runs 119 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 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MirrordExecution.start_internal mirrord/cli/src/execution.rs:387 — MethodTooLong — start_internal runs 118 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 18 over it, 1.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: OutgoingProxy.run mirrord/intproxy/src/proxies/outgoing.rs:785 — MethodTooLong — run runs 118 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 18 over it, 1.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: CliError.from mirrord/cli/src/error.rs:1338 — MethodTooLong — from runs 116 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 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ResolvedTarget.assert_valid_mirrord_target mirrord/kube/src/resolved.rs:420 — MethodTooLong — assert_valid_mirrord_target runs 116 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 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OperatorApi.should_copy_target mirrord/operator/src/client.rs:2908 — MethodTooLong — should_copy_target runs 116 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 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FileManager.handle_message mirrord/agent/src/file.rs:125 — MethodTooLong — handle_message runs 115 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 15 over it, 1.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: IncomingProxy.handle_chunked_request mirrord/intproxy/src/proxies/incoming.rs:474 — MethodTooLong — handle_chunked_request runs 113 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 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OperatorApi.prepare_multi_cluster_session mirrord/operator/src/client.rs:2698 — MethodTooLong — prepare_multi_cluster_session 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.
  • MethodTooLong: DebuggerType.get_ports mirrord/layer-lib/src/debugger_ports.rs:155 — MethodTooLong — get_ports 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.
  • + 6 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×29
  • Hotspot: mirrord/operator/src/client.rs mirrord/operator/src/client.rs:1158 — mirrord/operator/src/client.rs changed 82 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in OperatorApi::prepare_branch_dbs at line 1158. 5 of those changes were fix/bug commits, and the other 77 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/operator/src/client.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/config/src/lib.rs mirrord/config/src/lib.rs:1109 — mirrord/config/src/lib.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in LayerConfig::verify at line 1109. 2 of those changes were fix/bug commits, and the other 36 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/config/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/up/src/config.rs mirrord/up/src/config.rs:890 — mirrord/up/src/config.rs changed 78 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in ServiceConfig::assemble at line 890. 3 of those changes were fix/bug commits, and the other 75 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/up/src/config.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/cli/src/preview.rs mirrord/cli/src/preview.rs:918 — mirrord/cli/src/preview.rs changed 68 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in mirrord::preview::wait_until_started at line 918. 3 of those changes were fix/bug commits, and the other 65 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/cli/src/preview.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/cli/src/main.rs mirrord/cli/src/main.rs:1203 — mirrord/cli/src/main.rs changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in mirrord::main at line 1203. 4 of those changes were fix/bug commits, and the other 33 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/cli/src/main.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/operator/src/client/database_branches.rs mirrord/operator/src/client/database_branches.rs:1583 — mirrord/operator/src/client/database_branches.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in UnifiedDatabaseBranchParams::new at line 1583. 3 of those changes were fix/bug commits, and the other 30 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/operator/src/client/database_branches.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/config/src/feature/database_branches.rs mirrord/config/src/feature/database_branches.rs:1035 — mirrord/config/src/feature/database_branches.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in DatabaseBranchConfig::copy_mode at line 1035. 2 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/config/src/feature/database_branches.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/cli/src/preview/up.rs mirrord/cli/src/preview/up.rs:122 — mirrord/cli/src/preview/up.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in mirrord::preview::up::run_preview_up at line 122. 1 of those changes was a fix/bug commit, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/cli/src/preview/up.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/cli/src/connection.rs mirrord/cli/src/connection.rs:208 — mirrord/cli/src/connection.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in mirrord::connection::try_connect_using_operator at line 208. 5 of those changes were fix/bug commits, and the other 21 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/cli/src/connection.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/cli/src/up/checks.rs mirrord/cli/src/up/checks.rs:236 — mirrord/cli/src/up/checks.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in mirrord::up::checks::check_db_branches at line 236. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/cli/src/up/checks.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/monitor/src/App.tsx packages/monitor/src/App.tsx:55 — packages/monitor/src/App.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in App.App at line 55. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- packages/monitor/src/App.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/up/src/process.rs mirrord/up/src/process.rs:535 — mirrord/up/src/process.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in mirrord_up::process::supervise_with_second_signal at line 535. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/up/src/process.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/layer-lib/src/process/windows/execution/mod.rs mirrord/layer-lib/src/process/windows/execution/mod.rs:752 — mirrord/layer-lib/src/process/windows/execution/mod.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in LayerManagedProcess::inject_and_resume at line 752. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-lib/src/process/windows/execution/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/cli/src/internal_proxy/db_portforwards.rs mirrord/cli/src/internal_proxy/db_portforwards.rs:279 — mirrord/cli/src/internal_proxy/db_portforwards.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in mirrord::internal_proxy::db_portforwards::extract_portforward_configs at line 279. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/cli/src/internal_proxy/db_portforwards.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/config/src/feature/database_branches/pg.rs mirrord/config/src/feature/database_branches/pg.rs:169 — mirrord/config/src/feature/database_branches/pg.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in PgBranchConfig::verify_additional_databases at line 169. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/config/src/feature/database_branches/pg.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/operator/src/client/preview_sync.rs mirrord/operator/src/client/preview_sync.rs:574 — mirrord/operator/src/client/preview_sync.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in mirrord_operator::client::preview_sync::pack_changes at line 574. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/operator/src/client/preview_sync.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/layer-win/src/hooks/socket/mod.rs mirrord/layer-win/src/hooks/socket/mod.rs:351 — mirrord/layer-win/src/hooks/socket/mod.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in mirrord_layer_win::hooks::socket::bind_detour at line 351. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-win/src/hooks/socket/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: xtask/src/main.rs xtask/src/main.rs:199 — xtask/src/main.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in xtask::main at line 199. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- xtask/src/main.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/monitor/src/components/EventStream.tsx packages/monitor/src/components/EventStream.tsx:58 — packages/monitor/src/components/EventStream.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in EventStream.EventStream at line 58. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- packages/monitor/src/components/EventStream.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/layer-lib/src/socket/ops.rs mirrord/layer-lib/src/socket/ops.rs:306 — mirrord/layer-lib/src/socket/ops.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in mirrord_layer_lib::socket::ops::connect_common at line 306. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-lib/src/socket/ops.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/intproxy/src/proxies/files.rs mirrord/intproxy/src/proxies/files.rs:900 — mirrord/intproxy/src/proxies/files.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in FilesProxy::file_response at line 900. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/intproxy/src/proxies/files.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/layer-lib/src/debugger_ports.rs mirrord/layer-lib/src/debugger_ports.rs:155 — mirrord/layer-lib/src/debugger_ports.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in DebuggerType::get_ports at line 155. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-lib/src/debugger_ports.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/monitor/src/components/SessionDetail.tsx packages/monitor/src/components/SessionDetail.tsx:35 — packages/monitor/src/components/SessionDetail.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in SessionDetail.SessionDetail at line 35. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- packages/monitor/src/components/SessionDetail.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/config/src/feature/database_branches/generic.rs mirrord/config/src/feature/database_branches/generic.rs:265 — mirrord/config/src/feature/database_branches/generic.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in GenericBranchConfig::verify at line 265. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/config/src/feature/database_branches/generic.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mirrord/tui/src/screens/queues.rs mirrord/tui/src/screens/queues.rs:734 — mirrord/tui/src/screens/queues.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in mirrord_tui::screens::queues::details_lines at line 734. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/tui/src/screens/queues.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.
  • + 4 more in this group — see findings.md.
D2 · Cognitive Complexity · mirrord · ×16
  • mirrord::preview::wait_until_started (cognitive 49) mirrord/cli/src/preview.rs:918 — mirrord::preview::wait_until_started has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 9 (22 pts), boolean chains 3, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord::preview::up::prepare_service (cognitive 46) mirrord/cli/src/preview/up.rs:377 — mirrord::preview::up::prepare_service has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 23). 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.
  • mirrord::preview::up::run_preview_up (cognitive 37) mirrord/cli/src/preview/up.rs:122 — mirrord::preview::up::run_preview_up has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 11 (19 pts), loops 7 (8 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • mirrord::ui::chaos_command (cognitive 36) mirrord/cli/src/ui.rs:284 — mirrord::ui::chaos_command has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 6 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord::up::checks::check_db_branches (cognitive 36) mirrord/cli/src/up/checks.rs:236 — mirrord::up::checks::check_db_branches has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 8 (10 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord::preview::preview_status (cognitive 32) mirrord/cli/src/preview.rs:1444 — mirrord::preview::preview_status has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 6 (15 pts), if/else 7 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • mirrord::connection::try_connect_using_operator (cognitive 29) mirrord/cli/src/connection.rs:208 — mirrord::connection::try_connect_using_operator has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 6, match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord::external_proxy::proxy (cognitive 29) mirrord/cli/src/external_proxy.rs:73 — mirrord::external_proxy::proxy has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 5 (13 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord::db_branches::destroy_command (cognitive 23) mirrord/cli/src/db_branches.rs:467 — mirrord::db_branches::destroy_command has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord::operator::install::uninstall::clear_finalized (cognitive 21) mirrord/cli/src/operator/install/uninstall.rs:331 — mirrord::operator::install::uninstall::clear_finalized has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (7 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord::exec (cognitive 18) mirrord/cli/src/main.rs:931 — mirrord::exec has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • mirrord::internal_proxy::db_portforwards::extract_portforward_configs (cognitive 17) mirrord/cli/src/internal_proxy/db_portforwards.rs:279 — mirrord::internal_proxy::db_portforwards::extract_portforward_configs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 3 (7 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord::preview::resources::compare::diff_into (cognitive 17) mirrord/cli/src/preview/resources/compare.rs:60 — mirrord::preview::resources::compare::diff_into has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (6 pts), match/switch 3 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • mirrord::connection::create_and_connect (cognitive 16) mirrord/cli/src/connection.rs:524 — mirrord::connection::create_and_connect has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 4, boolean chains 1 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • mirrord::internal_proxy::db_portforwards::resolve_port_mappings (cognitive 16) mirrord/cli/src/internal_proxy/db_portforwards.rs:437 — mirrord::internal_proxy::db_portforwards::resolve_port_mappings has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (8 pts), if/else 5 (7 pts), loops 1 (nesting depth added 4). 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.
  • mirrord::preview::sync::list_entries (cognitive 16) mirrord/cli/src/preview/sync.rs:958 — mirrord::preview::sync::list_entries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
X2 · Cancellation propagation · Async function without AbortSignal · ×16
  • Async function without AbortSignal: queryFn packages/wizard/src/lib/queries.ts:43 — `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: queryFn packages/wizard/src/lib/queries.ts:65 — `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: queryFn packages/wizard/src/lib/queries.ts:82 — `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: queryFn packages/wizard/src/lib/queries.ts:95 — `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: queryFn packages/wizard/src/lib/queries.ts:111 — `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: queryFn packages/wizard/src/lib/queries.ts:131 — `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: listSessions packages/monitor/src/api.ts:50 — `listSessions` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getSession packages/monitor/src/api.ts:61 — `getSession` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: killSession packages/monitor/src/api.ts:85 — `killSession` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: listChaosRules packages/monitor/src/api.ts:129 — `listChaosRules` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: createChaosRule packages/monitor/src/api.ts:140 — `createChaosRule` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: updateChaosRule packages/monitor/src/api.ts:162 — `updateChaosRule` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: deleteChaosRule packages/monitor/src/api.ts:187 — `deleteChaosRule` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getPreviewDetail packages/monitor/src/api.ts:228 — `getPreviewDetail` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: listContexts packages/monitor/src/api.ts:267 — `listContexts` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: resolveToken packages/monitor/src/extensionConfigure.ts:17 — `resolveToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
D3 · God Classes · ClassTooLong · ×14
  • ClassTooLong: OperatorApi mirrord/operator/src/client.rs:410 — ClassTooLong — 2196 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 54 methods, 6 blocks, lines 410-3773. The bar is 400 significant lines; this is 1796 over it, 5.49× 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: CliError mirrord/cli/src/error.rs:309 — ClassTooLong — 842 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 8 blocks, lines 309-1498. The bar is 400 significant lines; this is 442 over it, 2.11× 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: LayerConfig mirrord/config/src/lib.rs:372 — ClassTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 3 blocks, lines 372-1797. The bar is 400 significant lines; this is 259 over it, 1.65× 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: FileManager mirrord/agent/src/file.rs:105 — ClassTooLong — 618 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 3 blocks, lines 105-1038. The bar is 400 significant lines; this is 218 over it, 1.55× 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: UnifiedBranchParams mirrord/operator/src/client/database_branches.rs:2028 — ClassTooLong — 596 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 2 blocks, lines 2028-2734. The bar is 400 significant lines; this is 196 over it, 1.49× 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: IncomingProxy mirrord/intproxy/src/proxies/incoming.rs:184 — ClassTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods, 3 blocks, lines 184-1034. The bar is 400 significant lines; this is 165 over it, 1.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ResolvedTarget mirrord/kube/src/resolved.rs:43 — ClassTooLong — 534 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, 4 blocks, lines 43-857. The bar is 400 significant lines; this is 134 over it, 1.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LayerManagedProcess mirrord/layer-lib/src/process/windows/execution/mod.rs:247 — ClassTooLong — 534 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, 4 blocks, lines 247-1194. The bar is 400 significant lines; this is 134 over it, 1.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FilesProxy mirrord/intproxy/src/proxies/files.rs:438 — ClassTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 10 methods, 4 blocks, lines 438-1258. The bar is 400 significant lines; this is 131 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: IntProxy mirrord/intproxy/src/lib.rs:130 — ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 2 blocks, lines 130-1055. The bar is 400 significant lines; this is 104 over it, 1.26× 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: MirrordExecution mirrord/cli/src/execution.rs:107 — ClassTooLong — 481 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 2 blocks, lines 107-1096. The bar is 400 significant lines; this is 81 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: OutgoingProxy mirrord/intproxy/src/proxies/outgoing.rs:214 — ClassTooLong — 469 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 3 blocks, lines 214-951. The bar is 400 significant lines; this is 69 over it, 1.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.
  • ClassTooLong: TargetsScreen mirrord/tui/src/screens/targets.rs:97 — ClassTooLong — 444 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 3 blocks, lines 97-786. The bar is 400 significant lines; this is 44 over it, 1.11× 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: PreparedPreview mirrord/cli/src/preview.rs:237 — ClassTooLong — 429 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 2 methods, 2 blocks, lines 237-896. The bar is 400 significant lines; this is 29 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D1 · Cyclomatic Complexity · mirrord · ×13
  • mirrord::main (cyclomatic 43) mirrord/cli/src/main.rs:1203 — mirrord::main has cyclomatic complexity 43 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • mirrord::preview::wait_until_started (cyclomatic 32) mirrord/cli/src/preview.rs:918 — mirrord::preview::wait_until_started has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • mirrord::preview::up::run_preview_up (cyclomatic 28) mirrord/cli/src/preview/up.rs:122 — mirrord::preview::up::run_preview_up has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • mirrord::up::checks::check_db_branches (cyclomatic 26) mirrord/cli/src/up/checks.rs:236 — mirrord::up::checks::check_db_branches has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mirrord::connection::try_connect_using_operator (cyclomatic 25) mirrord/cli/src/connection.rs:208 — mirrord::connection::try_connect_using_operator has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mirrord::preview::preview_status (cyclomatic 24) mirrord/cli/src/preview.rs:1444 — mirrord::preview::preview_status has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • mirrord::external_proxy::proxy (cyclomatic 21) mirrord/cli/src/external_proxy.rs:73 — mirrord::external_proxy::proxy has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • mirrord::internal_proxy::db_portforwards::extract_portforward_configs (cyclomatic 20) mirrord/cli/src/internal_proxy/db_portforwards.rs:279 — mirrord::internal_proxy::db_portforwards::extract_portforward_configs has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • mirrord::preview::up::prepare_service (cyclomatic 20) mirrord/cli/src/preview/up.rs:377 — mirrord::preview::up::prepare_service 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.
  • mirrord::ui::chaos_command (cyclomatic 20) mirrord/cli/src/ui.rs:284 — mirrord::ui::chaos_command has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mirrord::print_config (cyclomatic 18) mirrord/cli/src/main.rs:808 — mirrord::print_config has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • mirrord::exec (cyclomatic 17) mirrord/cli/src/main.rs:931 — mirrord::exec has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • mirrord::operator::install::uninstall::clear_finalized (cyclomatic 16) mirrord/cli/src/operator/install/uninstall.rs:331 — mirrord::operator::install::uninstall::clear_finalized has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×13
  • Duplicated block (11 lines × 2) mirrord/agent/src/entrypoint.rs:1078 — mirrord/agent/src/entrypoint.rs:1078-1088 | mirrord/agent/src/entrypoint.rs:1344-1354 — both copies are in the same file, so extract the block into 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) mirrord/agent/src/incoming/connection/http.rs:214 — mirrord/agent/src/incoming/connection/http.rs:214-224 | mirrord/agent/src/incoming/connection/http.rs:450-460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/incoming/connection/http.rs:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) mirrord/agent/src/outgoing/seqpacket.rs:186 — mirrord/agent/src/outgoing/seqpacket.rs:186-196 | mirrord/agent/src/outgoing/udp.rs:158-168 — before extracting anything, compare `mirrord/agent/src/outgoing/seqpacket.rs` and `mirrord/agent/src/outgoing/udp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) mirrord/agent/src/outgoing/seqpacket.rs:199 — mirrord/agent/src/outgoing/seqpacket.rs:199-209 | mirrord/agent/src/outgoing/udp.rs:171-181 — before extracting anything, compare `mirrord/agent/src/outgoing/seqpacket.rs` and `mirrord/agent/src/outgoing/udp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/outgoing/seqpacket.rs:199` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) mirrord/auth/src/credentials.rs:360 — mirrord/auth/src/credentials.rs:360-370 | mirrord/auth/src/credentials.rs:390-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/auth/src/credentials.rs:360` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) mirrord/cli/src/execution.rs:660 — mirrord/cli/src/execution.rs:660-670 | mirrord/cli/src/execution.rs:833-843 — both copies are in the same file, so extract the block into 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) mirrord/cli/src/preview/resources/compare.rs:65 — mirrord/cli/src/preview/resources/compare.rs:65-75 | mirrord/cli/src/preview/resources/compare.rs:140-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/preview/resources/compare.rs:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) mirrord/operator/src/client.rs:2364 — mirrord/operator/src/client.rs:2364-2374 | mirrord/operator/src/client.rs:2729-2739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client.rs:2364` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) mirrord/operator/src/client.rs:3236 — mirrord/operator/src/client.rs:3236-3246 | mirrord/operator/src/client.rs:3274-3284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client.rs:3236` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/operator/src/client.rs:3234` calls `namespace`, `unwrap_or` and `mirrord/operator/src/client.rs:3272` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) mirrord/tui/src/screens/targets/browser.rs:545 — mirrord/tui/src/screens/targets/browser.rs:545-555 | mirrord/tui/src/screens/targets/plan.rs:179-189 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/targets/browser.rs:545` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) mirrord/cli/src/port_forward.rs:374 — mirrord/cli/src/port_forward.rs:374-384 | mirrord/cli/src/port_forward.rs:705-715 — both copies are in the same file, so extract the block into 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) mirrord/layer/src/file/hooks.rs:1420 — mirrord/layer/src/file/hooks.rs:1420-1430 | mirrord/layer/src/file/hooks.rs:1448-1458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/file/hooks.rs:1420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) mirrord/intproxy/src/proxies/incoming/http_gateway.rs:113 — mirrord/intproxy/src/proxies/incoming/http_gateway.rs:113-123 | mirrord/intproxy/src/proxies/incoming/http_gateway.rs:142-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/intproxy/src/proxies/incoming/http_gateway.rs:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×13
  • Duplicated block (8 lines × 2) mirrord/agent/src/file.rs:380 — mirrord/agent/src/file.rs:380-387 | mirrord/agent/src/file.rs:408-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/file.rs:380` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) mirrord/agent/src/incoming/task.rs:445 — mirrord/agent/src/incoming/task.rs:445-452 | mirrord/agent/src/incoming/task.rs:461-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/incoming/task.rs:445` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) mirrord/cli/src/ci.rs:545 — mirrord/cli/src/ci.rs:545-552 | mirrord/cli/src/ci.rs:650-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/ci.rs:545` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/cli/src/ci.rs:649` calls `code`, `unwrap_or_default` and `mirrord/cli/src/ci.rs:544` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) mirrord/cli/src/execution.rs:708 — mirrord/cli/src/execution.rs:708-715 | mirrord/cli/src/execution.rs:918-925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mirrord/cli/src/execution.rs:936` calls `wait`, `unwrap` and `mirrord/cli/src/execution.rs:717` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) mirrord/layer-lib/src/debugger_ports.rs:231 — mirrord/layer-lib/src/debugger_ports.rs:231-238 | mirrord/layer-lib/src/debugger_ports.rs:251-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer-lib/src/debugger_ports.rs:231` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) mirrord/layer-win/src/hooks/files/ops/query_info.rs:111 — mirrord/layer-win/src/hooks/files/ops/query_info.rs:111-118 | mirrord/layer-win/src/hooks/files/ops/query_info.rs:234-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/layer-win/src/hooks/files/ops/query_info.rs:231` calls `Some`, `try_xstat` and `mirrord/layer-win/src/hooks/files/ops/query_info.rs:108` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) mirrord/tui/src/screens/preview_envs/view.rs:879 — mirrord/tui/src/screens/preview_envs/view.rs:879-886 | mirrord/tui/src/screens/preview_envs/view.rs:970-977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) mirrord/agent/src/incoming/connection/copy_bidirectional.rs:116 — mirrord/agent/src/incoming/connection/copy_bidirectional.rs:116-123 | mirrord/agent/src/incoming/connection/http_task.rs:357-364 — 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) mirrord/tui/src/screens/databases.rs:668 — mirrord/tui/src/screens/databases.rs:668-675 | mirrord/tui/src/screens/queues.rs:709-716 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 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) mirrord/cli/src/preview.rs:1790 — mirrord/cli/src/preview.rs:1790-1797 | mirrord/cli/src/preview.rs:1936-1947 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/preview.rs:1790` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) mirrord/tui/src/screens/preview_envs/view.rs:538 — mirrord/tui/src/screens/preview_envs/view.rs:538-545 | mirrord/tui/src/screens/preview_envs/view.rs:565-572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/preview_envs/view.rs:538` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) mirrord/tui/src/screens/queues.rs:829 — mirrord/tui/src/screens/queues.rs:829-836 | mirrord/tui/src/screens/queues.rs:889-896 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/queues.rs:829` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/tui/src/screens/queues.rs:888` calls `iter`, `filter`, `count` and `mirrord/tui/src/screens/queues.rs:828` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) mirrord/layer/src/file/hooks.rs:1477 — mirrord/layer/src/file/hooks.rs:1477-1484 | mirrord/layer/src/file/hooks.rs:1507-1514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/file/hooks.rs:1477` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D15 · Churn × Complexity Hotspots · Repeated repair · ×12
  • Repeated repair: mirrord/layer-lib/src/file/filter.rs mirrord/layer-lib/src/file/filter.rs:175 — mirrord/layer-lib/src/file/filter.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is FileFilter::check at line 175), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(layer): keep ancestors local only to calls that describe them”; “fix(layer): keep the working directory's ancestors local by default”; “fix(windows): keep %TEMP% local by default”; “fix(windows): keep unmatched paths local under localwithoverrides”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-lib/src/file/filter.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/layer-win/src/hooks/mod.rs mirrord/layer-win/src/hooks/mod.rs:30 — mirrord/layer-win/src/hooks/mod.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is mirrord_layer_win::hooks::initialize_hooks at line 30), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(windows): build child environments with Windows name rules”; “fix(windows): make a failed or slow layer startup inert, run-once and reported”; “fix(windows): bypass the layer's own hooks per call, not per thread”; “fix(windows): write layer logs by default and keep logging out of detours”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-win/src/hooks/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/layer-win/src/hooks/process/mod.rs mirrord/layer-win/src/hooks/process/mod.rs:345 — mirrord/layer-win/src/hooks/process/mod.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is mirrord_layer_win::hooks::process::getprocaddress_detour at line 345), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(windows): build child environments with Windows name rules”; “fix(windows): make a failed or slow layer startup inert, run-once and reported”; “fix(windows): write layer logs by default and keep logging out of detours”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-win/src/hooks/process/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/utils-win/src/diagnostics/crash.rs mirrord/utils-win/src/diagnostics/crash.rs:449 — mirrord/utils-win/src/diagnostics/crash.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is utils_win::diagnostics::crash::write_crash_record at line 449), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(utils-win): keep the stack walk inside the committed stack”; “fix(windows): make a failed or slow layer startup inert, run-once and reported”; “fix(windows): make layer readiness race-free and report init failures”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/utils-win/src/diagnostics/crash.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/layer-win/src/lib.rs mirrord/layer-win/src/lib.rs:329 — mirrord/layer-win/src/lib.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is mirrord_layer_win::dll_attach at line 329), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(windows): build child environments with Windows name rules”; “fix(windows): make a failed or slow layer startup inert, run-once and reported”; “fix(windows): make layer readiness race-free and report init failures”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-win/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/utils-win/src/diagnostics/report.rs mirrord/utils-win/src/diagnostics/report.rs:774 — mirrord/utils-win/src/diagnostics/report.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is utils_win::diagnostics::report::build_session_archive at line 774), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(windows): make a failed or slow layer startup inert, run-once and reported”; “fix(windows): make crash reports describe what actually happened”; “fix(windows): write layer logs by default and keep logging out of detours”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/utils-win/src/diagnostics/report.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/layer-win/src/hooks/socket/ops.rs mirrord/layer-win/src/hooks/socket/ops.rs:116 — mirrord/layer-win/src/hooks/socket/ops.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is WSABufferData::from_raw at line 116), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fix lint on Windows”; “fix(windows): preserve socket errors across the layer's own cleanup”; “fix(windows): bypass the layer's own hooks per call, not per thread”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-win/src/hooks/socket/ops.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/config/src/template.rs mirrord/config/src/template.rs:78 — mirrord/config/src/template.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is mirrord_config::template::regex_escape at line 78), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(config): leave a network share out of path_pattern”; “fix(config): make regex_escape work in http_filter patterns”; “fix(windows): keep %TEMP% local by default”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/config/src/template.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/layer-lib/src/file/mapper.rs mirrord/layer-lib/src/file/mapper.rs:62 — mirrord/layer-lib/src/file/mapper.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is FileRemapper::change_pattern_path at line 62), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(windows): filter a mapped path as remote even when it looks unchanged”; “fix(layer): replace case-insensitively in fs mappings”; “fix(windows): make a failed or slow layer startup inert, run-once and reported”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/layer-lib/src/file/mapper.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/cli/src/attach.rs mirrord/cli/src/attach.rs:38 — mirrord/cli/src/attach.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is mirrord::attach::attach_command at line 38), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): print Windows exec and attach error causes once”; “fix(windows): make a failed or slow layer startup inert, run-once and reported”; “fix(cli): attach reports why it failed instead of a timeout”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/cli/src/attach.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/utils-win/src/diagnostics/monitor.rs mirrord/utils-win/src/diagnostics/monitor.rs:215 — mirrord/utils-win/src/diagnostics/monitor.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is utils_win::diagnostics::monitor::exchange at line 215), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(windows): make a failed or slow layer startup inert, run-once and reported”; “fix(windows): make crash reports describe what actually happened”; “fix(windows): make layer readiness race-free and report init failures”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/utils-win/src/diagnostics/monitor.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mirrord/utils-win/src/diagnostics/monitor/channel.rs mirrord/utils-win/src/diagnostics/monitor/channel.rs:145 — mirrord/utils-win/src/diagnostics/monitor/channel.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is utils_win::diagnostics::monitor::channel::register at line 145), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(windows): make a failed or slow layer startup inert, run-once and reported”; “fix(windows): make crash reports describe what actually happened”; “fix(windows): make layer readiness race-free and report init failures”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 03:50:59 +00:00' --until='2026-11-14 03:50:59 +00:00' --full-history --no-merges -- mirrord/utils-win/src/diagnostics/monitor/channel.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×12
  • Duplicated block (6 lines × 2) mirrord/kube/src/error.rs:161 — mirrord/kube/src/error.rs:161-166 | mirrord/kube/src/error.rs:183-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/kube/src/error.rs:161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) mirrord/layer-win/src/hooks/socket/mod.rs:836 — mirrord/layer-win/src/hooks/socket/mod.rs:836-841 | mirrord/layer/src/socket/ops.rs:710-715 — 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) mirrord/layer/src/lib.rs:505 — mirrord/layer/src/lib.rs:505-511 | mirrord/layer/src/lib.rs:616-621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/lib.rs:505` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) mirrord/protocol/src/codec.rs:297 — mirrord/protocol/src/codec.rs:297-302 | mirrord/protocol/src/codec.rs:312-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/protocol/src/codec.rs:297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) mirrord/tui/src/screens/queues.rs:143 — mirrord/tui/src/screens/queues.rs:143-148 | mirrord/tui/src/screens/queues.rs:248-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/queues.rs:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) mirrord/agent/src/outgoing/seqpacket.rs:225 — mirrord/agent/src/outgoing/seqpacket.rs:225-230 | mirrord/agent/src/outgoing/udp.rs:197-202 — before extracting anything, compare `mirrord/agent/src/outgoing/seqpacket.rs` and `mirrord/agent/src/outgoing/udp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) mirrord/config/src/feature/database_branches/mariadb.rs:120 — mirrord/config/src/feature/database_branches/mariadb.rs:120-125 | mirrord/config/src/feature/database_branches/mysql.rs:116-121 — 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) mirrord/tui/src/screens/databases.rs:555 — mirrord/tui/src/screens/databases.rs:555-560 | mirrord/tui/src/screens/queues.rs:562-567 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) mirrord/agent/src/incoming/mirror_handle.rs:85 — mirrord/agent/src/incoming/mirror_handle.rs:85-90 | mirrord/agent/src/incoming/steal_handle.rs:88-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) mirrord/layer-lib/src/mutex.rs:11 — mirrord/layer-lib/src/mutex.rs:11-16 | mirrord/sip/src/codesign.rs:146-151 — 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) mirrord/agent/src/incoming/connection/tcp.rs:92 — mirrord/agent/src/incoming/connection/tcp.rs:92-97 | mirrord/agent/src/incoming/connection/tcp.rs:162-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/incoming/connection/tcp.rs:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `shutdown` to `CancellationToken) -> (StolenTcp` in one and `CancellationToken` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) mirrord/cli/src/execution.rs:1007 — mirrord/cli/src/execution.rs:1007-1012 | mirrord/layer/src/lib.rs:550-555 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/execution.rs:1007` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D5 · Coupling · Off the main sequence · ×12
  • Off the main sequence: mirrord-jaq — mirrord-jaq: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-nightly-polyfill — mirrord-nightly-polyfill: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-remote-layer-protocol — mirrord-remote-layer-protocol: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-session-monitor-protocol — mirrord-session-monitor-protocol: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-sessions-manager-protocol — mirrord-sessions-manager-protocol: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-sip — mirrord-sip: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-protocol — mirrord-protocol: abstractness 0.01, instability 0.07, distance 0.92 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-progress — mirrord-progress: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-agent-env — mirrord-agent-env: abstractness 0.20, instability 0.00, distance 0.80 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-analytics — mirrord-analytics: abstractness 0.20, instability 0.00, distance 0.80 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-intproxy-protocol — mirrord-intproxy-protocol: abstractness 0.10, instability 0.14, distance 0.76 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: mirrord-tls-util — mirrord-tls-util: abstractness 0.29, instability 0.00, distance 0.71 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
D31 · IaC & Container Security · Medium IaC · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×11
  • Duplicated block (7 lines × 2) mirrord/cli/src/ci.rs:113 — mirrord/cli/src/ci.rs:113-119 | mirrord/cli/src/operator/session.rs:43-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) mirrord/cli/src/db_branches.rs:363 — mirrord/cli/src/db_branches.rs:363-369 | mirrord/cli/src/db_branches.rs:471-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) mirrord/operator/src/crd/db_branching/mysql.rs:88 — mirrord/operator/src/crd/db_branching/mysql.rs:88-94 | mirrord/operator/src/crd/db_branching/pg.rs:93-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `MysqlBranchCopyConfig` in one and `PgBranchCopyConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) mirrord/operator/src/crd/db_branching/mysql.rs:96 — mirrord/operator/src/crd/db_branching/mysql.rs:96-102 | mirrord/operator/src/crd/db_branching/pg.rs:101-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `MysqlBranchCopyConfig` in one and `PgBranchCopyConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) mirrord/protocol-api/src/client/outgoing.rs:227 — mirrord/protocol-api/src/client/outgoing.rs:227-233 | mirrord/protocol-api/src/client/outgoing.rs:265-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) mirrord/agent/iptables/src/mesh.rs:98 — mirrord/agent/iptables/src/mesh.rs:98-104 | mirrord/agent/iptables/src/standard.rs:46-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) mirrord/agent/src/outgoing/seqpacket.rs:177 — mirrord/agent/src/outgoing/seqpacket.rs:177-183 | mirrord/agent/src/outgoing/udp.rs:149-155 — before extracting anything, compare `mirrord/agent/src/outgoing/seqpacket.rs` and `mirrord/agent/src/outgoing/udp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) mirrord/cli/src/preview.rs:2689 — mirrord/cli/src/preview.rs:2689-2695 | mirrord/operator/src/client/queue_split_progress.rs:203-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) mirrord/config/src/feature/database_branches/mariadb.rs:110 — mirrord/config/src/feature/database_branches/mariadb.rs:110-116 | mirrord/config/src/feature/database_branches/mysql.rs:106-112 — 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) mirrord/cli/src/config.rs:801 — mirrord/cli/src/config.rs:801-808 | mirrord/cli/src/config.rs:1828-1834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/config.rs:801` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) xtask/src/tasks/cli.rs:94 — xtask/src/tasks/cli.rs:94-100 | xtask/src/tasks/layer.rs:210-216 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×10
  • Duplicated block (10 lines × 2) mirrord/cli/src/ci.rs:556 — mirrord/cli/src/ci.rs:556-565 | mirrord/cli/src/ci.rs:664-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/ci.rs:556` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) mirrord/cli/src/local_redis.rs:198 — mirrord/cli/src/local_redis.rs:198-207 | mirrord/cli/src/local_redis.rs:246-255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/local_redis.rs:198` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:47 — mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:47-56 | mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:109-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) mirrord/layer-win/src/hooks/files/ops/read.rs:229 — mirrord/layer-win/src/hooks/files/ops/read.rs:229-238 | mirrord/layer-win/src/hooks/files/ops/set_info.rs:74-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer-win/src/hooks/files/ops/read.rs:229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) mirrord/layer/src/file/open_dirs.rs:260 — mirrord/layer/src/file/open_dirs.rs:260-269 | mirrord/layer/src/file/open_dirs.rs:298-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/file/open_dirs.rs:260` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `out_entry` to `&mut libc::dirent` in one and `&mut libc::dirent64` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) mirrord/tui/src/screens/databases.rs:1085 — mirrord/tui/src/screens/databases.rs:1085-1094 | mirrord/tui/src/screens/terminal/panel.rs:129-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/databases.rs:1085` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/tui/src/screens/databases.rs:1083` calls `max` and `mirrord/tui/src/screens/terminal/panel.rs:127` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) mirrord/tui/src/screens/targets/browser.rs:484 — mirrord/tui/src/screens/targets/browser.rs:484-493 | mirrord/tui/src/screens/targets/plan.rs:135-144 — 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) mirrord/utils-win/src/modules.rs:365 — mirrord/utils-win/src/modules.rs:365-374 | mirrord/utils-win/src/modules.rs:388-397 — both copies are in the same file, so extract the block into 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) mirrord/cli/src/config.rs:895 — mirrord/cli/src/config.rs:895-904 | mirrord/cli/src/config.rs:966-975 — both copies are in the same file, so extract the block into 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) mirrord/agent/iptables/src/mesh/istio.rs:190 — mirrord/agent/iptables/src/mesh/istio.rs:190-199 | mirrord/agent/iptables/src/standard.rs:54-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×9
  • Animation without a prefers-reduced-motion guard packages/ui/src/index.css:109 — `.event-row-animate` moves (`animation: eventFadeIn 0.2s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard packages/ui/src/index.css:156 — `.detail-fade-in` moves (`animation: detailFadeIn 0.18s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard packages/ui/src/index.css:171 — `.sidebar-item-animate` moves (`animation: sidebarItemFadeIn 0.16s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard packages/ui/src/index.css:277 — `.animate-fade-in` moves (`animation: fadeIn 0.3s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard packages/ui/src/index.css:281 — `.animate-slide-in` moves (`animation: slideIn 0.3s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard packages/ui/src/index.css:285 — `.animate-scale-in` moves (`animation: scaleIn 0.2s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard packages/ui/src/index.css:304 — `.animate-dialog-in` moves (`animation: dialogFadeIn 0.2s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard packages/ui/src/index.css:327 — `.animate-tab-in` moves (`animation: tabFadeIn 0.2s ease-out forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard packages/ui/src/index.css:334 — `.spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×9
  • Duplicated block (16 lines × 2) mirrord/analytics/src/lib.rs:420 — mirrord/analytics/src/lib.rs:420-435 | mirrord/analytics/src/lib.rs:509-524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/analytics/src/lib.rs:420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/analytics/src/lib.rs:419` calls `add` and `mirrord/analytics/src/lib.rs:508` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) mirrord/cli/src/session.rs:563 — mirrord/cli/src/session.rs:563-578 | mirrord/tui/src/screens/terminal/sessions.rs:226-241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) mirrord/intproxy/src/proxies/incoming.rs:666 — mirrord/intproxy/src/proxies/incoming.rs:666-681 | mirrord/intproxy/src/proxies/incoming.rs:684-699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) mirrord/intproxy/src/proxies/incoming/http_gateway.rs:268 — mirrord/intproxy/src/proxies/incoming/http_gateway.rs:268-283 | mirrord/intproxy/src/proxies/incoming/http_gateway.rs:298-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/intproxy/src/proxies/incoming/http_gateway.rs:268` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) mirrord/layer/macro/src/lib.rs:55 — mirrord/layer/macro/src/lib.rs:55-70 | mirrord/layer/macro/src/lib.rs:428-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/macro/src/lib.rs:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/layer/macro/src/lib.rs:427` calls `clone` and `mirrord/layer/macro/src/lib.rs:54` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) mirrord/layer/src/socket/dns_sd.rs:724 — mirrord/layer/src/socket/dns_sd.rs:724-739 | mirrord/layer/src/socket/dns_sd.rs:780-795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/socket/dns_sd.rs:724` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) mirrord/tui/src/screens/databases.rs:77 — mirrord/tui/src/screens/databases.rs:77-92 | mirrord/tui/src/screens/queues.rs:76-91 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/databases.rs:77` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) mirrord/tui/src/screens/databases.rs:334 — mirrord/tui/src/screens/databases.rs:334-349 | mirrord/tui/src/screens/queues.rs:309-324 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) mirrord/tui/src/screens/databases.rs:352 — mirrord/tui/src/screens/databases.rs:352-367 | mirrord/tui/src/screens/queues.rs:359-374 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/databases.rs:352` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×8
  • Duplicated block (13 lines × 2) mirrord/agent/src/outgoing/router.rs:152 — mirrord/agent/src/outgoing/router.rs:152-164 | mirrord/agent/src/outgoing/router.rs:185-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/outgoing/router.rs:152` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) mirrord/layer/src/socket/ops.rs:815 — mirrord/layer/src/socket/ops.rs:815-827 | mirrord/layer/src/socket/ops.rs:933-945 — both copies are in the same file, so extract the block into 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) mirrord/operator/src/client/database_branches.rs:2530 — mirrord/operator/src/client/database_branches.rs:2530-2542 | mirrord/operator/src/client/database_branches.rs:2615-2627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:2530` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) mirrord/protocol-api/src/client/retrying.rs:152 — mirrord/protocol-api/src/client/retrying.rs:152-164 | mirrord/protocol-api/src/client/retrying.rs:178-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/protocol-api/src/client/retrying.rs:152` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) mirrord/tui/src/screens/databases.rs:130 — mirrord/tui/src/screens/databases.rs:130-142 | mirrord/tui/src/screens/queues.rs:125-137 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/databases.rs:130` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) mirrord/tui/src/screens/databases.rs:319 — mirrord/tui/src/screens/databases.rs:319-331 | mirrord/tui/src/screens/queues.rs:294-306 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) mirrord/tui/src/screens/databases.rs:921 — mirrord/tui/src/screens/databases.rs:921-933 | mirrord/tui/src/screens/databases.rs:945-957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) mirrord/operator/src/crd.rs:1710 — mirrord/operator/src/crd.rs:1710-1722 | mirrord/operator/src/crd/rabbitmq.rs:99-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `session` to `Option<&MirrordSqsSession>` in one and `Option<&MirrordRmqSession>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D2 · Cognitive Complexity · mirrord_tui · ×7
  • mirrord_tui::screens::preview_envs::view::card_content (cognitive 32) mirrord/tui/src/screens/preview_envs/view.rs:1003 — mirrord_tui::screens::preview_envs::view::card_content has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_tui::screens::queues::details_lines (cognitive 31) mirrord/tui/src/screens/queues.rs:734 — mirrord_tui::screens::queues::details_lines has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (9 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_tui::screens::preview_envs::data::run (cognitive 25) mirrord/tui/src/screens/preview_envs/data.rs:62 — mirrord_tui::screens::preview_envs::data::run has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 2 (7 pts), loops 3 (5 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • mirrord_tui::screens::targets::suggest::discover (cognitive 18) mirrord/tui/src/screens/targets/suggest.rs:23 — mirrord_tui::screens::targets::suggest::discover has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • mirrord_tui::helpers::wrap (cognitive 17) mirrord/tui/src/helpers.rs:61 — mirrord_tui::helpers::wrap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_tui::screens::databases::connection_source_section (cognitive 16) mirrord/tui/src/screens/databases.rs:871 — mirrord_tui::screens::databases::connection_source_section has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 1 (3 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • mirrord_tui::screens::databases::migrations_spec_section (cognitive 16) mirrord/tui/src/screens/databases.rs:908 — mirrord_tui::screens::databases::migrations_spec_section has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change coupling · ×7
  • Change coupling: connection.rs ↔ session.rs mirrord/cli/src/connection.rs:1 — `mirrord/cli/src/connection.rs` and `mirrord/cli/src/operator/session.rs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `c6dddd26` `mirrord ci start` and `mirrord ci stop` (#3618); `4e3509f5` Retries kube requests with a tower `Policy`. (#3564); `47c0d590` Improve mirrord progress (interactive auth, message buffer) (#3470) — run `git show` on any of them.
  • Change coupling: ops.rs ↔ go.rs mirrord/layer/src/file/ops.rs:1 — `mirrord/layer/src/file/ops.rs` and `mirrord/layer/src/go.rs` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `86533813` Refactor layer Detour type with stable rust features; `ef4f9bc5` Strip instrument and tracing in fn that Go hooks call into (#4423) (at that commit the file was still `mirrord/layer/src/go/mod.rs`); `6b49b015` Add hook for `rename`. (#3504) (at that commit the file was still `mirrord/layer/src/go/mod.rs`) — run `git show` on any of them.
  • Change coupling: ephemeral.rs ↔ job.rs mirrord/kube/src/api/container/ephemeral.rs:1 — `mirrord/kube/src/api/container/ephemeral.rs` and `mirrord/kube/src/api/container/job.rs` change together 55% of the time (12 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `29c3bfbe` fix(366): fail fast on image misses (#4157); `a73fddea` Move agent container arguments from `command` to `args` (#4143); `47c0d590` Improve mirrord progress (interactive auth, message buffer) (#3470) — run `git show` on any of them.
  • Change coupling: db_portforwards.rs ↔ branch_database.rs mirrord/cli/src/internal_proxy/db_portforwards.rs:1 — `mirrord/cli/src/internal_proxy/db_portforwards.rs` and `mirrord/operator/src/crd/db_branching/branch_database.rs` change together 53% of the time (16 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `3accd3e1` Add additional_databases to PostgreSQL db branches; `c07e07aa` Add turbopuffer namespace branching; `478e89c4` S3 branching config — run `git show` on any of them.
  • Change coupling: credential_store.rs ↔ config.rs mirrord/auth/src/credential_store.rs:1 — `mirrord/auth/src/credential_store.rs` and `mirrord/cli/src/config.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `435ce6f7` preview: reshape `sync` into an optional `run` and a `prepare` (#5201); `64afcb2b` Change mirrord UI to run as background process (#4460); `bf1ed681` mirrord up (#4161) — run `git show` on any of them.
  • Change coupling: connection.rs ↔ extract.rs mirrord/cli/src/connection.rs:1 — `mirrord/cli/src/connection.rs` and `mirrord/cli/src/extract.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `47c0d590` Improve mirrord progress (interactive auth, message buffer) (#3470); `20bd12f4` Rename some potentially confusing names. (#2914); `639d5e4e` Improve operator detection + errors in CLI (#2520) — run `git show` on any of them.
  • Change coupling: extension.rs ↔ extract.rs mirrord/cli/src/extension.rs:1 — `mirrord/cli/src/extension.rs` and `mirrord/cli/src/extract.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `47c0d590` Improve mirrord progress (interactive auth, message buffer) (#3470); `20bd12f4` Rename some potentially confusing names. (#2914); `639d5e4e` Improve operator detection + errors in CLI (#2520) — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×7
  • Edited copy of a member (18 corresponding lines) mirrord/protocol-io/src/websocket.rs:225 — mirrord/protocol-io/src/websocket.rs:225-242 | mirrord/protocol-io/src/websocket.rs:244-261 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mirrord/agent/src/outgoing/seqpacket.rs:142 — mirrord/agent/src/outgoing/seqpacket.rs:142-164 | mirrord/agent/src/outgoing/udp.rs:215-232 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mirrord/tls-util/src/secure_channel.rs:87 — mirrord/tls-util/src/secure_channel.rs:87-108 | mirrord/tls-util/src/secure_channel.rs:113-130 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mirrord/cli/src/ui/server.rs:853 — mirrord/cli/src/ui/server.rs:853-872 | mirrord/cli/src/ui/server.rs:876-893 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mirrord/layer/src/file/open_dirs.rs:95 — mirrord/layer/src/file/open_dirs.rs:95-112 | mirrord/layer/src/file/open_dirs.rs:127-144 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mirrord/cli/src/queues.rs:201 — mirrord/cli/src/queues.rs:201-218 | mirrord/cli/src/queues.rs:446-467 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mirrord/layer/src/socket/hooks.rs:492 — mirrord/layer/src/socket/hooks.rs:492-509 | mirrord/layer/src/socket/hooks.rs:519-536 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×7
  • Duplicated block (9 lines × 2) mirrord/agent/src/http/sender.rs:57 — mirrord/agent/src/http/sender.rs:57-65 | mirrord/intproxy/src/proxies/incoming/http.rs:344-354 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) mirrord/cli/src/config.rs:621 — mirrord/cli/src/config.rs:621-629 | mirrord/cli/src/config.rs:1716-1724 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/config.rs:621` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) mirrord/cli/src/preview.rs:163 — mirrord/cli/src/preview.rs:163-173 | mirrord/cli/src/preview/up.rs:428-436 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/preview.rs:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) mirrord/config/src/feature/database_branches/s3.rs:118 — mirrord/config/src/feature/database_branches/s3.rs:118-126 | mirrord/config/src/feature/database_branches/turbopuffer.rs:209-217 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/config/src/feature/database_branches/s3.rs:118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:83 — mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:83-91 | mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:149-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) mirrord/operator/src/client.rs:536 — mirrord/operator/src/client.rs:536-544 | mirrord/operator/src/client.rs:3656-3664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client.rs:536` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) mirrord/operator/src/crd.rs:1697 — mirrord/operator/src/crd.rs:1697-1705 | mirrord/operator/src/crd/rabbitmq.rs:86-94 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×7
  • Low cohesion: IncomingIoWrapper (LCOM4 5) mirrord/agent/src/incoming/connection.rs:169 — IncomingIoWrapper's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SeqpacketSink (LCOM4 4) mirrord/agent/src/outgoing/seqpacket.rs:172 — SeqpacketSink's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UdpSink (LCOM4 4) mirrord/agent/src/outgoing/udp.rs:144 — UdpSink's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UnboundedBufferedSink (LCOM4 4) mirrord/agent/src/util/io/buffered.rs:101 — UnboundedBufferedSink's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AsyncEncoder (LCOM4 4) mirrord/intproxy/protocol/src/codec/codec_async.rs:27 — AsyncEncoder's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: McpServer (LCOM4 4) mirrord/mcp/src/lib.rs:104 — McpServer's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: JsonProgress (LCOM4 4) mirrord/progress/src/implementations.rs:15 — JsonProgress's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D2 · Cognitive Complexity · OperatorApi · ×6
  • OperatorApi::prepare_branch_dbs (cognitive 131) mirrord/operator/src/client.rs:1158 — OperatorApi::prepare_branch_dbs has cognitive complexity 131 (threshold 15). Drivers by points: if/else 40 (80 pts), loops 16 (37 pts), match/switch 4 (10 pts), boolean chains 4 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OperatorApi::prepare_session (cognitive 30) mirrord/operator/src/client.rs:2351 — OperatorApi::prepare_session has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OperatorApi::should_copy_target (cognitive 25) mirrord/operator/src/client.rs:2908 — OperatorApi::should_copy_target has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 3, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OperatorApi::prepare_multi_cluster_session (cognitive 17) mirrord/operator/src/client.rs:2698 — OperatorApi::prepare_multi_cluster_session has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OperatorApi::should_copy_target_mc (cognitive 17) mirrord/operator/src/client.rs:3090 — OperatorApi::should_copy_target_mc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OperatorApi::check_feature_support (cognitive 16) mirrord/operator/src/client.rs:2017 — OperatorApi::check_feature_support has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · mirrord_layer_win · ×6
  • mirrord_layer_win::hooks::files::ops::query_info::info (cognitive 55) mirrord/layer-win/src/hooks/files/ops/query_info.rs:76 — mirrord_layer_win::hooks::files::ops::query_info::info has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (51 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 31). Of this number, 48 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_layer_win::hooks::files::ops::set_info::handle (cognitive 36) mirrord/layer-win/src/hooks/files/ops/set_info.rs:67 — mirrord_layer_win::hooks::files::ops::set_info::handle has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (33 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 22). Of this number, 32 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_layer_win::hooks::socket::bind_detour (cognitive 26) mirrord/layer-win/src/hooks/socket/mod.rs:351 — mirrord_layer_win::hooks::socket::bind_detour has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 4 (5 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_layer_win::hooks::socket::connectex_detour (cognitive 23) mirrord/layer-win/src/hooks/socket/mod.rs:1087 — mirrord_layer_win::hooks::socket::connectex_detour has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_layer_win::hooks::files::ops::open::handle (cognitive 22) mirrord/layer-win/src/hooks/files/ops/open.rs:105 — mirrord_layer_win::hooks::files::ops::open::handle has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • mirrord_layer_win::hooks::socket::initialize_hooks (cognitive 18) mirrord/layer-win/src/hooks/socket/mod.rs:2121 — mirrord_layer_win::hooks::socket::initialize_hooks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×6
  • Edited copy of a member (15 corresponding lines) mirrord/protocol-api/src/client/outgoing.rs:167 — mirrord/protocol-api/src/client/outgoing.rs:167-181 | mirrord/protocol-api/src/client/outgoing.rs:191-208 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mirrord/vpn/src/config.rs:41 — mirrord/vpn/src/config.rs:41-62 | mirrord/vpn/src/config.rs:64-78 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mirrord/protocol-io/src/lib.rs:125 — mirrord/protocol-io/src/lib.rs:125-140 | mirrord/protocol-io/src/lib.rs:149-163 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) medschool/src/parse.rs:134 — medschool/src/parse.rs:134-148 | medschool/src/parse.rs:156-170 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mirrord/layer-go/src/linux_aarch64.rs:178 — mirrord/layer-go/src/linux_aarch64.rs:178-192 | mirrord/layer-go/src/linux_aarch64.rs:199-213 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mirrord/sip/src/lib.rs:645 — mirrord/sip/src/lib.rs:645-659 | mirrord/sip/src/lib.rs:665-680 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×6
  • Edited copy of a member (11 corresponding lines) mirrord/protocol/src/codec.rs:296 — mirrord/protocol/src/codec.rs:296-306 | mirrord/protocol/src/codec.rs:311-321 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mirrord/tls-util/src/read_pem.rs:59 — mirrord/tls-util/src/read_pem.rs:59-69 | mirrord/tls-util/src/read_pem.rs:75-85 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mirrord/tui/src/screens/targets/form.rs:230 — mirrord/tui/src/screens/targets/form.rs:230-240 | mirrord/tui/src/screens/targets/form.rs:244-254 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mirrord/agent/src/incoming/mirror_handle.rs:110 — mirrord/agent/src/incoming/mirror_handle.rs:110-120 | mirrord/agent/src/incoming/steal_handle.rs:122-132 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mirrord/agent/src/incoming/connection/copy_bidirectional.rs:104 — mirrord/agent/src/incoming/connection/copy_bidirectional.rs:104-114 | mirrord/agent/src/incoming/connection/http_task.rs:344-355 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mirrord/config/src/feature/database_branches.rs:1326 — mirrord/config/src/feature/database_branches.rs:1326-1337 | mirrord/config/src/feature/database_branches.rs:1340-1350 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×6
  • Edited copy of a member (9 corresponding lines) mirrord/protocol-api/src/client/tunnels/streams.rs:156 — mirrord/protocol-api/src/client/tunnels/streams.rs:156-164 | mirrord/protocol-api/src/client/tunnels/streams.rs:174-182 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mirrord/agent/src/incoming/connection/copy_bidirectional.rs:137 — mirrord/agent/src/incoming/connection/copy_bidirectional.rs:137-145 | mirrord/agent/src/incoming/connection/http_task.rs:440-448 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mirrord/layer-lib/src/socket.rs:192 — mirrord/layer-lib/src/socket.rs:192-200 | mirrord/layer-lib/src/socket/sockets.rs:111-119 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mirrord/agent/src/incoming/connection/copy_bidirectional.rs:157 — mirrord/agent/src/incoming/connection/copy_bidirectional.rs:157-165 | mirrord/agent/src/incoming/connection/http_task.rs:465-474 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mirrord/intproxy/src/proxies/incoming/http/response_mode.rs:22 — mirrord/intproxy/src/proxies/incoming/http/response_mode.rs:22-30 | mirrord/protocol-api/src/client/tunnels/streams.rs:600-608 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) xtask/src/tasks/test.rs:94 — xtask/src/tasks/test.rs:94-103 | xtask/src/tasks/test.rs:105-113 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×6
  • Duplicated block (12 lines × 2) mirrord/agent/src/steal/api.rs:543 — mirrord/agent/src/steal/api.rs:543-554 | mirrord/agent/src/steal/api.rs:569-580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/steal/api.rs:543` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) mirrord/cli/src/config.rs:1806 — mirrord/cli/src/config.rs:1806-1817 | mirrord/cli/src/config.rs:1945-1956 — both copies are in the same file, so extract the block into 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) mirrord/kube/src/api/kubernetes/seeker.rs:278 — mirrord/kube/src/api/kubernetes/seeker.rs:278-289 | mirrord/kube/src/api/kubernetes/seeker.rs:326-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/kube/src/api/kubernetes/seeker.rs:278` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) mirrord/layer/src/file/hooks.rs:390 — mirrord/layer/src/file/hooks.rs:390-401 | mirrord/layer/src/file/hooks.rs:423-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/file/hooks.rs:390` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `entry` to `*mut dirent` in one and `*mut dirent64` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) mirrord/layer/src/file/open_dirs.rs:96 — mirrord/layer/src/file/open_dirs.rs:96-107 | mirrord/layer/src/file/open_dirs.rs:128-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) mirrord/operator/src/client/database_branches.rs:1255 — mirrord/operator/src/client/database_branches.rs:1255-1266 | mirrord/operator/src/client/database_branches.rs:1520-1532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D2 · Cognitive Complexity · mirrord_layer_lib · ×5
  • mirrord_layer_lib::socket::ops::connect_common (cognitive 28) mirrord/layer-lib/src/socket/ops.rs:306 — mirrord_layer_lib::socket::ops::connect_common has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 9, match/switch 4 (6 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.
  • mirrord_layer_lib::debugger_ports::tokenize_argfile (cognitive 27) mirrord/layer-lib/src/debugger_ports.rs:429 — mirrord_layer_lib::debugger_ports::tokenize_argfile has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 3 (10 pts), loops 2 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_layer_lib::process::windows::command_line::push_quoted (cognitive 23) mirrord/layer-lib/src/process/windows/command_line.rs:37 — mirrord_layer_lib::process::windows::command_line::push_quoted has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (16 pts), match/switch 2 (5 pts), boolean chains 1, if/else 1 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • mirrord_layer_lib::socket::dns::reverse_dns::update_dns_reverse_mapping_bulk (cognitive 20) mirrord/layer-lib/src/socket/dns/reverse_dns.rs:34 — mirrord_layer_lib::socket::dns::reverse_dns::update_dns_reverse_mapping_bulk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_layer_lib::socket::ops::connect_outgoing_common (cognitive 18) mirrord/layer-lib/src/socket/ops.rs:458 — mirrord_layer_lib::socket::ops::connect_outgoing_common has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×5
  • Edited copy of a member (26 corresponding lines) mirrord/agent/src/outgoing/seqpacket.rs:198 — mirrord/agent/src/outgoing/seqpacket.rs:198-223 | mirrord/agent/src/outgoing/udp.rs:170-195 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) mirrord/cli/src/extract.rs:61 — mirrord/cli/src/extract.rs:61-89 | mirrord/cli/src/extract.rs:99-124 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) mirrord/cli/src/data/global_config.rs:273 — mirrord/cli/src/data/global_config.rs:273-311 | mirrord/cli/src/data/global_config.rs:313-338 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) mirrord/agent/src/file.rs:309 — mirrord/agent/src/file.rs:309-334 | mirrord/agent/src/file.rs:342-376 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) mirrord/layer/src/file/hooks.rs:379 — mirrord/layer/src/file/hooks.rs:379-404 | mirrord/layer/src/file/hooks.rs:412-437 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×5
  • Edited copy of a member (17 corresponding lines) mirrord/config/src/feature/database_branches.rs:975 — mirrord/config/src/feature/database_branches.rs:975-991 | mirrord/config/src/feature/database_branches.rs:1177-1193 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mirrord/cli/src/config.rs:1609 — mirrord/cli/src/config.rs:1609-1625 | mirrord/cli/src/config.rs:1710-1733 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mirrord/intproxy/src/proxies/incoming/subscriptions.rs:84 — mirrord/intproxy/src/proxies/incoming/subscriptions.rs:84-100 | mirrord/intproxy/src/proxies/incoming/subscriptions.rs:105-124 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mirrord/agent/src/incoming/composed.rs:63 — mirrord/agent/src/incoming/composed.rs:63-80 | mirrord/agent/src/incoming/composed.rs:86-102 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) test-utils/src/lib.rs:214 — test-utils/src/lib.rs:214-230 | test-utils/src/lib.rs:232-248 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×5
  • Edited copy of a member (12 corresponding lines) mirrord/tui/src/screens/databases.rs:603 — mirrord/tui/src/screens/databases.rs:603-614 | mirrord/tui/src/screens/queues.rs:610-621 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mirrord/tui/src/screens/databases.rs:526 — mirrord/tui/src/screens/databases.rs:526-537 | mirrord/tui/src/screens/queues.rs:533-544 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mirrord/layer/src/file/hooks.rs:441 — mirrord/layer/src/file/hooks.rs:441-452 | mirrord/layer/src/file/hooks.rs:455-466 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mirrord/cli/src/config.rs:724 — mirrord/cli/src/config.rs:724-735 | mirrord/cli/src/config.rs:1942-1959 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mirrord/tui/src/screens/targets/form.rs:1112 — mirrord/tui/src/screens/targets/form.rs:1112-1124 | mirrord/up/src/list.rs:297-308 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×5
  • Edited copy of a member (10 corresponding lines) mirrord/tui/src/screens/databases.rs:449 — mirrord/tui/src/screens/databases.rs:449-458 | mirrord/tui/src/screens/queues.rs:456-465 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mirrord/tui/src/screens/targets/suggest.rs:116 — mirrord/tui/src/screens/targets/suggest.rs:116-126 | mirrord/tui/src/screens/targets/suggest.rs:130-139 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mirrord/layer/src/file/hooks.rs:830 — mirrord/layer/src/file/hooks.rs:830-839 | mirrord/layer/src/file/hooks.rs:858-867 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mirrord/config/src/lib.rs:764 — mirrord/config/src/lib.rs:764-773 | mirrord/up/src/config.rs:1200-1213 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mirrord/agent/iptables/src/mesh.rs:119 — mirrord/agent/iptables/src/mesh.rs:119-130 | mirrord/agent/iptables/src/mesh/istio.rs:201-210 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×5
  • Edited copy of a member (13 corresponding lines) mirrord/sessions-manager/client/src/credentials.rs:93 — mirrord/sessions-manager/client/src/credentials.rs:93-105 | mirrord/sessions-manager/client/src/credentials.rs:107-119 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mirrord/layer-win/src/hooks/socket/addrinfo_ex.rs:255 — mirrord/layer-win/src/hooks/socket/addrinfo_ex.rs:255-280 | mirrord/layer-win/src/hooks/socket/addrinfo_ex.rs:282-294 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mirrord/agent/src/entrypoint/setup.rs:73 — mirrord/agent/src/entrypoint/setup.rs:73-85 | mirrord/agent/src/entrypoint/setup.rs:90-103 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mirrord/layer-go/src/linux_aarch64.rs:34 — mirrord/layer-go/src/linux_aarch64.rs:34-46 | mirrord/layer-go/src/linux_x64.rs:680-692 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mirrord/cli/src/ui/chaos.rs:34 — mirrord/cli/src/ui/chaos.rs:34-50 | mirrord/intproxy/src/session_monitor/chaos.rs:44-56 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×5
  • Edited copy of a member (6 corresponding lines) mirrord/agent/src/outgoing/tcp_unix.rs:202 — mirrord/agent/src/outgoing/tcp_unix.rs:202-207 | mirrord/tls-util/src/maybe_tls.rs:58-63 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mirrord/agent/src/outgoing/tcp_unix.rs:234 — mirrord/agent/src/outgoing/tcp_unix.rs:234-239 | mirrord/tls-util/src/maybe_tls.rs:69-74 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mirrord/agent/src/outgoing/tcp_unix.rs:252 — mirrord/agent/src/outgoing/tcp_unix.rs:252-257 | mirrord/tls-util/src/maybe_tls.rs:28-33 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mirrord/cli/src/util.rs:281 — mirrord/cli/src/util.rs:281-286 | mirrord/intproxy/src/proxies/outgoing/net_protocol_ext.rs:49-54 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mirrord/protocol/src/outgoing.rs:175 — mirrord/protocol/src/outgoing.rs:175-180 | mirrord/protocol/src/tcp.rs:59-64 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×5
  • Duplicated block (14 lines × 2) mirrord/layer-go/src/linux_aarch64.rs:97 — mirrord/layer-go/src/linux_aarch64.rs:97-110 | mirrord/layer-go/src/linux_aarch64.rs:141-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer-go/src/linux_aarch64.rs:97` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) mirrord/layer-win/src/hooks/socket/mod.rs:306 — mirrord/layer-win/src/hooks/socket/mod.rs:306-319 | mirrord/layer-win/src/hooks/socket/mod.rs:333-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. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer-win/src/hooks/socket/mod.rs:306` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) mirrord/protocol-io/src/lib.rs:127 — mirrord/protocol-io/src/lib.rs:127-140 | mirrord/protocol-io/src/lib.rs:150-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/protocol-io/src/lib.rs:127` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) mirrord/tui/src/screens/databases.rs:61 — mirrord/tui/src/screens/databases.rs:61-74 | mirrord/tui/src/screens/queues.rs:52-65 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/databases.rs:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) xtask/src/tasks/cli.rs:106 — xtask/src/tasks/cli.rs:106-119 | xtask/src/tasks/cli.rs:156-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×5
  • Duplicated block (5 lines × 2) mirrord/cli/src/connection.rs:140 — mirrord/cli/src/connection.rs:140-144 | mirrord/operator/src/client.rs:2321-2325 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/connection.rs:140` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) mirrord/config/src/feature/split_queues.rs:678 — mirrord/config/src/feature/split_queues.rs:678-685 | mirrord/tui/src/screens/targets/model.rs:315-319 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/config/src/feature/split_queues.rs:678` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) mirrord/layer/src/go.rs:129 — mirrord/layer/src/go.rs:129-133 | mirrord/layer/src/go.rs:203-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) mirrord/cli/src/login.rs:266 — mirrord/cli/src/login.rs:266-270 | mirrord/cluster-auth/src/jwt.rs:26-30 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) mirrord/intproxy/src/proxies/outgoing/interceptor/read_queue.rs:134 — mirrord/intproxy/src/proxies/outgoing/interceptor/read_queue.rs:134-138 | mirrord/intproxy/src/proxies/outgoing/interceptor/write_queue.rs:151-155 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/intproxy/src/proxies/outgoing/interceptor/read_queue.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
AC6 · Visual & motion safety · Focus outline removed inline · ×4
  • Focus outline removed inline packages/monitor/src/components/ContextNamespacePicker.tsx:148 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/monitor/src/components/chaos/BreakPopover.tsx:114 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/monitor/src/components/chaos/BreakPopover.tsx:126 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/monitor/src/components/events/EventSearchBar.tsx:35 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
D1 · Cyclomatic Complexity · mirrord_layer_win · ×4
  • mirrord_layer_win::hooks::files::ops::query_info::info (cyclomatic 23) mirrord/layer-win/src/hooks/files/ops/query_info.rs:76 — mirrord_layer_win::hooks::files::ops::query_info::info has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mirrord_layer_win::hooks::files::ops::open::handle (cyclomatic 20) mirrord/layer-win/src/hooks/files/ops/open.rs:105 — mirrord_layer_win::hooks::files::ops::open::handle 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.
  • mirrord_layer_win::hooks::socket::bind_detour (cyclomatic 19) mirrord/layer-win/src/hooks/socket/mod.rs:351 — mirrord_layer_win::hooks::socket::bind_detour has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • mirrord_layer_win::hooks::files::ops::set_info::handle (cyclomatic 18) mirrord/layer-win/src/hooks/files/ops/set_info.rs:67 — mirrord_layer_win::hooks::files::ops::set_info::handle has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D17 · Explicit Debt · FixmeComment · ×4
  • FixmeComment mirrord/intproxy/src/session_monitor/chaos/rules.rs:421 — // FIXME: kept for compatibility, but ignored by intproxy. See — 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.
  • FixmeComment mirrord/intproxy/src/session_monitor/chaos/rules.rs:631 — // FIXME: kept for compatibility, but ignored by intproxy. See — 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.
  • FixmeComment mirrord/intproxy/src/proxies/outgoing/chaos.rs:114 — // FIXME: `after` is ignored, the error is always delivered immediately. Restore the — 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.
  • FixmeComment mirrord/intproxy/src/proxies/outgoing/chaos.rs:127 — // FIXME: The correct implementation of connect latency relies on layer — 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.
D2 · Cognitive Complexity · mirrord_up · ×4
  • mirrord_up::process::wait_for_first_exit (cognitive 35) mirrord/up/src/process.rs:407 — mirrord_up::process::wait_for_first_exit has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_up::process::supervise_with_second_signal (cognitive 29) mirrord/up/src/process.rs:535 — mirrord_up::process::supervise_with_second_signal has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 10 (19 pts), if/else 8, loops 2 (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.
  • mirrord_up::process::forward_output (cognitive 18) mirrord/up/src/process.rs:473 — mirrord_up::process::forward_output has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_up::pick_workload (cognitive 17) mirrord/up/src/lib.rs:739 — mirrord_up::pick_workload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mirrord_operator · ×4
  • mirrord_operator::preview_template::visit_pod_references (cognitive 34) mirrord/operator/src/preview_template.rs:25 — mirrord_operator::preview_template::visit_pod_references has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 6 (9 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_operator::client::preview_sync::pack_changes (cognitive 23) mirrord/operator/src/client/preview_sync.rs:574 — mirrord_operator::client::preview_sync::pack_changes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_operator::client::split_config_branches::same_source_warnings (cognitive 19) mirrord/operator/src/client/split_config_branches.rs:203 — mirrord_operator::client::split_config_branches::same_source_warnings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 5 (8 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_operator::client::database_branches::create_branches (cognitive 18) mirrord/operator/src/client/database_branches.rs:1152 — mirrord_operator::client::database_branches::create_branches has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×4
  • Edited copy of a member (22 corresponding lines) mirrord/tui/src/screens/preview_envs/view.rs:638 — mirrord/tui/src/screens/preview_envs/view.rs:638-664 | mirrord/tui/src/screens/preview_envs/view.rs:676-697 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) mirrord/protocol-api/src/client/retrying.rs:139 — mirrord/protocol-api/src/client/retrying.rs:139-164 | mirrord/protocol-api/src/client/retrying.rs:169-190 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) mirrord/layer/src/file/hooks.rs:958 — mirrord/layer/src/file/hooks.rs:958-979 | mirrord/layer/src/file/hooks.rs:983-1005 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) mirrord/layer/src/file/open_dirs.rs:253 — mirrord/layer/src/file/open_dirs.rs:253-283 | mirrord/layer/src/file/open_dirs.rs:291-312 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×4
  • Duplicated block (18 lines × 2) mirrord/cli/src/ci.rs:523 — mirrord/cli/src/ci.rs:523-540 | mirrord/cli/src/ci.rs:623-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/ci.rs:523` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mirrord/cli/src/ci.rs:643` calls `success` and `mirrord/cli/src/ci.rs:541` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 2) mirrord/cli/src/execution.rs:717 — mirrord/cli/src/execution.rs:717-734 | mirrord/cli/src/execution.rs:939-956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/cli/src/execution.rs:936` calls `wait`, `unwrap` and `mirrord/cli/src/execution.rs:715` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 2) mirrord/layer/src/file/hooks.rs:959 — mirrord/layer/src/file/hooks.rs:959-976 | mirrord/layer/src/file/hooks.rs:984-1001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/file/hooks.rs:959` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) mirrord/config/src/feature/database_branches.rs:1453 — mirrord/config/src/feature/database_branches.rs:1453-1470 | mirrord/config/src/feature/database_branches.rs:2326-2343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/config/src/feature/database_branches.rs:1453` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) mirrord/intproxy/src/proxies/files.rs:362 — mirrord/intproxy/src/proxies/files.rs:362-378 | mirrord/protocol-api/src/file_ext.rs:209-225 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (17 lines × 2) mirrord/layer/macro/src/lib.rs:72 — mirrord/layer/macro/src/lib.rs:72-88 | mirrord/layer/macro/src/lib.rs:454-470 — both copies are in the same file, so extract the block into 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) mirrord/layer/src/file/hooks.rs:654 — mirrord/layer/src/file/hooks.rs:654-670 | mirrord/layer/src/file/hooks.rs:681-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/file/hooks.rs:654` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) xtask/src/main.rs:205 — xtask/src/main.rs:205-221 | xtask/src/main.rs:245-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `xtask/src/main.rs:205` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) mirrord/kube/src/resolved.rs:426 — mirrord/kube/src/resolved.rs:426-440 | mirrord/kube/src/resolved.rs:492-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/kube/src/resolved.rs:426` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) mirrord/layer/src/socket/hooks.rs:237 — mirrord/layer/src/socket/hooks.rs:237-251 | mirrord/layer/src/socket/hooks.rs:262-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/socket/hooks.rs:237` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) xtask/src/tasks/layer.rs:222 — xtask/src/tasks/layer.rs:222-236 | xtask/src/tasks/layer.rs:266-280 — both copies are in the same file, so extract the block into 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) mirrord/protocol-api/src/client/simple_request.rs:118 — mirrord/protocol-api/src/client/simple_request.rs:118-132 | mirrord/protocol-api/src/client/simple_request.rs:158-172 — both copies are in the same file, so extract the 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 (9 lines × 3) · ×4
  • Duplicated block (9 lines × 3) mirrord/layer-win/src/hooks/socket/mod.rs:281 — mirrord/layer-win/src/hooks/socket/mod.rs:281-289 | mirrord/layer-win/src/hooks/socket/mod.rs:308-316 | mirrord/layer-win/src/hooks/socket/mod.rs:335-343 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer-win/src/hooks/socket/mod.rs:281` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 3) mirrord/operator/src/client.rs:1875 — mirrord/operator/src/client.rs:1875-1883 | mirrord/operator/src/client.rs:1885-1893 | mirrord/operator/src/client.rs:1895-1903 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) mirrord/agent/src/steal/api.rs:532 — mirrord/agent/src/steal/api.rs:532-540 | mirrord/agent/src/steal/api.rs:557-565 | mirrord/agent/src/steal/api.rs:583-592 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/steal/api.rs:583` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mirrord/agent/src/steal/api.rs:567` calls `map_body` and `mirrord/agent/src/steal/api.rs:594` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) mirrord/operator/src/client/database_branches.rs:70 — mirrord/operator/src/client/database_branches.rs:70-78 | mirrord/operator/src/client/database_branches.rs:230-238 | mirrord/operator/src/client/database_branches.rs:389-397 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • Outbound HTTP without resilience mirrord/cli/src/operator/install.rs:248 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience mirrord/cli/src/operator/install/signup.rs:59 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience mirrord/cluster-auth/src/client.rs:214 — `hyper_util::client::legacy::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience xtask/src/tasks/sip_binaries.rs:30 — `reqwest::blocking::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D1 · Cyclomatic Complexity · TargetsScreen · ×3
  • TargetsScreen::handle_event (cyclomatic 28) mirrord/tui/src/screens/targets.rs:664 — TargetsScreen::handle_event has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • TargetsScreen::draw (cyclomatic 19) mirrord/tui/src/screens/targets.rs:552 — TargetsScreen::draw has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TargetsScreen::run (cyclomatic 16) mirrord/tui/src/screens/targets.rs:152 — TargetsScreen::run has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TargetsScreen · ×3
  • TargetsScreen::handle_event (cognitive 35) mirrord/tui/src/screens/targets.rs:664 — TargetsScreen::handle_event has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 9 (22 pts), if/else 10 (11 pts), boolean chains 2 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • TargetsScreen::draw (cognitive 26) mirrord/tui/src/screens/targets.rs:552 — TargetsScreen::draw has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, match/switch 4, 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.
  • TargetsScreen::run (cognitive 24) mirrord/tui/src/screens/targets.rs:152 — TargetsScreen::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 4 (7 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LayerManagedProcess · ×3
  • LayerManagedProcess::inject_and_resume (cognitive 26) mirrord/layer-lib/src/process/windows/execution/mod.rs:752 — LayerManagedProcess::inject_and_resume has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 8 (11 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayerManagedProcess::execute_with_closure (cognitive 22) mirrord/layer-lib/src/process/windows/execution/mod.rs:582 — LayerManagedProcess::execute_with_closure has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, match/switch 3 (4 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayerManagedProcess::add_mirrord_env_vars (cognitive 19) mirrord/layer-lib/src/process/windows/execution/mod.rs:293 — LayerManagedProcess::add_mirrord_env_vars has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mirrord_mcp · ×3
  • mirrord_mcp::tools::explain_config_option::explain (cognitive 21) mirrord/mcp/src/tools/explain_config_option.rs:374 — mirrord_mcp::tools::explain_config_option::explain has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • mirrord_mcp::tools::validate_config::check_services (cognitive 21) mirrord/mcp/src/tools/validate_config.rs:510 — mirrord_mcp::tools::validate_config::check_services has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 6 (15 pts), if/else 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • mirrord_mcp::tools::validate_config::expected_types (cognitive 16) mirrord/mcp/src/tools/validate_config.rs:924 — mirrord_mcp::tools::validate_config::expected_types has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (7 pts), match/switch 2 (5 pts), if/else 1 (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.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×3
  • Edited copy of a member (41 corresponding lines) mirrord/cli/src/config.rs:770 — mirrord/cli/src/config.rs:770-817 | mirrord/cli/src/config.rs:1797-1837 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) mirrord/operator/src/client/database_branches.rs:2639 — mirrord/operator/src/client/database_branches.rs:2639-2680 | mirrord/operator/src/client/database_branches.rs:2693-2733 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) mirrord/kube/src/api/kubernetes/rollout.rs:67 — mirrord/kube/src/api/kubernetes/rollout.rs:67-114 | mirrord/kube/src/api/kubernetes/rollout.rs:123-163 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×3
  • Edited copy of a member (33 corresponding lines) mirrord/protocol-api/src/client/outgoing.rs:214 — mirrord/protocol-api/src/client/outgoing.rs:214-246 | mirrord/protocol-api/src/client/outgoing.rs:252-284 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) mirrord/tui/src/screens/databases.rs:60 — mirrord/tui/src/screens/databases.rs:60-92 | mirrord/tui/src/screens/queues.rs:51-91 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) mirrord/operator/src/crd/db_branching/branch_database.rs:1220 — mirrord/operator/src/crd/db_branching/branch_database.rs:1220-1252 | mirrord/operator/src/crd/db_branching/branch_database.rs:1256-1288 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×3
  • Edited copy of a member (36 corresponding lines) mirrord/intproxy/src/proxies/outgoing/interceptor/read_queue.rs:44 — mirrord/intproxy/src/proxies/outgoing/interceptor/read_queue.rs:44-79 | mirrord/intproxy/src/proxies/outgoing/interceptor/write_queue.rs:49-87 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) mirrord/vpn/src/packet.rs:21 — mirrord/vpn/src/packet.rs:21-56 | mirrord/vpn/src/packet.rs:58-93 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) mirrord/layer-go/src/linux_aarch64.rs:96 — mirrord/layer-go/src/linux_aarch64.rs:96-131 | mirrord/layer-go/src/linux_aarch64.rs:134-171 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×3
  • Edited copy of a member (21 corresponding lines) mirrord/agent/src/file.rs:379 — mirrord/agent/src/file.rs:379-399 | mirrord/agent/src/file.rs:407-432 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) mirrord/utils-win/src/modules.rs:363 — mirrord/utils-win/src/modules.rs:363-383 | mirrord/utils-win/src/modules.rs:386-406 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) mirrord/layer/src/file/hooks.rs:653 — mirrord/layer/src/file/hooks.rs:653-673 | mirrord/layer/src/file/hooks.rs:680-700 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) mirrord/auth/src/credentials.rs:349 — mirrord/auth/src/credentials.rs:349-370 | mirrord/auth/src/credentials.rs:382-400 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mirrord/layer/src/socket/hooks.rs:233 — mirrord/layer/src/socket/hooks.rs:233-251 | mirrord/layer/src/socket/hooks.rs:258-276 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mirrord/intproxy/src/proxies/outgoing/chaos.rs:212 — mirrord/intproxy/src/proxies/outgoing/chaos.rs:212-230 | mirrord/intproxy/src/proxies/outgoing/chaos.rs:240-261 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×3
  • Edited copy of a member (16 corresponding lines) mirrord/config/src/feature/fs/mode.rs:94 — mirrord/config/src/feature/fs/mode.rs:94-110 | mirrord/config/src/feature/fs/mode.rs:114-129 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mirrord/operator/src/client.rs:627 — mirrord/operator/src/client.rs:627-646 | mirrord/operator/src/client.rs:3649-3664 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mirrord/progress/src/implementations.rs:178 — mirrord/progress/src/implementations.rs:178-194 | mirrord/progress/src/implementations.rs:198-213 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×3
  • Edited copy of a member (14 corresponding lines) mirrord/layer/src/socket/hooks.rs:295 — mirrord/layer/src/socket/hooks.rs:295-312 | mirrord/layer/src/socket/hooks.rs:316-329 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) mirrord/config/src/feature/database_branches.rs:1527 — mirrord/config/src/feature/database_branches.rs:1527-1540 | mirrord/config/src/feature/database_branches.rs:1545-1558 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) mirrord/agent/src/incoming/connection/http_task.rs:235 — mirrord/agent/src/incoming/connection/http_task.rs:235-248 | mirrord/agent/src/steal/api.rs:794-807 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) mirrord/layer/src/file/hooks.rs:709 — mirrord/layer/src/file/hooks.rs:709-727 | mirrord/layer/src/file/hooks.rs:739-757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/file/hooks.rs:709` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) mirrord/operator/src/client/database_branches.rs:1234 — mirrord/operator/src/client/database_branches.rs:1234-1252 | mirrord/operator/src/client/database_branches.rs:1498-1516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:1234` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) mirrord/tui/src/screens/databases.rs:505 — mirrord/tui/src/screens/databases.rs:505-523 | mirrord/tui/src/screens/queues.rs:512-530 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×3
  • Duplicated block (17–18 lines × 2) mirrord/cli/src/config.rs:2064 — mirrord/cli/src/config.rs:2064-2081 | mirrord/cli/src/config.rs:2090-2106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17–18 lines × 2) mirrord/cli/src/execution.rs:639 — mirrord/cli/src/execution.rs:639-656 | mirrord/cli/src/execution.rs:800-816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17–18 lines × 2) mirrord/operator/src/client.rs:2934 — mirrord/operator/src/client.rs:2934-2951 | mirrord/operator/src/client.rs:3115-3131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client.rs:2934` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×3
  • Duplicated block (7–9 lines × 2) mirrord/cli/src/external_proxy.rs:106 — mirrord/cli/src/external_proxy.rs:106-114 | mirrord/cli/src/main.rs:1020-1026 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/external_proxy.rs:106` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7–9 lines × 2) mirrord/cli/src/ui/server/v2.rs:476 — mirrord/cli/src/ui/server/v2.rs:476-484 | mirrord/cli/src/ui/server/v2.rs:595-601 — both copies are in the same file, so extract the block into 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–9 lines × 2) mirrord/intproxy/src/failover_strategy.rs:273 — mirrord/intproxy/src/failover_strategy.rs:273-281 | mirrord/intproxy/src/lib.rs:609-615 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×3
  • Duplicated block (11 lines × 2 locations) packages/monitor/src/components/ConnectOperatorModal.tsx:161 — packages/monitor/src/components/ConnectOperatorModal.tsx:161 · packages/monitor/src/components/ConnectOperatorModal.tsx:227 — 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) packages/monitor/src/components/chaos/BreakPopover.tsx:113 — packages/monitor/src/components/chaos/BreakPopover.tsx:113 · packages/monitor/src/components/chaos/BreakPopover.tsx:125 — 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 (11 lines × 2 locations) packages/wizard/src/components/steps/RunStep.tsx:24 — packages/wizard/src/components/steps/RunStep.tsx:24 · packages/wizard/src/components/steps/RunStep.tsx:39 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC2 · Forms & labels · <Input> field component without a label · ×2
  • <Input> field component without a label packages/monitor/src/components/SubscribeEventsTable.tsx:196 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Input> field component without a label packages/wizard/src/components/steps/TargetStep.tsx:190 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
D1 · Cyclomatic Complexity · OperatorApi · ×2
  • OperatorApi::prepare_branch_dbs (cyclomatic 73) mirrord/operator/src/client.rs:1158 — OperatorApi::prepare_branch_dbs has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • OperatorApi::should_copy_target (cyclomatic 21) mirrord/operator/src/client.rs:2908 — OperatorApi::should_copy_target has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LayerConfig · ×2
  • LayerConfig::verify (cyclomatic 66) mirrord/config/src/lib.rs:1109 — LayerConfig::verify has cyclomatic complexity 66 (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.
  • LayerConfig::verify_for_preview_env (cyclomatic 22) mirrord/config/src/lib.rs:1597 — LayerConfig::verify_for_preview_env has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SettingsForm · ×2
  • SettingsForm::handle_key (cyclomatic 33) mirrord/tui/src/screens/targets/form.rs:420 — SettingsForm::handle_key has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • SettingsForm::draw (cyclomatic 21) mirrord/tui/src/screens/targets/form.rs:618 — SettingsForm::draw has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FilesProxy · ×2
  • FilesProxy::file_request (cyclomatic 28) mirrord/intproxy/src/proxies/files.rs:604 — FilesProxy::file_request has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: FileRequest::agent_lost_response (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • FilesProxy::file_response (cyclomatic 17) mirrord/intproxy/src/proxies/files.rs:900 — FilesProxy::file_response has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: FileRequest::agent_lost_response (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · PreparedPreview · ×2
  • PreparedPreview::prepare (cyclomatic 26) mirrord/cli/src/preview.rs:285 — PreparedPreview::prepare has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PreparedPreview::start (cyclomatic 16) mirrord/cli/src/preview.rs:646 — PreparedPreview::start has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ClientConnectionHandler · ×2
  • ClientConnectionHandler::start (cyclomatic 23) mirrord/agent/src/entrypoint.rs:554 — ClientConnectionHandler::start has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • ClientConnectionHandler::handle_client_message (cyclomatic 22) mirrord/agent/src/entrypoint.rs:666 — ClientConnectionHandler::handle_client_message has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LayerManagedProcess · ×2
  • LayerManagedProcess::inject_and_resume (cyclomatic 23) mirrord/layer-lib/src/process/windows/execution/mod.rs:752 — LayerManagedProcess::inject_and_resume has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • LayerManagedProcess::execute_with_closure (cyclomatic 18) mirrord/layer-lib/src/process/windows/execution/mod.rs:582 — LayerManagedProcess::execute_with_closure has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · mirrord_layer_lib · ×2
  • mirrord_layer_lib::socket::ops::connect_common (cyclomatic 23) mirrord/layer-lib/src/socket/ops.rs:306 — mirrord_layer_lib::socket::ops::connect_common has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • mirrord_layer_lib::debugger_ports::tokenize_argfile (cyclomatic 17) mirrord/layer-lib/src/debugger_ports.rs:429 — mirrord_layer_lib::debugger_ports::tokenize_argfile has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · mirrord_tui · ×2
  • mirrord_tui::screens::queues::details_lines (cyclomatic 22) mirrord/tui/src/screens/queues.rs:734 — mirrord_tui::screens::queues::details_lines has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: QueuesScreen::handle_event (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • mirrord_tui::screens::targets::suggest::discover (cyclomatic 17) mirrord/tui/src/screens/targets/suggest.rs:23 — mirrord_tui::screens::targets::suggest::discover has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UpConfig · ×2
  • UpConfig::select_preview_images (cyclomatic 18) mirrord/up/src/config.rs:1686 — UpConfig::select_preview_images has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • UpConfig::collect_analytics (cyclomatic 16) mirrord/up/src/config.rs:2130 — UpConfig::collect_analytics 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 · mirrord_operator · ×2
  • mirrord_operator::client::preview_sync::pack_changes (cyclomatic 16) mirrord/operator/src/client/preview_sync.rs:574 — mirrord_operator::client::preview_sync::pack_changes 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.
  • mirrord_operator::preview_template::visit_pod_references (cyclomatic 16) mirrord/operator/src/preview_template.rs:25 — mirrord_operator::preview_template::visit_pod_references has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · LayerConfig · ×2
  • LayerConfig::verify (cognitive 75) mirrord/config/src/lib.rs:1109 — LayerConfig::verify has cognitive complexity 75 (threshold 15). Drivers by points: if/else 46 (54 pts), boolean chains 8, loops 4 (7 pts), match/switch 4 (6 pts) (nesting depth added 13). 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.
  • LayerConfig::verify_for_preview_env (cognitive 22) mirrord/config/src/lib.rs:1597 — LayerConfig::verify_for_preview_env has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SettingsForm · ×2
  • SettingsForm::handle_key (cognitive 48) mirrord/tui/src/screens/targets/form.rs:420 — SettingsForm::handle_key has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 8 (21 pts), boolean chains 6 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SettingsForm::draw (cognitive 40) mirrord/tui/src/screens/targets/form.rs:618 — SettingsForm::draw has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (29 pts), match/switch 4 (8 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PreparedPreview · ×2
  • PreparedPreview::prepare (cognitive 38) mirrord/cli/src/preview.rs:285 — PreparedPreview::prepare has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 4 (8 pts), match/switch 5 (7 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PreparedPreview::start (cognitive 23) mirrord/cli/src/preview.rs:646 — PreparedPreview::start has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 5 (9 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilesProxy · ×2
  • FilesProxy::file_request (cognitive 37) mirrord/intproxy/src/proxies/files.rs:604 — FilesProxy::file_request has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 6 (12 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FilesProxy::file_response (cognitive 21) mirrord/intproxy/src/proxies/files.rs:900 — FilesProxy::file_response has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (3 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ResolvedTarget · ×2
  • ResolvedTarget::get_env (cognitive 32) mirrord/kube/src/resolved.rs:798 — ResolvedTarget::get_env has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (12 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ResolvedTarget::assert_valid_mirrord_target (cognitive 16) mirrord/kube/src/resolved.rs:420 — ResolvedTarget::assert_valid_mirrord_target has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HttpFilter · ×2
  • HttpFilter::matches (cognitive 28) mirrord/agent/src/http/filter.rs:109 — HttpFilter::matches has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • HttpFilter::fmt (cognitive 19) mirrord/protocol/src/tcp.rs:469 — HttpFilter::fmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (6 pts), match/switch 2 (3 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GenericBranchConfig · ×2
  • GenericBranchConfig::verify_var_references (cognitive 26) mirrord/config/src/feature/database_branches/generic.rs:425 — GenericBranchConfig::verify_var_references has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GenericBranchConfig::verify (cognitive 24) mirrord/config/src/feature/database_branches/generic.rs:265 — GenericBranchConfig::verify has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, loops 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncomingProxy · ×2
  • IncomingProxy::handle_message (cognitive 21) mirrord/intproxy/src/proxies/incoming.rs:737 — IncomingProxy::handle_message has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 2 (5 pts), loops 2 (5 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • IncomingProxy::handle_chunked_request (cognitive 19) mirrord/intproxy/src/proxies/incoming.rs:474 — IncomingProxy::handle_chunked_request has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · UpConfig · ×2
  • UpConfig::select_preview_images (cognitive 20) mirrord/up/src/config.rs:1686 — UpConfig::select_preview_images has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 4 (5 pts), loops 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • UpConfig::collect_analytics (cognitive 19) mirrord/up/src/config.rs:2130 — UpConfig::collect_analytics has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils_win · ×2
  • utils_win::diagnostics::dialog::window_proc (cognitive 19) mirrord/utils-win/src/diagnostics/dialog.rs:275 — utils_win::diagnostics::dialog::window_proc has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • utils_win::diagnostics::report::build_session_archive (cognitive 19) mirrord/utils-win/src/diagnostics/report.rs:774 — utils_win::diagnostics::report::build_session_archive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyMethods · ×2
  • TooManyMethods: OperatorApi mirrord/operator/src/client.rs:410 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FileManager mirrord/agent/src/file.rs:105 — 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) mirrord/kube/src/api/kubernetes/seeker.rs:273 — mirrord/kube/src/api/kubernetes/seeker.rs:273-305 | mirrord/kube/src/api/kubernetes/seeker.rs:322-352 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) mirrord/operator/src/client.rs:3218 — mirrord/operator/src/client.rs:3218-3246 | mirrord/operator/src/client.rs:3256-3284 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) mirrord/cli/src/db_branches.rs:75 — mirrord/cli/src/db_branches.rs:75-103 | mirrord/cli/src/db_branches.rs:113-135 | mirrord/cli/src/db_branches.rs:145-167 | mirrord/cli/src/db_branches.rs:177-199 — 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) mirrord/protocol-api/src/client/simple_request.rs:84 — mirrord/protocol-api/src/client/simple_request.rs:84-106 | mirrord/protocol-api/src/client/simple_request.rs:116-140 | mirrord/protocol-api/src/client/simple_request.rs:150-180 | mirrord/protocol-api/src/client/simple_request.rs:190-221 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×2
  • Edited copy of a member (42 corresponding lines) mirrord/tui/src/screens/databases.rs:97 — mirrord/tui/src/screens/databases.rs:97-142 | mirrord/tui/src/screens/queues.rs:96-137 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) mirrord/agent/iptables/src/lib.rs:205 — mirrord/agent/iptables/src/lib.rs:205-256 | mirrord/agent/iptables/src/lib.rs:283-324 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×2
  • Edited copy of a member (30 corresponding lines) mirrord/cli/src/config.rs:894 — mirrord/cli/src/config.rs:894-936 | mirrord/cli/src/config.rs:965-994 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) mirrord/tui/src/screens/preview_envs/view.rs:899 — mirrord/tui/src/screens/preview_envs/view.rs:899-929 | mirrord/tui/src/screens/preview_envs/view.rs:931-960 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) mirrord/tui/src/screens/preview_envs/view.rs:534 — mirrord/tui/src/screens/preview_envs/view.rs:534-555 | mirrord/tui/src/screens/preview_envs/view.rs:561-580 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) mirrord/layer-win/src/managed/sharded_map.rs:112 — mirrord/layer-win/src/managed/sharded_map.rs:112-132 | mirrord/layer-win/src/managed/sharded_map.rs:200-219 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×2
  • Edited copy of a member (24 corresponding lines) mirrord/agent/src/incoming/mirror_handle.rs:48 — mirrord/agent/src/incoming/mirror_handle.rs:48-71 | mirrord/agent/src/incoming/steal_handle.rs:51-74 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) mirrord/cli/src/connection.rs:825 — mirrord/cli/src/connection.rs:825-848 | mirrord/cli/src/connection.rs:853-876 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) mirrord/agent/src/util/io/timeout.rs:48 — mirrord/agent/src/util/io/timeout.rs:48-61 | mirrord/agent/src/util/io/timeout.rs:70-83 | mirrord/agent/src/util/io/timeout.rs:85-98 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) mirrord/protocol-api/src/client.rs:227 — mirrord/protocol-api/src/client.rs:227-241 | mirrord/protocol-api/src/client.rs:248-261 | mirrord/protocol-api/src/client.rs:368-382 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) mirrord/layer/src/file/hooks.rs:708 — mirrord/layer/src/file/hooks.rs:708-730 | mirrord/layer/src/file/hooks.rs:738-760 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) mirrord/analytics/src/lib.rs:417 — mirrord/analytics/src/lib.rs:417-440 | mirrord/analytics/src/lib.rs:507-529 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) mirrord/layer-win/src/hooks/socket/mod.rs:276 — mirrord/layer-win/src/hooks/socket/mod.rs:276-291 | mirrord/layer-win/src/hooks/socket/mod.rs:303-319 | mirrord/layer-win/src/hooks/socket/mod.rs:330-346 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) mirrord/layer-tests/src/intproxy.rs:479 — mirrord/layer-tests/src/intproxy.rs:479-501 | mirrord/layer-tests/src/intproxy.rs:746-765 | mirrord/layer-tests/src/intproxy.rs:773-788 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 13+ corresponding lines) mirrord/config/src/feature/network/incoming/http_filter.rs:293 — mirrord/config/src/feature/network/incoming/http_filter.rs:293-305 | mirrord/config/src/feature/network/incoming/http_filter.rs:307-319 | mirrord/config/src/feature/network/incoming/http_filter.rs:321-333 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) mirrord/agent/src/outgoing/seqpacket.rs:86 — mirrord/agent/src/outgoing/seqpacket.rs:86-98 | mirrord/agent/src/outgoing/tcp_unix.rs:127-142 | mirrord/agent/src/outgoing/udp.rs:79-94 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) mirrord/intproxy/src/session_monitor/chaos/api.rs:137 — mirrord/intproxy/src/session_monitor/chaos/api.rs:137-147 | mirrord/intproxy/src/session_monitor/chaos/api.rs:151-161 | mirrord/intproxy/src/session_monitor/chaos/api.rs:165-175 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) mirrord/operator/src/crd.rs:1474 — mirrord/operator/src/crd.rs:1474-1489 | mirrord/operator/src/crd/db_branching/branch_database.rs:271-281 | mirrord/operator/src/crd/db_branching/core.rs:624-639 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×2
  • Edited copy of a member (5 corresponding lines) mirrord/intproxy/src/session_monitor/transport_unix.rs:43 — mirrord/intproxy/src/session_monitor/transport_unix.rs:43-47 | mirrord/intproxy/src/session_monitor/transport_windows.rs:57-61 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) mirrord/config/src/config/deprecated.rs:18 — mirrord/config/src/config/deprecated.rs:18-22 | mirrord/config/src/config/unstable.rs:19-26 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (27–29 lines × 2) · ×2
  • Duplicated block (27–29 lines × 2) mirrord/cli/src/preview.rs:1452 — mirrord/cli/src/preview.rs:1452-1480 | mirrord/cli/src/preview.rs:1730-1756 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (27–29 lines × 2) mirrord/cli/src/preview.rs:1760 — mirrord/cli/src/preview.rs:1760-1788 | mirrord/cli/src/preview.rs:1903-1929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/preview.rs:1760` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) mirrord/operator/src/client.rs:1568 — mirrord/operator/src/client.rs:1568-1588 | mirrord/operator/src/client.rs:1642-1662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client.rs:1568` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) mirrord/tui/src/screens/databases.rs:255 — mirrord/tui/src/screens/databases.rs:255-275 | mirrord/tui/src/screens/queues.rs:269-289 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/databases.rs:255` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) mirrord/operator/src/client/database_branches.rs:80 — mirrord/operator/src/client/database_branches.rs:80-94 | mirrord/operator/src/client/database_branches.rs:240-254 | mirrord/operator/src/client/database_branches.rs:399-413 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:80` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 3) mirrord/operator/src/client/database_branches.rs:180 — mirrord/operator/src/client/database_branches.rs:180-194 | mirrord/operator/src/client/database_branches.rs:339-353 | mirrord/operator/src/client/database_branches.rs:499-513 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:180` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) mirrord/cli/src/db_branches.rs:503 — mirrord/cli/src/db_branches.rs:503-515 | mirrord/cli/src/db_branches.rs:574-587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/db_branches.rs:503` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) mirrord/tui/src/screens/databases.rs:230 — mirrord/tui/src/screens/databases.rs:230-243 | mirrord/tui/src/screens/queues.rs:235-247 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/databases.rs:230` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) mirrord/agent/src/outgoing.rs:113 — mirrord/agent/src/outgoing.rs:113-125 | mirrord/agent/src/outgoing.rs:135-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/outgoing.rs:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) mirrord/config/src/feature/fs/mode.rs:95 — mirrord/config/src/feature/fs/mode.rs:95-107 | mirrord/config/src/feature/fs/mode.rs:115-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/config/src/feature/fs/mode.rs:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) mirrord/agent/src/util/io/timeout.rs:51 — mirrord/agent/src/util/io/timeout.rs:51-61 | mirrord/agent/src/util/io/timeout.rs:73-83 | mirrord/agent/src/util/io/timeout.rs:88-98 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/agent/src/util/io/timeout.rs:51` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) mirrord/operator/src/client/database_branches.rs:167 — mirrord/operator/src/client/database_branches.rs:167-177 | mirrord/operator/src/client/database_branches.rs:326-336 | mirrord/operator/src/client/database_branches.rs:486-496 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) mirrord/cli/src/external_proxy.rs:110 — mirrord/cli/src/external_proxy.rs:110-118 | mirrord/cli/src/internal_proxy.rs:360-367 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8–9 lines × 2) mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:59 — mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:59-66 | mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:121-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) mirrord/kube/src/resolved.rs:439 — mirrord/kube/src/resolved.rs:439-443 | mirrord/kube/src/resolved.rs:505-509 | mirrord/kube/src/resolved.rs:563-567 | mirrord/kube/src/resolved.rs:612-616 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/kube/src/resolved.rs:439` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/kube/src/resolved.rs:561` calls `and_then`, `as_ref` and `mirrord/kube/src/resolved.rs:437` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 4) mirrord/protocol-api/src/client/simple_request.rs:85 — mirrord/protocol-api/src/client/simple_request.rs:85-89 | mirrord/protocol-api/src/client/simple_request.rs:117-121 | mirrord/protocol-api/src/client/simple_request.rs:157-161 | mirrord/protocol-api/src/client/simple_request.rs:195-199 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/protocol-api/src/client/simple_request.rs:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/protocol-api/src/client/simple_request.rs:191` calls `matches`, `Err` and `mirrord/protocol-api/src/client/simple_request.rs:84` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×2
  • Sync-over-async blocking mirrord/agent/src/task.rs:47 — `spawn` 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 mirrord/cli/src/local_redis.rs:116 — `start` 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.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×2
  • Duplicated block (13 lines × 2 locations) packages/monitor/src/api.ts:171 — packages/monitor/src/api.ts:171 · packages/monitor/src/api.ts:190 — 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) packages/monitor/src/components/EmptySessionState.tsx:59 — packages/monitor/src/components/EmptySessionState.tsx:59 · packages/monitor/src/components/EmptySessionState.tsx:74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×2
  • Duplicated block (12 lines × 2 locations) packages/monitor/src/extensionBridge.ts:66 — packages/monitor/src/extensionBridge.ts:66 · packages/monitor/src/extensionBridge.ts:94 — 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) packages/monitor/src/hooks/useChaosRules.ts:237 — packages/monitor/src/hooks/useChaosRules.ts:237 · packages/monitor/src/hooks/useChaosRules.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 (8 lines × 2 locations) · ×2
  • Duplicated block (8 lines × 2 locations) packages/monitor/src/components/OperatorSessionDetail.tsx:42 — packages/monitor/src/components/OperatorSessionDetail.tsx:42 · packages/monitor/src/utils.ts:102 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (8 lines × 2 locations) packages/wizard/src/components/steps/RunStep.tsx:47 — packages/wizard/src/components/steps/RunStep.tsx:47 · packages/wizard/src/components/steps/TrafficStep.tsx:78 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R8 · Dependency Hygiene · Unused dependency '@eslint/js' · ×2
  • Unused dependency '@eslint/js' — Declared in packages/monitor/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
  • Unused dependency '@eslint/js' — Declared in packages/wizard/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.
AC2 · Forms & labels · <SearchInput> field component without a label · ×1
  • <SearchInput> field component without a label packages/monitor/src/components/SessionSidebar.tsx:213 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels · <Select> field component without a label · ×1
  • <Select> field component without a label packages/monitor/src/components/SubscribeEventsTable.tsx:202 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels · <Textarea> field component without a label · ×1
  • <Textarea> field component without a label packages/monitor/src/components/chaos/RequestChaosTypeDialog.tsx:60 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark REDACTED:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×1
  • Focus outline removed in CSS without a :focus replacement packages/ui/src/index.css:229 — `.focus-ring` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D1 · Cyclomatic Complexity · App.App (cyclomatic 54) · ×1
  • App.App (cyclomatic 54) packages/monitor/src/App.tsx:55 — App.App has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 9 of the 54 points are its own statements and the rest belongs to 27 function literals inside it that branch (lines 254, 129, 184, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Wizard.Wizard (cyclomatic 53) · ×1
  • Wizard.Wizard (cyclomatic 53) packages/wizard/src/components/Wizard.tsx:52 — Wizard.Wizard has cyclomatic complexity 53 (threshold 15). Of this number, 25 points are the body's own statements and 28 belong to 7 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PreviewEnvsScreen · ×1
  • PreviewEnvsScreen::handle_event (cyclomatic 37) mirrord/tui/src/screens/preview_envs.rs:118 — PreviewEnvsScreen::handle_event has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · OutgoingProxy · ×1
  • OutgoingProxy::run (cyclomatic 36) mirrord/intproxy/src/proxies/outgoing.rs:785 — OutgoingProxy::run has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · EventStream.EventStream (cyclomatic 34) · ×1
  • EventStream.EventStream (cyclomatic 34) packages/monitor/src/components/EventStream.tsx:58 — EventStream.EventStream has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 177, 256, 139, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · UnifiedDatabaseBranchParams · ×1
  • UnifiedDatabaseBranchParams::new (cyclomatic 33) mirrord/operator/src/client/database_branches.rs:1583 — UnifiedDatabaseBranchParams::new has cyclomatic complexity 33 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Input · ×1
  • Input::handle_key (cyclomatic 32) mirrord/tui/src/screens/targets/form.rs:256 — Input::handle_key has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ConfigFlags · ×1
  • ConfigFlags::new (cyclomatic 31) mirrord/config/derive/src/config/flag.rs:71 — ConfigFlags::new has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DatabaseBranchConfig · ×1
  • DatabaseBranchConfig::copy_mode (cyclomatic 31) mirrord/config/src/feature/database_branches.rs:1035 — DatabaseBranchConfig::copy_mode has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TrafficTunnels · ×1
  • TrafficTunnels::handle_event (cyclomatic 31) mirrord/protocol-api/src/client/tunnels.rs:400 — TrafficTunnels::handle_event has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionSidebar.SessionSidebar (cyclomatic 31) · ×1
  • SessionSidebar.SessionSidebar (cyclomatic 31) packages/monitor/src/components/SessionSidebar.tsx:88 — SessionSidebar.SessionSidebar has cyclomatic complexity 31 (threshold 15). Of this number, 23 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceConfig · ×1
  • ServiceConfig::assemble (cyclomatic 30) mirrord/up/src/config.rs:890 — ServiceConfig::assemble has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TcpStealerApi · ×1
  • TcpStealerApi::handle_client_message (cyclomatic 27) mirrord/agent/src/steal/api.rs:483 — TcpStealerApi::handle_client_message has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PortForwarder · ×1
  • PortForwarder::handle_msg_from_agent (cyclomatic 27) mirrord/cli/src/port_forward.rs:215 — PortForwarder::handle_msg_from_agent has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · App · ×1
  • App::handle_event (cyclomatic 27) mirrord/tui/src/app.rs:382 — App::handle_event has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PreviewDiagnostics.PreviewDiagnostics (cyclomatic 27) · ×1
  • PreviewDiagnostics.PreviewDiagnostics (cyclomatic 27) packages/monitor/src/components/PreviewDiagnostics.tsx:40 — PreviewDiagnostics.PreviewDiagnostics has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TargetStep.TargetStep (cyclomatic 26) · ×1
  • TargetStep.TargetStep (cyclomatic 26) packages/wizard/src/components/steps/TargetStep.tsx:31 — TargetStep.TargetStep has cyclomatic complexity 26 (threshold 15). Of this number, 18 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SessionDetail.SessionDetail (cyclomatic 24) · ×1
  • SessionDetail.SessionDetail (cyclomatic 24) packages/monitor/src/components/SessionDetail.tsx:35 — SessionDetail.SessionDetail has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 103, 59, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TargetConfig · ×1
  • TargetConfig::collect_analytics (cyclomatic 23) mirrord/config/src/target.rs:726 — TargetConfig::collect_analytics has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PgBranchConfig · ×1
  • PgBranchConfig::verify_additional_databases (cyclomatic 22) mirrord/config/src/feature/database_branches/pg.rs:169 — PgBranchConfig::verify_additional_databases has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GenericBranchConfig · ×1
  • GenericBranchConfig::verify (cyclomatic 21) mirrord/config/src/feature/database_branches/generic.rs:265 — GenericBranchConfig::verify has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · xtask · ×1
  • xtask::main (cyclomatic 21) xtask/src/main.rs:199 — xtask::main has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · StatusCommandHandler · ×1
  • StatusCommandHandler::handle (cyclomatic 20) mirrord/cli/src/operator/status.rs:203 — StatusCommandHandler::handle 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 · DatabaseBranchesConfig · ×1
  • DatabaseBranchesConfig::verify (cyclomatic 20) mirrord/config/src/feature/database_branches.rs:688 — DatabaseBranchesConfig::verify has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · IntProxy · ×1
  • IntProxy::handle_agent_message (cyclomatic 20) mirrord/intproxy/src/lib.rs:774 — IntProxy::handle_agent_message has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · mirrord_layer · ×1
  • mirrord_layer::socket::ops::bind (cyclomatic 20) mirrord/layer/src/socket/ops.rs:176 — mirrord_layer::socket::ops::bind 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 · DebuggerType · ×1
  • DebuggerType::get_ports (cyclomatic 20) mirrord/layer-lib/src/debugger_ports.rs:155 — DebuggerType::get_ports 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 · Interceptor · ×1
  • Interceptor::run (cyclomatic 19) mirrord/intproxy/src/proxies/outgoing/interceptor.rs:110 — Interceptor::run has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · mirrord_kube · ×1
  • mirrord_kube::api::container::job::create_job_agent (cyclomatic 19) mirrord/kube/src/api/container/job.rs:41 — mirrord_kube::api::container::job::create_job_agent has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClientTask · ×1
  • ClientTask::handle_server_message (cyclomatic 19) mirrord/protocol-api/src/client/task.rs:301 — ClientTask::handle_server_message has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Browser · ×1
  • Browser::handle_key (cyclomatic 19) mirrord/tui/src/screens/targets/browser.rs:301 — Browser::handle_key has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · mirrord_up · ×1
  • mirrord_up::process::supervise_with_second_signal (cyclomatic 19) mirrord/up/src/process.rs:535 — mirrord_up::process::supervise_with_second_signal has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · HttpFilter · ×1
  • HttpFilter::matches (cyclomatic 18) mirrord/agent/src/http/filter.rs:109 — HttpFilter::matches has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ExecParams · ×1
  • ExecParams::as_env_vars (cyclomatic 18) mirrord/cli/src/config.rs:540 — ExecParams::as_env_vars has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · IncomingProxy · ×1
  • IncomingProxy::handle_message (cyclomatic 18) mirrord/intproxy/src/proxies/incoming.rs:737 — IncomingProxy::handle_message has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SubscribeEventsTable.SubscribeEventsTable (cyclomatic 18) · ×1
  • SubscribeEventsTable.SubscribeEventsTable (cyclomatic 18) packages/monitor/src/components/SubscribeEventsTable.tsx:145 — SubscribeEventsTable.SubscribeEventsTable has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 183, 177, 170, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ResolvedTarget · ×1
  • ResolvedTarget::assert_valid_mirrord_target (cyclomatic 17) mirrord/kube/src/resolved.rs:420 — ResolvedTarget::assert_valid_mirrord_target has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PreviewSyncConfig · ×1
  • PreviewSyncConfig::check (cyclomatic 17) mirrord/operator/src/crd/preview/sync_config.rs:169 — PreviewSyncConfig::check has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · utils_win · ×1
  • utils_win::diagnostics::dialog::window_proc (cyclomatic 17) mirrord/utils-win/src/diagnostics/dialog.rs:275 — utils_win::diagnostics::dialog::window_proc has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EventRow.EventRow (cyclomatic 17) · ×1
  • EventRow.EventRow (cyclomatic 17) packages/monitor/src/components/events/EventRow.tsx:22 — EventRow.EventRow has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ProtocolAndAddressFilter · ×1
  • ProtocolAndAddressFilter::matches (cyclomatic 16) mirrord/layer-lib/src/socket.rs:727 — ProtocolAndAddressFilter::matches has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PidWatch · ×1
  • PidWatch::run (cyclomatic 16) mirrord/utils-win/src/diagnostics/monitor/server.rs:1037 — PidWatch::run 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 · ContextNamespacePicker.NamespaceCombobox (cyclomatic 16) · ×1
  • ContextNamespacePicker.NamespaceCombobox (cyclomatic 16) packages/monitor/src/components/ContextNamespacePicker.tsx:96 — ContextNamespacePicker.NamespaceCombobox has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · OperatorSessionDetail.OperatorSessionDetail (cyclomatic 16) · ×1
  • OperatorSessionDetail.OperatorSessionDetail (cyclomatic 16) packages/monitor/src/components/OperatorSessionDetail.tsx:74 — OperatorSessionDetail.OperatorSessionDetail has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 16) · ×1
  • (anonymous) (cyclomatic 16) REDACTED:178 — (anonymous) has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to 5 function items inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D17 · Explicit Debt · HackComment · ×1
  • HackComment mirrord/cli/src/prefetch.rs:439 — // HACK ideally this would be handled by protocol-api — 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 · OutgoingProxy · ×1
  • OutgoingProxy::run (cognitive 72) mirrord/intproxy/src/proxies/outgoing.rs:785 — OutgoingProxy::run has cognitive complexity 72 (threshold 15). Drivers by points: match/switch 10 (34 pts), if/else 8 (33 pts), loops 2 (5 pts) (nesting depth added 52). 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 · App.App (cognitive 62) · ×1
  • App.App (cognitive 62) packages/monitor/src/App.tsx:55 — App.App has cognitive complexity 62 (threshold 15). Drivers by points: if/else 26 (27 pts), ternaries 14 (23 pts), boolean chains 10, error handling 1, loops 1 (nesting depth added 10). Most of this is not in the body itself: 13 of the 62 points are its own statements and the rest belongs to 27 function literals inside it that branch (lines 254, 129, 184, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TrafficTunnels · ×1
  • TrafficTunnels::handle_event (cognitive 59) mirrord/protocol-api/src/client/tunnels.rs:400 — TrafficTunnels::handle_event has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (47 pts), match/switch 5 (12 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PortForwarder · ×1
  • PortForwarder::handle_msg_from_agent (cognitive 55) mirrord/cli/src/port_forward.rs:215 — PortForwarder::handle_msg_from_agent has cognitive complexity 55 (threshold 15). Drivers by points: match/switch 11 (30 pts), if/else 7 (25 pts) (nesting depth added 37). 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 · TcpStealerApi · ×1
  • TcpStealerApi::handle_client_message (cognitive 46) mirrord/agent/src/steal/api.rs:483 — TcpStealerApi::handle_client_message has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (38 pts), match/switch 3 (5 pts), loops 1 (3 pts) (nesting depth added 27). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TcpMirrorApi · ×1
  • TcpMirrorApi::next (cognitive 44) mirrord/agent/src/mirror.rs:97 — TcpMirrorApi::next has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (35 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifiedDatabaseBranchParams · ×1
  • UnifiedDatabaseBranchParams::new (cognitive 40) mirrord/operator/src/client/database_branches.rs:1583 — UnifiedDatabaseBranchParams::new has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 4 (8 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FullResponseFut · ×1
  • FullResponseFut::poll (cognitive 40) mirrord/protocol-api/src/client/tunnels/streams.rs:275 — FullResponseFut::poll has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 4 (13 pts), loops 2 (6 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatusCommandHandler · ×1
  • StatusCommandHandler::handle (cognitive 38) mirrord/cli/src/operator/status.rs:203 — StatusCommandHandler::handle has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 8 (15 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionSidebar.SessionSidebar (cognitive 38) · ×1
  • SessionSidebar.SessionSidebar (cognitive 38) packages/monitor/src/components/SessionSidebar.tsx:88 — SessionSidebar.SessionSidebar has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 11 (19 pts), boolean chains 14, if/else 5 (nesting depth added 8). Of this number, 30 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PgBranchConfig · ×1
  • PgBranchConfig::verify_additional_databases (cognitive 37) mirrord/config/src/feature/database_branches/pg.rs:169 — PgBranchConfig::verify_additional_databases has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 6 (9 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebuggerType · ×1
  • DebuggerType::get_ports (cognitive 36) mirrord/layer-lib/src/debugger_ports.rs:155 — DebuggerType::get_ports has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 7 (14 pts), boolean chains 3 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LayerInitializer · ×1
  • LayerInitializer::run (cognitive 35) mirrord/intproxy/src/layer_initializer.rs:147 — LayerInitializer::run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 5 (17 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mirrord_kube · ×1
  • mirrord_kube::api::container::job::create_job_agent (cognitive 35) mirrord/kube/src/api/container/job.rs:41 — mirrord_kube::api::container::job::create_job_agent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (22 pts), match/switch 4 (10 pts), boolean chains 2, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TargetConfig · ×1
  • TargetConfig::collect_analytics (cognitive 34) mirrord/config/src/target.rs:726 — TargetConfig::collect_analytics has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (32 pts), match/switch 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Wizard.Wizard (cognitive 34) · ×1
  • Wizard.Wizard (cognitive 34) packages/wizard/src/components/Wizard.tsx:52 — Wizard.Wizard has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 16, ternaries 7 (11 pts), if/else 3 (4 pts), match/switch 3 (nesting depth added 5). Of this number, 16 points are the body's own statements and 18 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PreviewDiagnostics.PreviewDiagnostics (cognitive 31) · ×1
  • PreviewDiagnostics.PreviewDiagnostics (cognitive 31) packages/monitor/src/components/PreviewDiagnostics.tsx:40 — PreviewDiagnostics.PreviewDiagnostics has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 8, if/else 7 (nesting depth added 6). Of this number, 23 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PidWatch · ×1
  • PidWatch::run (cognitive 30) mirrord/utils-win/src/diagnostics/monitor/server.rs:1037 — PidWatch::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalConnectionTask · ×1
  • LocalConnectionTask::run (cognitive 29) mirrord/cli/src/port_forward.rs:849 — LocalConnectionTask::run has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 9 (20 pts), if/else 2 (8 pts), loops 1 (nesting depth added 17). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ConfigFlags · ×1
  • ConfigFlags::new (cognitive 28) mirrord/config/derive/src/config/flag.rs:71 — ConfigFlags::new has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, match/switch 4 (9 pts), if/else 1 (4 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabaseBranchesConfig · ×1
  • DatabaseBranchesConfig::verify (cognitive 27) mirrord/config/src/feature/database_branches.rs:688 — DatabaseBranchesConfig::verify has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (10 pts), match/switch 2 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabaseBranchConfig · ×1
  • DatabaseBranchConfig::copy_mode (cognitive 26) mirrord/config/src/feature/database_branches.rs:1035 — DatabaseBranchConfig::copy_mode has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 13 (26 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Interceptor · ×1
  • Interceptor::run (cognitive 26) mirrord/intproxy/src/proxies/outgoing/interceptor.rs:110 — Interceptor::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 4 (9 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientConnectionHandler · ×1
  • ClientConnectionHandler::start (cognitive 25) mirrord/agent/src/entrypoint.rs:554 — ClientConnectionHandler::start has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 11 (20 pts), if/else 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TcpProxyTask · ×1
  • TcpProxyTask::run (cognitive 25) mirrord/intproxy/src/proxies/incoming/tcp_proxy.rs:142 — TcpProxyTask::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceConfig · ×1
  • ServiceConfig::assemble (cognitive 25) mirrord/up/src/config.rs:890 — ServiceConfig::assemble has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 6 (8 pts), boolean chains 5 (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 · EventStream.EventStream (cognitive 25) · ×1
  • EventStream.EventStream (cognitive 25) packages/monitor/src/components/EventStream.tsx:58 — EventStream.EventStream has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 15, ternaries 7 (8 pts), if/else 2 (nesting depth added 1). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 177, 256, 139, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Browser · ×1
  • Browser::rows (cognitive 24) mirrord/tui/src/screens/targets/browser.rs:202 — Browser::rows has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mirrord_layer · ×1
  • mirrord_layer::socket::ops::bind (cognitive 23) mirrord/layer/src/socket/ops.rs:176 — mirrord_layer::socket::ops::bind has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 5, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TargetStep.TargetStep (cognitive 23) · ×1
  • TargetStep.TargetStep (cognitive 23) packages/wizard/src/components/steps/TargetStep.tsx:31 — TargetStep.TargetStep has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, ternaries 7 (8 pts), if/else 3 (nesting depth added 1). Of this number, 16 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · mirrord_config · ×1
  • mirrord_config::feature::magic::without_java_agents (cognitive 22) mirrord/config/src/feature/magic.rs:112 — mirrord_config::feature::magic::without_java_agents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HttpGatewayTask · ×1
  • HttpGatewayTask::run (cognitive 22) mirrord/intproxy/src/proxies/incoming/http_gateway.rs:367 — HttpGatewayTask::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabaseBranchParams · ×1
  • DatabaseBranchParams::new (cognitive 22) mirrord/operator/src/client/database_branches.rs:544 — DatabaseBranchParams::new has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PreviewSyncConfig · ×1
  • PreviewSyncConfig::check (cognitive 21) mirrord/operator/src/crd/preview/sync_config.rs:169 — PreviewSyncConfig::check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mirrord_agent · ×1
  • mirrord_agent::entrypoint::start_agent_workload_companion (cognitive 20) mirrord/agent/src/entrypoint.rs:1340 — mirrord_agent::entrypoint::start_agent_workload_companion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (9 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Changes · ×1
  • Changes::merge (cognitive 20) mirrord/cli/src/preview/sync.rs:1171 — Changes::merge has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · App · ×1
  • App::handle_event (cognitive 20) mirrord/tui/src/app.rs:382 — App::handle_event has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 5 (9 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TerminalScreen · ×1
  • TerminalScreen::draw (cognitive 20) mirrord/tui/src/screens/terminal.rs:240 — TerminalScreen::draw has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 pts), match/switch 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useChaosRules.useChaosRules.poll (cognitive 20) · ×1
  • useChaosRules.useChaosRules.poll (cognitive 20) packages/monitor/src/hooks/useChaosRules.ts:120 — useChaosRules.useChaosRules.poll has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), loops 2, boolean chains 1, error handling 1 (nesting depth added 8). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 144). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TcpStealerTask · ×1
  • TcpStealerTask::handle_stolen_traffic (cognitive 19) mirrord/agent/src/steal/task.rs:145 — TcpStealerTask::handle_stolen_traffic has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExecParams · ×1
  • ExecParams::as_env_vars (cognitive 19) mirrord/cli/src/config.rs:540 — ExecParams::as_env_vars has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProtocolAndAddressFilter · ×1
  • ProtocolAndAddressFilter::matches (cognitive 19) mirrord/layer-lib/src/socket.rs:727 — ProtocolAndAddressFilter::matches has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 3 (7 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PingPong · ×1
  • PingPong::run (cognitive 19) mirrord/intproxy/src/ping_pong.rs:86 — PingPong::run has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ResponseManager · ×1
  • ResponseManager::receive (cognitive 19) mirrord/layer-lib/src/proxy_connection/responses.rs:37 — ResponseManager::receive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 3 (7 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Input · ×1
  • Input::handle_key (cognitive 19) mirrord/tui/src/screens/targets/form.rs:256 — Input::handle_key has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, match/switch 3 (5 pts) (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RedirectorTask · ×1
  • RedirectorTask::handle_initialized_connection (cognitive 18) mirrord/agent/src/incoming/task.rs:274 — RedirectorTask::handle_initialized_connection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (7 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 · AsyncDecoder · ×1
  • AsyncDecoder::poll_next (cognitive 17) mirrord/intproxy/protocol/src/codec/codec_async.rs:168 — AsyncDecoder::poll_next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FailoverStrategy · ×1
  • FailoverStrategy::run_with_termination (cognitive 17) mirrord/intproxy/src/failover_strategy.rs:182 — FailoverStrategy::run_with_termination has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 3 (5 pts), loops 3 (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 · SinglePortForwarder · ×1
  • SinglePortForwarder::into_retry_future (cognitive 17) mirrord/kube/src/api/kubernetes/portforwarder.rs:152 — SinglePortForwarder::into_retry_future has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mirrord_protocol_io · ×1
  • mirrord_protocol_io::websocket::run_writer (cognitive 17) mirrord/protocol-io/src/websocket.rs:327 — mirrord_protocol_io::websocket::run_writer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mirrord_macros · ×1
  • mirrord_macros::boxed_future (cognitive 17) mirrord/macros/src/lib.rs:83 — mirrord_macros::boxed_future has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 5, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ConnInfo · ×1
  • ConnInfo::connection_string (cognitive 16) mirrord/cli/src/internal_proxy/db_portforwards.rs:209 — ConnInfo::connection_string has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 4 (5 pts), boolean chains 2 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ShardedMap · ×1
  • ShardedMap::for_each (cognitive 16) mirrord/layer-win/src/managed/sharded_map.rs:225 — ShardedMap::for_each has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (11 pts), match/switch 1 (3 pts), if/else 1 (2 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PreviewEnvsScreen · ×1
  • PreviewEnvsScreen::handle_event (cognitive 16) mirrord/tui/src/screens/preview_envs.rs:118 — PreviewEnvsScreen::handle_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 5 (8 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventBuffer.absorb (cognitive 16) · ×1
  • EventBuffer.absorb (cognitive 16) packages/monitor/src/eventBuffer.ts:30 — EventBuffer.absorb has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyFields · ×1
  • TooManyFields: ConnectParams mirrord/operator/src/client/connect_params.rs:30 — TooManyFields — 44 stored fields beside 1 method. The bar is 30 stored fields; this is 14 over it, 1.47× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: diagnose.rs, execution.rs, vpn.rs mirrord/cli/src/diagnose.rs — 3 files — `mirrord/cli/src/diagnose.rs`, `mirrord/cli/src/execution.rs`, `mirrord/cli/src/vpn.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 35 shared lines) · ×1
  • Near-duplicate member family (4 members, 35 shared lines) mirrord/operator/src/client/database_branches.rs:64 — mirrord/operator/src/client/database_branches.rs:64-155 | mirrord/operator/src/client/database_branches.rs:224-315 | mirrord/operator/src/client/database_branches.rs:383-474 | mirrord/operator/src/client/database_branches.rs:1157-1286 — These 4 members are variants of one another: a block of 35 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 36 shared lines) · ×1
  • Near-duplicate member family (3 members, 36 shared lines) mirrord/operator/src/client/database_branches.rs:166 — mirrord/operator/src/client/database_branches.rs:166-213 | mirrord/operator/src/client/database_branches.rs:325-372 | mirrord/operator/src/client/database_branches.rs:485-532 — These 3 members are variants of one another: a block of 36 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 (74 shared lines) · ×1
  • Near-duplicate member pair (74 shared lines) mirrord/operator/src/client.rs:2362 — mirrord/operator/src/client.rs:2362-2540 | mirrord/operator/src/client.rs:2708-2859 — These two members are variants of one another: 74 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (54 shared lines) · ×1
  • Near-duplicate member pair (54 shared lines) mirrord/cli/src/execution.rs:630 — mirrord/cli/src/execution.rs:630-754 | mirrord/cli/src/execution.rs:799-978 — These two members are variants of one another: 54 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (36 shared lines) · ×1
  • Near-duplicate member pair (36 shared lines) mirrord/cli/src/ci.rs:501 — mirrord/cli/src/ci.rs:501-568 | mirrord/cli/src/ci.rs:582-676 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (27 shared lines) · ×1
  • Near-duplicate member pair (27 shared lines) mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:46 — mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:46-96 | mirrord/kube/src/api/kubernetes/rollout/workload_ref.rs:108-162 — These two members are variants of one another: 27 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) mirrord/operator/src/client/database_branches.rs:2050 — mirrord/operator/src/client/database_branches.rs:2050-2105 | mirrord/operator/src/client/database_branches.rs:2114-2154 | mirrord/operator/src/client/database_branches.rs:2163-2203 | mirrord/operator/src/client/database_branches.rs:2211-2250 | mirrord/operator/src/client/database_branches.rs:2259-2299 | mirrord/operator/src/client/database_branches.rs:2308-2346 | mirrord/operator/src/client/database_branches.rs:2355-2394 | mirrord/operator/src/client/database_branches.rs:2402-2440 | mirrord/operator/src/client/database_branches.rs:2449-2487 | mirrord/operator/src/client/database_branches.rs:2495-2542 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) mirrord/layer/src/file/ops.rs:470 — mirrord/layer/src/file/ops.rs:470-481 | mirrord/layer/src/file/ops.rs:484-498 | mirrord/layer/src/file/ops.rs:501-524 | mirrord/layer/src/file/ops.rs:527-538 | mirrord/layer/src/file/ops.rs:541-552 | mirrord/layer/src/file/ops.rs:555-589 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (80 corresponding lines) · ×1
  • Edited copy of a member (80 corresponding lines) mirrord/layer/macro/src/lib.rs:30 — mirrord/layer/macro/src/lib.rs:30-109 | mirrord/layer/macro/src/lib.rs:403-502 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) mirrord/layer-lib/src/error.rs:450 — mirrord/layer-lib/src/error.rs:450-510 | mirrord/layer-lib/src/error.rs:513-585 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) mirrord/cli/src/execution.rs:986 — mirrord/cli/src/execution.rs:986-1048 | mirrord/layer/src/lib.rs:534-589 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) mirrord/tui/src/screens/databases.rs:229 — mirrord/tui/src/screens/databases.rs:229-275 | mirrord/tui/src/screens/queues.rs:234-289 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) mirrord/intproxy/src/proxies/files.rs:359 — mirrord/intproxy/src/proxies/files.rs:359-398 | mirrord/protocol-api/src/file_ext.rs:205-238 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) mirrord/layer-lib/src/socket/ops.rs:635 — mirrord/layer-lib/src/socket/ops.rs:635-682 | mirrord/layer/src/socket/ops.rs:1008-1055 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) mirrord/layer-win/src/hooks/socket/mod.rs:1724 — mirrord/layer-win/src/hooks/socket/mod.rs:1724-1768 | mirrord/layer-win/src/hooks/socket/mod.rs:1778-1817 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 20+ corresponding lines) mirrord/config/src/feature/database_branches.rs:877 — mirrord/config/src/feature/database_branches.rs:877-896 | mirrord/config/src/feature/database_branches.rs:900-921 | mirrord/config/src/feature/database_branches.rs:925-948 | mirrord/config/src/feature/database_branches.rs:952-971 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) mirrord/agent/src/outgoing/seqpacket.rs:100 — mirrord/agent/src/outgoing/seqpacket.rs:100-134 | mirrord/agent/src/outgoing/tcp_unix.rs:144-189 | mirrord/agent/src/outgoing/udp.rs:96-141 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 39+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 39+ corresponding lines) xtask/src/tasks/cli.rs:79 — xtask/src/tasks/cli.rs:79-123 | xtask/src/tasks/cli.rs:130-173 | xtask/src/tasks/layer.rs:246-284 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) mirrord/kube/src/resolved.rs:106 — mirrord/kube/src/resolved.rs:106-135 | mirrord/kube/src/resolved.rs:152-183 | mirrord/kube/src/resolved.rs:208-237 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) mirrord/operator/src/client/database_branches.rs:886 — mirrord/operator/src/client/database_branches.rs:886-908 | mirrord/operator/src/client/database_branches.rs:920-945 | mirrord/operator/src/client/database_branches.rs:957-979 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 21+ corresponding lines) mirrord/layer/src/file/hooks.rs:1414 — mirrord/layer/src/file/hooks.rs:1414-1434 | mirrord/layer/src/file/hooks.rs:1442-1462 | mirrord/layer/src/file/hooks.rs:1471-1492 | mirrord/layer/src/file/hooks.rs:1501-1522 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) mirrord/layer-go/src/linux_x64.rs:21 — mirrord/layer-go/src/linux_x64.rs:21-103 | mirrord/layer-go/src/linux_x64.rs:192-267 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) mirrord/operator/src/crd/db_branching/mongodb.rs:83 — mirrord/operator/src/crd/db_branching/mongodb.rs:83-102 | mirrord/operator/src/crd/db_branching/mysql.rs:85-108 | mirrord/operator/src/crd/db_branching/pg.rs:90-113 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) mirrord/agent/src/steal/subscriptions.rs:147 — mirrord/agent/src/steal/subscriptions.rs:147-173 | mirrord/agent/src/steal/subscriptions.rs:181-208 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 22+ corresponding lines) mirrord/operator/src/crd/db_branching/branch_database.rs:1292 — mirrord/operator/src/crd/db_branching/branch_database.rs:1292-1313 | mirrord/operator/src/crd/db_branching/branch_database.rs:1317-1338 | mirrord/operator/src/crd/db_branching/branch_database.rs:1342-1363 | mirrord/operator/src/crd/db_branching/branch_database.rs:1367-1388 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 37+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 37+ corresponding lines) mirrord/layer/src/socket/dns_sd.rs:619 — mirrord/layer/src/socket/dns_sd.rs:619-655 | mirrord/layer/src/socket/dns_sd.rs:670-708 | mirrord/layer/src/socket/dns_sd.rs:723-763 | mirrord/layer/src/socket/dns_sd.rs:779-821 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) mirrord/agent/src/file.rs:573 — mirrord/agent/src/file.rs:573-589 | mirrord/agent/src/file.rs:591-624 | mirrord/agent/src/file.rs:626-642 | mirrord/agent/src/file.rs:644-660 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) mirrord/layer-go/src/linux_x64.rs:575 — mirrord/layer-go/src/linux_x64.rs:575-611 | mirrord/layer-go/src/linux_x64.rs:618-660 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) mirrord/agent/src/file.rs:457 — mirrord/agent/src/file.rs:457-475 | mirrord/agent/src/file.rs:662-682 | mirrord/agent/src/file.rs:684-707 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) mirrord/kube/src/error.rs:138 — mirrord/kube/src/error.rs:138-149 | mirrord/kube/src/error.rs:160-173 | mirrord/kube/src/error.rs:182-195 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 14+ corresponding lines) mirrord/layer/src/file/hooks.rs:98 — mirrord/layer/src/file/hooks.rs:98-111 | mirrord/layer/src/file/hooks.rs:122-135 | mirrord/layer/src/file/hooks.rs:143-156 | mirrord/layer/src/file/hooks.rs:497-513 | mirrord/layer/src/file/hooks.rs:526-542 | mirrord/layer/src/file/hooks.rs:550-566 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 10+ corresponding lines) mirrord/cli/src/connector.rs:230 — mirrord/cli/src/connector.rs:230-241 | mirrord/cli/src/connector.rs:243-257 | mirrord/cli/src/connector.rs:259-270 | mirrord/cli/src/connector.rs:272-283 | mirrord/cli/src/connector.rs:289-298 | mirrord/cli/src/connector.rs:300-312 | mirrord/cli/src/connector.rs:314-323 | mirrord/cli/src/connector.rs:325-334 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×1
  • Edited copy of a member (7 corresponding lines) mirrord/cli/src/ci.rs:332 — mirrord/cli/src/ci.rs:332-338 | mirrord/cli/src/ci.rs:341-347 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 15+ corresponding lines) mirrord/layer/src/file/hooks.rs:1213 — mirrord/layer/src/file/hooks.rs:1213-1227 | mirrord/layer/src/file/hooks.rs:1235-1249 | mirrord/layer/src/file/hooks.rs:1253-1267 | mirrord/layer/src/file/hooks.rs:1275-1289 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 10+ corresponding lines) mirrord/agent/iptables/src/mesh.rs:53 — mirrord/agent/iptables/src/mesh.rs:53-62 | mirrord/agent/iptables/src/mesh/istio.rs:44-54 | mirrord/agent/iptables/src/mesh/istio.rs:56-66 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×1
  • Edited copy of a member (8 corresponding lines) mirrord/agent/iptables/src/mesh/exclusion.rs:31 — mirrord/agent/iptables/src/mesh/exclusion.rs:31-39 | mirrord/agent/iptables/src/prerouting.rs:29-36 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) mirrord/config/src/feature/database_branches.rs:108 — mirrord/config/src/feature/database_branches.rs:108-115 | mirrord/operator/src/crd/copy_target.rs:177-184 | mirrord/operator/src/crd/queue_filter.rs:207-214 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×1
  • Duplicated block (57 lines × 2) mirrord/tui/src/screens/databases.rs:378 — mirrord/tui/src/screens/databases.rs:378-434 | mirrord/tui/src/screens/queues.rs:385-441 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) mirrord/layer-lib/src/socket/ops.rs:636 — mirrord/layer-lib/src/socket/ops.rs:636-676 | mirrord/layer/src/socket/ops.rs:1009-1049 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer-lib/src/socket/ops.rs:636` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `sockfd` to `SocketDescriptor` in one and `RawFd` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) mirrord/operator/src/client.rs:2420 — mirrord/operator/src/client.rs:2420-2456 | mirrord/operator/src/client.rs:2790-2826 — both copies are in the same file, so extract the 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 lines × 2) · ×1
  • Duplicated block (34 lines × 2) mirrord/cli/src/port_forward.rs:1049 — mirrord/cli/src/port_forward.rs:1049-1082 | mirrord/layer-lib/src/setup.rs:450-483 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (26–32 lines × 2) · ×1
  • Duplicated block (26–32 lines × 2) mirrord/operator/src/client.rs:2385 — mirrord/operator/src/client.rs:2385-2410 | mirrord/operator/src/client.rs:2754-2785 — both copies are in the same file, so extract the 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 (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) mirrord/layer/src/socket/ops.rs:1093 — mirrord/layer/src/socket/ops.rs:1093-1119 | mirrord/layer/src/socket/ops.rs:1188-1215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/socket/ops.rs:1093` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) mirrord/tui/src/screens/databases.rs:198 — mirrord/tui/src/screens/databases.rs:198-222 | mirrord/tui/src/screens/queues.rs:203-227 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) mirrord/layer/src/socket/ops.rs:1129 — mirrord/layer/src/socket/ops.rs:1129-1151 | mirrord/layer/src/socket/ops.rs:1231-1251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/socket/ops.rs:1129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) mirrord/operator/src/client/database_branches.rs:96 — mirrord/operator/src/client/database_branches.rs:96-115 | mirrord/operator/src/client/database_branches.rs:256-275 | mirrord/operator/src/client/database_branches.rs:415-434 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) mirrord/sip/src/lib.rs:275 — mirrord/sip/src/lib.rs:275-294 | mirrord/sip/src/lib.rs:303-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/sip/src/lib.rs:275` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 4) · ×1
  • Duplicated block (19 lines × 4) mirrord/operator/src/client/database_branches.rs:2087 — mirrord/operator/src/client/database_branches.rs:2087-2105 | mirrord/operator/src/client/database_branches.rs:2185-2203 | mirrord/operator/src/client/database_branches.rs:2281-2299 | mirrord/operator/src/client/database_branches.rs:2328-2346 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:2087` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/operator/src/client/database_branches.rs:2325` calls `Some`, `clone`, `into` and `mirrord/operator/src/client/database_branches.rs:2086` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16–19 lines × 3) · ×1
  • Duplicated block (16–19 lines × 3) mirrord/operator/src/client/database_branches.rs:2580 — mirrord/operator/src/client/database_branches.rs:2580-2598 | mirrord/operator/src/client/database_branches.rs:2647-2662 | mirrord/operator/src/client/database_branches.rs:2701-2716 — 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 (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) mirrord/cli/src/db_branches.rs:86 — mirrord/cli/src/db_branches.rs:86-103 | mirrord/cli/src/db_branches.rs:118-135 | mirrord/cli/src/db_branches.rs:150-167 | mirrord/cli/src/db_branches.rs:182-199 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/db_branches.rs:86` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) mirrord/operator/src/client.rs:2955 — mirrord/operator/src/client.rs:2955-2971 | mirrord/operator/src/client.rs:3135-3150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client.rs:2955` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) mirrord/layer/macro/src/lib.rs:31 — mirrord/layer/macro/src/lib.rs:31-54 | mirrord/layer/macro/src/lib.rs:404-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/macro/src/lib.rs:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mirrord/layer/macro/src/lib.rs:427` calls `clone` and `mirrord/layer/macro/src/lib.rs:55` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) mirrord/tui/src/screens/databases.rs:99 — mirrord/tui/src/screens/databases.rs:99-113 | mirrord/tui/src/screens/queues.rs:98-109 — before extracting anything, compare `mirrord/tui/src/screens/databases.rs` and `mirrord/tui/src/screens/queues.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 253 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/databases.rs:99` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) mirrord/operator/src/client/database_branches.rs:118 — mirrord/operator/src/client/database_branches.rs:118-131 | mirrord/operator/src/client/database_branches.rs:278-291 | mirrord/operator/src/client/database_branches.rs:437-450 | mirrord/operator/src/client/database_branches.rs:1236-1249 | mirrord/operator/src/client/database_branches.rs:1500-1513 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:118` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) mirrord/operator/src/client/preview_sync.rs:173 — mirrord/operator/src/client/preview_sync.rs:173-183 | mirrord/operator/src/client/preview_sync.rs:206-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/preview_sync.rs:173` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) mirrord/operator/src/client/database_branches.rs:104 — mirrord/operator/src/client/database_branches.rs:104-116 | mirrord/operator/src/client/database_branches.rs:264-276 | mirrord/operator/src/client/database_branches.rs:423-435 | mirrord/operator/src/client/database_branches.rs:1223-1234 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) mirrord/operator/src/client/database_branches.rs:2238 — mirrord/operator/src/client/database_branches.rs:2238-2250 | mirrord/operator/src/client/database_branches.rs:2668-2680 | mirrord/operator/src/client/database_branches.rs:2721-2733 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:2238` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/operator/src/client/database_branches.rs:2718` calls `Some`, `clone`, `into` and `mirrord/operator/src/client/database_branches.rs:2237` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) mirrord/cli/src/data/global_config.rs:274 — mirrord/cli/src/data/global_config.rs:274-285 | mirrord/cli/src/data/global_config.rs:314-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/data/global_config.rs:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) mirrord/intproxy/src/remote_resources.rs:51 — mirrord/intproxy/src/remote_resources.rs:51-61 | mirrord/intproxy/src/remote_resources.rs:96-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/intproxy/src/remote_resources.rs:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) mirrord/operator/src/client/database_branches.rs:199 — mirrord/operator/src/client/database_branches.rs:199-208 | mirrord/operator/src/client/database_branches.rs:358-367 | mirrord/operator/src/client/database_branches.rs:518-527 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:199` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) mirrord/tui/src/screens/preview_envs/view.rs:655 — mirrord/tui/src/screens/preview_envs/view.rs:655-664 | mirrord/tui/src/screens/preview_envs/view.rs:690-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/preview_envs/view.rs:655` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 9) · ×1
  • Duplicated block (9 lines × 9) mirrord/operator/src/client/database_branches.rs:2066 — mirrord/operator/src/client/database_branches.rs:2066-2074 | mirrord/operator/src/client/database_branches.rs:2118-2126 | mirrord/operator/src/client/database_branches.rs:2167-2175 | mirrord/operator/src/client/database_branches.rs:2214-2222 | mirrord/operator/src/client/database_branches.rs:2263-2271 | mirrord/operator/src/client/database_branches.rs:2311-2319 | mirrord/operator/src/client/database_branches.rs:2358-2366 | mirrord/operator/src/client/database_branches.rs:2405-2413 | mirrord/operator/src/client/database_branches.rs:2506-2514 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:2066` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/operator/src/client/database_branches.rs:2117` calls `as_ref` and `mirrord/operator/src/client/database_branches.rs:2213` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–9 lines × 6) · ×1
  • Duplicated block (6–9 lines × 6) mirrord/layer/src/file/ops.rs:476 — mirrord/layer/src/file/ops.rs:476-481 | mirrord/layer/src/file/ops.rs:490-498 | mirrord/layer/src/file/ops.rs:516-524 | mirrord/layer/src/file/ops.rs:533-538 | mirrord/layer/src/file/ops.rs:547-552 | mirrord/layer/src/file/ops.rs:581-589 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/layer/src/file/ops.rs:476` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 6) · ×1
  • Duplicated block (8–9 lines × 6) mirrord/operator/src/client/database_branches.rs:2213 — mirrord/operator/src/client/database_branches.rs:2213-2220 | mirrord/operator/src/client/database_branches.rs:2310-2317 | mirrord/operator/src/client/database_branches.rs:2357-2364 | mirrord/operator/src/client/database_branches.rs:2404-2411 | mirrord/operator/src/client/database_branches.rs:2451-2458 | mirrord/operator/src/client/database_branches.rs:2504-2512 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:2213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mirrord/operator/src/client/database_branches.rs:2221` calls `clone` and `mirrord/operator/src/client/database_branches.rs:2459` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) mirrord/operator/src/client/database_branches.rs:82 — mirrord/operator/src/client/database_branches.rs:82-90 | mirrord/operator/src/client/database_branches.rs:242-250 | mirrord/operator/src/client/database_branches.rs:401-409 | mirrord/operator/src/client/database_branches.rs:1176-1184 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client/database_branches.rs:82` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) mirrord/operator/src/client.rs:1878 — mirrord/operator/src/client.rs:1878-1885 | mirrord/operator/src/client.rs:1888-1895 | mirrord/operator/src/client/database_branches.rs:1223-1232 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/operator/src/client.rs:1878` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) mirrord/agent/iptables/src/mesh/exclusion.rs:41 — mirrord/agent/iptables/src/mesh/exclusion.rs:41-46 | mirrord/agent/iptables/src/output.rs:87-92 | mirrord/agent/iptables/src/prerouting.rs:38-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) mirrord/tui/src/screens/preview_envs/view.rs:535 — mirrord/tui/src/screens/preview_envs/view.rs:535-541 | mirrord/tui/src/screens/preview_envs/view.rs:562-568 | mirrord/tui/src/screens/preview_envs/view.rs:648-654 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/tui/src/screens/preview_envs/view.rs:535` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) mirrord/kube/src/resolved.rs:439 — mirrord/kube/src/resolved.rs:439-443 | mirrord/kube/src/resolved.rs:505-509 | mirrord/kube/src/resolved.rs:563-567 | mirrord/kube/src/resolved.rs:612-616 | mirrord/kube/src/resolved.rs:634-638 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/kube/src/resolved.rs:439` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mirrord/kube/src/resolved.rs:561` calls `and_then`, `as_ref` and `mirrord/kube/src/resolved.rs:437` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) mirrord/cli/src/config.rs:564 — mirrord/cli/src/config.rs:564-568 | mirrord/cli/src/config.rs:793-797 | mirrord/cli/src/config.rs:1820-1824 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mirrord/cli/src/config.rs:564` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 17+ corresponding lines) mirrord/layer-tests/src/intproxy.rs:433 — mirrord/layer-tests/src/intproxy.rs:433-452 | mirrord/layer-tests/src/intproxy.rs:528-547 | mirrord/layer-tests/src/intproxy.rs:550-571 | mirrord/layer-tests/src/intproxy.rs:593-611 | mirrord/layer-tests/src/intproxy.rs:635-651 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) test-utils/src/lib.rs:527 — test-utils/src/lib.rs:527-536 | test-utils/src/lib.rs:545-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `test-utils/src/lib.rs:527` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — packages/monitor/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
R10 · Code Duplication · Duplicated block with local edits (72 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (72 matched lines × 2 locations) packages/wizard/src/components/steps/TargetStep.tsx:105 — packages/wizard/src/components/steps/TargetStep.tsx:105 · packages/wizard/src/components/steps/TrafficStep.tsx:29 — the two spans are one implementation copied and then locally edited — 330 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 (18 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (18 matched lines × 2 locations) packages/monitor/src/components/ContextNamespacePicker.tsx:40 — packages/monitor/src/components/ContextNamespacePicker.tsx:40 · packages/monitor/src/components/ContextNamespacePicker.tsx:129 — the two spans are one implementation copied and then locally edited — 95 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) packages/wizard/src/components/steps/ExportStep.tsx:45 — packages/wizard/src/components/steps/ExportStep.tsx:45 · packages/wizard/src/components/steps/TrafficStep.tsx:22 — 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 (15 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (15 matched lines × 2 locations) packages/monitor/src/components/AppHeader.tsx:61 — packages/monitor/src/components/AppHeader.tsx:61 · packages/monitor/src/components/ContextNamespacePicker.tsx:237 — the two spans are one implementation copied and then locally edited — 97 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 (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) packages/monitor/src/components/FunnelHero.tsx:95 — packages/monitor/src/components/FunnelHero.tsx:95 · packages/monitor/src/components/SessionSidebar.tsx:525 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×1
  • Duplicated block (9 lines × 2 locations) packages/monitor/src/api.ts:270 — packages/monitor/src/api.ts:270 · packages/monitor/src/api.ts:285 — 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 (9 lines × 5 locations) · ×1
  • Duplicated block (9 lines × 5 locations) packages/monitor/src/components/SubscribeEventsTable.tsx:230 — packages/monitor/src/components/SubscribeEventsTable.tsx:230 · packages/wizard/src/components/steps/ExportStep.tsx:54 · packages/wizard/src/components/steps/RunStep.tsx:18 · packages/wizard/src/components/steps/TargetStep.tsx:107 · +1 more site(s) not listed — the 5 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. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (9 lines × 4 locations) · ×1
  • Duplicated block (9 lines × 4 locations) packages/monitor/src/components/chaos/ChaosRuleForm.tsx:208 — packages/monitor/src/components/chaos/ChaosRuleForm.tsx:208 · packages/monitor/src/components/chaos/ChaosRuleForm.tsx:217 · packages/monitor/src/components/chaos/ChaosRuleForm.tsx:226 · packages/monitor/src/components/chaos/ChaosRuleForm.tsx:266 — all 4 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.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×1
  • Duplicated block (7 lines × 2 locations) packages/monitor/src/components/chaos/ChaosRuleForm.tsx:230 — packages/monitor/src/components/chaos/ChaosRuleForm.tsx:230 · packages/monitor/src/components/chaos/ChaosRuleForm.tsx:270 — 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.
R10 · Code Duplication · Duplicated block (5 lines × 2 locations) · ×1
  • Duplicated block (5 lines × 2 locations) packages/monitor/src/hooks/useChaosRules.ts:222 — packages/monitor/src/hooks/useChaosRules.ts:222 · packages/monitor/src/hooks/useChaosRules.ts:246 — 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.
R2 · Cyclomatic Complexity · Complex function TargetStep (cyclomatic 25, cognitive 21) · ×1
  • Complex function TargetStep (cyclomatic 25, cognitive 21) packages/wizard/src/components/steps/TargetStep.tsx:31 — TargetStep has cyclomatic complexity 25 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 Wizard (cyclomatic 25, cognitive 19) · ×1
  • Complex function Wizard (cyclomatic 25, cognitive 19) packages/wizard/src/components/Wizard.tsx:52 — Wizard has cyclomatic complexity 25 and cognitive complexity 19; 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 SessionSidebar (cyclomatic 23, cognitive 22) · ×1
  • Complex function SessionSidebar (cyclomatic 23, cognitive 22) packages/monitor/src/components/SessionSidebar.tsx:88 — SessionSidebar has cyclomatic complexity 23 and cognitive complexity 22; 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 PreviewDiagnostics (cyclomatic 20, cognitive 20) · ×1
  • Complex function PreviewDiagnostics (cyclomatic 20, cognitive 20) packages/monitor/src/components/PreviewDiagnostics.tsx:40 — PreviewDiagnostics has cyclomatic complexity 20 and cognitive complexity 20; 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 OperatorSessionDetail (cyclomatic 19, cognitive 18) · ×1
  • Complex function OperatorSessionDetail (cyclomatic 19, cognitive 18) packages/monitor/src/components/OperatorSessionDetail.tsx:74 — OperatorSessionDetail has cyclomatic complexity 19 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 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 EventRow (cyclomatic 16, cognitive 14) · ×1
  • Complex function EventRow (cyclomatic 16, cognitive 14) packages/monitor/src/components/events/EventRow.tsx:22 — EventRow has cyclomatic complexity 16 and cognitive complexity 14; 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 EventStream (cyclomatic 15, cognitive 11) · ×1
  • Complex function EventStream (cyclomatic 15, cognitive 11) packages/monitor/src/components/EventStream.tsx:58 — EventStream has cyclomatic complexity 15 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 NamespaceCombobox (cyclomatic 14, cognitive 11) · ×1
  • Complex function NamespaceCombobox (cyclomatic 14, cognitive 11) packages/monitor/src/components/ContextNamespacePicker.tsx:96 — NamespaceCombobox has cyclomatic complexity 14 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 TrafficStep (cyclomatic 12, cognitive 11) · ×1
  • Complex function TrafficStep (cyclomatic 12, cognitive 11) packages/wizard/src/components/steps/TrafficStep.tsx:9 — TrafficStep has cyclomatic complexity 12 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 timeout (cyclomatic 11, cognitive 11) · ×1
  • Complex function timeout (cyclomatic 11, cognitive 11) packages/monitor/src/App.tsx:254 — timeout has cyclomatic complexity 11 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 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 Widget (cyclomatic 11, cognitive 10) · ×1
  • Complex function Widget (cyclomatic 11, cognitive 10) packages/monitor/src/components/Widget.tsx:17 — Widget 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.
R2 · Cyclomatic Complexity · Complex function App (cyclomatic 11, cognitive 9) · ×1
  • Complex function App (cyclomatic 11, cognitive 9) packages/monitor/src/App.tsx:55 — App has cyclomatic complexity 11 and cognitive complexity 9; 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 · packages/monitor/src/components/SessionSidebar.tsx · ×1
  • packages/monitor/src/components/SessionSidebar.tsx: 515 lines of code packages/monitor/src/components/SessionSidebar.tsx:1 — packages/monitor/src/components/SessionSidebar.tsx has 515 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/monitor/src/App.tsx · ×1
  • packages/monitor/src/App.tsx: 488 lines of code packages/monitor/src/App.tsx:1 — packages/monitor/src/App.tsx has 488 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~247 LoC) · ×1
  • Dead file (~247 LoC) REDACTED — no import path from any entry point (9 application, 12 tooling, 29 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 'express' · ×1
  • Unused dependency 'express' — 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 'portfinder' · ×1
  • Unused dependency 'portfinder' — 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.
X15 · Unvalidated length from an untrusted reader · Length read from the parsed input is spent without ever being bounded · ×1
  • Length read from the parsed input is spent without ever being bounded mirrord/intproxy/protocol/src/codec.rs:151 — `len` is read from the bytes being parsed at line 149 (`u32::from_be_bytes`), then used to size a `.resize` at line 151 — and nowhere in its scope is `len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating.
Minor — 88 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging mirrord/utils-win/src/diagnostics/report.rs:296 — `warn!` at line 296 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/tui/src/app.rs:212 — `error!` at line 212 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/tui/src/screens/databases.rs:111 — `debug!` at line 111 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/tui/src/screens/databases.rs:118 — `warn!` at line 118 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/tui/src/screens/queues.rs:110 — `debug!` at line 110 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/tui/src/screens/queues.rs:113 — `warn!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/tls-util/src/root_store.rs:93 — `warn!` at line 93 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/sip/src/lib.rs:496 — `warn!` at line 496 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/sip/src/lib.rs:689 — `trace!` at line 689 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/sip/src/lib.rs:700 — `trace!` at line 700 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/sip/src/lib.rs:967 — `trace!` at line 967 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/sip/src/lib.rs:978 — `trace!` at line 978 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/sessions-manager/client/src/client/agent.rs:200 — `warn!` at line 200 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/diagnostics.rs:187 — `warn!` at line 187 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/diagnostics.rs:224 — `info!` at line 224 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/diagnostics.rs:235 — `warn!` at line 235 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/diagnostics.rs:250 — `warn!` at line 250 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/diagnostics.rs:260 — `info!` at line 260 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/lib.rs:258 — `error!` at line 258 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/lib.rs:343 — `error!` at line 343 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/lib.rs:391 — `error!` at line 391 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/subprocess.rs:78 — `debug!` at line 78 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/subprocess.rs:94 — `debug!` at line 94 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/subprocess.rs:103 — `debug!` at line 103 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging mirrord/layer-win/src/process/elevation.rs:59 — `debug!` at line 59 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • + 15 more in this group — see findings.md.
D16 · Bus Factor · Off-boarding risk · ×9
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 16 significant file(s) lose their only recent owner: mirrord/layer-win/src/hooks/files/ops/read.rs, mirrord/layer-win/src/hooks/files/ops/query_info.rs, mirrord/config/src/template.rs, mirrord/layer-win/src/hooks/files/managed_handle.rs, mirrord/layer-win/src/hooks/files/ops/stubs.rs, mirrord/layer-win/src/hooks/files/ops/open.rs, mirrord/layer-win/src/hooks/files/ops/set_info.rs, mirrord/layer-win/src/task_pool/mod.rs (+8 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 12 significant file(s) lose their only recent owner: mirrord/mcp/src/tools/validate_config.rs, mirrord/mcp/src/tools/explain_config_option.rs, mirrord/cli/src/up/checks.rs, mirrord/cli/src/prefetch.rs, mirrord/mcp/src/tools/search_docs.rs, mirrord/mcp/src/corpus.rs, mirrord/mcp/src/lib.rs, mirrord/config/derive/src/config/flag.rs (+4 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 11 significant file(s) lose their only recent owner: mirrord/tui/src/screens/targets/form.rs, mirrord/tui/src/screens/targets.rs, mirrord/tui/src/screens/targets/browser.rs, mirrord/tui/src/screens/targets/plan.rs, mirrord/tui/src/screens/preview_envs.rs, mirrord/tui/src/screens/targets/suggest.rs, mirrord/tui/src/screens/terminal/input.rs, mirrord/tui/src/stderr.rs (+3 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 10 significant file(s) lose their only recent owner: mirrord/cli/src/preview/resources.rs, mirrord/agent/src/http/share_link.rs, mirrord/cli/src/preview/resources/compare.rs, mirrord/operator/src/preview_template.rs, mirrord/cli/src/preview/resources/helm.rs, mirrord/cli/src/preview/resources/scope.rs, mirrord/cli/src/preview/resources/report.rs, mirrord/cli/src/preview/multicluster.rs (+2 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 10 significant file(s) lose their only recent owner: mirrord/agent/src/workload_companion/handoff.rs, mirrord/sessions-manager/client/src/control_plane/subscriber.rs, mirrord/sessions-manager/client/src/client/agent.rs, mirrord/operator-websocket/src/upgrade.rs, mirrord/layer/core/src/hooks.rs, mirrord/sessions-manager/client/src/assignments.rs, mirrord/sessions-manager/client/src/control_plane/api.rs, mirrord/sessions-manager/protocol/src/control_plane.rs (+2 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 5 significant file(s) lose their only recent owner: mirrord/agent/iptables/src/backend.rs, mirrord/cli/src/config/ci.rs, mirrord/cli/src/ci/error.rs, mirrord/session-monitor-client/src/request_builder.rs, mirrord/cli/src/ci/container.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 4 significant file(s) lose their only recent owner: mirrord/utils-win/src/diagnostics/dialog/theme.rs, mirrord/utils-win/src/error.rs, mirrord/utils-win/src/diagnostics/dialog/state.rs, mirrord/layer-lib/src/process/windows/diagnostics.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 4 significant file(s) lose their only recent owner: packages/monitor/src/components/SettingsDialog.tsx, packages/monitor/src/components/events/EventRow.tsx, packages/wizard/src/components/Homepage.tsx, packages/monitor/src/components/events/eventConfig.ts. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 3 significant file(s) lose their only recent owner: mirrord/utils-win/src/diagnostics/stack.rs, mirrord/macros/src/lib.rs, mirrord/cli/src/process_handoff.rs. Pair on, review, or document these before any departure.
X7 · Silent fallback defaults · Silent fallback default on Err · ×7
  • Silent fallback default on Err mirrord/cli/src/main.rs:1460 — `prompt_outdated_version` turns every `Err` into `true` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err mirrord/cli/src/preview/resources/scope.rs:110 — `references` turns every `Err` into `References::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err mirrord/progress/src/lib.rs:76 — `utm_medium` turns every `Err` into `"plugin".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err mirrord/session-monitor-client/src/lib.rs:104 — `session_endpoints` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err mirrord/tui/src/screens/targets/launch.rs:95 — `lingering_sessions` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err mirrord/tui/src/screens/targets/suggest.rs:154 — `complete_path` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err mirrord/tui/src/screens/terminal/panel.rs:119 — `uptime` turns every `Err` into `"unknown".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned file · ×3
  • Orphaned file medschool/src/types.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file mirrord/utils-win/src/diagnostics/handle.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file mirrord/utils-win/src/fixed_buf.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
X10 · Duplicated predicate · Duplicated predicate · ×3
  • Duplicated predicate mirrord/cli/src/execution.rs:1012 — `!env_vars_exclude.is_empty() || !env_vars_include.is_empty()` appears character-identically in 2 files — mirrord/cli/src/execution.rs, mirrord/layer/src/lib.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mirrord/tui/src/screens/databases.rs:338 — `self.search.visible() && self.details.is_none()` appears character-identically in 2 files — mirrord/tui/src/screens/databases.rs, mirrord/tui/src/screens/queues.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mirrord/cli/src/operator/session.rs:118 — `status.code == 404 && status.reason.contains("parse")` appears character-identically in 2 files — mirrord/cli/src/operator/session.rs, mirrord/cli/src/session.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 8 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 (88 single-owned of 610 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 610 of the 831 production source files in this repository met that bar). They are anonymized user #10 (3 file(s)), anonymized user #11 (3 file(s)), anonymized user #12 (2 file(s)), anonymized user #13 (1 file(s)), anonymized user #14 (1 file(s)), anonymized user #15 (1 file(s)) (+2 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: mirrord/layer/src/socket/dns_sd.rs, mirrord/agent/src/http/extract_requests.rs, mirrord/intproxy/src/proxies/outgoing/interceptor/delay_queue.rs, mirrord/sip/src/rosetta.rs, mirrord/cli/src/diagnose/sip.rs, mirrord/vpn/src/config.rs, mirrord/cli/src/operator/install/uninstall.rs, mirrord/layer-tests/src/fake_intproxy.rs (+5 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found packages/ui/package.json:7 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `packages/ui/package.json` makes this repository a deployable product (line 7).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 6 of 48 project(s) overshoot their size bounds, lowering Project Cohesion to 7.5/10. The most over is `mirrord/cli` (42469 LoC, 145 module-visible types across 16 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 3 of 610 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 610 of the 831 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: medschool/src/types.rs, mirrord/utils-win/src/diagnostics/handle.rs, mirrord/utils-win/src/fixed_buf.rs. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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 · Implementation type on the public API · ×1
  • Implementation type on the public API mirrord/progress/src/implementations.rs:15 — 7 public types in `mirrord_progress.implementations` are marked as implementation by their own namespace, folder or name: `JsonProgress` (mirrord/progress/src/implementations.rs:15, `implementations`), `SimpleProgress` (mirrord/progress/src/implementations.rs:112, `implementations`), `SpinnerProgress` (mirrord/progress/src/implementations.rs:165, `implementations`), `PrefixedProgress` (mirrord/progress/src/implementations.rs:291, `implementations`), `NotificationLevel` (mirrord/progress/src/implementations.rs:359, `implementations`), `IdeAction` (mirrord/progress/src/implementations.rs:371, `implementations`), `IdeMessage` (mirrord/progress/src/implementations.rs:378, `implementations`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 30/33 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `mirrord/layer-tests`, `packages/wizard`, `xtask`.
P3 · Security & performance tooling · Dependabot does not watch github-actions/npm/gomod/pip · ×1
  • Dependabot does not watch github-actions/npm/gomod/pip REDACTED:4 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `github-actions`, `npm`, `gomod`, `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
S1 · Web-Security Posture · Security headers incomplete · ×1
  • Security headers incomplete — Set: Content-Security-Policy, Referrer-Policy, X-Content-Type-Options, X-Frame-Options. Missing: Strict-Transport-Security — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each.(−0.5 on this card.) The server: `axum::serve(` (mirrord/intproxy/src/session_monitor/api.rs:234).
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 0/16 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 0/2 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Minor — 37 finding(s)
D12 · Dependency Hygiene · Outdated · ×37
  • Outdated: actix-codec — `actix-codec` is locked at 0.5.3 but 0.5.4 is the current stable release on crates.io, and it already satisfies the `"0.5"` requirement declared in mirrord/agent/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p actix-codec` and commit the updated REDACTED.
  • Outdated: aws-config — `aws-config` is locked at 1.11.0 but 1.13.2 is the current stable release on crates.io, and it already satisfies the `"1.5"` requirement declared in mirrord/cluster-auth/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-config` and commit the updated REDACTED.
  • Outdated: aws-credential-types — `aws-credential-types` is locked at 1.3.0 but 1.3.1 is the current stable release on crates.io, and it already satisfies the `"1.2"` requirement declared in mirrord/cluster-auth/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-credential-types` and commit the updated REDACTED.
  • Outdated: aws-sdk-sqs — `aws-sdk-sqs` is locked at 1.108.0 but 1.121.0 is the current stable release on crates.io, and it already satisfies the `"1.39"` requirement declared in tests/rust-sqs-printer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sdk-sqs` and commit the updated REDACTED.
  • Outdated: aws-sigv4 — `aws-sigv4` is locked at 1.5.1 but 1.6.5 is the current stable release on crates.io, and it already satisfies the `"1.2"` requirement declared in mirrord/cluster-auth/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aws-sigv4` and commit the updated REDACTED.
  • Outdated: bitflags — `bitflags` is locked at 2.13.1 but 2.13.2 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in mirrord/config/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bitflags` and commit the updated REDACTED.
  • Outdated: clap — `clap` is locked at 4.6.6 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4"` requirement declared in medschool/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
  • Outdated: clap_complete — `clap_complete` is locked at 4.6.9 but 4.6.11 is the current stable release on crates.io, and it already satisfies the `"4.4.1"` requirement declared in mirrord/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap_complete` and commit the updated REDACTED.
  • Outdated: errno — `errno` is locked at 0.3.14 but 0.3.15 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in mirrord/layer-tests/tests/apps/issue1776/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p errno` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.10 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in mirrord/auth/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: hyper — `hyper` is locked at 1.11.1 but 1.12.0 is the current stable release on crates.io, and it already satisfies the `"1.10"` requirement declared in tests/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper` and commit the updated REDACTED.
  • Outdated: hyper-rustls — `hyper-rustls` is locked at 0.27.9 but 0.27.10 is the current stable release on crates.io, and it already satisfies the `"0.27"` requirement declared in mirrord/cluster-auth/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper-rustls` and commit the updated REDACTED.
  • Outdated: hyper-util — `hyper-util` is locked at 0.1.20 but 0.1.21 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in tests/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hyper-util` and commit the updated REDACTED.
  • Outdated: ignore — `ignore` is locked at 0.4.33 but 0.4.34 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in mirrord/operator/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ignore` and commit the updated REDACTED.
  • Outdated: ipnet — `ipnet` is locked at 2.12.1 but 2.12.2 is the current stable release on crates.io, and it already satisfies the `"2.8"` requirement declared in mirrord/config/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ipnet` and commit the updated REDACTED.
  • Outdated: libc — `libc` is locked at 0.2.189 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in mirrord/agent/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
  • Outdated: log — `log` is locked at 0.4.34 but 0.4.35 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in mirrord/console/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
  • Outdated: notify — `notify` is locked at 8.2.0 but 8.2.2 is the current stable release on crates.io, and it already satisfies the `"8"` requirement declared in mirrord/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p notify` and commit the updated REDACTED.
  • Outdated: process-wrap — `process-wrap` is locked at 10.0.0 but 10.0.1 is the current stable release on crates.io, and it already satisfies the `"10.0.0"` requirement declared in mirrord/up/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p process-wrap` and commit the updated REDACTED.
  • Outdated: prost — `prost` is locked at 0.14.4 but 0.14.6 is the current stable release on crates.io, and it already satisfies the `"0.14"` requirement declared in mirrord/config/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p prost` and commit the updated REDACTED.
  • Outdated: rand — `rand` is locked at 0.10.2 but 0.10.3 is the current stable release on crates.io, and it already satisfies the `"0.10"` requirement declared in tests/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rand` and commit the updated REDACTED.
  • Outdated: reqwest — `reqwest` is locked at 0.13.4 but 0.13.5 is the current stable release on crates.io, and it already satisfies the `"0.13"` requirement declared in tests/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p reqwest` and commit the updated REDACTED.
  • Outdated: rmcp — `rmcp` is locked at 3.9.0 but 3.10.0 is the current stable release on crates.io, and it already satisfies the `"3.5"` requirement declared in mirrord/mcp/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rmcp` and commit the updated REDACTED.
  • Outdated: rust-embed — `rust-embed` is locked at 8.12.0 but 8.14.0 is the current stable release on crates.io, and it already satisfies the `"8"` requirement declared in mirrord/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rust-embed` and commit the updated REDACTED.
  • Outdated: schemars — `schemars` is locked at 1.2.2 but 1.2.3 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in mirrord/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p schemars` and commit the updated REDACTED.
  • + 12 more in this group — see findings.md.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-1dd82f32c5c34c12b778f231c9ffafa8/history.json --exit-code 0 --source .2artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-1dd82f32c5c34c12b778f231c9ffafa8/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .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/** .11artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .33artifacts/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/** .0artifacts/raw/trivy-fs.json

Run 01a1db79-736e-7b2e-abf9-ee219ce8526a · 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