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

NVIDIA/OpenShell

Measured 27 October 2026, 08:55 UTC, at code version e5adf6f

No regression since the last survey Code coverage: not measured

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

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

CAI score 71out of 100 Strong
CriticalWeakAdequateStrongExemplary
Down 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 very large codebase: 565,952 lines of product code in 41 projects, tests not counted · Estimated rebuild effort: about 5.6 person-years · Weakest lens: Production Readiness, 64

Findings by how serious they are

38 critical 1742 serious 113 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 08:55 UTC

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

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

95of 95 dimensions measured by tools.
1860of 1893 findings point to an exact file and line, so you can open each one in the code. The other 33 concern the repository as a whole, such as missing documentation.
95dimensions across 9 lenses, read from 565,952 lines of product code in 41 projects.
Chapters

Executive summary

NVIDIA/OpenShell meets our standard for a preview release. It scores 71 out of 100 and is rated Strong, and 28 of its 38 critical findings are security problems.

Every lens scores high enough to be rated Strong, so no single lens holds the score back. The best first step for the work it takes is making the tests check their results, worth about 4 points. Protecting outgoing calls with timeouts comes next, worth about 5 points.

Nine weaknesses in the code could be used by an attacker. Seven secrets can leak from the build pipeline, and seven settings leave the servers or containers unsafe. Fixing the weaknesses the scanner points to, limiting each secret to its own step and correcting the unsafe settings would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once, and the three pipeline steps that run downloads without checking them need each download checked against a known checksum first. Saving the change and the message together would take care of the six places where data is saved and a message sent separately.

The product code is 565,952 lines, about €820,000 to rebuild.

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

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

Every lens already scores high enough to be rated Strong, so no single lens holds the score back.

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

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

  • Cyclomatic Complexity · ConfigRuntime::reconcile (cyclomatic 51) crates/openshell-supervisor/src/config_runtime.rs
  • Cyclomatic Complexity · openshell_supervisor::run_sandbox_instance (cyclomatic 47) crates/openshell-supervisor/src/lib.rs
  • Cyclomatic Complexity · openshell_supervisor::shared_host::run_stream (cyclomatic 35) crates/openshell-supervisor/src/shared_host.rs
  • Cyclomatic Complexity · ComputeRuntime::start_sandbox_with_intent (cyclomatic 27) crates/openshell-server/src/compute/mod.rs
  • Cyclomatic Complexity · openshell_supervisor::config_runtime::run_policy_poll_loop_with_client (cyclomatic 27) crates/openshell-supervisor/src/config_runtime.rs
  • Cyclomatic Complexity · select-release-candidate.select_candidate (cyclomatic 25) tasks/scripts/select-release-candidate.py
  • Cyclomatic Complexity · gateway.validateGatewayName (cyclomatic 25) sdk/go/openshell/v1/gateway/paths.go
  • Cyclomatic Complexity · ComputeRuntime::create_sandbox_with_runtime_inputs_and_guards (cyclomatic 24) crates/openshell-server/src/compute/mod.rs
  • Cyclomatic Complexity · SupervisorPool::transition_admitting (cyclomatic 23) crates/openshell-server/src/supervisor_pool.rs
  • Cyclomatic Complexity · openshell_sandbox_backend::sandbox_auth::plan_attach (cyclomatic 20) crates/openshell-sandbox-backend/src/sandbox_auth.rs
  • Cyclomatic Complexity · openshell_crypto::pki::issuer::issuer_from_der (cyclomatic 19) crates/openshell-crypto/src/pki/issuer.rs
  • Cyclomatic Complexity · KubernetesComputeDriver::start_sandbox_runtime_generation (cyclomatic 19) crates/openshell-driver-kubernetes/src/driver.rs
  • Cyclomatic Complexity · SupervisorHostController::run_session (cyclomatic 19) crates/openshell-supervisor-control/src/controller.rs
  • Cyclomatic Complexity · SshHandler::subsystem_request (cyclomatic 19) crates/openshell-supervisor-process/src/ssh.rs
  • Cyclomatic Complexity · openshell_sandbox_backend::stream_adapter::send (cyclomatic 18) crates/openshell-sandbox-backend/src/stream_adapter.rs
  • Cyclomatic Complexity · openshell_server::grpc::policy::endpoint_status::handle_report_endpoint_status_inner (cyclomatic 18) crates/openshell-server/src/grpc/policy/endpoint_status.rs
  • Cyclomatic Complexity · ConfigRuntime::apply_delivered_sandbox (cyclomatic 18) crates/openshell-supervisor/src/config_runtime.rs
  • Cyclomatic Complexity · SshHandler::start_exec_spec (cyclomatic 18) crates/openshell-supervisor-process/src/ssh.rs
  • Cyclomatic Complexity · openshell_core::grpc_client::refresh_token_loop (cyclomatic 17) crates/openshell-core/src/grpc_client.rs
  • Cyclomatic Complexity · openshell_server::grpc::policy::build_provider_environment_snapshot_from_inputs (cyclomatic 17) crates/openshell-server/src/grpc/policy.rs
  • Cyclomatic Complexity · openshell_server::supervisor_session::accept_supervisor_session (cyclomatic 17) crates/openshell-server/src/supervisor_session.rs
  • Cyclomatic Complexity · openshell_cli::ssh::upload::transfer (cyclomatic 16) crates/openshell-cli/src/ssh/upload.rs
  • Cyclomatic Complexity · openshell_driver_vm::runtime::run_libkrun_vm (cyclomatic 16) crates/openshell-driver-vm/src/runtime.rs
  • Cognitive Complexity · ConfigRuntime::reconcile (cognitive 83) crates/openshell-supervisor/src/config_runtime.rs
  • Cognitive Complexity · openshell_supervisor::run_sandbox_instance (cognitive 67) crates/openshell-supervisor/src/lib.rs
  • Cognitive Complexity · openshell_supervisor::shared_host::run_stream (cognitive 65) crates/openshell-supervisor/src/shared_host.rs
  • Cognitive Complexity · openshell_supervisor::config_runtime::run_policy_poll_loop_with_client (cognitive 57) crates/openshell-supervisor/src/config_runtime.rs
  • Cognitive Complexity · select-release-candidate.select_candidate (cognitive 49) tasks/scripts/select-release-candidate.py
  • Cognitive Complexity · ComputeRuntime::start_sandbox_with_intent (cognitive 42) crates/openshell-server/src/compute/mod.rs
  • Cognitive Complexity · SupervisorPool::transition_admitting (cognitive 39) crates/openshell-server/src/supervisor_pool.rs
  • Cognitive Complexity · openshell_server::grpc::policy::build_provider_environment_snapshot_from_inputs (cognitive 30) crates/openshell-server/src/grpc/policy.rs
  • Cognitive Complexity · SupervisorHostController::run_session (cognitive 30) crates/openshell-supervisor-control/src/controller.rs
  • Cognitive Complexity · openshell_supervisor_control::credential::deliver_credentials (cognitive 29) crates/openshell-supervisor-control/src/credential.rs
  • Cognitive Complexity · openshell_sandbox_backend::sandbox_auth::plan_attach (cognitive 27) crates/openshell-sandbox-backend/src/sandbox_auth.rs
  • Cognitive Complexity · ComputeRuntime::create_sandbox_with_runtime_inputs_and_guards (cognitive 26) crates/openshell-server/src/compute/mod.rs
  • Cognitive Complexity · ConfigRuntime::apply_delivered_sandbox (cognitive 26) crates/openshell-supervisor/src/config_runtime.rs
  • Cognitive Complexity · SshHandler::start_exec_spec (cognitive 26) crates/openshell-supervisor-process/src/ssh.rs
  • Cognitive Complexity · openshell_cli::ssh::upload::transfer (cognitive 24) crates/openshell-cli/src/ssh/upload.rs
  • Cognitive Complexity · openshell_crypto::pki::issuer::issuer_from_der (cognitive 24) crates/openshell-crypto/src/pki/issuer.rs
  • Cognitive Complexity · openshell_server::config_delivery::task::run (cognitive 24) crates/openshell-server/src/config_delivery/task.rs
  • Cognitive Complexity · openshell_sandbox::boundary_server::linux::run_routed_runtime_control (cognitive 23) crates/openshell-sandbox/src/boundary_server.rs
  • Cognitive Complexity · openshell_server::auth::sandbox_session::advance_identity_for_takeover (cognitive 23) crates/openshell-server/src/auth/sandbox_session.rs
  • Cognitive Complexity · openshell_sandbox::boundary_server::linux::bridge_grpc_server_stream (cognitive 21) crates/openshell-sandbox/src/boundary_server.rs
  • Cognitive Complexity · openshell_server::supervisor_session::accept_supervisor_session (cognitive 21) crates/openshell-server/src/supervisor_session.rs
  • Cognitive Complexity · openshell_supervisor::sandbox_instance_host::run_hosted_sandbox_instance (cognitive 21) crates/openshell-supervisor/src/sandbox_instance_host.rs
  • Cognitive Complexity · ComputeRuntime::recover_failed_lifecycle (cognitive 20) crates/openshell-server/src/compute/mod.rs
  • Cognitive Complexity · openshell_server::supervisor_session::handle_connect_supervisor (cognitive 20) crates/openshell-server/src/supervisor_session.rs
  • Cognitive Complexity · openshell_server::grpc::policy::build_sandbox_config_snapshot_from_inputs (cognitive 18) crates/openshell-server/src/grpc/policy.rs
  • Cognitive Complexity · gateway.validateGatewayName (cognitive 18) sdk/go/openshell/v1/gateway/paths.go
  • Cognitive Complexity · ExportWorker::run (cognitive 17) crates/openshell-otel/src/ocsf.rs
  • Cognitive Complexity · openshell_sandbox::boundary_server::linux::validate_config (cognitive 17) crates/openshell-sandbox/src/boundary_server.rs
  • Cognitive Complexity · openshell_sandbox_backend::stream_adapter::send (cognitive 17) crates/openshell-sandbox-backend/src/stream_adapter.rs
  • Cognitive Complexity · openshell_server::grpc::policy::record_policy_apply_result (cognitive 17) crates/openshell-server/src/grpc/policy.rs
  • Cognitive Complexity · openshell_driver_vm::driver::validate_vm_driver_mounts (cognitive 16) crates/openshell-driver-vm/src/driver.rs
  • Cognitive Complexity · openshell_sandbox_backend::runtime_initiated::accept_loop (cognitive 16) crates/openshell-sandbox-backend/src/runtime_initiated.rs
  • Cognitive Complexity · SupervisorPool::reconcile_once (cognitive 16) crates/openshell-server/src/supervisor_pool.rs
  • Cognitive Complexity · codex_compatibility_report.write_report (cognitive 16) tasks/scripts/codex_compatibility_report.py
  • God Classes · FunctionTooLong: openshell_supervisor::run_sandbox_instance crates/openshell-supervisor/src/lib.rs
  • God Classes · MethodTooLong: ConfigRuntime.reconcile crates/openshell-supervisor/src/config_runtime.rs
  • God Classes · FileTooLong: src/supervisor_pool.rs crates/openshell-server/src/supervisor_pool.rs
  • God Classes · FileTooLong: src/config_runtime.rs crates/openshell-supervisor/src/config_runtime.rs
  • God Classes · FunctionTooLong: openshell_server::supervisor_session::accept_supervisor_session crates/openshell-server/src/supervisor_session.rs
  • God Classes · MethodTooLong: ComputeRuntime.create_sandbox_with_runtime_inputs_and_guards crates/openshell-server/src/compute/mod.rs
  • God Classes · FileTooLong: src/shared_host.rs crates/openshell-supervisor/src/shared_host.rs
  • God Classes · TooManyMethods: SupervisorPool crates/openshell-server/src/supervisor_pool.rs
  • God Classes · ClassTooLong: ConfigRuntime crates/openshell-supervisor/src/config_runtime.rs
  • God Classes · MethodTooLong: ComputeRuntime.start_sandbox_with_intent crates/openshell-server/src/compute/mod.rs
  • God Classes · FileTooLong: src/controller.rs crates/openshell-supervisor-control/src/controller.rs
  • God Classes · FunctionTooLong: openshell_server::grpc::policy::build_sandbox_config_snapshot_from_inputs crates/openshell-server/src/grpc/policy.rs
  • God Classes · FunctionTooLong: openshell_supervisor::config_runtime::run_policy_poll_loop_with_client crates/openshell-supervisor/src/config_runtime.rs
  • God Classes · FunctionTooLong: openshell_server::grpc::policy::build_provider_environment_snapshot_from_inputs crates/openshell-server/src/grpc/policy.rs
  • God Classes · ClassTooLong: SupervisorHostController crates/openshell-supervisor-control/src/controller.rs
  • God Classes · FunctionTooLong: openshell_server::grpc::provider::exchange_provider_subject_token_inner crates/openshell-server/src/grpc/provider.rs
  • God Classes · TooManyFields: Args crates/openshell-supervisor/src/main.rs
  • God Classes · FunctionTooLong: openshell_server::build_compute_runtime crates/openshell-server/src/lib.rs
  • God Classes · MethodTooLong: ConfigRuntime.apply_delivered_sandbox crates/openshell-supervisor/src/config_runtime.rs
  • God Classes · FileTooLong: src/config_file.rs crates/openshell-server/src/config_file.rs
  • God Classes · FileTooLong: src/protobuf.rs crates/openshell-sandbox-backend/src/protobuf.rs
  • God Classes · FileTooLong: config_delivery/session.rs crates/openshell-server/src/config_delivery/session.rs
  • God Classes · MethodTooLong: KubernetesSandboxRuntimeBoundarySpec.provision crates/openshell-driver-kubernetes/src/isolation.rs
  • God Classes · FileTooLong: src/config.rs crates/openshell-driver-kubernetes/src/config.rs
  • God Classes · MethodTooLong: ComputeRuntime.set_supervisor_session_state_from_snapshot crates/openshell-server/src/compute/mod.rs
  • God Classes · MethodTooLong: AuthGrpcRouter.call crates/openshell-server/src/multiplex.rs
  • God Classes · MethodTooLong: VmDriver.ensure_cached_registry_rootfs_image crates/openshell-driver-vm/src/driver.rs
  • God Classes · FileTooLong: src/provider_profile_sources.rs crates/openshell-server/src/provider_profile_sources.rs
  • God Classes · FunctionTooLong: openshell_supervisor_process::supervisor_session::run_single_session crates/openshell-supervisor-process/src/supervisor_session.rs
  • God Classes · TooManyMethods: SandboxClient python/openshell/sandbox.py
  • God Classes · TooManyMethods: SupervisorHostController crates/openshell-supervisor-control/src/controller.rs
  • God Classes · FunctionTooLong: openshell_driver_docker::stage_docker_supervisor_bundle crates/openshell-driver-docker/src/lib.rs
  • God Classes · TooManyFields: RunArgs crates/openshell-server/src/cli.rs
  • God Classes · TooManyFields: GatewayFileSection crates/openshell-server/src/config_file.rs
  • God Classes · FunctionTooLong: openshell_supervisor::shared::run_platform crates/openshell-supervisor/src/shared.rs
  • God Classes · FileTooLong: config_delivery/mod.rs crates/openshell-server/src/config_delivery/mod.rs
  • God Classes · FileTooLong: src/main.rs crates/openshell-driver-vm/src/main.rs
  • God Classes · FunctionTooLong: openshell_server::gateway_metrics::describe_and_initialize crates/openshell-server/src/gateway_metrics.rs
  • God Classes · FileTooLong: src/sandbox_instance_host.rs crates/openshell-supervisor/src/sandbox_instance_host.rs
  • God Classes · FileTooLong: src/main.rs crates/openshell-supervisor/src/main.rs
  • God Classes · FunctionTooLong: openshell_driver_podman::container::build_env crates/openshell-driver-podman/src/container.rs
  • God Classes · MethodTooLong: PodmanComputeDriver.start_sandbox crates/openshell-driver-podman/src/driver.rs
  • Code Duplication · Near-duplicate member pair (54 shared lines) crates/openshell-server/src/grpc/sandbox.rs

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

Fixed since the last survey: 161 findings

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

  • Cyclomatic Complexity · openshell_supervisor::run_policy_poll_loop_with_client (cyclomatic 69) crates/openshell-supervisor/src/lib.rs
  • Cyclomatic Complexity · openshell_supervisor::run_sandbox_with_backend (cyclomatic 36) crates/openshell-supervisor/src/lib.rs
  • Cyclomatic Complexity · ComputeRuntime::start_sandbox_authenticated (cyclomatic 22) crates/openshell-server/src/compute/mod.rs
  • Cyclomatic Complexity · ComputeRuntime::create_sandbox_authenticated_with_guards (cyclomatic 21) crates/openshell-server/src/compute/mod.rs
  • Cyclomatic Complexity · BoundaryRuntime::dispatch (cyclomatic 18) crates/openshell-sandbox/src/boundary_server.rs
  • Cyclomatic Complexity · openshell_server::grpc::policy::load_sandbox_config (cyclomatic 17) crates/openshell-server/src/grpc/policy.rs
  • Cyclomatic Complexity · MainSession::start_io (cyclomatic 17) crates/openshell-supervisor-process/src/main_session.rs
  • Cyclomatic Complexity · openshell_server::grpc::sandbox::handle_create_sandbox_inner (cyclomatic 16) crates/openshell-server/src/grpc/sandbox.rs
  • Cyclomatic Complexity · ControlReadiness::start (cyclomatic 16) crates/openshell-supervisor/src/lib.rs
  • Cyclomatic Complexity · SshHandler::signal (cyclomatic 16) crates/openshell-supervisor-process/src/ssh.rs
  • Cognitive Complexity · openshell_supervisor::run_policy_poll_loop_with_client (cognitive 152) crates/openshell-supervisor/src/lib.rs
  • Cognitive Complexity · openshell_supervisor::run_sandbox_with_backend (cognitive 52) crates/openshell-supervisor/src/lib.rs
  • Cognitive Complexity · MainSession::start_io (cognitive 37) crates/openshell-supervisor-process/src/main_session.rs
  • Cognitive Complexity · ComputeRuntime::start_sandbox_authenticated (cognitive 31) crates/openshell-server/src/compute/mod.rs
  • Cognitive Complexity · ComputeRuntime::create_sandbox_authenticated_with_guards (cognitive 23) crates/openshell-server/src/compute/mod.rs
  • Cognitive Complexity · openshell_server::grpc::policy::load_sandbox_provider_environment (cognitive 23) crates/openshell-server/src/grpc/policy.rs
  • Cognitive Complexity · openshell_server_macros::expand (cognitive 23) crates/openshell-server-macros/src/lib.rs
  • Cognitive Complexity · openshell_server::grpc::policy::load_sandbox_config (cognitive 22) crates/openshell-server/src/grpc/policy.rs
  • Cognitive Complexity · ReachabilityModel::encode_credentials (cognitive 21) crates/openshell-prover/src/model.rs
  • Cognitive Complexity · RpcAuth::parse (cognitive 21) crates/openshell-server-macros/src/lib.rs
  • God Classes · FunctionTooLong: openshell_supervisor::run_policy_poll_loop_with_client crates/openshell-supervisor/src/lib.rs
  • God Classes · FunctionTooLong: openshell_supervisor::run_sandbox_with_backend crates/openshell-supervisor/src/lib.rs
  • God Classes · MethodTooLong: KubernetesComputeDriver.create_sandbox_runtime_companions crates/openshell-driver-kubernetes/src/driver.rs
  • God Classes · FunctionTooLong: openshell_server::grpc::policy::load_sandbox_config crates/openshell-server/src/grpc/policy.rs
  • God Classes · MethodTooLong: ComputeRuntime.create_sandbox_authenticated_with_guards crates/openshell-server/src/compute/mod.rs
  • God Classes · FunctionTooLong: openshell_server::grpc::policy::load_sandbox_provider_environment crates/openshell-server/src/grpc/policy.rs
  • God Classes · MethodTooLong: ComputeRuntime.start_sandbox_authenticated crates/openshell-server/src/compute/mod.rs
  • God Classes · FunctionTooLong: openshell_server::grpc::provider::handle_exchange_provider_subject_token crates/openshell-server/src/grpc/provider.rs
  • God Classes · MethodTooLong: VmDriver.ensure_cached_bootstrap_rootfs_image crates/openshell-driver-vm/src/driver.rs
  • Code Duplication · Near-duplicate member pair (134 shared lines) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Near-duplicate member pair (59 shared lines) crates/openshell-server/src/grpc/sandbox.rs
  • Code Duplication · Near-duplicate member pair (52 shared lines) crates/openshell-sandbox/src/main_session.rs
  • Code Duplication · Near-duplicate member pair (40 shared lines) crates/openshell-server/src/compute/mod.rs
  • Code Duplication · Near-duplicate member pair (35 shared lines) crates/openshell-cli/src/commands/provider.rs
  • Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) crates/openshell-server/src/compute/mod.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) crates/openshell-server/src/grpc/policy.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) crates/openshell-server/src/grpc/sandbox.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/openshell-sandbox/src/boundary_server.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/openshell-sdk/src/client.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/openshell-supervisor-network/src/l7/relay.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) sdk/go/openshell/v1/fake/sandbox.go
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) sdk/go/openshell/v1/internal/converter/provider.go
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openshell-ocsf/src/events/api_activity.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openshell-sandbox/src/boundary_server.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openshell-server/src/grpc/provider.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) sdk/go/openshell/v1/fake/config.go
  • Code Duplication · Duplicated block (76–77 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs
  • Code Duplication · Duplicated block (26 lines × 2) crates/openshell-cli/src/edge_tunnel.rs
  • Code Duplication · Duplicated block (25 lines × 2) crates/openshell-cli/src/edge_tunnel.rs
  • Code Duplication · Duplicated block (23–24 lines × 2) crates/openshell-cli/src/edge_tunnel.rs
  • Code Duplication · Duplicated block (24 lines × 2) crates/openshell-server/src/grpc/policy.rs
  • Code Duplication · Duplicated block (24 lines × 2) crates/openshell-server/src/grpc/policy.rs
  • Code Duplication · Duplicated block (23 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Duplicated block (20–22 lines × 2) crates/openshell-sandbox-backend/src/runtime.rs
  • Code Duplication · Duplicated block (22 lines × 2) crates/openshell-sandbox/src/main_session.rs
  • Code Duplication · Duplicated block (21 lines × 2) crates/openshell-cli/src/edge_tunnel.rs
  • Code Duplication · Duplicated block (19–21 lines × 2) crates/openshell-server/src/compute/mod.rs
  • Code Duplication · Duplicated block (20 lines × 2) crates/openshell-cli/src/edge_tunnel.rs
  • Code Duplication · Duplicated block (20 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Duplicated block (20 lines × 2) crates/openshell-providers/src/profiles.rs
  • Code Duplication · Duplicated block (19 lines × 2) crates/openshell-cli/src/edge_tunnel.rs
  • Code Duplication · Duplicated block (19 lines × 2) crates/openshell-server/src/compute/mod.rs
  • Code Duplication · Duplicated block (17–18 lines × 3) crates/openshell-cli/src/edge_tunnel.rs
  • Code Duplication · Duplicated block (18 lines × 2) crates/openshell-driver-vm/src/driver.rs
  • Code Duplication · Duplicated block (16 lines × 2) crates/openshell-cli/src/commands/provider.rs
  • Code Duplication · Duplicated block (16 lines × 2) crates/openshell-prover/src/model.rs
  • Code Duplication · Duplicated block (13–15 lines × 2) crates/openshell-driver-docker/src/isolation.rs
  • Code Duplication · Duplicated block (15 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Duplicated block (13–15 lines × 2) crates/openshell-driver-vm/src/driver.rs
  • Code Duplication · Duplicated block (15 lines × 2) crates/openshell-sandbox/src/main_session.rs
  • Code Duplication · Duplicated block (14 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Duplicated block (14 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Duplicated block (14 lines × 2) crates/openshell-server/src/grpc/sandbox.rs
  • Code Duplication · Duplicated block (11–14 lines × 2) crates/openshell-server/src/grpc/service.rs
  • Code Duplication · Duplicated block (13 lines × 4) crates/openshell-server/src/grpc/provider.rs
  • Code Duplication · Duplicated block (13 lines × 2) crates/openshell-sandbox/src/main_session.rs
  • Code Duplication · Duplicated block (12 lines × 4) crates/openshell-server/src/grpc/policy.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/openshell-cli/src/commands/provider.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/openshell-sandbox/src/main_session.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/openshell-server/src/compute/mod.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/openshell-server/src/grpc/policy/endpoint_status.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/openshell-supervisor-network/src/proxy.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/openshell-sandbox/src/boundary_server.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/openshell-server/src/grpc/provider.rs
  • Code Duplication · Duplicated block (10 lines × 8) crates/openshell-server/src/grpc/provider.rs
  • Code Duplication · Duplicated block (10 lines × 6) crates/openshell-server/src/grpc/sandbox.rs
  • Code Duplication · Duplicated block (9–10 lines × 5) crates/openshell-server/src/grpc/policy.rs
  • Code Duplication · Duplicated block (10 lines × 5) crates/openshell-server/src/grpc/policy.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs
  • Code Duplication · Duplicated block (9–10 lines × 2) crates/openshell-sandbox/src/boundary_server.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/openshell-sandbox/src/main_session.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/openshell-server/src/compute/mod.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/openshell-supervisor/src/lib.rs
  • Code Duplication · Duplicated block (9 lines × 5) crates/openshell-server/src/grpc/policy.rs
  • Code Duplication · Duplicated block (9 lines × 3) crates/openshell-server/src/compute/mod.rs
Rebuild cost: about €820,000 · Estimate
Cost to rebuild€270,000 to €1,400,000, for 4,548 to 14,429 hours of work, about 5.6 person-years for 3 to 11 engineers
Difficulty of the problemLow, 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×1.0 at a score of 71. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeVery large: 565,952 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with client.test.ts.
Raises the score by about 4 points · Low effort · Test Quality
2
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.
Raises the score by about 5 points · Medium effort · Outbound HTTP resilience
3
Keep a changelog (e.g.
Keep-a-Changelog) recording what shipped in each release.
Raises the score by about 3 points · Medium effort · Release Hygiene

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €820,000 to build again, about 5.6 person-years of work. Its weakest lens is Production Readiness, at 64 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No assertions (empty test) finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 Test Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.9 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 3% to 6% on every change. The history of the code shows how much it changes: about 798,751 lines over the last 90 days, which is about 3,239,379 lines a year. At that pace, the extra work comes to an estimated 218.1 to 1308.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch openshell-bootstrap openshell-bootstrap openshell-core openshell-core openshell-bootstrap->openshell-core openshell-crypto openshell-crypto openshell-bootstrap->openshell-crypto openshell-cli openshell-cli openshell-cli->openshell-bootstrap openshell-cli->openshell-core openshell-cli->openshell-crypto openshell-policy openshell-policy openshell-cli->openshell-policy openshell-core->openshell-crypto openshell-otel openshell-otel openshell-core->openshell-otel openshell-driver-docker openshell-driver-docker openshell-driver-docker->openshell-core openshell-isolation-interface openshell-isolation-interface openshell-driver-docker->openshell-isolation-interface openshell-driver-docker->openshell-otel openshell-sandbox-backend openshell-sandbox-backend openshell-driver-docker->openshell-sandbox-backend openshell-driver-kubernetes openshell-driver-kubernetes openshell-driver-kubernetes->openshell-core openshell-driver-kubernetes->openshell-crypto openshell-driver-kubernetes->openshell-isolation-interface openshell-driver-kubernetes->openshell-otel openshell-driver-kubernetes->openshell-policy openshell-driver-kubernetes->openshell-sandbox-backend openshell-supervisor-control openshell-supervisor-control openshell-driver-kubernetes->openshell-supervisor-control openshell-driver-mxc openshell-driver-mxc openshell-driver-mxc->openshell-core openshell-ocsf openshell-ocsf openshell-driver-mxc->openshell-ocsf openshell-driver-mxc->openshell-policy openshell-supervisor-network openshell-supervisor-network openshell-driver-mxc->openshell-supervisor-network openshell-driver-podman openshell-driver-podman openshell-driver-podman->openshell-core openshell-driver-podman->openshell-isolation-interface openshell-driver-podman->openshell-otel openshell-driver-podman->openshell-sandbox-backend openshell-driver-vm openshell-driver-vm openshell-driver-vm->openshell-core openshell-driver-vm->openshell-crypto openshell-driver-vm->openshell-driver-podman openshell-driver-vm->openshell-isolation-interface openshell-driver-vm->openshell-otel openshell-driver-vm->openshell-policy openshell-driver-vm->openshell-sandbox-backend openshell-gateway openshell-gateway openshell-gateway->openshell-core openshell-gateway->openshell-driver-docker openshell-gateway->openshell-driver-kubernetes openshell-gateway->openshell-driver-mxc openshell-gateway->openshell-driver-podman openshell-gateway->openshell-otel openshell-gateway->openshell-policy openshell-server openshell-server openshell-gateway->openshell-server openshell-isolation-interface->openshell-core openshell-otel->openshell-ocsf openshell-policy->openshell-core openshell-sandbox openshell-sandbox openshell-sandbox->openshell-core openshell-sandbox->openshell-crypto openshell-sandbox->openshell-isolation-interface openshell-sandbox->openshell-ocsf openshell-sandbox->openshell-policy openshell-sandbox->openshell-sandbox-backend openshell-sandbox-backend->openshell-core openshell-sandbox-backend->openshell-crypto openshell-sandbox-backend->openshell-isolation-interface openshell-server->openshell-bootstrap openshell-server->openshell-core openshell-server->openshell-crypto openshell-server->openshell-ocsf openshell-server->openshell-otel openshell-server->openshell-policy openshell-server->openshell-supervisor-control openshell-supervisor openshell-supervisor openshell-supervisor->openshell-core openshell-supervisor->openshell-crypto openshell-supervisor->openshell-isolation-interface openshell-supervisor->openshell-ocsf openshell-supervisor->openshell-otel openshell-supervisor->openshell-policy openshell-supervisor->openshell-sandbox-backend openshell-supervisor->openshell-supervisor-control openshell-supervisor->openshell-supervisor-network openshell-supervisor-control->openshell-core openshell-supervisor-control->openshell-otel openshell-supervisor-control->openshell-sandbox-backend openshell-supervisor-network->openshell-core openshell-supervisor-network->openshell-crypto openshell-supervisor-network->openshell-isolation-interface openshell-supervisor-network->openshell-ocsf openshell-supervisor-network->openshell-policy openshell-supervisor-network->openshell-sandbox-backend __more__ +21 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.

528 modules, with 1450 dependencies between them. 11 loops run through 95 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 488 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 openshell_core.config2 openshell_core.jwt.session3 openshell_driver_vm.preparation4 openshell_ocsf.events.base_event5 openshell_ocsf.objects.endpoint6 openshell_supervisor_process.ssh.input7 openshell_isolation_interface.contract8 openshell_ocsf.builders9 openshell_ocsf.events10 openshell_server.auth.principal11 openshell_server.config_delivery.task12 openshell_sandbox_backend.boundary_protocol13 openshell_server.auth.audit14 openshell_core.policy15 openshell_sdk.types16 openshell_supervisor_middleware17 openshell_driver_kubernetes.driver18 openshell_supervisor_network.opa19 openshell_tui.app20 openshell_core.error21 openshell_conformance22 openshell_core.provider_credentials23 openshell_policy_schema24 openshell_server.persistence25 openshell_core.endpoint_status26 openshell_sandbox.boundary_server.linux27 openshell_sandbox_backend.runtime28 openshell_server.credentials29 openshell_server.multiplex30 openshell_server.supervisor_session31 openshell_server.compute32 openshell_supervisor33 openshell_supervisor_network.l734 openshell_core.grpc_client35 openshell_server36 openshell_supervisor_network.l7.rest37 openshell_server.grpc.provider38 openshell_supervisor_network.l7.relay39 openshell_server.grpc.policy40 openshell_supervisor_network.proxy
1 openshell_core.config
2 openshell_core.jwt.session
3 openshell_driver_vm.preparation
4 openshell_ocsf.events.base_event
5 openshell_ocsf.objects.endpoint
6 openshell_supervisor_process.ssh.input
7 openshell_isolation_interface.contract512
8 openshell_ocsf.builders11
9 openshell_ocsf.events1
10 openshell_server.auth.principal1
11 openshell_server.config_delivery.task1
12 openshell_sandbox_backend.boundary_protocol22103
13 openshell_server.auth.audit11121
14 openshell_core.policy3
15 openshell_sdk.types1
16 openshell_supervisor_middleware1311
17 openshell_driver_kubernetes.driver1221121
18 openshell_supervisor_network.opa163
19 openshell_tui.app11
20 openshell_core.error1
21 openshell_conformance1
22 openshell_core.provider_credentials1
23 openshell_policy_schema41
24 openshell_server.persistence1
25 openshell_core.endpoint_status11
26 openshell_sandbox.boundary_server.linux223423221
27 openshell_sandbox_backend.runtime71313115214
28 openshell_server.credentials2224
29 openshell_server.multiplex18211363
30 openshell_server.supervisor_session32121213
31 openshell_server.compute31228411
32 openshell_supervisor313235233312
33 openshell_supervisor_network.l71124
34 openshell_core.grpc_client162111
35 openshell_server3311121231
36 openshell_supervisor_network.l7.rest1331142
37 openshell_server.grpc.provider111211
38 openshell_supervisor_network.l7.relay11161363
39 openshell_server.grpc.policy11111116112
40 openshell_supervisor_network.proxy11221116124623
Uses a module listed above itPart of a loopThe module itself
1 openshell_core.config2 openshell_core.jwt.session3 openshell_driver_vm.preparation4 openshell_ocsf.events.base_event5 openshell_ocsf.objects.endpoint6 openshell_supervisor_process.ssh.input7 openshell_isolation_interface.contract8 openshell_ocsf.builders9 openshell_ocsf.events10 openshell_server.auth.principal11 openshell_server.config_delivery.task12 openshell_sandbox_backend.boundary_protocol13 openshell_server.auth.audit14 openshell_core.policy15 openshell_sdk.types16 openshell_supervisor_middleware17 openshell_driver_kubernetes.driver18 openshell_supervisor_network.opa19 openshell_tui.app20 openshell_core.error21 openshell_conformance22 openshell_core.provider_credentials23 openshell_policy_schema24 openshell_server.persistence25 openshell_core.endpoint_status26 openshell_sandbox.boundary_server.linux27 openshell_sandbox_backend.runtime28 openshell_server.credentials29 openshell_server.multiplex30 openshell_server.supervisor_session31 openshell_server.compute32 openshell_supervisor33 openshell_supervisor_network.l734 openshell_core.grpc_client35 openshell_server36 openshell_supervisor_network.l7.rest37 openshell_server.grpc.provider38 openshell_supervisor_network.l7.relay39 openshell_server.grpc.policy40 openshell_supervisor_network.proxyopenshell_core.config1openshell_core.jwt.session2openshell_driver_vm.preparation3openshell_ocsf.events.base_event4openshell_ocsf.objects.endpoint5openshell_supervisor_process.ssh.input6openshell_isolation_interface.contract7openshell_ocsf.builders8openshell_ocsf.events9openshell_server.auth.principal10openshell_server.config_delivery.task11openshell_sandbox_backend.boundary_protocol12openshell_server.auth.audit13openshell_core.policy14openshell_sdk.types15openshell_supervisor_middleware16openshell_driver_kubernetes.driver17openshell_supervisor_network.opa18openshell_tui.app19openshell_core.error20openshell_conformance21openshell_core.provider_credentials22openshell_policy_schema23openshell_server.persistence24openshell_core.endpoint_status25openshell_sandbox.boundary_server.linux26openshell_sandbox_backend.runtime27openshell_server.credentials28openshell_server.multiplex29openshell_server.supervisor_session30openshell_server.compute31openshell_supervisor32openshell_supervisor_network.l733openshell_core.grpc_client34openshell_server35openshell_supervisor_network.l7.rest36openshell_server.grpc.provider37openshell_supervisor_network.l7.relay38openshell_server.grpc.policy39openshell_supervisor_network.proxy4051211111221031112131131112211211631111141111223423221713131152142224182113633212121331228411313235233312112416211133111212311331142111211111613631111111611211221116124623+488 more modules (most-connected shown)

At a glance — Code Health · 73% · Adequate · gated by D2 ·

At a glance — Architecture · 94% · Exemplary ·

At a glance — Maturity · 89% · Exemplary ·

At a glance — Readiness · 64% · Adequate · gated by P7 ·

At a glance — Security · 76% · Adequate · gated by D29 ·

At a glance — Event-Driven · 80% · Strong ·

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

At a glance — Accessibility · 80% · Strong ·

At a glance — Performance · 81% · Strong ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures35Medium
A05:2025 — Injection28High / Critical
A02:2025 — Security Misconfiguration14High / Critical
A07:2025 — Authentication Failures2High / Critical

Roadmap

First, harden outbound HTTP resilience by enforcing request timeouts and adding retry logic with back-off to prevent unbounded calls. Next, improve test quality by addressing empty tests and maintain release hygiene by documenting changes in a changelog. Finally, ensure disaster recovery readiness by defining and testing restore procedures, and split large files into smaller, focused modules to improve maintainability.

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

Do thisHelpsEffortDimension
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with client.test.ts.+4.4 ptsLowTest Quality
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.+4.8 ptsMediumOutbound HTTP resilience
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+2.9 ptsMediumRelease Hygiene
Bring the 2 bodies over 240 down to 240 or less in Cognitive Complexity — start with openshell_providers::profiles::validate_profile_set (cognitive 504), openshell_supervisor_network::l7::validate_l7_policies (cognitive 266).+0.7 ptsMediumCognitive Complexity
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+1.2 ptsMediumDR & Backup
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml.+0.5 ptsLowPlatform End-of-Life
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+0.8 ptsMediumLarge Files
Resolve the 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (8).+0.4 ptsLowStatic Analysis (SAST)

File quality

Per-file score 0–10 — a quality signature. Of 309 files carrying findings, judged against the Preview bar: 1% slop · 5% mixed · 94% near-clean.

FileScoreBandWorst signal
REDACTED1.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.7MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
crates/openshell-supervisor-network/src/l7/rest.rs5.5MixedCyclomatic Complexity: openshell_supervisor_network::l7::rest::relay_http_request_with_response_middleware_guarded_observed (cyclomatic 39)
crates/openshell-sandbox/src/main_session.rs5.5MixedCyclomatic Complexity: MainSession::start_io (cyclomatic 19)
crates/openshell-core/src/config.rs5.5MixedCognitive Complexity: UpstreamProxyConfig::validate (cognitive 16)
crates/openshell-sdk/src/client.rs5.5MixedGod Classes: FileTooLong: src/client.rs
REDACTED5.8MixedDependency Vulnerabilities: Medium CVE: REDACTED
REDACTED5.8MixedIaC & Container Security: High IaC: REDACTED
crates/openshell-supervisor-network/src/proxy.rs6.0MixedExplicit Debt: TodoComment
crates/openshell-server/src/grpc/policy.rs6.0MixedExplicit Debt: TodoComment
crates/openshell-driver-kubernetes/src/driver.rs6.0MixedExplicit Debt: TodoComment
crates/openshell-core/src/grpc_client.rs6.0MixedExplicit Debt: TodoComment
crates/openshell-supervisor-network/src/policy_local.rs6.7MixedExplicit Debt: TodoComment
REDACTED6.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED6.9MixedDependency Vulnerabilities: Medium CVE: REDACTED
crates/openshell-providers/src/profiles.rs7.0Near-cleanCyclomatic Complexity: openshell_providers::profiles::validate_profile_set (cyclomatic 170)

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

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

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

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

Could not be resolved — 9

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

Methodology & how to trust this report

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

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

What we checked — 95 dimensions across the health lenses
D1D2D3D4D5D6D7D9D10D12D13D14D15D16D17D19D20D26D28D29D30D31D34D35D36D37D40D41D43D44AC1AC2AC5AC6AC7AX10AX3AX5AX6AX8AX9C2ED4ES1ES2M1M2M3M4P1P10P2P3P4P5P6P7P8PF1PF2PF3R1R10R2R3R4R5R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X26X27X28X29X3X30X4X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a17c92-729a-7d47-be85-036611b4c40f.

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

Run transparency — what happened this run

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

  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 152 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 325 test source file(s) (.rs, .py, .go) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability not scored — the JavaScript/TypeScript suite (vitest via `npm ci --ignore-scripts` in sdk/typescript/ (0 tests)) ran but surfaced no test cases to the runner, so flakiness couldn't be exercised.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D31 IaC & Container Security — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. E2e/mcp-conformance/Dockerfile.client.dockerignore carries no `FROM` instruction, so it declares no build stage and every REDACTED rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 149 of 150 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `sdk/go/openshell/v1/internal/options/options.go`, `sdk/go/openshell/v1/watch.go` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D41 Kernel & Syscall Confinement — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Deploy/helm/openshell/ci/values-autoscaling.yaml:9, deploy/helm/openshell/ci/values-high-availability.yaml:10, deploy/helm/openshell/templates/certgen.yaml:62, deploy/helm/openshell/templates/certgen.yaml:134, deploy/helm/openshell/templates/deployment.yaml:6, deploy/helm/openshell/templates/statefulset.yaml:6, deploy/helm/openshell/templates/supervisor.yaml:22, deploy/helm/openshell/values.yaml:23 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. User interface: 3 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. Boot: crawled PUBLIC routes only — add a Playwright storageState (e.g. playwright/.auth/user.json) or a test auth-setup to crawl authenticated screens rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:8080: page.goto: net::ERR_CONNECTION_RESET at http://127.0.0.1:8080/ Call log: - navigating to "http://127.0.0.1:8080/", waiting until "load" rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:8081: page.goto: net::ERR_CONNECTION_RESET at http://127.0.0.1:8081/ Call log: - navigating to "http://127.0.0.1:8081/", waiting until "load" .
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Go, Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Go, Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 12 further occurrence(s) are not listed individually; the score already reflects all 52.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
  • D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
  • 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 (REDACTED, 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.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

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

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

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

196 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was openshell_providers::profiles::validate_profile_set at 170. A further 15 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 DispositionId::label at 29 — they are counted neither in the figure above nor in this dimension's score. 8 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: crates/openshell-ocsf/src/enums/disposition.rs (DispositionId::label at 29), crates/openshell-driver-mxc/src/etw_consumer.rs (openshell_driver_mxc::etw_consumer::format_property_value at 22), crates/openshell-policy/src/merge.rs (PolicyMergeError::fmt at 22), crates/openshell-gateway-interceptors/src/runtime.rs (openshell_gateway_interceptors::runtime::grpc_code_from_name at 18), crates/openshell-otel/src/grpc.rs (openshell_otel::grpc::grpc_status_code_name at 17), and 3 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.

openshell_server::grpc::sandbox::handle_watch_sandbox (cyclomatic 86) · ×32crates/openshell-server/src/grpc/sandbox.rs:2033
openshell_supervisor_network::l7::validate_l7_policies (cyclomatic 96) · ×28crates/openshell-supervisor-network/src/l7/mod.rs:1236
openshell_cli::run_async (cyclomatic 138) · ×18crates/openshell-cli/src/main.rs:2635
App::handle_create_provider_key (cyclomatic 94) · ×10crates/openshell-tui/src/app.rs:2484
openshell_tui::run (cyclomatic 77) · ×8crates/openshell-tui/src/lib.rs:94

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

What to do

  1. Bring the 2 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with openshell_providers::profiles::validate_profile_set (cyclomatic 170), openshell_cli::run_async (cyclomatic 138). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 5.5 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity3.0 / 10Weak✓ Tool-verified

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

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

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

365 method(s) exceeded the cognitive complexity threshold of 15; the worst was openshell_providers::profiles::validate_profile_set at 504.

openshell_server::grpc::sandbox::handle_watch_sandbox (cognitive 219) · ×58crates/openshell-server/src/grpc/sandbox.rs:2033
openshell_supervisor_network::l7::validate_l7_policies (cognitive 266) · ×54crates/openshell-supervisor-network/src/l7/mod.rs:1236
openshell_cli::run_async (cognitive 179) · ×27crates/openshell-cli/src/main.rs:2635
openshell_tui::run (cognitive 164) · ×16crates/openshell-tui/src/lib.rs:94
openshell_sandbox::probe_socket_virtualization (cognitive 61) · ×12crates/openshell-sandbox/src/main.rs:348

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

What to do

  1. Bring the 2 bodies over 240 down to 240 or less in Cognitive Complexity — start with openshell_providers::profiles::validate_profile_set (cognitive 504), openshell_supervisor_network::l7::validate_l7_policies (cognitive 266). — 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 Cognitive Complexity from 3.0 to about 4.0/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

302 god class(es) detected.

FunctionTooLong: openshell_cli::run_async · ×102crates/openshell-cli/src/main.rs:2635
FileTooLong: src/driver.rs · ×100crates/openshell-driver-kubernetes/src/driver.rs
MethodTooLong: VmDriver.provision_sandbox_inner · ×49crates/openshell-driver-vm/src/driver.rs:1369
ClassTooLong: ComputeRuntime · ×24crates/openshell-server/src/compute/mod.rs:875
TooManyMethods: ComputeRuntime · ×15crates/openshell-server/src/compute/mod.rs:875

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

What to do

  1. Resolve the 102 FunctionTooLong finding(s) in God Classes — start with lib.rs (12), policy.rs (10), provider.rs (10). — One of this dimension's main actionable groups (102 warning-level).
  2. Resolve the 100 FileTooLong finding(s) in God Classes — start with lib.rs (10), mod.rs (6), driver.rs (4). — One of this dimension's main actionable groups (100 warning-level).
  3. Resolve the 49 MethodTooLong finding(s) in God Classes — start with driver.rs (15), app.rs (6), lib.rs (6). — One of this dimension's main actionable groups (49 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

665 duplicated block group(s) detected. A further 27 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 5 of the 692 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 (10 lines × 2) · ×49crates/openshell-binary-identity/src/lib.rs:267
Duplicated block (9 lines × 2) · ×49crates/openshell-cli/src/commands/common.rs:979
Duplicated block (8 lines × 2) · ×49crates/openshell-driver-kubernetes-secrets/src/lib.rs:586
Duplicated block (7 lines × 2) · ×42crates/openshell-cli/src/main.rs:3854
Duplicated block (6 lines × 2) · ×40crates/openshell-cli/src/run.rs:1756

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

What to do

  1. Resolve the 49 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with lib.rs (5), mod.rs (4), REDACTED (4). — One of this dimension's main actionable groups (49 warning-level).
  2. Resolve the 49 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with lib.rs (6), grpc.rs (3), process.rs (3). — One of this dimension's main actionable groups (49 warning-level).
  3. Resolve the 49 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with lib.rs (5), driver.rs (4), REDACTED (4). — One of this dimension's main actionable groups (49 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling7.5 / 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 7.5 / 10 · rule-coverage 100% · ceiling Prevented

41 production modules (Cargo+npm+Go), 0 dependency cycle(s), 3 unstable depended-on module(s). Read from the build's own module declarations; 9 module(s) off the main sequence, with abstractness counted on 40 of the 41 (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: openshell-extension-core · ×9
Unstable project openshell-driver-kubernetes
Unstable project openshell-server
Unstable project openshell-supervisor-network

What to do

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

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

D6 · Cohesion (LCOM4)9.8 / 10Stronggated by 5 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

5 of 392 classes have LCOM4 above 3.

Low cohesion: Config (LCOM4 19) · ×5crates/openshell-core/src/config.rs:216

What to do

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

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Classify ADR enforcement: Current Shape Appendix · ×9rfc/0005-sandbox-proxy-egress-adapter/current-shape.md

What to do

  1. Resolve the 9 Classify ADR enforcement finding(s) in Architectural Integrity — start with current-shape.md, implementation-plan.md, technical-design.md. — One of this dimension's main actionable groups (9 recommendation-level).
  2. Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D9 · Test Distribution9.6 / 10Exemplary✓ Tool-verified

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

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

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

10812 test methods: 10027 unit, 472 integration, 0 BDD, 313 e2e. The JavaScript/TypeScript suite contributes 152 `it`/`test` case(s) across 7 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 9135 `#[test]` function(s) across 566 file(s) declaring at least one; its unit/integration split is Cargo's own — 57 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 346 test function(s) across 31 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 1179 test case(s) across 83 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 0 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality9.8 / 10Adequategated by 1 critical finding✓ 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 9.8 / 10 · rule-coverage 100% · ceiling Prevented

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

No assertions (empty test): survives a forwarded socket that resets during the session-mint windowsdk/typescript/src/client.test.ts:2312

What to do

  1. Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with client.test.ts. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D12 · Dependency Hygiene9.8 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

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

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

Outdated: github.com/stretchr/testify · ×5

✓ On the Gold path — maintain.

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

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

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

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

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

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 812 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. This repository publishes itself under Apache-2.0, 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 a Python pyproject.toml/requirements.txt (pip/uv/Poetry), 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 74 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: crates/openshell-cli/src/run.rs (70×105=7350); crates/openshell-cli/src/main.rs (47×138=6486); crates/openshell-server/src/grpc/sandbox.rs (71×86=6106) Repeated repair below the complexity floor: crates/openshell-supervisor-network/src/policy_local.rs (10 of 17 changes were fixes); crates/openshell-core/src/secrets.rs (4 of 7 changes were fixes); crates/openshell-supervisor-network/src/identity.rs (3 of 4 changes were fixes)

Hotspot: crates/openshell-cli/src/run.rs · ×71crates/openshell-cli/src/run.rs:497
Repeated repair: crates/openshell-supervisor-network/src/policy_local.rs · ×3crates/openshell-supervisor-network/src/policy_local.rs:607

What to do

  1. Resolve the 71 Hotspot finding(s) in Churn × Complexity Hotspots — start with lib.rs (6), driver.rs (4), main.rs (3). — One of this dimension's main actionable groups (71 warning-level).
  2. Resolve the 3 Repeated repair finding(s) in Churn × Complexity Hotspots — start with policy_local.rs, secrets.rs, identity.rs. — One of this dimension's main actionable groups (3 warning-level).

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

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

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

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

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

26 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/openshell-supervisor-network/src/l7/jsonrpc.rs. Counted over 568 of the 702 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 · ×2
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt10.0 / 10Stronggated by 6 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

6 deducted task-comment markers across 565952 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 · ×6crates/openshell-supervisor-network/src/policy_local.rs:513

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

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

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

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

0 of 9 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question). How well each record argues its case is not measured.

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

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

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

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

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

4 of 41 build units (Cargo, Go, 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)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

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

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

D29 · Static Analysis (SAST)0.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

30 finding(s): 0 critical, 20 high, 5 medium, 5 low. semgrep hit a parse error in 64 file(s) — `crates/openshell-conformance/src/lib.rs` (line 326, line 937, line 962), `crates/openshell-core/src/grpc_client.rs` (line 618, lines 618–621, lines 622–623), `crates/openshell-driver-mxc/src/etw_consumer.rs` (line 622), `crates/openshell-driver-vm/scripts/openshell-vm-sandbox-init.sh` (line 572, line 577, line 583, …), `crates/openshell-driver-vm/src/preparation.rs` (line 309, line 521), … (+59 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 12 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

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

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

D30 · Dependency Vulnerabilities4.3 / 10Weak✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security7.0 7.0 / 10Adequate✓ 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 7.0 / 10 · rule-coverage 99% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness9.8 / 10Adequategated by 2 critical findings✓ 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.8 / 10 · rule-coverage 100% · ceiling Documented

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

Orphaned knowledge · ×2crates/openshell-vfio/src/pci.rs:1
Orphaned file · ×7fern/components/CustomFooter.tsx:1
Further orphaned files (smaller)

What to do

  1. Resolve the 2 Orphaned knowledge finding(s) in Knowledge Freshness — start with pci.rs, bind.rs. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 7 Orphaned file finding(s) in Knowledge Freshness — start with CustomFooter.tsx, sysfs.rs, gpu.rs. — One of this dimension's main actionable groups (7 recommendation-level).
  3. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.9 / 10Stronggated by 5 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.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: main.rs↔lib.rs 70%; config.rs↔main.rs 60%; lib.rs↔main.rs 59%

Change coupling: main.rs ↔ lib.rs · ×5crates/openshell-gateway/src/main.rs:1

What to do

  1. Resolve the 5 Change coupling finding(s) in Change Coupling — start with policy.rs (2), main.rs, config.rs. — One of this dimension's main actionable groups (5 warning-level).

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

D36 · Supply-chain Provenance & Signing10.0 / 10Stronggated by 3 serious findings✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

Build pipeline generates provenance, signs artifacts and produces an SBOM.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D40 · Network Egress Confinement10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.

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

Kubernetes workloads are covered by a network policy that restricts egress.

✓ On the Gold path — maintain.

Detailed fixes: d40_recommendation.md.

D41 · Kernel & Syscall Confinement6.0 / 10Adequate✓ Tool-verified

What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.

Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.

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

No workload manifest could be read as a pod spec, so no confinement was judged.

What to do

  1. Improve Kernel & Syscall Confinement — currently 6.0/10. — No workload manifest could be read as a pod spec, so no confinement was judged.

Detailed fixes: d41_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

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

End-of-life runtime: Rust 1.95rust-toolchain.toml:1

What to do

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

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

Frontend & cross-cutting dimensions

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

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 & labels10.0 / 10Exemplary○ Nothing flagged

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.

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 safety10.0 / 10Exemplary○ Nothing flagged

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.

AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

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

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

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

  • No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain you already use: enable Biome's a11y rule group in your biome.json `linter.rules` (it is off whenever `recommended` is false and the group is unlisted), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
AX10 · Code composition9.6 / 10Exemplary✓ Tool-verified

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

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

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

What to do

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

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

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

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

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

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

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

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

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

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

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

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

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

  • `SshIdentityStore.get_or_create` performs a durable write on a read path (a persist to a store/repository). The name announces the lazy initialisation, so the write is deliberate — the risk is that callers who only meant to READ still trigger it. Expose a read-only variant that returns nothing when the value is absent, and keep this one for the callers that genuinely want the create. — crates/openshell-server/src/ssh_identity.rs:419

What to do

  • Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
C2 · Access Controls10.0 / 10Exemplary○ Nothing flagged

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

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

ED4 · Outbox / dual-write8.0 / 10Strong✓ Tool-verified

Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.

Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.

  • `policy$module.handle_report_sandbox_configuration` performs two independent DURABLE writes — a durable state write (`store.update_message_cas`, :5173) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :5197) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — crates/openshell-server/src/grpc/policy.rs:5029
  • `policy$module.handle_approve_draft_chunk_inner` performs two independent DURABLE writes — a durable state write (`store.update_draft_chunk_status`, :6112) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6116) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — crates/openshell-server/src/grpc/policy.rs:6019
  • `policy$module.handle_reject_draft_chunk_inner` performs two independent DURABLE writes — a durable state write (`store.update_draft_chunk_status`, :6248) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6253) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — crates/openshell-server/src/grpc/policy.rs:6167
  • `policy$module.handle_approve_all_draft_chunks_inner` performs two independent DURABLE writes — a durable state write (`store.update_draft_chunk_status`, :6518) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6534) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — crates/openshell-server/src/grpc/policy.rs:6273
  • `policy$module.handle_undo_draft_chunk_inner` performs two independent DURABLE writes — a durable state write (`store.update_draft_chunk_status`, :6708) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6712) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — crates/openshell-server/src/grpc/policy.rs:6653
  • `policy$module.handle_clear_draft_chunks` performs two independent DURABLE writes — a durable state write (`store.delete_draft_chunks`, :6763) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6767) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — crates/openshell-server/src/grpc/policy.rs:6743

What to do

  • Adopt the transactional outbox pattern so DB writes and message publishes commit atomically — no lost or phantom events on a crash.
ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.

Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.

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

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

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

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

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

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

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add a README to the 17 of 44 project(s) that lack one — worth up to 0.8 pts.
M2 · Architecture documentation8.5 / 10Exemplary✓ 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.

What to do

  • Grow the ADR log (currently 9) — reach 20 to raise the maturity tier; document significant decisions as they're made.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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

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

P2 · Observability9.6 / 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 26/30 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/openshell-extension-core`, `crates/openshell-prover-cli`, `sdk/typescript`.

What to do

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

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

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

What to do

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

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

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

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

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

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

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
P6 · Release Hygiene5.0 / 10Adequate✓ 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.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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.

  • `Client::builder(TokioExecutor` 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. — crates/openshell-cli/src/commands/gateway.rs:1490
  • `reqwest::ClientBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — crates/openshell-cli/src/oidc_auth.rs:97, crates/openshell-sdk/src/oidc.rs:143

What to do

  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

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

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

PF1 · Benchmark discipline9.0 / 10Exemplary✓ Tool-verified

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

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

PF2 · Allocation hygiene7.4 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 47 use(s) across 16,451 production line(s) (~2.9/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Go: on hot paths, reuse buffers and objects through sync.Pool, preallocate slices and maps with make([]T, 0, n) / make(map[K]V, n), size builders with Grow, append with strconv.Append*, and reslice with buf[:0] instead of allocating anew.
PF3 · Async & latency hygiene8.5 / 10Exemplary✓ Tool-verified

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

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

  • `invoke_codex` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — tasks/scripts/codex_compatibility.py:69

What to do

  • Python: await the async equivalent (asyncio.sleep, an async HTTP client such as httpx.AsyncClient or aiohttp, asyncio.create_subprocess_exec), or move the blocking call off the loop with `await asyncio.to_thread(...)`; never call asyncio.run inside a coroutine — await the coroutine.
R1 · Type Safety7.5 / 10Strong✓ Tool-verified

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

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

What to do

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

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

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

  • sdk/typescript/src/client.ts:1089 · sdk/typescript/src/client.ts:1174 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — sdk/typescript/src/client.ts:1089
  • sdk/typescript/src/client.ts:1937 · sdk/typescript/src/client.ts:1954 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdk/typescript/src/client.ts:1937
  • sdk/typescript/src/client.ts:1235 · sdk/typescript/src/client.ts:1262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdk/typescript/src/client.ts:1235
  • sdk/typescript/src/client.ts:1139 · sdk/typescript/src/client.ts:1281 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — sdk/typescript/src/client.ts:1139
  • sdk/typescript/src/client.ts:782 · sdk/typescript/src/client.ts:799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdk/typescript/src/client.ts:782
  • sdk/typescript/src/client.ts:1292 · sdk/typescript/src/client.ts:1977 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — sdk/typescript/src/client.ts:1292
  • sdk/typescript/src/client.ts:2098 · sdk/typescript/src/providers.ts:29 — the two spans are one implementation copied and then locally edited — 58 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — sdk/typescript/src/client.ts:2098
  • sdk/typescript/src/client.ts:1345 · sdk/typescript/src/client.ts:1368 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — sdk/typescript/src/client.ts:1345
  • sdk/typescript/src/client.ts:1324 · sdk/typescript/src/client.ts:1355 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — sdk/typescript/src/client.ts:1324
  • fern/components/CustomFooter.tsx:70 · fern/components/CustomFooter.tsx:76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — fern/components/CustomFooter.tsx:70

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.8 / 10Exemplary✓ Tool-verified

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

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

  • getCredentials has cyclomatic complexity 24 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/providers.ts:51
  • watchLogs has cyclomatic complexity 21 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/client.ts:1469
  • validateSshResponse has cyclomatic complexity 18 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. — sdk/typescript/src/ssh-validate.ts:47
  • receive has cyclomatic complexity 15 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/client.ts:1616
  • execInteractive has cyclomatic complexity 15 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. — sdk/typescript/src/client.ts:1539
  • execStream has cyclomatic complexity 15 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/client.ts:1381
  • (anonymous) has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/client.test.ts:866
  • waitReady has cyclomatic complexity 12 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/client.ts:1324
  • evaluate has cyclomatic complexity 12 and cognitive complexity 15; 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. — tasks/scripts/check_issue_acceptance.cjs:16
  • forwardConnection has cyclomatic complexity 12 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/client.ts:1824
  • #exchange has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/oidc.ts:161
  • create 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. — sdk/typescript/src/client.ts:1213
  • forward has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/client.ts:1709
  • sandboxRef has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/typescript/src/client.ts:626

What to do

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

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

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

  • sdk/typescript/src/client.ts has 1954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdk/typescript/src/client.ts:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage7.8 / 10Strong✓ 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. (×2) — scripts/lint-mermaid/lint-mermaid.mjs:1, fern/components/CustomFooter.tsx:1

What to do

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

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

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

What to do

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

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

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

R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified

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

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

  • 4 file(s) (~465 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
  • 1 file(s) (~188 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — scripts/lint-mermaid
  • 16 file(s) (~6319 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: sdk/typescript/src/raw.ts imports './gen/datamodel_pb.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — sdk/typescript
R8 · Dependency Hygiene9.5 / 10Exemplary✓ 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 sdk/typescript/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 Posture6.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(` (crates/openshell-server/src/lib.rs:993)), 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.

  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. — crates/openshell-supervisor-network/src/l7/rest.rs:2735
  • Set: Content-Security-Policy. Missing: Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — 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.(−1.5 on this card.) The server: `axum::serve(` (crates/openshell-server/src/lib.rs:993).

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
  • Add Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options 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.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ Tool-verified

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

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

  • `prefix_navigation_paths` is public and takes `value: object` from its caller, and it calls itself at line 284 (`prefix_navigation_paths`) with a piece of `value` (and at line 287) — and nowhere in `prefix_navigation_paths` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `prefix_navigation_paths` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — tasks/scripts/sync_docs_website.py:284

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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

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

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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

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

X2 · Cancellation propagation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context or 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.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

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

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

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

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

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

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

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

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

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

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

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

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

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

X3 · Exception handling7.6 / 10Strong✓ Tool-verified

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

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

  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — sdk/typescript/src/client.ts:1591
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×2) — sdk/typescript/src/client.ts:1753, sdk/typescript/src/client.ts:1898
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — sdk/typescript/src/transport.ts:114
  • `if err := tl.acceptAndBridge(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — sdk/go/openshell/v1/tcp_client.go:149
  • `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — python/openshell/__init__.py:37

What to do

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

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

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

X4 · Structured logging6.9 / 10Strong✓ 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 644 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`. — crates/openshell-supervisor-process/src/ssh.rs:644
  • `warn!` at line 658 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`. — crates/openshell-supervisor-process/src/ssh.rs:658
  • `warn!` at line 939 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`. — crates/openshell-supervisor-process/src/ssh.rs:939
  • `warn!` at line 1029 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`. — crates/openshell-supervisor-process/src/ssh.rs:1029
  • `warn!` at line 1210 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`. — crates/openshell-supervisor-process/src/ssh.rs:1210
  • `debug!` at line 228 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`. — crates/openshell-supervisor-network/src/identity.rs:228
  • `debug!` at line 236 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`. — crates/openshell-supervisor-network/src/identity.rs:236
  • `debug!` at line 272 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`. — crates/openshell-supervisor-network/src/identity.rs:272
  • `debug!` at line 2126 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`. — crates/openshell-supervisor-network/src/opa.rs:2126
  • `info!` at line 2529 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`. — crates/openshell-supervisor-network/src/opa.rs:2529
  • `debug!` at line 2536 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`. — crates/openshell-supervisor-network/src/opa.rs:2536
  • `warn!` at line 2542 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`. — crates/openshell-supervisor-network/src/opa.rs:2542
  • `warn!` at line 2551 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`. — crates/openshell-supervisor-network/src/opa.rs:2551
  • `warn!` at line 2560 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`. — crates/openshell-supervisor-network/src/opa.rs:2560
  • `debug!` at line 593 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`. — crates/openshell-supervisor-network/src/procfs.rs:593
  • `warn!` at line 4130 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`. — crates/openshell-supervisor-network/src/proxy.rs:4130
  • `debug!` at line 4288 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`. — crates/openshell-supervisor-network/src/proxy.rs:4288
  • `warn!` at line 393 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`. — crates/openshell-supervisor-network/src/run.rs:393
  • `warn!` at line 409 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`. — crates/openshell-supervisor-network/src/run.rs:409
  • `warn!` at line 60 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`. — crates/openshell-supervisor-middleware/src/binding_policy.rs:60
  • `info!` at line 84 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`. — crates/openshell-supervisor-middleware/src/binding_policy.rs:84
  • `warn!` at line 2511 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`. — crates/openshell-supervisor/src/lib.rs:2511
  • `warn!` at line 4044 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`. — crates/openshell-supervisor/src/lib.rs:4044
  • `info!` at line 947 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`. — crates/openshell-supervisor/src/sandbox_instance_host.rs:947
  • `warn!` at line 386 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`. — crates/openshell-server/src/certgen.rs:386
  • `warn!` at line 138 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`. — crates/openshell-server/src/lib.rs:138
  • `info!` at line 698 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`. — crates/openshell-server/src/lib.rs:698
  • `error!` at line 994 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`. — crates/openshell-server/src/lib.rs:994
  • `error!` at line 1016 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`. — crates/openshell-server/src/lib.rs:1016
  • `warn!` at line 4218 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`. — crates/openshell-server/src/grpc/provider.rs:4218
  • `warn!` at line 4220 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`. — crates/openshell-server/src/grpc/provider.rs:4220
  • `warn!` at line 2726 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`. — crates/openshell-server/src/grpc/sandbox.rs:2726
  • `warn!` at line 2731 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`. — crates/openshell-server/src/grpc/sandbox.rs:2731
  • `warn!` at line 2738 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`. — crates/openshell-server/src/grpc/sandbox.rs:2738
  • `warn!` at line 333 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`. — crates/openshell-sandbox/src/process.rs:333
  • `warn!` at line 344 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`. — crates/openshell-sandbox/src/process.rs:344
  • `debug!` at line 1487 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`. — crates/openshell-driver-mxc/src/etw_consumer.rs:1487
  • `debug!` at line 1496 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`. — crates/openshell-driver-mxc/src/etw_consumer.rs:1496
  • `debug!` at line 1516 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`. — crates/openshell-driver-mxc/src/etw_consumer.rs:1516
  • `debug!` at line 1629 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`. — crates/openshell-driver-mxc/src/etw_consumer.rs:1629

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.6 / 10Exemplary✓ 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.

  • ~1.0 `!` null assertions per 1k TypeScript source lines — 3 assertion(s) across the 3105 source line(s) of the 11 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: sdk/typescript/src/client.ts (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

What to do

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

WCAG coverage — what static analysis assessed

Statically assessed 8 of 55 WCAG 2.2 Level A/AA success criteria (15%; ≈16% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 47 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
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 47 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.4, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.1, 2.1.2, 2.1.4, 2.2.1, 2.2.2, 2.3.1, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.1, 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 Health73%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture94%ExemplarySolid.
Maturity89%ExemplarySolid.
Readiness64%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security76%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event-Driven80%StrongSolid.
Event Sourcing100%ExemplaryStrongest area.
Accessibility80%StrongSolid.
Performance81%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 — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 9 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 38 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.

  • AC3 Page structure — No structural check found in the parsed markup — AC3 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AX1 Captive dependencies — Not applicable: this repository's Go 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; 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; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
  • 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 runtime tier booted this repository's service, but crawled PUBLIC routes only — add a Playwright storageState (e.g. playwright/.auth/user.json) or a test auth-setup to crawl authenticated screens rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:8080: page.goto: net::ERR_CONNECTION_RESET at http://127.0.0.1:8080/ Call log: - navigating to "http://127.0.0.1:8080/", waiting until "load" rendered 0/1 surface(s) × 2 renders render failed for http://127.0.0.1:8081: page.goto: net::ERR_CONNECTION_RESET at http://127.0.0.1:8081/ Call log: - navigating to "http://127.0.0.1:8081/", waiting until "load" . This repository also has a user interface (3 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates) that the booted service does not serve, and this scan has no strategy that reaches it — so no WCAG success criterion was verified in a rendered page on this run. That is a gap in OUR tooling, not a finding about your application: nothing here says the interface is inaccessible. The static accessibility checks still ran.
  • AXS1 Runtime exposed surface — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D11 Test Reliability — No tests discovered
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Go, JavaScript, Python, Rust, TypeScript not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Aggregate roots were found in only one source directory (openshell-core), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .go, .py, .rs, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • 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) — 2 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the vitest suite in sdk/typescript/ ran and not one test passed (FAIL src/client.test.ts [ src/client.test.ts ]), so the coverage report describes the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
  • DM1 Domain Modelling — applicable but not scored (3 signals for this style, 2 needed — the count is met but a required primary signal is absent): 2 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 177 value object(s); 4 domain event(s); its domain events are published by services or handlers — no domain entity raises one; no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — Not assessed, and this one is on us: 3 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • 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 — 38 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
ED4 · Outbox / dual-write · Dual write (no outbox) · ×6
  • Dual write (no outbox): policy$module.handle_report_sandbox_configuration crates/openshell-server/src/grpc/policy.rs:5029 — `policy$module.handle_report_sandbox_configuration` performs two independent DURABLE writes — a durable state write (`store.update_message_cas`, :5173) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :5197) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
  • Dual write (no outbox): policy$module.handle_approve_draft_chunk_inner crates/openshell-server/src/grpc/policy.rs:6019 — `policy$module.handle_approve_draft_chunk_inner` performs two independent DURABLE writes — a durable state write (`store.update_draft_chunk_status`, :6112) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6116) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
  • Dual write (no outbox): policy$module.handle_reject_draft_chunk_inner crates/openshell-server/src/grpc/policy.rs:6167 — `policy$module.handle_reject_draft_chunk_inner` performs two independent DURABLE writes — a durable state write (`store.update_draft_chunk_status`, :6248) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6253) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
  • Dual write (no outbox): policy$module.handle_approve_all_draft_chunks_inner crates/openshell-server/src/grpc/policy.rs:6273 — `policy$module.handle_approve_all_draft_chunks_inner` performs two independent DURABLE writes — a durable state write (`store.update_draft_chunk_status`, :6518) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6534) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
  • Dual write (no outbox): policy$module.handle_undo_draft_chunk_inner crates/openshell-server/src/grpc/policy.rs:6653 — `policy$module.handle_undo_draft_chunk_inner` performs two independent DURABLE writes — a durable state write (`store.update_draft_chunk_status`, :6708) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6712) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
  • Dual write (no outbox): policy$module.handle_clear_draft_chunks crates/openshell-server/src/grpc/policy.rs:6743 — `policy$module.handle_clear_draft_chunks` performs two independent DURABLE writes — a durable state write (`store.delete_draft_chunks`, :6763) and an independent publish to an event bus (`sandbox_watch_bus.notify`, :6767) — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×2
  • Orphaned knowledge crates/openshell-vfio/src/pci.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge crates/openshell-vfio/src/bind.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
AX9 · CQS / query purity · Query writes persistent state on the read path · ×1
  • Query writes persistent state on the read path: SshIdentityStore.get_or_create crates/openshell-server/src/ssh_identity.rs:419 — `SshIdentityStore.get_or_create` performs a durable write on a read path (a persist to a store/repository). The name announces the lazy initialisation, so the write is deliberate — the risk is that callers who only meant to READ still trigger it. Expose a read-only variant that returns nothing when the value is absent, and keep this one for the callers that genuinely want the create.
D10 · Test Quality · No assertions (empty test) · ×1
  • No assertions (empty test): survives a forwarded socket that resets during the session-mint window sdk/typescript/src/client.test.ts:2312 — Test method has an empty body — it asserts nothing and exercises no code.
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 1742 finding(s)
D3 · God Classes · FunctionTooLong · ×102
  • FunctionTooLong: openshell_cli::run_async crates/openshell-cli/src/main.rs:2635 — FunctionTooLong — openshell_cli::run_async runs 1322 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 1222 over it, 13.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_supervisor_network::proxy::handle_forward_proxy crates/openshell-supervisor-network/src/proxy.rs:5332 — FunctionTooLong — openshell_supervisor_network::proxy::handle_forward_proxy runs 1170 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 1070 over it, 11.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: openshell_providers::profiles::validate_profile_set crates/openshell-providers/src/profiles.rs:2138 — FunctionTooLong — openshell_providers::profiles::validate_profile_set runs 737 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 637 over it, 7.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_supervisor_network::proxy::handle_mediated_connection crates/openshell-supervisor-network/src/proxy.rs:2414 — FunctionTooLong — openshell_supervisor_network::proxy::handle_mediated_connection runs 658 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 558 over it, 6.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: openshell_supervisor::run_sandbox_instance crates/openshell-supervisor/src/lib.rs:1042 — FunctionTooLong — openshell_supervisor::run_sandbox_instance runs 572 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 472 over it, 5.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_cli::run::sandbox_create crates/openshell-cli/src/run.rs:497 — FunctionTooLong — openshell_cli::run::sandbox_create runs 519 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 419 over it, 5.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_server::grpc::policy::handle_update_config_inner crates/openshell-server/src/grpc/policy.rs:4176 — FunctionTooLong — openshell_server::grpc::policy::handle_update_config_inner runs 505 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 405 over it, 5.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_server::run_server crates/openshell-server/src/lib.rs:585 — FunctionTooLong — openshell_server::run_server runs 405 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 305 over it, 4.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_supervisor_network::l7::rest::http_response::relay_response_through_middleware crates/openshell-supervisor-network/src/l7/rest/http_response.rs:291 — FunctionTooLong — openshell_supervisor_network::l7::rest::http_response::relay_response_through_middleware runs 396 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 296 over it, 3.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: openshell_supervisor_network::l7::relay::relay_with_route_selection crates/openshell-supervisor-network/src/l7/relay.rs:1151 — FunctionTooLong — openshell_supervisor_network::l7::relay::relay_with_route_selection runs 363 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 263 over it, 3.63× 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: openshell_supervisor::load_policy_with_gateway crates/openshell-supervisor/src/lib.rs:2738 — FunctionTooLong — openshell_supervisor::load_policy_with_gateway runs 342 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 242 over it, 3.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_supervisor_network::l7::validate_l7_policies crates/openshell-supervisor-network/src/l7/mod.rs:1236 — FunctionTooLong — openshell_supervisor_network::l7::validate_l7_policies runs 331 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 231 over it, 3.31× 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: openshell_server::grpc::provider::handle_configure_provider_refresh crates/openshell-server/src/grpc/provider.rs:4814 — FunctionTooLong — openshell_server::grpc::provider::handle_configure_provider_refresh runs 323 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 223 over it, 3.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_server::grpc::policy::handle_submit_policy_analysis crates/openshell-server/src/grpc/policy.rs:5497 — FunctionTooLong — openshell_server::grpc::policy::handle_submit_policy_analysis runs 311 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 211 over it, 3.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_server::grpc::sandbox::handle_watch_sandbox crates/openshell-server/src/grpc/sandbox.rs:2033 — FunctionTooLong — openshell_server::grpc::sandbox::handle_watch_sandbox runs 299 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 199 over it, 2.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_tui::run crates/openshell-tui/src/lib.rs:94 — FunctionTooLong — openshell_tui::run runs 285 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 185 over it, 2.85× 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: openshell_supervisor_network::l7::rest::relay_http_request_with_response_middleware_guarded_observed crates/openshell-supervisor-network/src/l7/rest.rs:892 — FunctionTooLong — openshell_supervisor_network::l7::rest::relay_http_request_with_response_middleware_guarded_observed runs 268 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 168 over it, 2.68× 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: openshell_supervisor_network::run::run_networking crates/openshell-supervisor-network/src/run.rs:279 — FunctionTooLong — openshell_supervisor_network::run::run_networking runs 268 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 168 over it, 2.68× 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: openshell_server::grpc::provider::resolve_provider_environment_from_records_with_policy_bindings_and_credentials crates/openshell-server/src/grpc/provider.rs:1166 — FunctionTooLong — openshell_server::grpc::provider::resolve_provider_environment_from_records_with_policy_bindings_and_credentials runs 267 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 167 over it, 2.67× 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: openshell_supervisor_network::l7::relay::relay_rest crates/openshell-supervisor-network/src/l7/relay.rs:2020 — FunctionTooLong — openshell_supervisor_network::l7::relay::relay_rest runs 262 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_supervisor_network::opa::proto_to_opa_data_json crates/openshell-supervisor-network/src/opa.rs:2255 — FunctionTooLong — openshell_supervisor_network::opa::proto_to_opa_data_json runs 253 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 153 over it, 2.53× 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: openshell_tui::ui::draw_nav_bar crates/openshell-tui/src/ui/mod.rs:189 — FunctionTooLong — openshell_tui::ui::draw_nav_bar runs 246 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 146 over it, 2.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_server::grpc::sandbox::handle_create_sandbox_inner crates/openshell-server/src/grpc/sandbox.rs:460 — FunctionTooLong — openshell_server::grpc::sandbox::handle_create_sandbox_inner runs 244 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: openshell_cli::commands::gateway::gateway_add crates/openshell-cli/src/commands/gateway.rs:839 — FunctionTooLong — openshell_cli::commands::gateway::gateway_add runs 240 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 140 over it, 2.40× 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: openshell_driver_docker::spawn_docker_control_process crates/openshell-driver-docker/src/lib.rs:5248 — FunctionTooLong — openshell_driver_docker::spawn_docker_control_process runs 231 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 131 over it, 2.31× 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.
  • + 77 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×100
  • FileTooLong: src/driver.rs crates/openshell-driver-kubernetes/src/driver.rs — FileTooLong — 6219 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 138 free functions. The bar is 500 significant lines; this is 5719 over it, 12.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: grpc/policy.rs crates/openshell-server/src/grpc/policy.rs — FileTooLong — 5770 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 190 free functions. The bar is 500 significant lines; this is 5270 over it, 11.54× 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: compute/mod.rs crates/openshell-server/src/compute/mod.rs — FileTooLong — 5714 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 70% of them inside a single declaration: ComputeRuntime (3 blocks, 875-6566), declaring 65 free functions. The bar is 500 significant lines; this is 5214 over it, 11.43× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/driver.rs crates/openshell-driver-vm/src/driver.rs — FileTooLong — 5607 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 145 free functions. The bar is 500 significant lines; this is 5107 over it, 11.21× 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 crates/openshell-driver-docker/src/lib.rs — FileTooLong — 5196 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 141 free functions. The bar is 500 significant lines; this is 4696 over it, 10.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/run.rs crates/openshell-cli/src/run.rs — FileTooLong — 5100 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 151 free functions. The bar is 500 significant lines; this is 4600 over it, 10.20× 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/proxy.rs crates/openshell-supervisor-network/src/proxy.rs — FileTooLong — 5057 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 114 free functions. The bar is 500 significant lines; this is 4557 over it, 10.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: grpc/provider.rs crates/openshell-server/src/grpc/provider.rs — FileTooLong — 3848 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 146 free functions. The bar is 500 significant lines; this is 3348 over it, 7.70× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: grpc/sandbox.rs crates/openshell-server/src/grpc/sandbox.rs — FileTooLong — 2898 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 81 free functions. The bar is 500 significant lines; this is 2398 over it, 5.80× 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 crates/openshell-supervisor/src/lib.rs — FileTooLong — 2897 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 65 free functions. The bar is 500 significant lines; this is 2397 over it, 5.79× 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: l7/relay.rs crates/openshell-supervisor-network/src/l7/relay.rs — FileTooLong — 2726 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 68 free functions. The bar is 500 significant lines; this is 2226 over it, 5.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/main.rs crates/openshell-cli/src/main.rs — FileTooLong — 2697 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 2197 over it, 5.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/profiles.rs crates/openshell-providers/src/profiles.rs — FileTooLong — 2672 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 106 free functions. The bar is 500 significant lines; this is 2172 over it, 5.34× 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: l7/rest.rs crates/openshell-supervisor-network/src/l7/rest.rs — FileTooLong — 2515 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 98 free functions. The bar is 500 significant lines; this is 2015 over it, 5.03× 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/app.rs crates/openshell-tui/src/app.rs — FileTooLong — 2471 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: App (2 blocks, 592-3605). The bar is 500 significant lines; this is 1971 over it, 4.94× 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: commands/provider.rs crates/openshell-cli/src/commands/provider.rs — FileTooLong — 2142 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 74 free functions. The bar is 500 significant lines; this is 1642 over it, 4.28× 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 crates/openshell-tui/src/lib.rs — FileTooLong — 2131 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 56 free functions. The bar is 500 significant lines; this is 1631 over it, 4.26× 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/runtime.rs crates/openshell-sandbox-backend/src/runtime.rs — FileTooLong — 2099 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 1599 over it, 4.20× 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/supervisor_session.rs crates/openshell-server/src/supervisor_session.rs — FileTooLong — 2037 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 1537 over it, 4.07× 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: openshell/sandbox.py python/openshell/sandbox.py — FileTooLong — 1811 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1311 over it, 3.62× 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/provider_refresh.rs crates/openshell-server/src/provider_refresh.rs — FileTooLong — 1752 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 62 free functions. The bar is 500 significant lines; this is 1252 over it, 3.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1690 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: PostgresStore (2 blocks, 42-2203). The bar is 500 significant lines; this is 1190 over it, 3.38× 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/supervisor_pool.rs crates/openshell-server/src/supervisor_pool.rs — FileTooLong — 1686 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 1186 over it, 3.37× 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: persistence/sqlite.rs crates/openshell-server/src/persistence/sqlite.rs — FileTooLong — 1618 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: SqliteStore (2 blocks, 50-2032). The bar is 500 significant lines; this is 1118 over it, 3.24× 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/opa.rs crates/openshell-supervisor-network/src/opa.rs — FileTooLong — 1576 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 40 free functions. The bar is 500 significant lines; this is 1076 over it, 3.15× 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.
  • + 75 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×71
  • Hotspot: crates/openshell-cli/src/run.rs crates/openshell-cli/src/run.rs:497 — crates/openshell-cli/src/run.rs changed 70 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 105 in openshell_cli::run::sandbox_create at line 497. 28 of those changes were fix/bug commits, and the other 42 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-cli/src/run.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: crates/openshell-cli/src/main.rs crates/openshell-cli/src/main.rs:2635 — crates/openshell-cli/src/main.rs changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 138 in openshell_cli::run_async at line 2635. 14 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-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: crates/openshell-server/src/grpc/sandbox.rs crates/openshell-server/src/grpc/sandbox.rs:2033 — crates/openshell-server/src/grpc/sandbox.rs changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in openshell_server::grpc::sandbox::handle_watch_sandbox at line 2033. 22 of those changes were fix/bug commits, and the other 49 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-server/src/grpc/sandbox.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: crates/openshell-supervisor-network/src/proxy.rs crates/openshell-supervisor-network/src/proxy.rs:5332 — crates/openshell-supervisor-network/src/proxy.rs changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in openshell_supervisor_network::proxy::handle_forward_proxy at line 5332. 22 of those changes were fix/bug commits, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-supervisor-network/src/proxy.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: crates/openshell-server/src/grpc/policy.rs crates/openshell-server/src/grpc/policy.rs:4176 — crates/openshell-server/src/grpc/policy.rs changed 63 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in openshell_server::grpc::policy::handle_update_config_inner at line 4176. 24 of those changes were fix/bug commits, and the other 39 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-server/src/grpc/policy.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: crates/openshell-providers/src/profiles.rs crates/openshell-providers/src/profiles.rs:2138 — crates/openshell-providers/src/profiles.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 170 in openshell_providers::profiles::validate_profile_set at line 2138. 6 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-providers/src/profiles.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: crates/openshell-server/src/lib.rs crates/openshell-server/src/lib.rs:585 — crates/openshell-server/src/lib.rs changed 68 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in openshell_server::run_server at line 585. 14 of those changes were fix/bug commits, and the other 54 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-server/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: crates/openshell-server/src/compute/mod.rs crates/openshell-server/src/compute/mod.rs:4038 — crates/openshell-server/src/compute/mod.rs changed 78 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in ComputeRuntime::start_persisted_sandboxes_with_authentication at line 4038. 29 of those changes were fix/bug commits, and the other 49 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-server/src/compute/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: crates/openshell-server/src/grpc/provider.rs crates/openshell-server/src/grpc/provider.rs:1166 — crates/openshell-server/src/grpc/provider.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in openshell_server::grpc::provider::resolve_provider_environment_from_records_with_policy_bindings_and_credentials at line 1166. 5 of those changes were fix/bug commits, and the other 37 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-server/src/grpc/provider.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: crates/openshell-supervisor-network/src/l7/relay.rs crates/openshell-supervisor-network/src/l7/relay.rs:1151 — crates/openshell-supervisor-network/src/l7/relay.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in openshell_supervisor_network::l7::relay::relay_with_route_selection at line 1151. 17 of those changes were fix/bug commits, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-supervisor-network/src/l7/relay.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: crates/openshell-supervisor-network/src/opa.rs crates/openshell-supervisor-network/src/opa.rs:2255 — crates/openshell-supervisor-network/src/opa.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in openshell_supervisor_network::opa::proto_to_opa_data_json at line 2255. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-supervisor-network/src/opa.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: crates/openshell-driver-kubernetes/src/driver.rs crates/openshell-driver-kubernetes/src/driver.rs:4531 — crates/openshell-driver-kubernetes/src/driver.rs changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in KubernetesComputeDriver::reconcile_sandbox_runtime_resources at line 4531. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-driver-kubernetes/src/driver.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: crates/openshell-supervisor/src/lib.rs crates/openshell-supervisor/src/lib.rs:1042 — crates/openshell-supervisor/src/lib.rs changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in openshell_supervisor::run_sandbox_instance at line 1042. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-supervisor/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: crates/openshell-driver-vm/src/driver.rs crates/openshell-driver-vm/src/driver.rs:1369 — crates/openshell-driver-vm/src/driver.rs changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in VmDriver::provision_sandbox_inner at line 1369. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-driver-vm/src/driver.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: crates/openshell-server/src/cli.rs crates/openshell-server/src/cli.rs:1230 — crates/openshell-server/src/cli.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in openshell_server::cli::merge_file_into_args at line 1230. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-server/src/cli.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: crates/openshell-policy/src/lib.rs crates/openshell-policy/src/lib.rs:1413 — crates/openshell-policy/src/lib.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in openshell_policy::validate_sandbox_policy_with_mcp_presence at line 1413. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-policy/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: crates/openshell-supervisor-network/src/l7/mod.rs crates/openshell-supervisor-network/src/l7/mod.rs:1236 — crates/openshell-supervisor-network/src/l7/mod.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in openshell_supervisor_network::l7::validate_l7_policies at line 1236. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-supervisor-network/src/l7/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: crates/openshell-driver-docker/src/lib.rs crates/openshell-driver-docker/src/lib.rs:1266 — crates/openshell-driver-docker/src/lib.rs changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in DockerComputeDriver::admit_container_resources at line 1266. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-driver-docker/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: crates/openshell-driver-podman/src/driver.rs crates/openshell-driver-podman/src/driver.rs:939 — crates/openshell-driver-podman/src/driver.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in PodmanComputeDriver::create_sandbox at line 939. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-driver-podman/src/driver.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: crates/openshell-sandbox/src/boundary_server.rs crates/openshell-sandbox/src/boundary_server.rs:2040 — crates/openshell-sandbox/src/boundary_server.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in openshell_sandbox::boundary_server::linux::serve_one at line 2040. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-sandbox/src/boundary_server.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/openshell-server/src/multiplex.rs crates/openshell-server/src/multiplex.rs:1210 — crates/openshell-server/src/multiplex.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in AuthGrpcRouter::call at line 1210. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-server/src/multiplex.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: crates/openshell-sandbox/src/main.rs crates/openshell-sandbox/src/main.rs:348 — crates/openshell-sandbox/src/main.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in openshell_sandbox::probe_socket_virtualization at line 348. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-sandbox/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: crates/openshell-server/src/provider_refresh.rs crates/openshell-server/src/provider_refresh.rs:1424 — crates/openshell-server/src/provider_refresh.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in openshell_server::provider_refresh::apply_minted_credential at line 1424. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-server/src/provider_refresh.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: crates/openshell-cli/src/commands/provider.rs crates/openshell-cli/src/commands/provider.rs:2529 — crates/openshell-cli/src/commands/provider.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in openshell_cli::commands::provider::format_provider_profile_details at line 2529. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-cli/src/commands/provider.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: crates/openshell-supervisor-network/src/l7/rest.rs crates/openshell-supervisor-network/src/l7/rest.rs:892 — crates/openshell-supervisor-network/src/l7/rest.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in openshell_supervisor_network::l7::rest::relay_http_request_with_response_middleware_guarded_observed at line 892. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-supervisor-network/src/l7/rest.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.
  • + 46 more in this group — see findings.md.
D2 · Cognitive Complexity · openshell_server · ×58
  • openshell_server::grpc::sandbox::handle_watch_sandbox (cognitive 219) crates/openshell-server/src/grpc/sandbox.rs:2033 — openshell_server::grpc::sandbox::handle_watch_sandbox has cognitive complexity 219 (threshold 15). Drivers by points: if/else 61 (170 pts), match/switch 11 (31 pts), loops 7 (14 pts), boolean chains 4 (nesting depth added 136). 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.
  • openshell_server::grpc::provider::resolve_provider_environment_from_records_with_policy_bindings_and_credentials (cognitive 119) crates/openshell-server/src/grpc/provider.rs:1166 — openshell_server::grpc::provider::resolve_provider_environment_from_records_with_policy_bindings_and_credentials has cognitive complexity 119 (threshold 15). Drivers by points: if/else 29 (92 pts), loops 7 (14 pts), boolean chains 11, match/switch 1 (2 pts) (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::grpc::policy::handle_update_config_inner (cognitive 99) crates/openshell-server/src/grpc/policy.rs:4176 — openshell_server::grpc::policy::handle_update_config_inner has cognitive complexity 99 (threshold 15). Drivers by points: if/else 48 (86 pts), boolean chains 8, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::grpc::provider::profile_attached_sandbox_diagnostics (cognitive 68) crates/openshell-server/src/grpc/provider.rs:3808 — openshell_server::grpc::provider::profile_attached_sandbox_diagnostics has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (49 pts), loops 5 (10 pts), boolean chains 9 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::run_server (cognitive 55) crates/openshell-server/src/lib.rs:585 — openshell_server::run_server has cognitive complexity 55 (threshold 15). Drivers by points: if/else 33 (40 pts), boolean chains 6, match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 12). 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.
  • openshell_server::cli::merge_file_into_args (cognitive 52) crates/openshell-server/src/cli.rs:1230 — openshell_server::cli::merge_file_into_args has cognitive complexity 52 (threshold 15). Drivers by points: if/else 30 (34 pts), boolean chains 18 (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.
  • openshell_server::provider_refresh::apply_minted_credential (cognitive 51) crates/openshell-server/src/provider_refresh.rs:1424 — openshell_server::provider_refresh::apply_minted_credential has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (25 pts), loops 9 (18 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::grpc::provider::handle_configure_provider_refresh (cognitive 47) crates/openshell-server/src/grpc/provider.rs:4814 — openshell_server::grpc::provider::handle_configure_provider_refresh has cognitive complexity 47 (threshold 15). Drivers by points: if/else 28 (33 pts), loops 5 (6 pts), boolean chains 4, match/switch 3 (4 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.
  • openshell_server::grpc::provider_credentials::retrieve (cognitive 46) crates/openshell-server/src/grpc/provider_credentials.rs:138 — openshell_server::grpc::provider_credentials::retrieve has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 8, loops 8, match/switch 1 (2 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.
  • openshell_server::grpc::policy::apply_merge_operations_with_retry (cognitive 45) crates/openshell-server/src/grpc/policy.rs:7617 — openshell_server::grpc::policy::apply_merge_operations_with_retry has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (40 pts), boolean chains 2, match/switch 1 (2 pts), 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.
  • openshell_server::grpc::policy::handle_submit_policy_analysis (cognitive 41) crates/openshell-server/src/grpc/policy.rs:5497 — openshell_server::grpc::policy::handle_submit_policy_analysis has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 9, match/switch 2 (4 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::spawn_gateway_connection (cognitive 40) crates/openshell-server/src/lib.rs:1247 — openshell_server::spawn_gateway_connection has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (31 pts), match/switch 3 (9 pts) (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.
  • openshell_server::cli::prepare_server_config_with_drivers (cognitive 40) crates/openshell-server/src/cli.rs:380 — openshell_server::cli::prepare_server_config_with_drivers has cognitive complexity 40 (threshold 15). Drivers by points: if/else 27 (33 pts), boolean chains 6, match/switch 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_server::provider_profile_sources::build_effective_profiles (cognitive 35) crates/openshell-server/src/provider_profile_sources.rs:729 — openshell_server::provider_profile_sources::build_effective_profiles has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (27 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::grpc::policy::handle_approve_all_draft_chunks_inner (cognitive 34) crates/openshell-server/src/grpc/policy.rs:6273 — openshell_server::grpc::policy::handle_approve_all_draft_chunks_inner has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 6 (11 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::grpc::sandbox::run_interactive_exec_with_russh (cognitive 33) crates/openshell-server/src/grpc/sandbox.rs:3770 — openshell_server::grpc::sandbox::run_interactive_exec_with_russh has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 7 (13 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::provider_refresh::refresh_provider_credential_locked (cognitive 31) crates/openshell-server/src/provider_refresh.rs:1094 — openshell_server::provider_refresh::refresh_provider_credential_locked has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 5 (8 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.
  • openshell_server::grpc::policy::build_provider_environment_snapshot_from_inputs (cognitive 30) crates/openshell-server/src/grpc/policy.rs:3914 — openshell_server::grpc::policy::build_provider_environment_snapshot_from_inputs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 5 (10 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::grpc::mutation_replay::execute_owned (cognitive 29) crates/openshell-server/src/grpc/mutation_replay.rs:249 — openshell_server::grpc::mutation_replay::execute_owned has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::grpc::policy::provisioning_clock::configuration_change (cognitive 29) crates/openshell-server/src/grpc/policy/provisioning_clock.rs:20 — openshell_server::grpc::policy::provisioning_clock::configuration_change has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::grpc::policy::policy_static_credential_endpoint_bindings (cognitive 28) crates/openshell-server/src/grpc/policy.rs:2145 — openshell_server::grpc::policy::policy_static_credential_endpoint_bindings has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 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.
  • openshell_server::grpc::policy::handle_report_sandbox_configuration (cognitive 28) crates/openshell-server/src/grpc/policy.rs:5029 — openshell_server::grpc::policy::handle_report_sandbox_configuration has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_server::grpc::policy::generate_security_notes (cognitive 27) crates/openshell-server/src/grpc/policy.rs:7110 — openshell_server::grpc::policy::generate_security_notes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_server::grpc::provider_readiness::evaluate_status (cognitive 27) crates/openshell-server/src/grpc/provider_readiness.rs:489 — openshell_server::grpc::provider_readiness::evaluate_status has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (24 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.
  • openshell_server::supervisor_session::open_routed_relay_with_message (cognitive 27) crates/openshell-server/src/supervisor_session.rs:1695 — openshell_server::supervisor_session::open_routed_relay_with_message has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 33 more in this group — see findings.md.
D2 · Cognitive Complexity · openshell_supervisor_network · ×54
  • openshell_supervisor_network::l7::validate_l7_policies (cognitive 266) crates/openshell-supervisor-network/src/l7/mod.rs:1236 — openshell_supervisor_network::l7::validate_l7_policies has cognitive complexity 266 (threshold 15). Drivers by points: if/else 52 (204 pts), boolean chains 35, loops 8 (27 pts) (nesting depth added 171). 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.
  • openshell_supervisor_network::proxy::handle_forward_proxy (cognitive 159) crates/openshell-supervisor-network/src/proxy.rs:5332 — openshell_supervisor_network::proxy::handle_forward_proxy has cognitive complexity 159 (threshold 15). Drivers by points: if/else 66 (109 pts), match/switch 23 (38 pts), boolean chains 9, loops 1 (3 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::proxy::handle_mediated_connection (cognitive 130) crates/openshell-supervisor-network/src/proxy.rs:2414 — openshell_supervisor_network::proxy::handle_mediated_connection has cognitive complexity 130 (threshold 15). Drivers by points: if/else 68 (111 pts), match/switch 9 (16 pts), boolean chains 2, loops 1 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::l7::relay::relay_with_route_selection (cognitive 127) crates/openshell-supervisor-network/src/l7/relay.rs:1151 — openshell_supervisor_network::l7::relay::relay_with_route_selection has cognitive complexity 127 (threshold 15). Drivers by points: if/else 38 (94 pts), match/switch 10 (28 pts), boolean chains 4, loops 1 (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::l7::rest::relay_http_request_with_response_middleware_guarded_observed (cognitive 118) crates/openshell-supervisor-network/src/l7/rest.rs:892 — openshell_supervisor_network::l7::rest::relay_http_request_with_response_middleware_guarded_observed has cognitive complexity 118 (threshold 15). Drivers by points: if/else 33 (89 pts), match/switch 7 (29 pts) (nesting depth added 78). 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.
  • openshell_supervisor_network::l7::rest::http_response::relay_response_through_middleware (cognitive 100) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:291 — openshell_supervisor_network::l7::rest::http_response::relay_response_through_middleware has cognitive complexity 100 (threshold 15). Drivers by points: if/else 52 (72 pts), loops 6 (12 pts), boolean chains 8, match/switch 7 (8 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.
  • openshell_supervisor_network::l7::websocket::relay_client_to_server (cognitive 85) crates/openshell-supervisor-network/src/l7/websocket.rs:646 — openshell_supervisor_network::l7::websocket::relay_client_to_server has cognitive complexity 85 (threshold 15). Drivers by points: if/else 24 (67 pts), match/switch 5 (12 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::l7::rest::http_response::relay_normalized_response_body (cognitive 73) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1392 — openshell_supervisor_network::l7::rest::http_response::relay_normalized_response_body has cognitive complexity 73 (threshold 15). Drivers by points: if/else 23 (59 pts), loops 4 (9 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 43). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • openshell_supervisor_network::opa::proto_to_opa_data_json (cognitive 66) crates/openshell-supervisor-network/src/opa.rs:2255 — openshell_supervisor_network::opa::proto_to_opa_data_json has cognitive complexity 66 (threshold 15). Drivers by points: if/else 54 (65 pts), match/switch 1 (nesting depth added 11). 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.
  • openshell_supervisor_network::l7::relay::relay_rest (cognitive 63) crates/openshell-supervisor-network/src/l7/relay.rs:2020 — openshell_supervisor_network::l7::relay::relay_rest has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (39 pts), match/switch 8 (21 pts), boolean chains 2, loops 1 (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.
  • openshell_supervisor_network::l7::rest::http_response::relay_response (cognitive 58) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:42 — openshell_supervisor_network::l7::rest::http_response::relay_response has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (45 pts), boolean chains 9, match/switch 2 (3 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::l7::relay::relay_jsonrpc (cognitive 55) crates/openshell-supervisor-network/src/l7/relay.rs:2438 — openshell_supervisor_network::l7::relay::relay_jsonrpc has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (38 pts), match/switch 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::run::run_networking (cognitive 50) crates/openshell-supervisor-network/src/run.rs:279 — openshell_supervisor_network::run::run_networking has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (31 pts), match/switch 4 (12 pts), loops 2 (6 pts), boolean chains 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.
  • openshell_supervisor_network::l7::relay::relay_graphql (cognitive 48) crates/openshell-supervisor-network/src/l7/relay.rs:2717 — openshell_supervisor_network::l7::relay::relay_graphql has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 7 (16 pts), boolean chains 2, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::l7::rest::websocket_extension_offers (cognitive 35) crates/openshell-supervisor-network/src/l7/rest.rs:2579 — openshell_supervisor_network::l7::rest::websocket_extension_offers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 3 (6 pts), match/switch 1 (4 pts), boolean chains 2 (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.
  • openshell_supervisor_network::l7::websocket::relay_text_payload_with_before_credential_write (cognitive 34) crates/openshell-supervisor-network/src/l7/websocket.rs:1180 — openshell_supervisor_network::l7::websocket::relay_text_payload_with_before_credential_write has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::l7::relay::relay_passthrough_with_credentials (cognitive 32) crates/openshell-supervisor-network/src/l7/relay.rs:3506 — openshell_supervisor_network::l7::relay::relay_passthrough_with_credentials has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 5 (11 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::l7::rest::http_response::parse_response_head_for_middleware (cognitive 31) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1109 — openshell_supervisor_network::l7::rest::http_response::parse_response_head_for_middleware has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::proxy::preauthorize_transparent_open (cognitive 31) crates/openshell-supervisor-network/src/proxy.rs:576 — openshell_supervisor_network::proxy::preauthorize_transparent_open has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 8 (13 pts), boolean chains 2 (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.
  • openshell_supervisor_network::proxy::destination::filter_resolved_addresses (cognitive 31) crates/openshell-supervisor-network/src/proxy/destination.rs:155 — openshell_supervisor_network::proxy::destination::filter_resolved_addresses has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 2 (3 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.
  • openshell_supervisor_network::opa::resolve_binary_in_container (cognitive 27) crates/openshell-supervisor-network/src/opa.rs:2096 — openshell_supervisor_network::opa::resolve_binary_in_container has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 3 (6 pts), boolean chains 2, 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.
  • openshell_supervisor_network::l7::path::percent_decode_with_sentinel (cognitive 25) crates/openshell-supervisor-network/src/l7/path.rs:239 — openshell_supervisor_network::l7::path::percent_decode_with_sentinel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, match/switch 1 (3 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.
  • openshell_supervisor_network::l7::relay::handle_upgrade (cognitive 25) crates/openshell-supervisor-network/src/l7/relay.rs:1790 — openshell_supervisor_network::l7::relay::handle_upgrade has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_network::l7::rest::parse_body_length (cognitive 25) crates/openshell-supervisor-network/src/l7/rest.rs:3130 — openshell_supervisor_network::l7::rest::parse_body_length has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (4 pts), boolean chains 3 (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.
  • openshell_supervisor_network::opa::normalize_l7_config_aliases (cognitive 25) crates/openshell-supervisor-network/src/opa.rs:1827 — openshell_supervisor_network::opa::normalize_l7_config_aliases has cognitive complexity 25 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (9 pts), match/switch 1 (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.
  • + 29 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×49
  • MethodTooLong: VmDriver.provision_sandbox_inner crates/openshell-driver-vm/src/driver.rs:1369 — MethodTooLong — provision_sandbox_inner runs 408 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 308 over it, 4.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ConfigRuntime.reconcile crates/openshell-supervisor/src/config_runtime.rs:216 — MethodTooLong — reconcile runs 356 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 256 over it, 3.56× 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: App.handle_create_provider_key crates/openshell-tui/src/app.rs:2484 — MethodTooLong — handle_create_provider_key runs 326 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 226 over it, 3.26× 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: OcsfEvent.format_shorthand crates/openshell-ocsf/src/format/shorthand.rs:231 — MethodTooLong — format_shorthand runs 321 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 221 over it, 3.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ChainRunner.preflight_described_http_response crates/openshell-supervisor-middleware/src/response/preflight.rs:35 — MethodTooLong — preflight_described_http_response runs 315 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 215 over it, 3.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: PodmanComputeDriver.create_sandbox crates/openshell-driver-podman/src/driver.rs:939 — MethodTooLong — create_sandbox runs 303 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 203 over it, 3.03× 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: ChainRunner.evaluate_described_with_policy_admitted crates/openshell-supervisor-middleware/src/lib.rs:1684 — MethodTooLong — evaluate_described_with_policy_admitted runs 283 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 183 over it, 2.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KubernetesComputeDriver.install_sandbox_runtime_generation crates/openshell-driver-kubernetes/src/driver.rs:3344 — MethodTooLong — install_sandbox_runtime_generation runs 278 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 178 over it, 2.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: KubernetesComputeDriver.start_sandbox_runtime_generation crates/openshell-driver-kubernetes/src/driver.rs:3794 — MethodTooLong — start_sandbox_runtime_generation runs 278 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 178 over it, 2.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: DockerComputeDriver.provision_sandbox_inner crates/openshell-driver-docker/src/lib.rs:1636 — MethodTooLong — provision_sandbox_inner runs 259 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 159 over it, 2.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ProxyHandle.start_with_bind_addr crates/openshell-supervisor-network/src/proxy.rs:242 — MethodTooLong — start_with_bind_addr runs 228 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 128 over it, 2.28× 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: KubernetesComputeDriver.reconcile_sandbox_runtime_resources crates/openshell-driver-kubernetes/src/driver.rs:4531 — MethodTooLong — reconcile_sandbox_runtime_resources runs 216 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 116 over it, 2.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: WebSocketSession.evaluate_text_admitted_inner crates/openshell-supervisor-middleware/src/websocket.rs:576 — MethodTooLong — evaluate_text_admitted_inner runs 207 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 107 over it, 2.07× 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: KubernetesComputeDriver.create_sandbox_inner crates/openshell-driver-kubernetes/src/driver.rs:2175 — MethodTooLong — create_sandbox_inner 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: ComputeRuntime.create_sandbox_with_runtime_inputs_and_guards crates/openshell-server/src/compute/mod.rs:1526 — MethodTooLong — create_sandbox_with_runtime_inputs_and_guards 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.
  • MethodTooLong: ComputeRuntime.start_sandbox_with_intent crates/openshell-server/src/compute/mod.rs:2230 — MethodTooLong — start_sandbox_with_intent runs 172 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 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KubernetesComputeDriver.validate_capability_free_workload_pod crates/openshell-driver-kubernetes/src/driver.rs:2697 — MethodTooLong — validate_capability_free_workload_pod 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: App.provider_detail_from_provider crates/openshell-tui/src/app.rs:3294 — MethodTooLong — provider_detail_from_provider 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.
  • MethodTooLong: PolicyViolation.fmt crates/openshell-policy/src/lib.rs:1120 — MethodTooLong — fmt runs 151 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ComputeRuntime.restart_sandbox_runtime crates/openshell-server/src/compute/mod.rs:4808 — MethodTooLong — restart_sandbox_runtime runs 149 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 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DockerComputeDriver.new crates/openshell-driver-docker/src/lib.rs:896 — MethodTooLong — new runs 145 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 45 over it, 1.45× 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: App.handle_draft_key crates/openshell-tui/src/app.rs:1947 — MethodTooLong — handle_draft_key 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: ExecutionPlan.load crates/openshell-gateway-interceptors/src/plan.rs:178 — MethodTooLong — load 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.
  • MethodTooLong: VmDriver.spawn_host_supervisor crates/openshell-driver-vm/src/driver.rs:938 — MethodTooLong — spawn_host_supervisor runs 137 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 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SshHandler.subsystem_request crates/openshell-supervisor-process/src/ssh.rs:724 — MethodTooLong — subsystem_request runs 134 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×49
  • Duplicated block (10 lines × 2) crates/openshell-binary-identity/src/lib.rs:267 — crates/openshell-binary-identity/src/lib.rs:267-276 | crates/openshell-binary-identity/src/lib.rs:293-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/openshell-bootstrap/src/metadata.rs:333 — crates/openshell-bootstrap/src/metadata.rs:333-342 | crates/openshell-bootstrap/src/metadata.rs:364-373 — both copies are in the same file, so extract the block into 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) crates/openshell-cli/src/run.rs:5483 — crates/openshell-cli/src/run.rs:5483-5492 | crates/openshell-cli/src/run.rs:5527-5536 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-docker/src/lib.rs:575 — crates/openshell-driver-docker/src/lib.rs:575-584 | crates/openshell-driver-docker/src/lib.rs:613-622 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-vault/src/lib.rs:229 — crates/openshell-driver-vault/src/lib.rs:229-238 | crates/openshell-driver-vault/src/lib.rs:255-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/openshell-prover/src/credentials.rs:347 — crates/openshell-prover/src/credentials.rs:347-356 | crates/openshell-prover/src/registry.rs:227-236 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) crates/openshell-providers/src/profiles.rs:738 — crates/openshell-providers/src/profiles.rs:738-747 | crates/openshell-providers/src/profiles.rs:763-772 — both copies are in the same file, so extract the block into 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) crates/openshell-providers/src/profiles.rs:1855 — crates/openshell-providers/src/profiles.rs:1855-1864 | crates/openshell-providers/src/profiles.rs:1904-1913 — both copies are in the same file, so extract the block into 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) crates/openshell-sandbox/src/main.rs:1635 — crates/openshell-sandbox/src/main.rs:1635-1644 | crates/openshell-sandbox/src/main.rs:1688-1697 — both copies are in the same file, so extract the block into 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) crates/openshell-sdk/src/client.rs:924 — crates/openshell-sdk/src/client.rs:924-933 | crates/openshell-sdk/src/client.rs:941-950 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/openshell-sdk/src/client.rs:991 — crates/openshell-sdk/src/client.rs:991-1000 | crates/openshell-sdk/src/client.rs:1068-1077 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/compute/mod.rs:760 — crates/openshell-server/src/compute/mod.rs:760-769 | crates/openshell-server/src/compute/mod.rs:796-805 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/compute/mod.rs:5925 — crates/openshell-server/src/compute/mod.rs:5925-5934 | crates/openshell-server/src/compute/mod.rs:5990-5999 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/gateway_members.rs:126 — crates/openshell-server/src/gateway_members.rs:126-135 | crates/openshell-server/src/supervisor_pool.rs:1067-1076 — 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) crates/openshell-server/src/grpc/policy.rs:5358 — crates/openshell-server/src/grpc/policy.rs:5358-5367 | crates/openshell-server/src/grpc/policy.rs:6784-6793 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/policy.rs:5954 — crates/openshell-server/src/grpc/policy.rs:5954-5963 | crates/openshell-server/src/grpc/policy.rs:6785-6794 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/provider.rs:2976 — crates/openshell-server/src/grpc/provider.rs:2976-2985 | crates/openshell-server/src/grpc/provider.rs:3073-3082 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/provider.rs:3689 — crates/openshell-server/src/grpc/provider.rs:3689-3698 | crates/openshell-server/src/grpc/provider.rs:3789-3798 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/sandbox.rs:1127 — crates/openshell-server/src/grpc/sandbox.rs:1127-1136 | crates/openshell-server/src/grpc/sandbox.rs:1215-1224 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/sandbox.rs:1826 — crates/openshell-server/src/grpc/sandbox.rs:1826-1835 | crates/openshell-server/src/grpc/sandbox.rs:1923-1932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:3354 — crates/openshell-server/src/grpc/sandbox.rs:3354-3363 | crates/openshell-server/src/grpc/sandbox.rs:3447-3456 — both copies are in the same file, so extract the block into 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) REDACTED:1668 — REDACTED:1668-1677 | crates/openshell-server/src/persistence/sqlite.rs:1496-1505 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) REDACTED:1908 — REDACTED:1908-1917 | crates/openshell-server/src/persistence/sqlite.rs:1737-1746 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) REDACTED:2094 — REDACTED:2094-2103 | crates/openshell-server/src/persistence/sqlite.rs:1923-1932 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) crates/openshell-server/src/persistence/sqlite.rs:403 — crates/openshell-server/src/persistence/sqlite.rs:403-412 | crates/openshell-server/src/persistence/sqlite.rs:690-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.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×49
  • Duplicated block (9 lines × 2) crates/openshell-cli/src/commands/common.rs:979 — crates/openshell-cli/src/commands/common.rs:979-987 | crates/openshell-server/src/grpc/provider.rs:2520-2528 — 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) crates/openshell-core/src/auth.rs:77 — crates/openshell-core/src/auth.rs:77-85 | crates/openshell-sdk/src/auth.rs:103-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.
  • Duplicated block (9 lines × 2) crates/openshell-core/src/paths.rs:52 — crates/openshell-core/src/paths.rs:52-60 | crates/openshell-core/src/paths.rs:92-100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-driver-docker/src/lib.rs:154 — crates/openshell-driver-docker/src/lib.rs:154-162 | crates/openshell-driver-vm/src/driver.rs:723-731 — before extracting anything, compare `crates/openshell-driver-docker/src/lib.rs` and `crates/openshell-driver-vm/src/driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/openshell-driver-kubernetes/src/grpc.rs:114 — crates/openshell-driver-kubernetes/src/grpc.rs:114-122 | crates/openshell-driver-podman/src/grpc.rs:109-117 — before extracting anything, compare `crates/openshell-driver-kubernetes/src/grpc.rs` and `crates/openshell-driver-podman/src/grpc.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/openshell-driver-kubernetes/src/grpc.rs:183 — crates/openshell-driver-kubernetes/src/grpc.rs:183-191 | crates/openshell-driver-podman/src/grpc.rs:171-179 — before extracting anything, compare `crates/openshell-driver-kubernetes/src/grpc.rs` and `crates/openshell-driver-podman/src/grpc.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/openshell-driver-kubernetes/src/grpc.rs:231 — crates/openshell-driver-kubernetes/src/grpc.rs:231-239 | crates/openshell-driver-podman/src/grpc.rs:213-221 — before extracting anything, compare `crates/openshell-driver-kubernetes/src/grpc.rs` and `crates/openshell-driver-podman/src/grpc.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/openshell-driver-vm/src/driver.rs:4404 — crates/openshell-driver-vm/src/driver.rs:4404-4412 | crates/openshell-driver-vm/src/driver.rs:4549-4557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-prover/src/model.rs:122 — crates/openshell-prover/src/model.rs:122-130 | crates/openshell-prover/src/model.rs:143-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-sandbox/src/boundary_server.rs:3345 — crates/openshell-sandbox/src/boundary_server.rs:3345-3353 | crates/openshell-sandbox/src/boundary_server.rs:3722-3730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-sandbox/src/boundary_server.rs:3916 — crates/openshell-sandbox/src/boundary_server.rs:3916-3924 | crates/openshell-sandbox/src/boundary_server.rs:4022-4030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-sandbox/src/denial_aggregator.rs:161 — crates/openshell-sandbox/src/denial_aggregator.rs:161-169 | crates/openshell-supervisor/src/denial_aggregator.rs:161-169 — before extracting anything, compare `crates/openshell-sandbox/src/denial_aggregator.rs` and `crates/openshell-supervisor/src/denial_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/openshell-sandbox/src/main_session.rs:535 — crates/openshell-sandbox/src/main_session.rs:535-543 | crates/openshell-supervisor-process/src/main_session.rs:271-279 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/openshell-sandbox/src/main_session.rs:642 — crates/openshell-sandbox/src/main_session.rs:642-650 | crates/openshell-sandbox/src/main_session.rs:660-668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-sandbox/src/process.rs:489 — crates/openshell-sandbox/src/process.rs:489-497 | crates/openshell-sandbox/src/process.rs:650-658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-sandbox/src/process.rs:610 — crates/openshell-sandbox/src/process.rs:610-618 | crates/openshell-sandbox/src/process.rs:735-743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-sandbox/src/process.rs:778 — crates/openshell-sandbox/src/process.rs:778-786 | crates/openshell-sandbox/src/process.rs:795-803 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-sdk/src/client.rs:363 — crates/openshell-sdk/src/client.rs:363-371 | crates/openshell-sdk/src/client.rs:1115-1123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-server/src/compute/mod.rs:4069 — crates/openshell-server/src/compute/mod.rs:4069-4077 | crates/openshell-server/src/compute/mod.rs:4323-4331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-server/src/config_file.rs:750 — crates/openshell-server/src/config_file.rs:750-758 | crates/openshell-server/src/config_file.rs:772-780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:1519 — crates/openshell-server/src/grpc/sandbox.rs:1519-1527 | crates/openshell-server/src/grpc/sandbox.rs:1650-1658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-server/src/multiplex.rs:870 — crates/openshell-server/src/multiplex.rs:870-878 | crates/openshell-server/src/multiplex.rs:896-904 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/openshell-server/src/multiplex.rs:1417 — crates/openshell-server/src/multiplex.rs:1417-1425 | crates/openshell-server/src/multiplex.rs:1443-1451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) REDACTED:1358 — REDACTED:1358-1366 | crates/openshell-server/src/persistence/sqlite.rs:1187-1195 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) crates/openshell-server/src/provider_profile_sources.rs:112 — crates/openshell-server/src/provider_profile_sources.rs:112-120 | crates/openshell-server/src/provider_profile_sources.rs:133-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×49
  • Duplicated block (8 lines × 2) crates/openshell-driver-kubernetes-secrets/src/lib.rs:586 — crates/openshell-driver-kubernetes-secrets/src/lib.rs:586-593 | crates/openshell-driver-vault/src/lib.rs:838-845 — before extracting anything, compare `crates/openshell-driver-kubernetes-secrets/src/lib.rs` and `crates/openshell-driver-vault/src/lib.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) crates/openshell-driver-kubernetes/src/sandbox_runtime.rs:678 — crates/openshell-driver-kubernetes/src/sandbox_runtime.rs:678-685 | crates/openshell-driver-kubernetes/src/sandbox_runtime.rs:704-711 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-mxc/src/driver.rs:270 — crates/openshell-driver-mxc/src/driver.rs:270-277 | crates/openshell-driver-podman/src/driver.rs:2110-2117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/openshell-driver-mxc/src/driver.rs:1146 — crates/openshell-driver-mxc/src/driver.rs:1146-1153 | crates/openshell-driver-mxc/src/driver.rs:1174-1181 — both copies are in the same file, so extract the block into 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) crates/openshell-gateway/src/lib.rs:319 — crates/openshell-gateway/src/lib.rs:319-326 | crates/openshell-gateway/src/lib.rs:451-458 — both copies are in the same file, so extract the block into 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) crates/openshell-gateway/src/vm.rs:759 — crates/openshell-gateway/src/vm.rs:759-766 | crates/openshell-server/src/credentials.rs:1864-1871 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/openshell-ocsf/src/format/shorthand.rs:238 — crates/openshell-ocsf/src/format/shorthand.rs:238-245 | crates/openshell-ocsf/src/format/shorthand.rs:309-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/openshell-sandbox/src/boundary_server.rs:3183 — crates/openshell-sandbox/src/boundary_server.rs:3183-3190 | crates/openshell-sandbox/src/boundary_server.rs:4712-4719 — both copies are in the same file, so extract the block into 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) crates/openshell-sandbox/src/linux/seccomp_notify.rs:548 — crates/openshell-sandbox/src/linux/seccomp_notify.rs:548-555 | crates/openshell-sandbox/src/linux/seccomp_notify.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.
  • Duplicated block (8 lines × 2) crates/openshell-sandbox/src/main_session.rs:510 — crates/openshell-sandbox/src/main_session.rs:510-517 | crates/openshell-supervisor-process/src/main_session.rs:259-266 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) crates/openshell-sandbox/src/main_session.rs:925 — crates/openshell-sandbox/src/main_session.rs:925-932 | crates/openshell-supervisor-process/src/main_session.rs:468-475 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) crates/openshell-sandbox/src/network_broker.rs:917 — crates/openshell-sandbox/src/network_broker.rs:917-924 | crates/openshell-sandbox/src/network_broker.rs:946-953 — both copies are in the same file, so extract the block into 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) crates/openshell-sandbox/src/process.rs:563 — crates/openshell-sandbox/src/process.rs:563-570 | crates/openshell-sandbox/src/process.rs:707-714 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/certgen.rs:824 — crates/openshell-server/src/certgen.rs:824-831 | crates/openshell-server/src/certgen.rs:887-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/openshell-server/src/config_delivery/mod.rs:356 — crates/openshell-server/src/config_delivery/mod.rs:356-363 | crates/openshell-server/src/config_delivery/mod.rs:395-402 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/policy.rs:6079 — crates/openshell-server/src/grpc/policy.rs:6079-6086 | crates/openshell-server/src/grpc/policy.rs:6338-6345 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/provider.rs:2981 — crates/openshell-server/src/grpc/provider.rs:2981-2988 | crates/openshell-server/src/grpc/provider.rs:3206-3213 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/persistence/mod.rs:1178 — crates/openshell-server/src/persistence/mod.rs:1178-1185 | crates/openshell-server/src/persistence/mod.rs:1384-1391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) REDACTED:374 — REDACTED:374-381 | crates/openshell-server/src/persistence/sqlite.rs:338-345 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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) REDACTED:798 — REDACTED:798-805 | crates/openshell-server/src/persistence/sqlite.rs:590-597 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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) REDACTED:2208 — REDACTED:2208-2215 | crates/openshell-server/src/persistence/sqlite.rs:2082-2089 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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) crates/openshell-server/src/provider_refresh.rs:1329 — crates/openshell-server/src/provider_refresh.rs:1329-1336 | crates/openshell-server/src/provider_refresh.rs:1388-1395 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/tracing_bus.rs:318 — crates/openshell-server/src/tracing_bus.rs:318-325 | crates/openshell-server/src/tracing_bus.rs:999-1006 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/opa.rs:724 — crates/openshell-supervisor-network/src/opa.rs:724-731 | crates/openshell-supervisor-network/src/opa.rs:790-798 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/proxy.rs:5899 — crates/openshell-supervisor-network/src/proxy.rs:5899-5906 | crates/openshell-supervisor-network/src/proxy.rs:5950-5957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×42
  • Duplicated block (7 lines × 2) crates/openshell-cli/src/main.rs:3854 — crates/openshell-cli/src/main.rs:3854-3860 | crates/openshell-cli/src/main.rs:3920-3926 — both copies are in the same file, so extract the block into 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) crates/openshell-conformance/src/scenarios/policy_behavior.rs:291 — crates/openshell-conformance/src/scenarios/policy_behavior.rs:291-297 | crates/openshell-conformance/src/scenarios/policy_behavior.rs:366-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) REDACTED:330 — REDACTED:330-336 | REDACTED:401-407 — both copies are in the same file, so extract the block into 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) REDACTED:497 — REDACTED:497-503 | REDACTED:601-607 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-podman/src/container.rs:1441 — crates/openshell-driver-podman/src/container.rs:1441-1447 | crates/openshell-driver-podman/src/container.rs:1489-1495 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-podman/src/container.rs:1459 — crates/openshell-driver-podman/src/container.rs:1459-1465 | crates/openshell-driver-podman/src/container.rs:1477-1483 — both copies are in the same file, so extract the block into 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) crates/openshell-sandbox-backend/src/boundary_protocol.rs:1506 — crates/openshell-sandbox-backend/src/boundary_protocol.rs:1506-1512 | crates/openshell-sandbox-backend/src/boundary_protocol.rs:1527-1533 — both copies are in the same file, so extract the block into 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) crates/openshell-sandbox/src/activity_aggregator.rs:108 — crates/openshell-sandbox/src/activity_aggregator.rs:108-114 | crates/openshell-supervisor/src/activity_aggregator.rs:108-114 — before extracting anything, compare `crates/openshell-sandbox/src/activity_aggregator.rs` and `crates/openshell-supervisor/src/activity_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) crates/openshell-sandbox/src/main_session.rs:981 — crates/openshell-sandbox/src/main_session.rs:981-987 | crates/openshell-supervisor-process/src/main_session.rs:485-491 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) crates/openshell-server/src/grpc/provider_credentials.rs:222 — crates/openshell-server/src/grpc/provider_credentials.rs:222-228 | crates/openshell-server/src/grpc/provider_credentials.rs:292-298 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/persistence/legacy_time_wire.rs:62 — crates/openshell-server/src/persistence/legacy_time_wire.rs:62-68 | crates/openshell-server/src/persistence/legacy_time_wire.rs:188-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/openshell-server/src/tracing_bus.rs:258 — crates/openshell-server/src/tracing_bus.rs:258-264 | crates/openshell-server/src/tracing_bus.rs:1017-1023 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/l7/relay.rs:2629 — crates/openshell-supervisor-network/src/l7/relay.rs:2629-2635 | crates/openshell-supervisor-network/src/l7/relay.rs:2647-2653 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/l7/rest.rs:1414 — crates/openshell-supervisor-network/src/l7/rest.rs:1414-1420 | crates/openshell-supervisor-network/src/l7/rest.rs:3196-3202 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/l7/rest.rs:2392 — crates/openshell-supervisor-network/src/l7/rest.rs:2392-2398 | crates/openshell-supervisor-network/src/l7/rest.rs:2472-2478 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/l7/rest.rs:2665 — crates/openshell-supervisor-network/src/l7/rest.rs:2665-2671 | crates/openshell-supervisor-network/src/l7/rest.rs:3462-3468 — both copies are in the same file, so extract the block into 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) crates/openshell-tui/src/ui/mod.rs:232 — crates/openshell-tui/src/ui/mod.rs:232-238 | crates/openshell-tui/src/ui/mod.rs:254-260 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-docker/src/lib.rs:2754 — crates/openshell-driver-docker/src/lib.rs:2754-2760 | crates/openshell-driver-vm/src/driver.rs:4731-4737 — before extracting anything, compare `crates/openshell-driver-docker/src/lib.rs` and `crates/openshell-driver-vm/src/driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) crates/openshell-driver-kubernetes-secrets/src/lib.rs:487 — crates/openshell-driver-kubernetes-secrets/src/lib.rs:487-493 | crates/openshell-driver-vault/src/lib.rs:550-556 — before extracting anything, compare `crates/openshell-driver-kubernetes-secrets/src/lib.rs` and `crates/openshell-driver-vault/src/lib.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) crates/openshell-driver-kubernetes-secrets/src/main.rs:104 — crates/openshell-driver-kubernetes-secrets/src/main.rs:104-110 | crates/openshell-driver-vault/src/main.rs:156-162 — before extracting anything, compare `crates/openshell-driver-kubernetes-secrets/src/main.rs` and `crates/openshell-driver-vault/src/main.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs:6889 — crates/openshell-driver-kubernetes/src/driver.rs:6889-6895 | crates/openshell-driver-vm/src/driver.rs:7830-7836 — 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) crates/openshell-providers/src/profiles.rs:3491 — crates/openshell-providers/src/profiles.rs:3491-3497 | crates/openshell-server/src/grpc/provider.rs:1705-1711 — before extracting anything, compare `crates/openshell-providers/src/profiles.rs` and `crates/openshell-server/src/grpc/provider.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) crates/openshell-sandbox/src/main_session.rs:850 — crates/openshell-sandbox/src/main_session.rs:850-856 | crates/openshell-supervisor-process/src/main_session.rs:396-402 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) crates/openshell-supervisor-network/src/l7/mod.rs:617 — crates/openshell-supervisor-network/src/l7/mod.rs:617-623 | crates/openshell-supervisor-network/src/opa.rs:1330-1336 — before extracting anything, compare `crates/openshell-supervisor-network/src/l7/mod.rs` and `crates/openshell-supervisor-network/src/opa.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) REDACTED:350 — REDACTED:350-356 | crates/openshell-server/src/persistence/sqlite.rs:320-326 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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.
  • + 17 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×40
  • Duplicated block (6 lines × 2) crates/openshell-cli/src/run.rs:1756 — crates/openshell-cli/src/run.rs:1756-1761 | crates/openshell-cli/src/run.rs:1767-1772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-core/src/host_pattern.rs:182 — crates/openshell-core/src/host_pattern.rs:182-187 | crates/openshell-policy/src/ambiguity.rs:577-583 — 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) crates/openshell-core/src/jwt.rs:23 — crates/openshell-core/src/jwt.rs:23-28 | crates/openshell-server/src/auth/peer.rs:386-391 — 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) crates/openshell-driver-docker/src/lib.rs:4910 — crates/openshell-driver-docker/src/lib.rs:4910-4915 | crates/openshell-driver-docker/src/lib.rs:4954-4959 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-driver-docker/src/lib.rs:5819 — crates/openshell-driver-docker/src/lib.rs:5819-5824 | crates/openshell-driver-vm/src/driver.rs:6277-6282 — before extracting anything, compare `crates/openshell-driver-docker/src/lib.rs` and `crates/openshell-driver-vm/src/driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/openshell-driver-kubernetes-secrets/src/lib.rs:165 — crates/openshell-driver-kubernetes-secrets/src/lib.rs:165-170 | crates/openshell-driver-vault/src/lib.rs:180-185 — before extracting anything, compare `crates/openshell-driver-kubernetes-secrets/src/lib.rs` and `crates/openshell-driver-vault/src/lib.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/openshell-driver-podman/src/isolation.rs:86 — crates/openshell-driver-podman/src/isolation.rs:86-93 | crates/openshell-driver-podman/src/isolation.rs:99-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-driver-vm/src/driver.rs:4348 — crates/openshell-driver-vm/src/driver.rs:4348-4353 | crates/openshell-driver-vm/src/driver.rs:4484-4489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-driver-vm/src/driver.rs:5945 — crates/openshell-driver-vm/src/driver.rs:5945-5950 | crates/openshell-driver-vm/src/driver.rs:6048-6053 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-ocsf/src/events/network_activity.rs:71 — crates/openshell-ocsf/src/events/network_activity.rs:71-76 | crates/openshell-ocsf/src/events/ssh_activity.rs:67-72 — 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) crates/openshell-server/src/certgen.rs:834 — crates/openshell-server/src/certgen.rs:834-839 | crates/openshell-server/src/certgen.rs:895-900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) REDACTED:367 — REDACTED:367-372 | crates/openshell-server/src/persistence/sqlite.rs:331-336 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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) crates/openshell-server/src/supervisor_session.rs:2072 — crates/openshell-server/src/supervisor_session.rs:2072-2077 | crates/openshell-server/src/supervisor_session.rs:2135-2140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-supervisor-network/src/l7/rest.rs:2538 — crates/openshell-supervisor-network/src/l7/rest.rs:2538-2543 | crates/openshell-supervisor-network/src/l7/rest.rs:3570-3575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:2704 — crates/openshell-supervisor-network/src/proxy.rs:2704-2709 | crates/openshell-supervisor-network/src/proxy.rs:3232-3237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-tui/src/lib.rs:2447 — crates/openshell-tui/src/lib.rs:2447-2453 | crates/openshell-tui/src/lib.rs:2547-2552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-tui/src/lib.rs:2811 — crates/openshell-tui/src/lib.rs:2811-2816 | crates/openshell-tui/src/lib.rs:2821-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.
  • Duplicated block (6 lines × 2) crates/openshell-tui/src/ui/create_provider.rs:195 — crates/openshell-tui/src/ui/create_provider.rs:195-200 | crates/openshell-tui/src/ui/create_provider.rs:328-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-tui/src/ui/mod.rs:224 — crates/openshell-tui/src/ui/mod.rs:224-229 | crates/openshell-tui/src/ui/mod.rs:316-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/openshell-vfio/src/gpu.rs:121 — crates/openshell-vfio/src/gpu.rs:121-128 | crates/openshell-vfio/src/gpu.rs:145-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.
  • Duplicated block (6 lines × 2) crates/openshell-driver-kubernetes-secrets/src/lib.rs:469 — crates/openshell-driver-kubernetes-secrets/src/lib.rs:469-474 | crates/openshell-driver-vault/src/lib.rs:532-537 — before extracting anything, compare `crates/openshell-driver-kubernetes-secrets/src/lib.rs` and `crates/openshell-driver-vault/src/lib.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/openshell-sandbox/src/activity_aggregator.rs:133 — crates/openshell-sandbox/src/activity_aggregator.rs:133-138 | crates/openshell-supervisor/src/activity_aggregator.rs:133-138 — before extracting anything, compare `crates/openshell-sandbox/src/activity_aggregator.rs` and `crates/openshell-supervisor/src/activity_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/openshell-sandbox/src/main_session.rs:37 — crates/openshell-sandbox/src/main_session.rs:37-42 | crates/openshell-supervisor-process/src/main_session.rs:31-36 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/openshell-sandbox/src/main_session.rs:946 — crates/openshell-sandbox/src/main_session.rs:946-951 | crates/openshell-supervisor-process/src/main_session.rs:477-482 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/openshell-server/src/compute/mod.rs:600 — crates/openshell-server/src/compute/mod.rs:600-605 | crates/openshell-server/src/credentials.rs:1552-1557 — 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.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×37
  • Duplicated block (11 lines × 2) crates/openshell-cli/src/commands/provider.rs:1258 — crates/openshell-cli/src/commands/provider.rs:1258-1268 | crates/openshell-cli/src/commands/provider.rs:1355-1365 — both copies are in the same file, so extract the block into 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) crates/openshell-cli/src/run.rs:3651 — crates/openshell-cli/src/run.rs:3651-3661 | crates/openshell-cli/src/run.rs:5105-5115 — both copies are in the same file, so extract the block into 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) crates/openshell-core/src/paths.rs:121 — crates/openshell-core/src/paths.rs:121-131 | crates/openshell-core/src/paths.rs:137-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/openshell-driver-docker/src/lib.rs:1708 — crates/openshell-driver-docker/src/lib.rs:1708-1718 | crates/openshell-driver-docker/src/lib.rs:1727-1737 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-docker/src/lib.rs:1796 — crates/openshell-driver-docker/src/lib.rs:1796-1806 | crates/openshell-driver-docker/src/lib.rs:1818-1828 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-docker/src/lib.rs:1853 — crates/openshell-driver-docker/src/lib.rs:1853-1863 | crates/openshell-driver-docker/src/lib.rs:1929-1939 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-vm/src/driver.rs:7467 — crates/openshell-driver-vm/src/driver.rs:7467-7477 | crates/openshell-driver-vm/src/layer_applier.rs:158-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) crates/openshell-sandbox-backend/src/runtime_initiated.rs:120 — crates/openshell-sandbox-backend/src/runtime_initiated.rs:120-130 | crates/openshell-sandbox-backend/src/runtime_routed.rs:461-471 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) crates/openshell-sandbox/src/denial_aggregator.rs:118 — crates/openshell-sandbox/src/denial_aggregator.rs:118-128 | crates/openshell-supervisor/src/denial_aggregator.rs:118-128 — before extracting anything, compare `crates/openshell-sandbox/src/denial_aggregator.rs` and `crates/openshell-supervisor/src/denial_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) crates/openshell-sandbox/src/main_session.rs:567 — crates/openshell-sandbox/src/main_session.rs:567-577 | crates/openshell-sandbox/src/main_session.rs:680-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/openshell-server/src/grpc/policy.rs:4558 — crates/openshell-server/src/grpc/policy.rs:4558-4568 | crates/openshell-server/src/grpc/policy.rs:4660-4670 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/provider.rs:2963 — crates/openshell-server/src/grpc/provider.rs:2963-2973 | crates/openshell-server/src/grpc/provider.rs:3058-3068 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/provider.rs:3014 — crates/openshell-server/src/grpc/provider.rs:3014-3024 | crates/openshell-server/src/grpc/workspace.rs:536-546 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/workspace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:1368 — crates/openshell-server/src/grpc/sandbox.rs:1368-1378 | crates/openshell-server/src/grpc/service.rs:42-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 (11 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:1769 — crates/openshell-server/src/grpc/sandbox.rs:1769-1779 | crates/openshell-server/src/grpc/sandbox.rs:1865-1875 — both copies are in the same file, so extract the block into 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) REDACTED:985 — REDACTED:985-995 | crates/openshell-server/src/persistence/sqlite.rs:762-772 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:1780 — REDACTED:1780-1790 | crates/openshell-server/src/persistence/sqlite.rs:1608-1618 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:1806 — REDACTED:1806-1816 | crates/openshell-server/src/persistence/sqlite.rs:1634-1644 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:1826 — REDACTED:1826-1836 | crates/openshell-server/src/persistence/sqlite.rs:1654-1664 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:1999 — REDACTED:1999-2009 | crates/openshell-server/src/persistence/sqlite.rs:1828-1838 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:2037 — REDACTED:2037-2047 | crates/openshell-server/src/persistence/sqlite.rs:1866-1876 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:2141 — REDACTED:2141-2151 | crates/openshell-server/src/persistence/sqlite.rs:1970-1980 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) crates/openshell-supervisor-network/src/l7/middleware.rs:91 — crates/openshell-supervisor-network/src/l7/middleware.rs:91-101 | crates/openshell-supervisor-network/src/l7/relay.rs:865-875 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:2041 — crates/openshell-supervisor-network/src/l7/relay.rs:2041-2051 | crates/openshell-supervisor-network/src/l7/relay.rs:3526-3536 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/l7/relay.rs:2074 — crates/openshell-supervisor-network/src/l7/relay.rs:2074-2085 | crates/openshell-supervisor-network/src/l7/relay.rs:2507-2517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 12 more in this group — see findings.md.
D1 · Cyclomatic Complexity · openshell_server · ×32
  • openshell_server::grpc::sandbox::handle_watch_sandbox (cyclomatic 86) crates/openshell-server/src/grpc/sandbox.rs:2033 — openshell_server::grpc::sandbox::handle_watch_sandbox has cyclomatic complexity 86 (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.
  • openshell_server::grpc::policy::handle_update_config_inner (cyclomatic 54) crates/openshell-server/src/grpc/policy.rs:4176 — openshell_server::grpc::policy::handle_update_config_inner has cyclomatic complexity 54 (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.
  • openshell_server::grpc::provider::resolve_provider_environment_from_records_with_policy_bindings_and_credentials (cyclomatic 50) crates/openshell-server/src/grpc/provider.rs:1166 — openshell_server::grpc::provider::resolve_provider_environment_from_records_with_policy_bindings_and_credentials has cyclomatic complexity 50 (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.
  • openshell_server::cli::merge_file_into_args (cyclomatic 49) crates/openshell-server/src/cli.rs:1230 — openshell_server::cli::merge_file_into_args has cyclomatic complexity 49 (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.
  • openshell_server::grpc::provider::handle_configure_provider_refresh (cyclomatic 41) crates/openshell-server/src/grpc/provider.rs:4814 — openshell_server::grpc::provider::handle_configure_provider_refresh has cyclomatic complexity 41 (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.
  • openshell_server::run_server (cyclomatic 39) crates/openshell-server/src/lib.rs:585 — openshell_server::run_server has cyclomatic complexity 39 (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.
  • openshell_server::grpc::provider_credentials::retrieve (cyclomatic 35) crates/openshell-server/src/grpc/provider_credentials.rs:138 — openshell_server::grpc::provider_credentials::retrieve has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_server::cli::prepare_server_config_with_drivers (cyclomatic 33) crates/openshell-server/src/cli.rs:380 — openshell_server::cli::prepare_server_config_with_drivers has cyclomatic complexity 33 (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.
  • openshell_server::grpc::provider::profile_attached_sandbox_diagnostics (cyclomatic 31) crates/openshell-server/src/grpc/provider.rs:3808 — openshell_server::grpc::provider::profile_attached_sandbox_diagnostics 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.
  • openshell_server::compute::apply_driver_snapshot (cyclomatic 30) crates/openshell-server/src/compute/mod.rs:7323 — openshell_server::compute::apply_driver_snapshot has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • openshell_server::provider_refresh::apply_minted_credential (cyclomatic 30) crates/openshell-server/src/provider_refresh.rs:1424 — openshell_server::provider_refresh::apply_minted_credential has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_server::grpc::policy::handle_submit_policy_analysis (cyclomatic 27) crates/openshell-server/src/grpc/policy.rs:5497 — openshell_server::grpc::policy::handle_submit_policy_analysis 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.
  • openshell_server::grpc::policy::handle_report_sandbox_configuration (cyclomatic 23) crates/openshell-server/src/grpc/policy.rs:5029 — openshell_server::grpc::policy::handle_report_sandbox_configuration has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • openshell_server::grpc::sandbox::run_interactive_exec_with_russh (cyclomatic 23) crates/openshell-server/src/grpc/sandbox.rs:3770 — openshell_server::grpc::sandbox::run_interactive_exec_with_russh 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.
  • openshell_server::auth::oidc::parse_jwk (cyclomatic 22) crates/openshell-server/src/auth/oidc.rs:385 — openshell_server::auth::oidc::parse_jwk 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.
  • openshell_server::grpc::policy::handle_approve_all_draft_chunks_inner (cyclomatic 22) crates/openshell-server/src/grpc/policy.rs:6273 — openshell_server::grpc::policy::handle_approve_all_draft_chunks_inner 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.
  • openshell_server::cli::validate_preflight_semantics (cyclomatic 21) crates/openshell-server/src/cli.rs:1047 — openshell_server::cli::validate_preflight_semantics has cyclomatic complexity 21 (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.
  • openshell_server::grpc::policy::apply_merge_operations_with_retry (cyclomatic 20) crates/openshell-server/src/grpc/policy.rs:7617 — openshell_server::grpc::policy::apply_merge_operations_with_retry 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.
  • openshell_server::grpc::provider::update_provider_record_validating (cyclomatic 20) crates/openshell-server/src/grpc/provider.rs:375 — openshell_server::grpc::provider::update_provider_record_validating 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.
  • openshell_server::grpc::provider_readiness::evaluate_status (cyclomatic 20) crates/openshell-server/src/grpc/provider_readiness.rs:489 — openshell_server::grpc::provider_readiness::evaluate_status 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.
  • openshell_server::service_routing::proxy_to_endpoint (cyclomatic 20) crates/openshell-server/src/service_routing.rs:337 — openshell_server::service_routing::proxy_to_endpoint 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.
  • openshell_server::grpc::policy::endpoint_status::handle_report_endpoint_status_inner (cyclomatic 18) crates/openshell-server/src/grpc/policy/endpoint_status.rs:113 — openshell_server::grpc::policy::endpoint_status::handle_report_endpoint_status_inner 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.
  • openshell_server::grpc::provider::create_provider_record_validating (cyclomatic 18) crates/openshell-server/src/grpc/provider.rs:142 — openshell_server::grpc::provider::create_provider_record_validating 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.
  • openshell_server::grpc::validation::validate_label_key (cyclomatic 18) crates/openshell-server/src/grpc/validation.rs:772 — openshell_server::grpc::validation::validate_label_key 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.
  • openshell_server::provider_refresh::refresh_provider_credential_locked (cyclomatic 18) crates/openshell-server/src/provider_refresh.rs:1094 — openshell_server::provider_refresh::refresh_provider_credential_locked has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×32
  • Duplicated block (5 lines × 2) crates/openshell-cli/src/commands/common.rs:901 — crates/openshell-cli/src/commands/common.rs:901-905 | crates/openshell-cli/src/commands/common.rs:940-944 — both copies are in the same file, so extract the block into 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) crates/openshell-core/src/secrets.rs:575 — crates/openshell-core/src/secrets.rs:575-579 | crates/openshell-core/src/secrets.rs:1142-1148 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-docker/src/lib.rs:4126 — crates/openshell-driver-docker/src/lib.rs:4126-4130 | crates/openshell-driver-docker/src/lib.rs:4145-4149 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-kubernetes-secrets/src/main.rs:127 — crates/openshell-driver-kubernetes-secrets/src/main.rs:127-131 | crates/openshell-driver-vault/src/main.rs:179-183 — before extracting anything, compare `crates/openshell-driver-kubernetes-secrets/src/main.rs` and `crates/openshell-driver-vault/src/main.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs:2036 — crates/openshell-driver-kubernetes/src/driver.rs:2036-2040 | crates/openshell-driver-kubernetes/src/driver.rs:4512-4516 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-kubernetes/src/driver.rs:6610 — crates/openshell-driver-kubernetes/src/driver.rs:6610-6614 | crates/openshell-driver-kubernetes/src/driver.rs:6653-6657 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-kubernetes/src/main.rs:341 — crates/openshell-driver-kubernetes/src/main.rs:341-345 | crates/openshell-driver-podman/src/main.rs:281-285 — 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) crates/openshell-driver-podman/src/container.rs:1680 — crates/openshell-driver-podman/src/container.rs:1680-1684 | crates/openshell-driver-podman/src/container.rs:1741-1745 — both copies are in the same file, so extract the block into 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) crates/openshell-ocsf/src/events/detection_finding.rs:67 — crates/openshell-ocsf/src/events/detection_finding.rs:67-71 | crates/openshell-ocsf/src/events/process_activity.rs:53-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/openshell-ocsf/src/events/http_activity.rs:81 — crates/openshell-ocsf/src/events/http_activity.rs:81-85 | crates/openshell-ocsf/src/events/network_activity.rs:75-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/openshell-server/src/credentials.rs:453 — crates/openshell-server/src/credentials.rs:453-457 | crates/openshell-server/src/credentials.rs:500-504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) REDACTED:2225 — REDACTED:2225-2229 | crates/openshell-server/src/persistence/sqlite.rs:2099-2103 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:5893 — crates/openshell-supervisor-network/src/proxy.rs:5893-5897 | crates/openshell-supervisor-network/src/proxy.rs:5944-5948 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-process/src/ssh.rs:1064 — crates/openshell-supervisor-process/src/ssh.rs:1064-1068 | crates/openshell-supervisor-process/src/ssh.rs:1085-1089 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor/src/config_runtime.rs:1602 — crates/openshell-supervisor/src/config_runtime.rs:1602-1606 | crates/openshell-tui/src/app.rs:212-216 — 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) crates/openshell-tui/src/app.rs:917 — crates/openshell-tui/src/app.rs:917-921 | crates/openshell-tui/src/app.rs:932-937 — both copies are in the same file, so extract the block into 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) crates/openshell-tui/src/lib.rs:959 — crates/openshell-tui/src/lib.rs:959-963 | crates/openshell-tui/src/lib.rs:1089-1094 — both copies are in the same file, so extract the block into 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) crates/openshell-tui/src/ui/create_provider.rs:985 — crates/openshell-tui/src/ui/create_provider.rs:985-989 | crates/openshell-tui/src/ui/create_sandbox.rs:233-237 — before extracting anything, compare `crates/openshell-tui/src/ui/create_provider.rs` and `crates/openshell-tui/src/ui/create_sandbox.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) crates/openshell-tui/src/ui/global_settings.rs:14 — crates/openshell-tui/src/ui/global_settings.rs:14-18 | crates/openshell-tui/src/ui/sandbox_settings.rs:13-17 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/openshell-driver-podman/src/socket_discovery.rs:154 — crates/openshell-driver-podman/src/socket_discovery.rs:154-158 | crates/openshell-driver-vm/src/driver.rs:5756-5760 — 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) crates/openshell-providers/src/profiles.rs:1848 — crates/openshell-providers/src/profiles.rs:1848-1852 | crates/openshell-supervisor-network/src/l7/mod.rs:984-988 — 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) crates/openshell-driver-kubernetes-secrets/src/main.rs:47 — crates/openshell-driver-kubernetes-secrets/src/main.rs:47-56 | crates/openshell-driver-vault/src/main.rs:72-76 — before extracting anything, compare `crates/openshell-driver-kubernetes-secrets/src/main.rs` and `crates/openshell-driver-vault/src/main.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) crates/openshell-driver-kubernetes/src/lifecycle.rs:17 — crates/openshell-driver-kubernetes/src/lifecycle.rs:17-21 | crates/openshell-server/src/compute/mod.rs:281-289 — 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) crates/openshell-vfio/src/pci.rs:131 — crates/openshell-vfio/src/pci.rs:131-137 | crates/openshell-vfio/src/pci.rs:165-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.
  • Duplicated block (5 lines × 2) crates/openshell-driver-vm/src/runtime.rs:454 — crates/openshell-driver-vm/src/runtime.rs:454-459 | crates/openshell-driver-vm/src/runtime.rs:469-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×30
  • Duplicated block (12 lines × 2) crates/openshell-cli/src/auth.rs:411 — crates/openshell-cli/src/auth.rs:411-422 | crates/openshell-cli/src/oidc_auth.rs:635-646 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) crates/openshell-cli/src/commands/gateway.rs:944 — crates/openshell-cli/src/commands/gateway.rs:944-955 | crates/openshell-cli/src/commands/gateway.rs:1153-1164 — both copies are in the same file, so extract the block into 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) crates/openshell-cli/src/commands/provider.rs:317 — crates/openshell-cli/src/commands/provider.rs:317-328 | crates/openshell-cli/src/commands/provider.rs:1564-1575 — both copies are in the same file, so extract the block into 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) crates/openshell-cli/src/commands/provider.rs:559 — crates/openshell-cli/src/commands/provider.rs:559-570 | crates/openshell-cli/src/commands/provider.rs:610-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.
  • Duplicated block (12 lines × 2) crates/openshell-cli/src/commands/provider.rs:1554 — crates/openshell-cli/src/commands/provider.rs:1554-1565 | crates/openshell-cli/src/run.rs:3825-3836 — before extracting anything, compare `crates/openshell-cli/src/commands/provider.rs` and `crates/openshell-cli/src/run.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) crates/openshell-cli/src/commands/provider.rs:1681 — crates/openshell-cli/src/commands/provider.rs:1681-1692 | crates/openshell-cli/src/commands/provider.rs:1720-1731 — both copies are in the same file, so extract the block into 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) crates/openshell-conformance/src/scenarios/sandbox_lifecycle.rs:315 — crates/openshell-conformance/src/scenarios/sandbox_lifecycle.rs:315-326 | crates/openshell-conformance/src/scenarios/smoke.rs:174-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) crates/openshell-driver-docker/src/main.rs:121 — crates/openshell-driver-docker/src/main.rs:121-132 | crates/openshell-driver-kubernetes/src/main.rs:214-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 (12 lines × 2) crates/openshell-driver-mxc/src/policy_map/map.rs:134 — crates/openshell-driver-mxc/src/policy_map/map.rs:134-145 | crates/openshell-driver-mxc/src/policy_map/map.rs:244-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.
  • Duplicated block (12 lines × 2) crates/openshell-driver-podman/src/container.rs:867 — crates/openshell-driver-podman/src/container.rs:867-878 | crates/openshell-driver-podman/src/container.rs:889-900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/openshell-driver-vm/src/layer_applier.rs:343 — crates/openshell-driver-vm/src/layer_applier.rs:343-354 | crates/openshell-driver-vm/src/layer_applier.rs:650-661 — both copies are in the same file, so extract the block into 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) crates/openshell-prover/src/containment.rs:2066 — crates/openshell-prover/src/containment.rs:2066-2077 | crates/openshell-prover/src/containment.rs:2080-2091 — both copies are in the same file, so extract the block into 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) crates/openshell-providers/src/profiles.rs:3570 — crates/openshell-providers/src/profiles.rs:3570-3581 | crates/openshell-server/src/grpc/provider.rs:1870-1881 — before extracting anything, compare `crates/openshell-providers/src/profiles.rs` and `crates/openshell-server/src/grpc/provider.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) crates/openshell-sdk/src/client.rs:1432 — crates/openshell-sdk/src/client.rs:1432-1443 | crates/openshell-sdk/src/client.rs:1473-1484 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/policy.rs:8163 — crates/openshell-server/src/grpc/policy.rs:8163-8174 | crates/openshell-server/src/grpc/policy.rs:8176-8187 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/provider.rs:1329 — crates/openshell-server/src/grpc/provider.rs:1329-1340 | crates/openshell-server/src/grpc/provider.rs:1408-1419 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/sandbox.rs:1811 — crates/openshell-server/src/grpc/sandbox.rs:1811-1822 | crates/openshell-server/src/grpc/sandbox.rs:1907-1918 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/workspace.rs:486 — crates/openshell-server/src/grpc/workspace.rs:486-497 | crates/openshell-server/src/grpc/workspace.rs:582-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) REDACTED:1544 — REDACTED:1544-1555 | crates/openshell-server/src/persistence/sqlite.rs:1383-1394 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) REDACTED:1842 — REDACTED:1842-1853 | crates/openshell-server/src/persistence/sqlite.rs:1670-1681 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) crates/openshell-supervisor-network/src/host.rs:149 — crates/openshell-supervisor-network/src/host.rs:149-160 | crates/openshell-supervisor-network/src/host.rs:178-189 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/l7/relay.rs:1199 — crates/openshell-supervisor-network/src/l7/relay.rs:1199-1210 | crates/openshell-supervisor-network/src/l7/relay.rs:2061-2072 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/sigv4.rs:284 — crates/openshell-supervisor-network/src/sigv4.rs:284-295 | crates/openshell-supervisor-network/src/sigv4.rs:351-362 — both copies are in the same file, so extract the block into 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) crates/openshell-sandbox/src/activity_aggregator.rs:147 — crates/openshell-sandbox/src/activity_aggregator.rs:147-158 | crates/openshell-supervisor/src/activity_aggregator.rs:147-158 — before extracting anything, compare `crates/openshell-sandbox/src/activity_aggregator.rs` and `crates/openshell-supervisor/src/activity_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) crates/openshell-sandbox/src/main_session.rs:836 — crates/openshell-sandbox/src/main_session.rs:836-847 | crates/openshell-supervisor-process/src/main_session.rs:382-393 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • + 5 more in this group — see findings.md.
D1 · Cyclomatic Complexity · openshell_supervisor_network · ×28
  • openshell_supervisor_network::l7::validate_l7_policies (cyclomatic 96) crates/openshell-supervisor-network/src/l7/mod.rs:1236 — openshell_supervisor_network::l7::validate_l7_policies has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_supervisor_network::proxy::handle_forward_proxy (cyclomatic 94) crates/openshell-supervisor-network/src/proxy.rs:5332 — openshell_supervisor_network::proxy::handle_forward_proxy has cyclomatic complexity 94 (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.
  • openshell_supervisor_network::proxy::handle_mediated_connection (cyclomatic 67) crates/openshell-supervisor-network/src/proxy.rs:2414 — openshell_supervisor_network::proxy::handle_mediated_connection has cyclomatic complexity 67 (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.
  • openshell_supervisor_network::l7::rest::http_response::relay_response_through_middleware (cyclomatic 61) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:291 — openshell_supervisor_network::l7::rest::http_response::relay_response_through_middleware has cyclomatic complexity 61 (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.
  • openshell_supervisor_network::opa::proto_to_opa_data_json (cyclomatic 59) crates/openshell-supervisor-network/src/opa.rs:2255 — openshell_supervisor_network::opa::proto_to_opa_data_json has cyclomatic complexity 59 (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.
  • openshell_supervisor_network::l7::relay::relay_with_route_selection (cyclomatic 51) crates/openshell-supervisor-network/src/l7/relay.rs:1151 — openshell_supervisor_network::l7::relay::relay_with_route_selection has cyclomatic complexity 51 (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.
  • openshell_supervisor_network::l7::rest::relay_http_request_with_response_middleware_guarded_observed (cyclomatic 39) crates/openshell-supervisor-network/src/l7/rest.rs:892 — openshell_supervisor_network::l7::rest::relay_http_request_with_response_middleware_guarded_observed has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_supervisor_network::l7::rest::http_response::relay_response (cyclomatic 35) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:42 — openshell_supervisor_network::l7::rest::http_response::relay_response has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_supervisor_network::l7::relay::relay_rest (cyclomatic 32) crates/openshell-supervisor-network/src/l7/relay.rs:2020 — openshell_supervisor_network::l7::relay::relay_rest has cyclomatic complexity 32 (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.
  • openshell_supervisor_network::l7::websocket::relay_client_to_server (cyclomatic 32) crates/openshell-supervisor-network/src/l7/websocket.rs:646 — openshell_supervisor_network::l7::websocket::relay_client_to_server has cyclomatic complexity 32 (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.
  • openshell_supervisor_network::l7::relay::relay_jsonrpc (cyclomatic 29) crates/openshell-supervisor-network/src/l7/relay.rs:2438 — openshell_supervisor_network::l7::relay::relay_jsonrpc has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_supervisor_network::l7::relay::relay_graphql (cyclomatic 28) crates/openshell-supervisor-network/src/l7/relay.rs:2717 — openshell_supervisor_network::l7::relay::relay_graphql 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.
  • openshell_supervisor_network::proxy::destination::filter_resolved_addresses (cyclomatic 27) crates/openshell-supervisor-network/src/proxy/destination.rs:155 — openshell_supervisor_network::proxy::destination::filter_resolved_addresses 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.
  • openshell_supervisor_network::l7::rest::http_response::relay_normalized_response_body (cyclomatic 26) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1392 — openshell_supervisor_network::l7::rest::http_response::relay_normalized_response_body 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.
  • openshell_supervisor_network::proxy::preauthorize_transparent_open (cyclomatic 23) crates/openshell-supervisor-network/src/proxy.rs:576 — openshell_supervisor_network::proxy::preauthorize_transparent_open 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.
  • openshell_supervisor_network::l7::websocket::relay_text_payload_with_before_credential_write (cyclomatic 22) crates/openshell-supervisor-network/src/l7/websocket.rs:1180 — openshell_supervisor_network::l7::websocket::relay_text_payload_with_before_credential_write 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.
  • openshell_supervisor_network::run::run_networking (cyclomatic 20) crates/openshell-supervisor-network/src/run.rs:279 — openshell_supervisor_network::run::run_networking 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.
  • openshell_supervisor_network::l7::jsonrpc::parse_mcp_payload (cyclomatic 19) crates/openshell-supervisor-network/src/l7/jsonrpc.rs:722 — openshell_supervisor_network::l7::jsonrpc::parse_mcp_payload 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.
  • openshell_supervisor_network::l7::relay::relay_passthrough_with_credentials (cyclomatic 19) crates/openshell-supervisor-network/src/l7/relay.rs:3506 — openshell_supervisor_network::l7::relay::relay_passthrough_with_credentials 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.
  • openshell_supervisor_network::l7::rest::parse_http_request (cyclomatic 19) crates/openshell-supervisor-network/src/l7/rest.rs:197 — openshell_supervisor_network::l7::rest::parse_http_request has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • openshell_supervisor_network::l7::rest::validate_websocket_response (cyclomatic 19) crates/openshell-supervisor-network/src/l7/rest.rs:3444 — openshell_supervisor_network::l7::rest::validate_websocket_response 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.
  • openshell_supervisor_network::l7::validate_matcher_value (cyclomatic 18) crates/openshell-supervisor-network/src/l7/mod.rs:814 — openshell_supervisor_network::l7::validate_matcher_value has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_supervisor_network::l7::rest::parse_websocket_upgrade_request (cyclomatic 18) crates/openshell-supervisor-network/src/l7/rest.rs:2651 — openshell_supervisor_network::l7::rest::parse_websocket_upgrade_request 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.
  • openshell_supervisor_network::l7::rest::http_response::parse_response_head_for_middleware (cyclomatic 18) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1109 — openshell_supervisor_network::l7::rest::http_response::parse_response_head_for_middleware has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_supervisor_network::proxy::rewrite_forward_request (cyclomatic 18) crates/openshell-supervisor-network/src/proxy.rs:5006 — openshell_supervisor_network::proxy::rewrite_forward_request has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • + 3 more in this group — see findings.md.
D2 · Cognitive Complexity · openshell_cli · ×27
  • openshell_cli::run_async (cognitive 179) crates/openshell-cli/src/main.rs:2635 — openshell_cli::run_async has cognitive complexity 179 (threshold 15). Drivers by points: if/else 55 (123 pts), match/switch 21 (48 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 100). 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.
  • openshell_cli::run::sandbox_create (cognitive 179) crates/openshell-cli/src/run.rs:497 — openshell_cli::run::sandbox_create has cognitive complexity 179 (threshold 15). Drivers by points: if/else 66 (127 pts), boolean chains 25, match/switch 11 (20 pts), loops 3 (7 pts) (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::run::sandbox_get_to_writer (cognitive 64) crates/openshell-cli/src/run.rs:1609 — openshell_cli::run::sandbox_get_to_writer has cognitive complexity 64 (threshold 15). Drivers by points: if/else 29 (39 pts), loops 8 (18 pts), boolean chains 6, match/switch 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.
  • openshell_cli::run::sandbox_exec_streaming_grpc (cognitive 64) crates/openshell-cli/src/run.rs:2580 — openshell_cli::run::sandbox_exec_streaming_grpc has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 6 (11 pts), match/switch 5 (11 pts), boolean chains 3 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::commands::gateway::gateway_add (cognitive 61) crates/openshell-cli/src/commands/gateway.rs:839 — openshell_cli::commands::gateway::gateway_add has cognitive complexity 61 (threshold 15). Drivers by points: if/else 29 (45 pts), match/switch 5 (12 pts), boolean chains 4 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::commands::provider::format_provider_profile_details (cognitive 53) crates/openshell-cli/src/commands/provider.rs:2529 — openshell_cli::commands::provider::format_provider_profile_details has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (39 pts), match/switch 4 (8 pts), loops 4, boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::run::sandbox_template_to_json (cognitive 41) crates/openshell-cli/src/run.rs:3632 — openshell_cli::run::sandbox_template_to_json has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 1 (nesting depth added 22). 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.
  • openshell_cli::policy_update::build_policy_update_plan (cognitive 37) crates/openshell-cli/src/policy_update.rs:24 — openshell_cli::policy_update::build_policy_update_plan has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 7, loops 6 (7 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::commands::provider::provider_create_with_options (cognitive 33) crates/openshell-cli/src/commands/provider.rs:1103 — openshell_cli::commands::provider::provider_create_with_options has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_cli::commands::gateway::gateway_status (cognitive 31) crates/openshell-cli/src/commands/gateway.rs:64 — openshell_cli::commands::gateway::gateway_status has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 4 (7 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::run::sandbox_list (cognitive 27) crates/openshell-cli/src/run.rs:2855 — openshell_cli::run::sandbox_list has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_cli::ssh::sandbox_connect_supervised (cognitive 27) crates/openshell-cli/src/ssh.rs:541 — openshell_cli::ssh::sandbox_connect_supervised has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::commands::provider::auto_create_provider (cognitive 26) crates/openshell-cli/src/commands/provider.rs:481 — openshell_cli::commands::provider::auto_create_provider has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 2 (4 pts), loops 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.
  • openshell_cli::ssh::upload::transfer (cognitive 24) crates/openshell-cli/src/ssh/upload.rs:292 — openshell_cli::ssh::upload::transfer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (7 pts), loops 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::commands::provider::provider_list (cognitive 21) crates/openshell-cli/src/commands/provider.rs:1495 — openshell_cli::commands::provider::provider_list has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_cli::commands::provider::provider_update (cognitive 21) crates/openshell-cli/src/commands/provider.rs:2739 — openshell_cli::commands::provider::provider_update has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • openshell_cli::completers::completion_grpc_client (cognitive 20) crates/openshell-cli/src/completers.rs:129 — openshell_cli::completers::completion_grpc_client has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (7 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.
  • openshell_cli::run::sandbox_delete (cognitive 19) crates/openshell-cli/src/run.rs:3989 — openshell_cli::run::sandbox_delete has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), match/switch 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::commands::provider::ensure_required_providers (cognitive 18) crates/openshell-cli/src/commands/provider.rs:382 — openshell_cli::commands::provider::ensure_required_providers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::apply_auth_with_status (cognitive 18) crates/openshell-cli/src/main.rs:169 — openshell_cli::apply_auth_with_status has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • openshell_cli::run::sandbox_draft_get (cognitive 18) crates/openshell-cli/src/run.rs:6723 — openshell_cli::run::sandbox_draft_get has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::run::sandbox_exec_grpc (cognitive 17) crates/openshell-cli/src/run.rs:1987 — openshell_cli::run::sandbox_exec_grpc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, match/switch 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • openshell_cli::commands::common::handle_platform_progress_event (cognitive 16) crates/openshell-cli/src/commands/common.rs:450 — openshell_cli::commands::common::handle_platform_progress_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::commands::provider_readiness::validate_mutation_receipts (cognitive 16) crates/openshell-cli/src/commands/provider_readiness.rs:76 — openshell_cli::commands::provider_readiness::validate_mutation_receipts has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (7 pts), loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_cli::oidc_auth::oidc_device_code_flow (cognitive 16) crates/openshell-cli/src/oidc_auth.rs:314 — openshell_cli::oidc_auth::oidc_device_code_flow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×26
  • Duplicated block (13 lines × 2) crates/openshell-cli/src/commands/provider.rs:575 — crates/openshell-cli/src/commands/provider.rs:575-587 | crates/openshell-cli/src/commands/provider.rs:625-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) crates/openshell-cli/src/run.rs:873 — crates/openshell-cli/src/run.rs:873-885 | crates/openshell-cli/src/run.rs:895-907 — both copies are in the same file, so extract the block into 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) crates/openshell-cli/src/run.rs:3746 — crates/openshell-cli/src/run.rs:3746-3758 | crates/openshell-cli/src/run.rs:4781-4793 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-docker/src/lib.rs:3339 — crates/openshell-driver-docker/src/lib.rs:3339-3351 | crates/openshell-driver-vm/src/driver.rs:4932-4944 — before extracting anything, compare `crates/openshell-driver-docker/src/lib.rs` and `crates/openshell-driver-vm/src/driver.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/openshell-driver-vm/src/driver.rs:1307 — crates/openshell-driver-vm/src/driver.rs:1307-1319 | crates/openshell-driver-vm/src/driver.rs:2510-2522 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-vm/src/rootfs.rs:897 — crates/openshell-driver-vm/src/rootfs.rs:897-909 | crates/openshell-driver-vm/src/rootfs.rs:991-1003 — both copies are in the same file, so extract the block into 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) crates/openshell-providers/src/profiles.rs:3513 — crates/openshell-providers/src/profiles.rs:3513-3525 | crates/openshell-server/src/grpc/provider.rs:1813-1825 — before extracting anything, compare `crates/openshell-providers/src/profiles.rs` and `crates/openshell-server/src/grpc/provider.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/openshell-sandbox/src/denial_aggregator.rs:173 — crates/openshell-sandbox/src/denial_aggregator.rs:173-185 | crates/openshell-supervisor/src/denial_aggregator.rs:173-185 — before extracting anything, compare `crates/openshell-sandbox/src/denial_aggregator.rs` and `crates/openshell-supervisor/src/denial_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/openshell-sandbox/src/main_session.rs:524 — crates/openshell-sandbox/src/main_session.rs:524-536 | crates/openshell-sandbox/src/main_session.rs:550-562 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/compute/mod.rs:6351 — crates/openshell-server/src/compute/mod.rs:6351-6363 | crates/openshell-server/src/compute/mod.rs:6400-6412 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/policy/endpoint_status.rs:455 — crates/openshell-server/src/grpc/policy/endpoint_status.rs:455-467 | crates/openshell-server/src/grpc/policy/endpoint_status.rs:518-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:1416 — crates/openshell-server/src/grpc/sandbox.rs:1416-1428 | crates/openshell-server/src/grpc/sandbox.rs:1587-1599 — both copies are in the same file, so extract the block into 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) REDACTED:1686 — REDACTED:1686-1698 | crates/openshell-server/src/persistence/sqlite.rs:1514-1526 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) REDACTED:1981 — REDACTED:1981-1993 | crates/openshell-server/src/persistence/sqlite.rs:1810-1822 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) REDACTED:2054 — REDACTED:2054-2066 | crates/openshell-server/src/persistence/sqlite.rs:1883-1895 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/openshell-server/src/supervisor_session.rs:2652 — crates/openshell-server/src/supervisor_session.rs:2652-2664 | crates/openshell-server/src/supervisor_session.rs:2675-2687 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-middleware/src/lib.rs:114 — crates/openshell-supervisor-middleware/src/lib.rs:114-126 | crates/openshell-supervisor-middleware/src/lib.rs:172-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1675 — crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1675-1687 | crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1817-1829 — both copies are in the same file, so extract the block into 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) crates/openshell-cli/src/commands/provider.rs:73 — crates/openshell-cli/src/commands/provider.rs:73-85 | crates/openshell-cli/src/run.rs:142-154 — before extracting anything, compare `crates/openshell-cli/src/commands/provider.rs` and `crates/openshell-cli/src/run.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) crates/openshell-sandbox-backend/src/runtime.rs:1902 — crates/openshell-sandbox-backend/src/runtime.rs:1902-1914 | crates/openshell-sandbox-backend/src/runtime.rs:1985-1998 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/l7/mod.rs:632 — crates/openshell-supervisor-network/src/l7/mod.rs:632-644 | crates/openshell-supervisor-network/src/l7/mod.rs:649-661 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/policy.rs:6117 — crates/openshell-server/src/grpc/policy.rs:6117-6129 | crates/openshell-server/src/grpc/policy.rs:6535-6547 — both copies are in the same file, so extract the block into 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) crates/openshell-driver-podman/src/client.rs:677 — crates/openshell-driver-podman/src/client.rs:677-689 | crates/openshell-driver-podman/src/client.rs:710-722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) sdk/go/openshell/v1/fake/provider.go:116 — sdk/go/openshell/v1/fake/provider.go:116-128 | sdk/go/openshell/v1/fake/sandbox.go:467-479 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) sdk/go/openshell/v1/gateway/token.go:130 — sdk/go/openshell/v1/gateway/token.go:130-142 | sdk/go/openshell/v1/oidc/token.go:114-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/go/openshell/v1/gateway/token.go:130` 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.
  • + 1 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×24
  • ClassTooLong: ComputeRuntime crates/openshell-server/src/compute/mod.rs:875 — ClassTooLong — 3985 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 140 methods, 3 blocks, lines 875-6566. The bar is 400 significant lines; this is 3585 over it, 9.96× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: KubernetesComputeDriver crates/openshell-driver-kubernetes/src/driver.rs:891 — ClassTooLong — 3369 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 87 methods, 3 blocks, lines 891-5395. The bar is 400 significant lines; this is 2969 over it, 8.42× 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: VmDriver crates/openshell-driver-vm/src/driver.rs:734 — ClassTooLong — 3205 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 65 methods, 4 blocks, lines 734-5900. The bar is 400 significant lines; this is 2805 over it, 8.01× 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: App crates/openshell-tui/src/app.rs:592 — ClassTooLong — 1979 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 58 methods, 2 blocks, lines 592-3605. The bar is 400 significant lines; this is 1579 over it, 4.95× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DockerComputeDriver crates/openshell-driver-docker/src/lib.rs:382 — ClassTooLong — 1843 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 47 methods, 3 blocks, lines 382-3549. The bar is 400 significant lines; this is 1443 over it, 4.61× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PostgresStore REDACTED:42 — ClassTooLong — 1537 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 56 methods, 2 blocks, lines 42-2203. The bar is 400 significant lines; this is 1137 over it, 3.84× 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: SqliteStore crates/openshell-server/src/persistence/sqlite.rs:50 — ClassTooLong — 1474 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 51 methods, 2 blocks, lines 50-2032. The bar is 400 significant lines; this is 1074 over it, 3.69× 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: PodmanComputeDriver crates/openshell-driver-podman/src/driver.rs:158 — ClassTooLong — 1039 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 3 blocks, lines 158-1883. The bar is 400 significant lines; this is 639 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Store crates/openshell-server/src/persistence/mod.rs:255 — ClassTooLong — 726 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 46 methods, 2 blocks, lines 255-1440. The bar is 400 significant lines; this is 326 over it, 1.82× 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: SshHandler crates/openshell-supervisor-process/src/ssh.rs:421 — ClassTooLong — 726 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 5 blocks, lines 421-1429. The bar is 400 significant lines; this is 326 over it, 1.82× 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: ConfigRuntime crates/openshell-supervisor/src/config_runtime.rs:167 — ClassTooLong — 717 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, 2 blocks, lines 167-1158. The bar is 400 significant lines; this is 317 over it, 1.79× 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: BoundaryClient crates/openshell-sandbox-backend/src/runtime.rs:1573 — ClassTooLong — 694 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 2 blocks, lines 1573-2662. The bar is 400 significant lines; this is 294 over it, 1.74× 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: SandboxClient sdk/typescript/src/client.ts:1184 — ClassTooLong — 606 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 206 over it, 1.52× 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: SupervisorHostController crates/openshell-supervisor-control/src/controller.rs:360 — ClassTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 4 blocks, lines 360-1250. The bar is 400 significant lines; this is 198 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ProviderCredentialState crates/openshell-core/src/provider_credentials.rs:83 — ClassTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 28 methods, 2 blocks, lines 83-955. The bar is 400 significant lines; this is 190 over it, 1.48× 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: OpenShellClient crates/openshell-sdk/src/client.rs:37 — ClassTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 2 blocks, lines 37-903. The bar is 400 significant lines; this is 128 over it, 1.32× 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: OpaEngine crates/openshell-supervisor-network/src/opa.rs:178 — ClassTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 2 blocks, lines 178-1142. The bar is 400 significant lines; this is 116 over it, 1.29× 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: ChainRunner crates/openshell-supervisor-middleware/src/lib.rs:580 — ClassTooLong — 510 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 3 blocks, lines 580-2060. The bar is 400 significant lines; this is 110 over it, 1.28× 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: SupervisorSessionRegistry crates/openshell-server/src/supervisor_session.rs:376 — ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 46 methods, 3 blocks, lines 376-1181. The bar is 400 significant lines; this is 100 over it, 1.25× 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: HttpResponseSession crates/openshell-supervisor-middleware/src/response.rs:225 — ClassTooLong — 496 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 2 blocks, lines 225-883. The bar is 400 significant lines; this is 96 over it, 1.24× 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: OpenShellService crates/openshell-server/src/grpc/mod.rs:228 — ClassTooLong — 493 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 228-938. The bar is 400 significant lines; this is 93 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.
  • ClassTooLong: PodmanClient crates/openshell-driver-podman/src/client.rs:346 — ClassTooLong — 483 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 2 blocks, lines 346-1082. The bar is 400 significant lines; this is 83 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LayerApplier crates/openshell-driver-vm/src/layer_applier.rs:27 — ClassTooLong — 483 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 2 blocks, lines 27-710. The bar is 400 significant lines; this is 83 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CredentialRuntime crates/openshell-server/src/credentials.rs:139 — ClassTooLong — 460 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 2 blocks, lines 139-802. The bar is 400 significant lines; this is 60 over it, 1.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×23
  • Duplicated block (14 lines × 2) crates/openshell-cli/src/commands/provider.rs:1450 — crates/openshell-cli/src/commands/provider.rs:1450-1463 | crates/openshell-cli/src/run.rs:3645-3658 — before extracting anything, compare `crates/openshell-cli/src/commands/provider.rs` and `crates/openshell-cli/src/run.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) crates/openshell-cli/src/run.rs:3444 — crates/openshell-cli/src/run.rs:3444-3457 | crates/openshell-cli/src/run.rs:3511-3524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-driver-vm/src/driver.rs:5599 — crates/openshell-driver-vm/src/driver.rs:5599-5612 | crates/openshell-driver-vm/src/driver.rs:5682-5695 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-providers/src/profiles.rs:1866 — crates/openshell-providers/src/profiles.rs:1866-1879 | crates/openshell-providers/src/profiles.rs:1915-1928 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-sandbox/src/activity_aggregator.rs:117 — crates/openshell-sandbox/src/activity_aggregator.rs:117-130 | crates/openshell-supervisor/src/activity_aggregator.rs:117-130 — before extracting anything, compare `crates/openshell-sandbox/src/activity_aggregator.rs` and `crates/openshell-supervisor/src/activity_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) crates/openshell-server/src/grpc/provider.rs:4826 — crates/openshell-server/src/grpc/provider.rs:4826-4839 | crates/openshell-server/src/grpc/provider.rs:5323-5336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:1004 — crates/openshell-server/src/grpc/sandbox.rs:1004-1017 | crates/openshell-server/src/grpc/sandbox.rs:1187-1200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) REDACTED:848 — REDACTED:848-861 | crates/openshell-server/src/persistence/sqlite.rs:640-653 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) REDACTED:2235 — REDACTED:2235-2248 | crates/openshell-server/src/persistence/sqlite.rs:2109-2122 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) crates/openshell-supervisor-network/src/l7/mod.rs:1843 — crates/openshell-supervisor-network/src/l7/mod.rs:1843-1856 | crates/openshell-supervisor-network/src/opa.rs:1828-1841 — before extracting anything, compare `crates/openshell-supervisor-network/src/l7/mod.rs` and `crates/openshell-supervisor-network/src/opa.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:1342 — crates/openshell-supervisor-network/src/l7/relay.rs:1342-1355 | crates/openshell-supervisor-network/src/l7/relay.rs:2511-2524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-supervisor-network/src/l7/rest.rs:2922 — crates/openshell-supervisor-network/src/l7/rest.rs:2922-2935 | crates/openshell-supervisor-network/src/proxy.rs:6959-6972 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:600 — crates/openshell-supervisor-network/src/proxy.rs:600-613 | crates/openshell-supervisor-network/src/proxy.rs:641-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-tui/src/lib.rs:2971 — crates/openshell-tui/src/lib.rs:2971-2984 | crates/openshell-tui/src/lib.rs:3068-3081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-tui/src/ui/create_provider.rs:431 — crates/openshell-tui/src/ui/create_provider.rs:431-444 | crates/openshell-tui/src/ui/create_provider.rs:900-913 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-cli/src/commands/gateway.rs:964 — crates/openshell-cli/src/commands/gateway.rs:964-980 | crates/openshell-cli/src/commands/gateway.rs:987-1000 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-supervisor-network/src/l7/mod.rs:434 — crates/openshell-supervisor-network/src/l7/mod.rs:434-448 | crates/openshell-supervisor-network/src/l7/rest.rs:1539-1552 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs:1125 — crates/openshell-driver-kubernetes/src/driver.rs:1125-1138 | crates/openshell-driver-podman/src/driver.rs:625-638 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14 lines × 2) crates/openshell-providers/src/profiles.rs:2881 — crates/openshell-providers/src/profiles.rs:2881-2894 | crates/openshell-providers/src/profiles.rs:2967-2980 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-cli/src/commands/common.rs:681 — crates/openshell-cli/src/commands/common.rs:681-694 | crates/openshell-cli/src/commands/common.rs:707-720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/openshell-cli/src/commands/gateway.rs:109 — crates/openshell-cli/src/commands/gateway.rs:109-122 | crates/openshell-cli/src/commands/gateway.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.
  • Duplicated block (14 lines × 2) crates/openshell-cli/src/commands/provider.rs:103 — crates/openshell-cli/src/commands/provider.rs:103-116 | crates/openshell-cli/src/run.rs:5015-5028 — before extracting anything, compare `crates/openshell-cli/src/commands/provider.rs` and `crates/openshell-cli/src/run.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) sdk/go/openshell/v1/provider_client.go:60 — sdk/go/openshell/v1/provider_client.go:60-73 | sdk/go/openshell/v1/service_client.go:54-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `p *providerClient) List(workspace` in one and `sandboxName` 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 (16 lines × 2) · ×21
  • Duplicated block (16 lines × 2) crates/openshell-driver-vm/src/driver.rs:3406 — crates/openshell-driver-vm/src/driver.rs:3406-3421 | crates/openshell-driver-vm/src/driver.rs:3937-3952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-driver-vm/src/driver.rs:3601 — crates/openshell-driver-vm/src/driver.rs:3601-3616 | crates/openshell-driver-vm/src/driver.rs:3639-3654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-driver-vm/src/driver.rs:3726 — crates/openshell-driver-vm/src/driver.rs:3726-3741 | crates/openshell-driver-vm/src/driver.rs:4328-4343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-sandbox/src/main_session.rs:885 — crates/openshell-sandbox/src/main_session.rs:885-900 | crates/openshell-supervisor-process/src/main_session.rs:431-446 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) crates/openshell-server/src/grpc/policy.rs:6179 — crates/openshell-server/src/grpc/policy.rs:6179-6194 | crates/openshell-server/src/grpc/policy.rs:6665-6680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-server/src/grpc/provider.rs:3877 — crates/openshell-server/src/grpc/provider.rs:3877-3892 | crates/openshell-server/src/grpc/provider.rs:3946-3961 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) REDACTED:1084 — REDACTED:1084-1099 | crates/openshell-server/src/persistence/sqlite.rs:863-878 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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) REDACTED:1520 — REDACTED:1520-1535 | crates/openshell-server/src/persistence/sqlite.rs:1359-1374 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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) crates/openshell-supervisor-middleware/src/lib.rs:1782 — crates/openshell-supervisor-middleware/src/lib.rs:1782-1797 | crates/openshell-supervisor-middleware/src/lib.rs:1852-1867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-supervisor-middleware/src/lib.rs:1833 — crates/openshell-supervisor-middleware/src/lib.rs:1833-1848 | crates/openshell-supervisor-middleware/src/lib.rs:1970-1986 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-supervisor-middleware/src/lib.rs:1901 — crates/openshell-supervisor-middleware/src/lib.rs:1901-1916 | crates/openshell-supervisor-middleware/src/lib.rs:2000-2015 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-supervisor-network/src/opa.rs:505 — crates/openshell-supervisor-network/src/opa.rs:505-520 | crates/openshell-supervisor-network/src/opa.rs:1707-1722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-supervisor-network/src/opa.rs:1784 — crates/openshell-supervisor-network/src/opa.rs:1784-1799 | crates/openshell-supervisor-network/src/opa.rs:1910-1925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-supervisor/src/endpoint_status.rs:114 — crates/openshell-supervisor/src/endpoint_status.rs:114-129 | crates/openshell-supervisor/src/endpoint_status.rs:261-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.
  • Duplicated block (16 lines × 2) crates/openshell-supervisor-middleware/src/lib.rs:1756 — crates/openshell-supervisor-middleware/src/lib.rs:1756-1771 | crates/openshell-supervisor-middleware/src/lib.rs:1936-1951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:6579 — crates/openshell-supervisor-network/src/proxy.rs:6579-6594 | crates/openshell-supervisor-network/src/proxy.rs:6657-6672 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) REDACTED:1749 — REDACTED:1749-1764 | crates/openshell-server/src/persistence/sqlite.rs:1577-1592 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:334 — crates/openshell-supervisor-network/src/l7/rest/http_response.rs:334-349 | crates/openshell-supervisor-network/src/l7/rest/http_response.rs:379-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) REDACTED:1052 — REDACTED:1052-1067 | crates/openshell-server/src/persistence/sqlite.rs:827-842 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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) crates/openshell-supervisor-network/src/run.rs:507 — crates/openshell-supervisor-network/src/run.rs:507-522 | crates/openshell-supervisor-network/src/run.rs:526-541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:2692 — crates/openshell-server/src/grpc/sandbox.rs:2692-2707 | crates/openshell-server/src/grpc/sandbox.rs:3271-3286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · openshell_cli · ×18
  • openshell_cli::run_async (cyclomatic 138) crates/openshell-cli/src/main.rs:2635 — openshell_cli::run_async has cyclomatic complexity 138 (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.
  • openshell_cli::run::sandbox_create (cyclomatic 105) crates/openshell-cli/src/run.rs:497 — openshell_cli::run::sandbox_create has cyclomatic complexity 105 (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.
  • openshell_cli::run::sandbox_get_to_writer (cyclomatic 40) crates/openshell-cli/src/run.rs:1609 — openshell_cli::run::sandbox_get_to_writer has cyclomatic complexity 40 (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.
  • openshell_cli::commands::provider::format_provider_profile_details (cyclomatic 38) crates/openshell-cli/src/commands/provider.rs:2529 — openshell_cli::commands::provider::format_provider_profile_details has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_cli::run::sandbox_exec_streaming_grpc (cyclomatic 34) crates/openshell-cli/src/run.rs:2580 — openshell_cli::run::sandbox_exec_streaming_grpc has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_cli::commands::gateway::gateway_add (cyclomatic 31) crates/openshell-cli/src/commands/gateway.rs:839 — openshell_cli::commands::gateway::gateway_add 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.
  • openshell_cli::policy_update::build_policy_update_plan (cyclomatic 29) crates/openshell-cli/src/policy_update.rs:24 — openshell_cli::policy_update::build_policy_update_plan has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_cli::commands::provider::provider_create_with_options (cyclomatic 24) crates/openshell-cli/src/commands/provider.rs:1103 — openshell_cli::commands::provider::provider_create_with_options has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • openshell_cli::run::sandbox_list (cyclomatic 20) crates/openshell-cli/src/run.rs:2855 — openshell_cli::run::sandbox_list 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.
  • openshell_cli::run::sandbox_template_to_json (cyclomatic 20) crates/openshell-cli/src/run.rs:3632 — openshell_cli::run::sandbox_template_to_json 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.
  • openshell_cli::commands::gateway::gateway_status (cyclomatic 18) crates/openshell-cli/src/commands/gateway.rs:64 — openshell_cli::commands::gateway::gateway_status has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_cli::commands::provider::provider_update (cyclomatic 18) crates/openshell-cli/src/commands/provider.rs:2739 — openshell_cli::commands::provider::provider_update 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.
  • openshell_cli::commands::gateway::gateway_authentication_state (cyclomatic 17) crates/openshell-cli/src/commands/gateway.rs:230 — openshell_cli::commands::gateway::gateway_authentication_state 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.
  • openshell_cli::policy_update::parse_add_endpoint_spec (cyclomatic 17) crates/openshell-cli/src/policy_update.rs:418 — openshell_cli::policy_update::parse_add_endpoint_spec has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
  • openshell_cli::commands::provider::auto_create_provider (cyclomatic 16) crates/openshell-cli/src/commands/provider.rs:481 — openshell_cli::commands::provider::auto_create_provider 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.
  • openshell_cli::run::sandbox_exec_grpc (cyclomatic 16) crates/openshell-cli/src/run.rs:1987 — openshell_cli::run::sandbox_exec_grpc 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.
  • openshell_cli::ssh::sandbox_connect_supervised (cyclomatic 16) crates/openshell-cli/src/ssh.rs:541 — openshell_cli::ssh::sandbox_connect_supervised 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.
  • openshell_cli::ssh::upload::transfer (cyclomatic 16) crates/openshell-cli/src/ssh/upload.rs:292 — openshell_cli::ssh::upload::transfer 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 · openshell_tui · ×16
  • openshell_tui::run (cognitive 164) crates/openshell-tui/src/lib.rs:94 — openshell_tui::run has cognitive complexity 164 (threshold 15). Drivers by points: if/else 35 (122 pts), match/switch 13 (38 pts), boolean chains 3, loops 1 (nesting depth added 112). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_tui::render_policy_lines (cognitive 76) crates/openshell-tui/src/lib.rs:1215 — openshell_tui::render_policy_lines has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (65 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_tui::ui::create_sandbox::draw_form (cognitive 38) crates/openshell-tui/src/ui/create_sandbox.rs:29 — openshell_tui::ui::create_sandbox::draw_form has cognitive complexity 38 (threshold 15). Drivers by points: if/else 30 (35 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_tui::ui::create_provider::draw_enter_key (cognitive 36) crates/openshell-tui/src/ui/create_provider.rs:235 — openshell_tui::ui::create_provider::draw_enter_key has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_tui::spawn_create_sandbox (cognitive 33) crates/openshell-tui/src/lib.rs:1395 — openshell_tui::spawn_create_sandbox has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_tui::ui::sandbox_draft::draw_detail_popup (cognitive 26) crates/openshell-tui/src/ui/sandbox_draft.rs:190 — openshell_tui::ui::sandbox_draft::draw_detail_popup has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 4 (9 pts), match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_tui::ui::dashboard::draw_gateway_list (cognitive 24) crates/openshell-tui/src/ui/dashboard.rs:37 — openshell_tui::ui::dashboard::draw_gateway_list has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (22 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.
  • openshell_tui::ui::sandbox_draft::wrap_value (cognitive 24) crates/openshell-tui/src/ui/sandbox_draft.rs:577 — openshell_tui::ui::sandbox_draft::wrap_value has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_tui::start_port_forwards (cognitive 23) crates/openshell-tui/src/lib.rs:1530 — openshell_tui::start_port_forwards has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 3 (9 pts), loops 2 (4 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.
  • openshell_tui::ui::sandbox_draft::draw (cognitive 23) crates/openshell-tui/src/ui/sandbox_draft.rs:17 — openshell_tui::ui::sandbox_draft::draw has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, match/switch 2 (4 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • openshell_tui::ui::draw_nav_bar (cognitive 22) crates/openshell-tui/src/ui/mod.rs:189 — openshell_tui::ui::draw_nav_bar has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 4 (8 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • openshell_tui::fetch_providers (cognitive 19) crates/openshell-tui/src/lib.rs:2221 — openshell_tui::fetch_providers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_tui::app::provider_to_redacted_yaml (cognitive 17) crates/openshell-tui/src/app.rs:888 — openshell_tui::app::provider_to_redacted_yaml has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 7 (8 pts) (nesting depth added 6). 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.
  • openshell_tui::ui::global_settings::draw (cognitive 17) crates/openshell-tui/src/ui/global_settings.rs:13 — openshell_tui::ui::global_settings::draw has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 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.
  • openshell_tui::sandbox_notes_for_view (cognitive 16) crates/openshell-tui/src/lib.rs:2695 — openshell_tui::sandbox_notes_for_view has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_tui::ui::create_provider::draw_update (cognitive 16) crates/openshell-tui/src/ui/create_provider.rs:785 — openshell_tui::ui::create_provider::draw_update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
D3 · God Classes · TooManyMethods · ×15
  • TooManyMethods: ComputeRuntime crates/openshell-server/src/compute/mod.rs:875 — TooManyMethods — 140 methods, declared across 4 files: compute/mod.rs (123), compute/mutation_guard.rs (8), compute/provisioning_operation.rs (5), compute/provisioning_deadline.rs (4). The bar is 30 methods; this is 110 over it, 4.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: KubernetesComputeDriver crates/openshell-driver-kubernetes/src/driver.rs:891 — TooManyMethods — 87 methods. The bar is 30 methods; this is 57 over it, 2.90× 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: VmDriver crates/openshell-driver-vm/src/driver.rs:734 — TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: App crates/openshell-tui/src/app.rs:592 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: PostgresStore REDACTED:42 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SupervisorPool crates/openshell-server/src/supervisor_pool.rs:386 — TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SqliteStore crates/openshell-server/src/persistence/sqlite.rs:50 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DockerComputeDriver crates/openshell-driver-docker/src/lib.rs:382 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× 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: Store crates/openshell-server/src/persistence/mod.rs:255 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× 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: SupervisorSessionRegistry crates/openshell-server/src/supervisor_session.rs:376 — TooManyMethods — 46 methods, declared across 2 files: src/supervisor_session.rs (37), config_delivery/session.rs (9). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OpenShellClient crates/openshell-sdk/src/client.rs:37 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OpaEngine crates/openshell-supervisor-network/src/opa.rs:178 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SandboxClient python/openshell/sandbox.py:657 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× 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: SupervisorHostController crates/openshell-supervisor-control/src/controller.rs:360 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× 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: PodmanClient crates/openshell-driver-podman/src/client.rs:346 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×15
  • Duplicated block (17 lines × 2) crates/openshell-driver-mxc/src/policy_map/map.rs:214 — crates/openshell-driver-mxc/src/policy_map/map.rs:214-230 | crates/openshell-driver-mxc/src/policy_map/map.rs:267-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) crates/openshell-policy/src/lib.rs:285 — crates/openshell-policy/src/lib.rs:285-301 | crates/openshell-policy/src/lib.rs:306-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) crates/openshell-sandbox/src/mechanistic_mapper.rs:226 — crates/openshell-sandbox/src/mechanistic_mapper.rs:226-242 | crates/openshell-supervisor/src/mechanistic_mapper.rs:227-243 — before extracting anything, compare `crates/openshell-sandbox/src/mechanistic_mapper.rs` and `crates/openshell-supervisor/src/mechanistic_mapper.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) crates/openshell-server/src/compute/lease.rs:90 — crates/openshell-server/src/compute/lease.rs:90-106 | crates/openshell-server/src/compute/lease.rs:130-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) crates/openshell-server/src/compute/lease.rs:134 — crates/openshell-server/src/compute/lease.rs:134-150 | crates/openshell-server/src/compute/lease.rs:176-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:3896 — crates/openshell-server/src/grpc/sandbox.rs:3896-3912 | crates/openshell-server/src/grpc/sandbox.rs:4126-4142 — both copies are in the same file, so extract the block into 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) REDACTED:1617 — REDACTED:1617-1633 | crates/openshell-server/src/persistence/sqlite.rs:1445-1461 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) REDACTED:1641 — REDACTED:1641-1657 | crates/openshell-server/src/persistence/sqlite.rs:1469-1485 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:1842 — crates/openshell-supervisor-network/src/proxy.rs:1842-1858 | crates/openshell-supervisor-network/src/proxy.rs:1871-1887 — both copies are in the same file, so extract the block into 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) crates/openshell-tui/src/ui/create_provider.rs:497 — crates/openshell-tui/src/ui/create_provider.rs:497-513 | crates/openshell-tui/src/ui/create_provider.rs:966-982 — both copies are in the same file, so extract the block into 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) crates/openshell-supervisor-network/src/proxy.rs:5588 — crates/openshell-supervisor-network/src/proxy.rs:5588-5604 | crates/openshell-supervisor-network/src/proxy.rs:5735-5753 — both copies are in the same file, so extract the block into 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) REDACTED:564 — REDACTED:564-580 | REDACTED:882-900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) REDACTED:781 — REDACTED:781-797 | crates/openshell-server/src/persistence/sqlite.rs:573-589 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) sdk/go/openshell/v1/fake/sandbox.go:332 — sdk/go/openshell/v1/fake/sandbox.go:332-348 | sdk/go/openshell/v1/fake/sandbox.go:389-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/go/openshell/v1/fake/sandbox.go:332` 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. 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 (17 lines × 2) sdk/go/openshell/v1/ssh_client.go:104 — sdk/go/openshell/v1/ssh_client.go:104-120 | sdk/go/openshell/v1/tcp_client.go:66-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/go/openshell/v1/ssh_client.go: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 (15 lines × 2) · ×14
  • Duplicated block (15 lines × 2) crates/openshell-cli/src/commands/provider.rs:145 — crates/openshell-cli/src/commands/provider.rs:145-159 | crates/openshell-cli/src/commands/provider.rs:228-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) crates/openshell-driver-kubernetes/src/driver.rs:5018 — crates/openshell-driver-kubernetes/src/driver.rs:5018-5032 | crates/openshell-driver-kubernetes/src/driver.rs:5157-5171 — both copies are in the same file, so extract the block into 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) crates/openshell-providers/src/profiles.rs:3528 — crates/openshell-providers/src/profiles.rs:3528-3542 | crates/openshell-server/src/grpc/provider.rs:1828-1842 — before extracting anything, compare `crates/openshell-providers/src/profiles.rs` and `crates/openshell-server/src/grpc/provider.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/openshell-sandbox/src/main_session.rs:867 — crates/openshell-sandbox/src/main_session.rs:867-881 | crates/openshell-supervisor-process/src/main_session.rs:413-427 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/openshell-sandbox/src/main_session.rs:905 — crates/openshell-sandbox/src/main_session.rs:905-919 | crates/openshell-supervisor-process/src/main_session.rs:451-465 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/openshell-server/src/compute/mod.rs:1997 — crates/openshell-server/src/compute/mod.rs:1997-2011 | crates/openshell-server/src/compute/mod.rs:2263-2277 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/provider.rs:1742 — crates/openshell-server/src/grpc/provider.rs:1742-1756 | crates/openshell-server/src/grpc/provider.rs:2302-2316 — both copies are in the same file, so extract the block into 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) REDACTED:2017 — REDACTED:2017-2031 | crates/openshell-server/src/persistence/sqlite.rs:1846-1860 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/openshell-supervisor-network/src/l7/rest.rs:1628 — crates/openshell-supervisor-network/src/l7/rest.rs:1628-1642 | crates/openshell-supervisor-network/src/l7/rest.rs:1792-1806 — both copies are in the same file, so extract the block into 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) crates/openshell-cli/src/run.rs:6463 — crates/openshell-cli/src/run.rs:6463-6477 | crates/openshell-cli/src/run.rs:6508-6522 — both copies are in the same file, so extract the block into 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) REDACTED:2067 — REDACTED:2067-2081 | crates/openshell-server/src/persistence/sqlite.rs:1896-1910 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) sdk/go/openshell/v1/file_client.go:59 — sdk/go/openshell/v1/file_client.go:59-73 | sdk/go/openshell/v1/file_client.go:92-106 — both copies are in the same file, so extract the 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (15 lines × 2) sdk/go/openshell/v1/sandbox_client.go:130 — sdk/go/openshell/v1/sandbox_client.go:130-144 | sdk/go/openshell/v1/sandbox_template_client.go:54-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `s *sandboxClient) List(workspace` in one and `s *sandboxTemplateClient) List(workspace` 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 (15 lines × 2) REDACTED:365 — REDACTED:365-379 | REDACTED:462-476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×13
  • Duplicated block (9 lines × 3) crates/openshell-sandbox/src/boundary_server.rs:3062 — crates/openshell-sandbox/src/boundary_server.rs:3062-3070 | crates/openshell-sandbox/src/boundary_server.rs:3163-3171 | crates/openshell-sandbox/src/boundary_server.rs:3345-3353 — 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) crates/openshell-server/src/compute/mod.rs:4819 — crates/openshell-server/src/compute/mod.rs:4819-4827 | crates/openshell-server/src/compute/mod.rs:5926-5934 | crates/openshell-server/src/compute/mod.rs:5991-5999 — 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) crates/openshell-server/src/compute/mod.rs:6351 — crates/openshell-server/src/compute/mod.rs:6351-6359 | crates/openshell-server/src/compute/mod.rs:6374-6382 | crates/openshell-server/src/compute/mod.rs:6400-6408 — 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) crates/openshell-server/src/grpc/policy.rs:5359 — crates/openshell-server/src/grpc/policy.rs:5359-5367 | crates/openshell-server/src/grpc/policy.rs:5954-5962 | crates/openshell-server/src/grpc/policy.rs:6785-6793 — 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) crates/openshell-server/src/persistence/sqlite.rs:402 — crates/openshell-server/src/persistence/sqlite.rs:402-410 | crates/openshell-server/src/persistence/sqlite.rs:689-697 | crates/openshell-server/src/persistence/sqlite.rs:722-730 — 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) crates/openshell-supervisor-network/src/l7/relay.rs:2156 — crates/openshell-supervisor-network/src/l7/relay.rs:2156-2164 | crates/openshell-supervisor-network/src/l7/relay.rs:2580-2588 | crates/openshell-supervisor-network/src/l7/relay.rs:2866-2874 — 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) crates/openshell-tui/src/ui/providers.rs:17 — crates/openshell-tui/src/ui/providers.rs:17-25 | crates/openshell-tui/src/ui/providers.rs:113-121 | crates/openshell-tui/src/ui/sandboxes.rs:12-20 — before extracting anything, compare `crates/openshell-tui/src/ui/providers.rs` and `crates/openshell-tui/src/ui/sandboxes.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) crates/openshell-bootstrap/src/metadata.rs:418 — crates/openshell-bootstrap/src/metadata.rs:418-426 | crates/openshell-bootstrap/src/oidc_token.rs:75-83 | crates/openshell-bootstrap/src/oidc_token.rs:102-110 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 3) crates/openshell-server/src/grpc/provider.rs:506 — crates/openshell-server/src/grpc/provider.rs:506-515 | crates/openshell-server/src/grpc/sandbox.rs:3354-3362 | crates/openshell-server/src/grpc/sandbox.rs:3447-3455 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/sandbox.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) crates/openshell-sandbox/src/linux/seccomp_notify.rs:385 — crates/openshell-sandbox/src/linux/seccomp_notify.rs:385-393 | crates/openshell-sandbox/src/linux/seccomp_notify.rs:444-452 | crates/openshell-sandbox/src/linux/seccomp_notify.rs:546-554 — 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) crates/openshell-sandbox/src/boundary_server.rs:5193 — crates/openshell-sandbox/src/boundary_server.rs:5193-5201 | crates/openshell-sandbox/src/boundary_server.rs:5220-5228 | crates/openshell-sandbox/src/boundary_server.rs:5245-5253 — 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) crates/openshell-sdk/src/client.rs:483 — crates/openshell-sdk/src/client.rs:483-491 | crates/openshell-sdk/src/client.rs:1219-1227 | crates/openshell-sdk/src/client.rs:1251-1259 — 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) sdk/go/openshell/v1/fake/ssh.go:45 — sdk/go/openshell/v1/fake/ssh.go:45-53 | sdk/go/openshell/v1/fake/tcp.go:29-37 | sdk/go/openshell/v1/fake/tcp.go:45-53 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sdk/go/openshell/v1/fake/tcp.go:55` calls `Sprintf` and `sdk/go/openshell/v1/fake/ssh.go:54` 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.
D2 · Cognitive Complexity · openshell_sandbox · ×12
  • openshell_sandbox::probe_socket_virtualization (cognitive 61) crates/openshell-sandbox/src/main.rs:348 — openshell_sandbox::probe_socket_virtualization has cognitive complexity 61 (threshold 15). Drivers by points: if/else 21 (45 pts), boolean chains 10, match/switch 2 (5 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_sandbox::boundary_server::linux::serve_one (cognitive 44) crates/openshell-sandbox/src/boundary_server.rs:2040 — openshell_sandbox::boundary_server::linux::serve_one has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 9 (15 pts), boolean chains 5 (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.
  • openshell_sandbox::boundary_server::linux::bridge_main_stream (cognitive 39) crates/openshell-sandbox/src/boundary_server.rs:4528 — openshell_sandbox::boundary_server::linux::bridge_main_stream has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 5 (13 pts), loops 2, 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.
  • openshell_sandbox::mechanistic_mapper::generate_proposals (cognitive 37) crates/openshell-sandbox/src/mechanistic_mapper.rs:60 — openshell_sandbox::mechanistic_mapper::generate_proposals has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 5 (9 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.
  • openshell_sandbox::network_broker::connect_socket (cognitive 36) crates/openshell-sandbox/src/network_broker.rs:851 — openshell_sandbox::network_broker::connect_socket has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 8 (11 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_sandbox::linux::proc_fd::installed_socket_inodes_excluding (cognitive 25) crates/openshell-sandbox/src/linux/proc_fd.rs:16 — openshell_sandbox::linux::proc_fd::installed_socket_inodes_excluding has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_sandbox::boundary_server::linux::run_routed_runtime_control (cognitive 23) crates/openshell-sandbox/src/boundary_server.rs:935 — openshell_sandbox::boundary_server::linux::run_routed_runtime_control has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_sandbox::boundary_server::linux::bridge_grpc_server_stream (cognitive 21) crates/openshell-sandbox/src/boundary_server.rs:1756 — openshell_sandbox::boundary_server::linux::bridge_grpc_server_stream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 5 (9 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_sandbox::network_broker::classify_send (cognitive 19) crates/openshell-sandbox/src/network_broker.rs:1389 — openshell_sandbox::network_broker::classify_send has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_sandbox::network_broker::start_dns_relay (cognitive 18) crates/openshell-sandbox/src/network_broker.rs:419 — openshell_sandbox::network_broker::start_dns_relay has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_sandbox::boundary_server::linux::validate_config (cognitive 17) crates/openshell-sandbox/src/boundary_server.rs:335 — openshell_sandbox::boundary_server::linux::validate_config has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_sandbox::perf::run (cognitive 16) crates/openshell-sandbox/src/perf.rs:83 — openshell_sandbox::perf::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×12
  • Duplicated block (18 lines × 2) crates/openshell-driver-vm/src/driver.rs:3387 — crates/openshell-driver-vm/src/driver.rs:3387-3404 | crates/openshell-driver-vm/src/driver.rs:3918-3935 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) crates/openshell-driver-vm/src/layer_applier.rs:116 — crates/openshell-driver-vm/src/layer_applier.rs:116-133 | crates/openshell-driver-vm/src/layer_applier.rs:192-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) crates/openshell-providers/src/profiles.rs:2857 — crates/openshell-providers/src/profiles.rs:2857-2874 | crates/openshell-providers/src/profiles.rs:2943-2960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) crates/openshell-providers/src/profiles.rs:3609 — crates/openshell-providers/src/profiles.rs:3609-3626 | crates/openshell-server/src/grpc/provider.rs:1909-1926 — before extracting anything, compare `crates/openshell-providers/src/profiles.rs` and `crates/openshell-server/src/grpc/provider.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) crates/openshell-sandbox/src/mechanistic_mapper.rs:382 — crates/openshell-sandbox/src/mechanistic_mapper.rs:382-399 | crates/openshell-supervisor/src/mechanistic_mapper.rs:383-400 — before extracting anything, compare `crates/openshell-sandbox/src/mechanistic_mapper.rs` and `crates/openshell-supervisor/src/mechanistic_mapper.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) crates/openshell-sandbox/src/mechanistic_mapper.rs:403 — crates/openshell-sandbox/src/mechanistic_mapper.rs:403-420 | crates/openshell-supervisor/src/mechanistic_mapper.rs:404-421 — before extracting anything, compare `crates/openshell-sandbox/src/mechanistic_mapper.rs` and `crates/openshell-supervisor/src/mechanistic_mapper.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:559 — crates/openshell-server/src/grpc/sandbox.rs:559-576 | crates/openshell-server/src/grpc/sandbox.rs:1449-1466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) REDACTED:818 — REDACTED:818-835 | crates/openshell-server/src/persistence/sqlite.rs:610-627 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) REDACTED:1248 — REDACTED:1248-1265 | crates/openshell-server/src/persistence/sqlite.rs:1085-1102 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) crates/openshell-vfio/src/gpu.rs:28 — crates/openshell-vfio/src/gpu.rs:28-45 | crates/openshell-vfio/src/pci.rs:224-241 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18 lines × 2) REDACTED:1955 — REDACTED:1955-1972 | crates/openshell-server/src/persistence/sqlite.rs:1784-1801 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) REDACTED:1862 — REDACTED:1862-1879 | crates/openshell-server/src/persistence/sqlite.rs:1690-1707 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 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.
D2 · Cognitive Complexity · ComputeRuntime · ×11
  • ComputeRuntime::start_persisted_sandboxes_with_authentication (cognitive 57) crates/openshell-server/src/compute/mod.rs:4038 — ComputeRuntime::start_persisted_sandboxes_with_authentication has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (40 pts), match/switch 5 (12 pts), boolean chains 4, 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.
  • ComputeRuntime::start_sandbox_with_intent (cognitive 42) crates/openshell-server/src/compute/mod.rs:2230 — ComputeRuntime::start_sandbox_with_intent has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 7, match/switch 3 (4 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ComputeRuntime::recover_persisted_lifecycle_transitions (cognitive 38) crates/openshell-server/src/compute/mod.rs:4319 — ComputeRuntime::recover_persisted_lifecycle_transitions has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 5 (14 pts), boolean chains 1, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ComputeRuntime::set_supervisor_session_state_from_snapshot (cognitive 37) crates/openshell-server/src/compute/mod.rs:5653 — ComputeRuntime::set_supervisor_session_state_from_snapshot has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 7, match/switch 2 (3 pts), loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ComputeRuntime::create_sandbox_with_runtime_inputs_and_guards (cognitive 26) crates/openshell-server/src/compute/mod.rs:1526 — ComputeRuntime::create_sandbox_with_runtime_inputs_and_guards has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, match/switch 4 (6 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ComputeRuntime::watch_loop (cognitive 24) crates/openshell-server/src/compute/mod.rs:4692 — ComputeRuntime::watch_loop has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 2 (7 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • ComputeRuntime::report_main_process_exit (cognitive 24) crates/openshell-server/src/compute/mod.rs:5822 — ComputeRuntime::report_main_process_exit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5 (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.
  • ComputeRuntime::reconcile_provisioning_deadlines (cognitive 22) crates/openshell-server/src/compute/provisioning_deadline.rs:457 — ComputeRuntime::reconcile_provisioning_deadlines has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, 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.
  • ComputeRuntime::recover_failed_lifecycle (cognitive 20) crates/openshell-server/src/compute/mod.rs:2841 — ComputeRuntime::recover_failed_lifecycle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • ComputeRuntime::restart_sandbox_runtime (cognitive 19) crates/openshell-server/src/compute/mod.rs:4808 — ComputeRuntime::restart_sandbox_runtime has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • ComputeRuntime::reclaim_provisioning_timeout (cognitive 16) crates/openshell-server/src/compute/provisioning_deadline.rs:653 — ComputeRuntime::reclaim_provisioning_timeout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D3 · God Classes · TooManyFields · ×11
  • TooManyFields: App crates/openshell-tui/src/app.rs:592 — TooManyFields — 118 stored fields beside 58 methods. The bar is 30 stored fields; this is 88 over it, 3.93× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Args crates/openshell-driver-vm/src/main.rs:27 — TooManyFields — 64 stored fields. The bar is 30 stored fields; this is 34 over it, 2.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: KubernetesComputeConfig crates/openshell-driver-kubernetes/src/config.rs:270 — TooManyFields — 43 stored fields beside 21 methods. The bar is 30 stored fields; this is 13 over it, 1.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Args crates/openshell-driver-kubernetes/src/main.rs:23 — TooManyFields — 43 stored fields. The bar is 30 stored fields; this is 13 over it, 1.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Args crates/openshell-supervisor/src/main.rs:58 — TooManyFields — 42 stored fields. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ContainerSpec crates/openshell-driver-podman/src/container.rs:304 — TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Args crates/openshell-driver-podman/src/main.rs:20 — TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: PodmanComputeConfig crates/openshell-driver-podman/src/config.rs:29 — TooManyFields — 34 stored fields beside 11 methods. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: RunArgs crates/openshell-server/src/cli.rs:72 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: GatewayFileSection crates/openshell-server/src/config_file.rs:88 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ServerState crates/openshell-server/src/lib.rs:310 — TooManyFields — 32 stored fields beside 2 methods. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D1 · Cyclomatic Complexity · App · ×10
  • App::handle_create_provider_key (cyclomatic 94) crates/openshell-tui/src/app.rs:2484 — App::handle_create_provider_key has cyclomatic complexity 94 (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.
  • App::handle_draft_key (cyclomatic 52) crates/openshell-tui/src/app.rs:1947 — App::handle_draft_key has cyclomatic complexity 52 (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.
  • App::handle_update_provider_key (cyclomatic 37) crates/openshell-tui/src/app.rs:3057 — App::handle_update_provider_key has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • App::handle_logs_key (cyclomatic 31) crates/openshell-tui/src/app.rs:2161 — App::handle_logs_key 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.
  • App::handle_providers_key (cyclomatic 21) crates/openshell-tui/src/app.rs:1431 — App::handle_providers_key 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.
  • App::handle_global_settings_key (cyclomatic 20) crates/openshell-tui/src/app.rs:1497 — App::handle_global_settings_key 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.
  • App::handle_create_form_key (cyclomatic 18) crates/openshell-tui/src/app.rs:2351 — App::handle_create_form_key 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.
  • App::handle_sandbox_settings_key (cyclomatic 17) crates/openshell-tui/src/app.rs:1776 — App::handle_sandbox_settings_key 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: App::handle_policy_key (cyclomatic 18) 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.
  • App::handle_sandboxes_key (cyclomatic 16) crates/openshell-tui/src/app.rs:1647 — App::handle_sandboxes_key has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: App::handle_policy_key (cyclomatic 18) 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.
  • App::provider_detail_from_provider (cyclomatic 16) crates/openshell-tui/src/app.rs:3294 — App::provider_detail_from_provider has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: App::handle_policy_key (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D2 · Cognitive Complexity · App · ×10
  • App::handle_create_provider_key (cognitive 233) crates/openshell-tui/src/app.rs:2484 — App::handle_create_provider_key has cognitive complexity 233 (threshold 15). Drivers by points: if/else 59 (181 pts), match/switch 12 (38 pts), loops 2 (9 pts), boolean chains 5 (nesting depth added 155). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::handle_draft_key (cognitive 74) crates/openshell-tui/src/app.rs:1947 — App::handle_draft_key has cognitive complexity 74 (threshold 15). Drivers by points: if/else 27 (65 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • App::handle_update_provider_key (cognitive 61) crates/openshell-tui/src/app.rs:3057 — App::handle_update_provider_key has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (41 pts), match/switch 7 (16 pts), boolean chains 4 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::handle_logs_key (cognitive 34) crates/openshell-tui/src/app.rs:2161 — App::handle_logs_key has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (30 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • App::handle_global_settings_key (cognitive 27) crates/openshell-tui/src/app.rs:1497 — App::handle_global_settings_key has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • App::handle_create_form_key (cognitive 26) crates/openshell-tui/src/app.rs:2351 — App::handle_create_form_key has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 3 (10 pts), boolean chains 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.
  • App::provider_detail_from_provider (cognitive 26) crates/openshell-tui/src/app.rs:3294 — App::provider_detail_from_provider has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23 (25 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • App::handle_sandbox_settings_key (cognitive 25) crates/openshell-tui/src/app.rs:1776 — App::handle_sandbox_settings_key has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (5 pts) (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.
  • App::handle_setting_edit_key (cognitive 20) crates/openshell-tui/src/app.rs:1568 — App::handle_setting_edit_key has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 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. This shape REPEATS in the file: one other method here (App::handle_sandbox_setting_edit_key) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • App::handle_sandbox_setting_edit_key (cognitive 20) crates/openshell-tui/src/app.rs:1850 — App::handle_sandbox_setting_edit_key has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 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. This shape REPEATS in the file: one other method here (App::handle_setting_edit_key) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · openshell_supervisor · ×9
  • openshell_supervisor::endpoint_status::run_reporter (cognitive 127) crates/openshell-supervisor/src/endpoint_status.rs:29 — openshell_supervisor::endpoint_status::run_reporter has cognitive complexity 127 (threshold 15). Drivers by points: if/else 20 (70 pts), match/switch 9 (37 pts), loops 7 (16 pts), boolean chains 4 (nesting depth added 87). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor::load_policy_with_gateway (cognitive 82) crates/openshell-supervisor/src/lib.rs:2738 — openshell_supervisor::load_policy_with_gateway has cognitive complexity 82 (threshold 15). Drivers by points: if/else 24 (60 pts), match/switch 5 (17 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • openshell_supervisor::run_sandbox_instance (cognitive 67) crates/openshell-supervisor/src/lib.rs:1042 — openshell_supervisor::run_sandbox_instance has cognitive complexity 67 (threshold 15). Drivers by points: if/else 46 (55 pts), boolean chains 6, match/switch 2 (5 pts), loops 1 (nesting depth added 12). 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.
  • openshell_supervisor::shared_host::run_stream (cognitive 65) crates/openshell-supervisor/src/shared_host.rs:1334 — openshell_supervisor::shared_host::run_stream has cognitive complexity 65 (threshold 15). Drivers by points: if/else 16 (49 pts), match/switch 4 (9 pts), boolean chains 6, loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor::config_runtime::run_policy_poll_loop_with_client (cognitive 57) crates/openshell-supervisor/src/config_runtime.rs:1212 — openshell_supervisor::config_runtime::run_policy_poll_loop_with_client has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (36 pts), match/switch 7 (17 pts), boolean chains 3, loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor::mechanistic_mapper::generate_proposals (cognitive 37) crates/openshell-supervisor/src/mechanistic_mapper.rs:60 — openshell_supervisor::mechanistic_mapper::generate_proposals has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 5 (9 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.
  • openshell_supervisor::main (cognitive 25) crates/openshell-supervisor/src/main.rs:417 — openshell_supervisor::main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_supervisor::sandbox_instance_host::run_hosted_sandbox_instance (cognitive 21) crates/openshell-supervisor/src/sandbox_instance_host.rs:621 — openshell_supervisor::sandbox_instance_host::run_hosted_sandbox_instance has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (2 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.
  • openshell_supervisor::enrich_proto_baseline_paths_with (cognitive 16) crates/openshell-supervisor/src/lib.rs:2082 — openshell_supervisor::enrich_proto_baseline_paths_with has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 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 · openshell_policy · ×9
  • openshell_policy::validate_sandbox_policy_with_mcp_presence (cognitive 115) crates/openshell-policy/src/lib.rs:1413 — openshell_policy::validate_sandbox_policy_with_mcp_presence has cognitive complexity 115 (threshold 15). Drivers by points: if/else 41 (81 pts), loops 6 (18 pts), boolean chains 16 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_policy::middleware::validate (cognitive 35) crates/openshell-policy/src/middleware.rs:182 — openshell_policy::middleware::validate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_policy::ambiguity::tokenize_runtime_path_glob (cognitive 32) crates/openshell-policy/src/ambiguity.rs:472 — openshell_policy::ambiguity::tokenize_runtime_path_glob has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_policy::l7_validate::validate_l7_endpoint_semantics (cognitive 24) crates/openshell-policy/src/l7_validate.rs:243 — openshell_policy::l7_validate::validate_l7_endpoint_semantics has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 11 (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.
  • openshell_policy::ambiguity::token_languages_overlap (cognitive 21) crates/openshell-policy/src/ambiguity.rs:576 — openshell_policy::ambiguity::token_languages_overlap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1, 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.
  • openshell_policy::collect_mcp_endpoint_violations (cognitive 20) crates/openshell-policy/src/lib.rs:1739 — openshell_policy::collect_mcp_endpoint_violations has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_policy::merge::canonicalize_advisor_add_rule (cognitive 18) crates/openshell-policy/src/merge.rs:30 — openshell_policy::merge::canonicalize_advisor_add_rule has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_policy::merge::remove_endpoint (cognitive 18) crates/openshell-policy/src/merge.rs:2362 — openshell_policy::merge::remove_endpoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_policy::ambiguity::find_endpoint_ambiguities (cognitive 16) crates/openshell-policy/src/ambiguity.rs:60 — openshell_policy::ambiguity::find_endpoint_ambiguities has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openshell_core · ×9
  • openshell_core::grpc_client::refresh_token_loop (cognitive 47) crates/openshell-core/src/grpc_client.rs:614 — openshell_core::grpc_client::refresh_token_loop has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 5 (19 pts), boolean chains 3, 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.
  • openshell_core::forward::find_proxy_command_match (cognitive 31) crates/openshell-core/src/forward.rs:290 — openshell_core::forward::find_proxy_command_match has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_core::driver_utils::validate_upstream_proxy_settings (cognitive 23) crates/openshell-core/src/driver_utils.rs:625 — openshell_core::driver_utils::validate_upstream_proxy_settings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_core::provider_credentials::compile_static_credential_bindings (cognitive 22) crates/openshell-core/src/provider_credentials.rs:957 — openshell_core::provider_credentials::compile_static_credential_bindings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • openshell_core::rpc_error::decode_details (cognitive 19) crates/openshell-core/src/rpc_error.rs:21 — openshell_core::rpc_error::decode_details has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_core::secrets::percent_decode (cognitive 17) crates/openshell-core/src/secrets.rs:939 — openshell_core::secrets::percent_decode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 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.
  • openshell_core::driver_utils::parse_upstream_proxy_url (cognitive 16) crates/openshell-core/src/driver_utils.rs:243 — openshell_core::driver_utils::parse_upstream_proxy_url has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, match/switch 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.
  • openshell_core::net::is_always_blocked_net (cognitive 16) crates/openshell-core/src/net.rs:90 — openshell_core::net::is_always_blocked_net has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • openshell_core::policy_identity::canonical_rule_bytes (cognitive 16) crates/openshell-core/src/policy_identity.rs:45 — openshell_core::policy_identity::canonical_rule_bytes has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 2 (6 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D5 · Coupling · Off the main sequence · ×9
  • Off the main sequence: openshell-extension-core — openshell-extension-core: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: openshell-policy-schema — openshell-policy-schema: 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: openshell-vfio — openshell-vfio: 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: openshell-ocsf — openshell-ocsf: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: openshell-otel — openshell-otel: abstractness 0.00, instability 0.09, distance 0.91 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
  • Off the main sequence: openshell-isolation-interface — openshell-isolation-interface: abstractness 0.06, instability 0.09, distance 0.85 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
  • Off the main sequence: openshell-policy — openshell-policy: abstractness 0.00, instability 0.15, distance 0.85 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
  • Off the main sequence: openshell-core — openshell-core: abstractness 0.06, instability 0.13, distance 0.80 — zone of pain — concrete and depended on by 26 project(s), so it's rigid to change.
  • Off the main sequence: openshell-crypto — openshell-crypto: abstractness 0.29, instability 0.00, distance 0.71 — zone of pain — concrete and depended on by 15 project(s), so it's rigid to change.
D1 · Cyclomatic Complexity · openshell_tui · ×8
  • openshell_tui::run (cyclomatic 77) crates/openshell-tui/src/lib.rs:94 — openshell_tui::run has cyclomatic complexity 77 (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.
  • openshell_tui::render_policy_lines (cyclomatic 27) crates/openshell-tui/src/lib.rs:1215 — openshell_tui::render_policy_lines 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.
  • openshell_tui::ui::create_sandbox::draw_form (cyclomatic 21) crates/openshell-tui/src/ui/create_sandbox.rs:29 — openshell_tui::ui::create_sandbox::draw_form has cyclomatic complexity 21 (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.
  • openshell_tui::ui::sandbox_draft::draw (cyclomatic 21) crates/openshell-tui/src/ui/sandbox_draft.rs:17 — openshell_tui::ui::sandbox_draft::draw has cyclomatic complexity 21 (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.
  • openshell_tui::ui::sandbox_draft::draw_detail_popup (cyclomatic 20) crates/openshell-tui/src/ui/sandbox_draft.rs:190 — openshell_tui::ui::sandbox_draft::draw_detail_popup 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.
  • openshell_tui::ui::create_provider::draw_enter_key (cyclomatic 18) crates/openshell-tui/src/ui/create_provider.rs:235 — openshell_tui::ui::create_provider::draw_enter_key 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.
  • openshell_tui::spawn_create_sandbox (cyclomatic 17) crates/openshell-tui/src/lib.rs:1395 — openshell_tui::spawn_create_sandbox 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.
  • openshell_tui::ui::sandbox_detail::draw (cyclomatic 16) crates/openshell-tui/src/ui/sandbox_detail.rs:62 — openshell_tui::ui::sandbox_detail::draw 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 · ComputeRuntime · ×8
  • ComputeRuntime::start_persisted_sandboxes_with_authentication (cyclomatic 30) crates/openshell-server/src/compute/mod.rs:4038 — ComputeRuntime::start_persisted_sandboxes_with_authentication has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ComputeRuntime::start_sandbox_with_intent (cyclomatic 27) crates/openshell-server/src/compute/mod.rs:2230 — ComputeRuntime::start_sandbox_with_intent 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.
  • ComputeRuntime::set_supervisor_session_state_from_snapshot (cyclomatic 25) crates/openshell-server/src/compute/mod.rs:5653 — ComputeRuntime::set_supervisor_session_state_from_snapshot 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.
  • ComputeRuntime::create_sandbox_with_runtime_inputs_and_guards (cyclomatic 24) crates/openshell-server/src/compute/mod.rs:1526 — ComputeRuntime::create_sandbox_with_runtime_inputs_and_guards has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • ComputeRuntime::recover_persisted_lifecycle_transitions (cyclomatic 20) crates/openshell-server/src/compute/mod.rs:4319 — ComputeRuntime::recover_persisted_lifecycle_transitions 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.
  • ComputeRuntime::restart_sandbox_runtime (cyclomatic 17) crates/openshell-server/src/compute/mod.rs:4808 — ComputeRuntime::restart_sandbox_runtime 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.
  • ComputeRuntime::report_main_process_exit (cyclomatic 16) crates/openshell-server/src/compute/mod.rs:5822 — ComputeRuntime::report_main_process_exit 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.
  • ComputeRuntime::reclaim_provisioning_timeout (cyclomatic 16) crates/openshell-server/src/compute/provisioning_deadline.rs:653 — ComputeRuntime::reclaim_provisioning_timeout 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 · openshell_prover · ×8
  • openshell_prover::containment::resource_limit_reason (cognitive 82) crates/openshell-prover/src/containment.rs:1926 — openshell_prover::containment::resource_limit_reason has cognitive complexity 82 (threshold 15). Drivers by points: if/else 12 (44 pts), loops 11 (37 pts), boolean chains 1 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_prover::containment::path_glob_regex (cognitive 24) crates/openshell-prover/src/containment.rs:2185 — openshell_prover::containment::path_glob_regex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_prover::queries::check_credential_safety (cognitive 24) crates/openshell-prover/src/queries.rs:77 — openshell_prover::queries::check_credential_safety has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (6 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_prover::accepted_risks::apply_accepted_risks (cognitive 22) crates/openshell-prover/src/accepted_risks.rs:99 — openshell_prover::accepted_risks::apply_accepted_risks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (6 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.
  • openshell_prover::report::render_report (cognitive 18) crates/openshell-prover/src/report.rs:129 — openshell_prover::report::render_report has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • openshell_prover::containment::is_canonical_rest_path (cognitive 17) crates/openshell-prover/src/containment.rs:1184 — openshell_prover::containment::is_canonical_rest_path has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_prover::containment::counterexample_from_model (cognitive 16) crates/openshell-prover/src/containment.rs:1025 — openshell_prover::containment::counterexample_from_model has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), 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, 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.
  • openshell_prover::containment::validate_supported_rest (cognitive 16) crates/openshell-prover/src/containment.rs:1724 — openshell_prover::containment::validate_supported_rest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openshell-driver-kubernetes/src/driver.rs:4901 — crates/openshell-driver-kubernetes/src/driver.rs:4901-4957 | crates/openshell-driver-kubernetes/src/driver.rs:4966-5000 | crates/openshell-driver-kubernetes/src/driver.rs:5007-5052 | crates/openshell-driver-kubernetes/src/driver.rs:5155-5189 — 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) crates/openshell-ocsf/src/events/api_activity.rs:57 — crates/openshell-ocsf/src/events/api_activity.rs:57-85 | crates/openshell-ocsf/src/events/http_activity.rs:71-96 | crates/openshell-ocsf/src/events/network_activity.rs:67-91 | crates/openshell-ocsf/src/events/ssh_activity.rs:61-85 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/openshell-sandbox/src/boundary_server.rs:3003 — crates/openshell-sandbox/src/boundary_server.rs:3003-3122 | crates/openshell-sandbox/src/boundary_server.rs:3144-3209 | crates/openshell-sandbox/src/boundary_server.rs:3344-3357 | crates/openshell-sandbox/src/boundary_server.rs:3721-3769 — 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) crates/openshell-sandbox/src/boundary_server.rs:3211 — crates/openshell-sandbox/src/boundary_server.rs:3211-3251 | crates/openshell-sandbox/src/sandbox/linux/landlock.rs:243-408 | crates/openshell-sandbox/src/sandbox/linux/landlock.rs:419-450 | crates/openshell-sandbox/src/sandbox/linux/mod.rs:113-215 — 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) crates/openshell-server/src/grpc/provider.rs:2811 — crates/openshell-server/src/grpc/provider.rs:2811-2866 | crates/openshell-server/src/grpc/sandbox.rs:974-1026 | crates/openshell-server/src/grpc/sandbox.rs:1157-1209 | crates/openshell-server/src/grpc/service.rs:216-293 — 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) REDACTED:1244 — REDACTED:1244-1333 | crates/openshell-server/src/persistence/sqlite.rs:1083-1162 | crates/openshell-server/src/persistence/sqlite.rs:1304-1323 | crates/openshell-server/src/persistence/sqlite.rs:1331-1349 — 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) crates/openshell-tui/src/ui/global_settings.rs:13 — crates/openshell-tui/src/ui/global_settings.rs:13-99 | crates/openshell-tui/src/ui/providers.rs:16-110 | crates/openshell-tui/src/ui/providers.rs:112-216 | crates/openshell-tui/src/ui/sandboxes.rs:11-133 — 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) sdk/go/openshell/v1/fake/config.go:25 — sdk/go/openshell/v1/fake/config.go:25-33 | sdk/go/openshell/v1/fake/exec.go:27-35 | sdk/go/openshell/v1/fake/exec.go:38-46 | sdk/go/openshell/v1/fake/exec.go:49-57 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×8
  • Duplicated block (6 lines × 3) crates/openshell-cli/src/main.rs:3853 — crates/openshell-cli/src/main.rs:3853-3858 | crates/openshell-cli/src/main.rs:3919-3924 | crates/openshell-cli/src/main.rs:4098-4103 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/openshell-gateway/src/lib.rs:282 — crates/openshell-gateway/src/lib.rs:282-287 | crates/openshell-gateway/src/lib.rs:360-365 | crates/openshell-gateway/src/lib.rs:427-432 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/openshell-providers/src/profiles.rs:3551 — crates/openshell-providers/src/profiles.rs:3551-3556 | crates/openshell-server/src/grpc/provider.rs:1851-1856 | crates/openshell-supervisor-network/src/l7/token_grant_injection.rs:573-578 — before extracting anything, compare `crates/openshell-providers/src/profiles.rs` and `crates/openshell-server/src/grpc/provider.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) crates/openshell-supervisor-network/src/proxy.rs:2867 — crates/openshell-supervisor-network/src/proxy.rs:2867-2872 | crates/openshell-supervisor-network/src/proxy.rs:2905-2910 | crates/openshell-supervisor-network/src/proxy.rs:3161-3166 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/openshell-tui/src/ui/mod.rs:199 — crates/openshell-tui/src/ui/mod.rs:199-204 | crates/openshell-tui/src/ui/mod.rs:221-226 | crates/openshell-tui/src/ui/mod.rs:413-418 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) crates/openshell-providers/src/profiles.rs:3558 — crates/openshell-providers/src/profiles.rs:3558-3563 | crates/openshell-server/src/grpc/provider.rs:1858-1863 | crates/openshell-supervisor-network/src/l7/token_grant_injection.rs:580-585 — before extracting anything, compare `crates/openshell-providers/src/profiles.rs` and `crates/openshell-server/src/grpc/provider.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) sdk/go/openshell/v1/fake/profile.go:73 — sdk/go/openshell/v1/fake/profile.go:73-78 | sdk/go/openshell/v1/fake/refresh.go:49-54 | sdk/go/openshell/v1/fake/service.go:57-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (6 lines × 3) sdk/go/openshell/v1/fake/provider.go:107 — sdk/go/openshell/v1/fake/provider.go:107-112 | sdk/go/openshell/v1/fake/sandbox.go:458-463 | sdk/go/openshell/v1/fake/sandbox_template.go:101-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D1 · Cyclomatic Complexity · openshell_supervisor · ×7
  • openshell_supervisor::run_sandbox_instance (cyclomatic 47) crates/openshell-supervisor/src/lib.rs:1042 — openshell_supervisor::run_sandbox_instance has cyclomatic complexity 47 (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.
  • openshell_supervisor::endpoint_status::run_reporter (cyclomatic 45) crates/openshell-supervisor/src/endpoint_status.rs:29 — openshell_supervisor::endpoint_status::run_reporter has cyclomatic complexity 45 (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.
  • openshell_supervisor::shared_host::run_stream (cyclomatic 35) crates/openshell-supervisor/src/shared_host.rs:1334 — openshell_supervisor::shared_host::run_stream has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_supervisor::load_policy_with_gateway (cyclomatic 30) crates/openshell-supervisor/src/lib.rs:2738 — openshell_supervisor::load_policy_with_gateway has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_supervisor::config_runtime::run_policy_poll_loop_with_client (cyclomatic 27) crates/openshell-supervisor/src/config_runtime.rs:1212 — openshell_supervisor::config_runtime::run_policy_poll_loop_with_client 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.
  • openshell_supervisor::main (cyclomatic 21) crates/openshell-supervisor/src/main.rs:417 — openshell_supervisor::main has cyclomatic complexity 21 (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.
  • openshell_supervisor::mechanistic_mapper::generate_proposals (cyclomatic 19) crates/openshell-supervisor/src/mechanistic_mapper.rs:60 — openshell_supervisor::mechanistic_mapper::generate_proposals 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 · openshell_sandbox · ×7
  • openshell_sandbox::probe_socket_virtualization (cyclomatic 37) crates/openshell-sandbox/src/main.rs:348 — openshell_sandbox::probe_socket_virtualization has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_sandbox::boundary_server::linux::serve_one (cyclomatic 33) crates/openshell-sandbox/src/boundary_server.rs:2040 — openshell_sandbox::boundary_server::linux::serve_one has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_sandbox::network_broker::connect_socket (cyclomatic 27) crates/openshell-sandbox/src/network_broker.rs:851 — openshell_sandbox::network_broker::connect_socket 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.
  • openshell_sandbox::boundary_server::linux::bridge_main_stream (cyclomatic 22) crates/openshell-sandbox/src/boundary_server.rs:4528 — openshell_sandbox::boundary_server::linux::bridge_main_stream has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_sandbox::boundary_server::linux::validate_config (cyclomatic 20) crates/openshell-sandbox/src/boundary_server.rs:335 — openshell_sandbox::boundary_server::linux::validate_config 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.
  • openshell_sandbox::mechanistic_mapper::generate_proposals (cyclomatic 19) crates/openshell-sandbox/src/mechanistic_mapper.rs:60 — openshell_sandbox::mechanistic_mapper::generate_proposals 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.
  • openshell_sandbox::network_broker::classify_send (cyclomatic 19) crates/openshell-sandbox/src/network_broker.rs:1389 — openshell_sandbox::network_broker::classify_send 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×7
  • Duplicated block (8–9 lines × 2) crates/openshell-core/src/provider_credentials.rs:723 — crates/openshell-core/src/provider_credentials.rs:723-730 | crates/openshell-core/src/provider_credentials.rs:821-829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–9 lines × 2) crates/openshell-driver-mxc/src/etw_consumer.rs:1024 — crates/openshell-driver-mxc/src/etw_consumer.rs:1024-1031 | crates/openshell-driver-mxc/src/etw_consumer.rs:1041-1049 — both copies are in the same file, so extract the block into 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–9 lines × 2) crates/openshell-server/src/grpc/provider.rs:3707 — crates/openshell-server/src/grpc/provider.rs:3707-3714 | crates/openshell-server/src/grpc/provider.rs:3721-3729 — both copies are in the same file, so extract the block into 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–9 lines × 2) REDACTED:1404 — REDACTED:1404-1411 | REDACTED:1465-1473 — both copies are in the same file, so extract the block into 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–9 lines × 2) crates/openshell-supervisor-network/src/l7/websocket.rs:2172 — crates/openshell-supervisor-network/src/l7/websocket.rs:2172-2179 | crates/openshell-supervisor-network/src/proxy.rs:2133-2141 — before extracting anything, compare `crates/openshell-supervisor-network/src/l7/websocket.rs` and `crates/openshell-supervisor-network/src/proxy.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8–9 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:1293 — crates/openshell-supervisor-network/src/proxy.rs:1293-1300 | crates/openshell-supervisor-network/src/proxy.rs:1471-1479 — both copies are in the same file, so extract the block into 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–9 lines × 2) crates/openshell-tui/src/ui/create_provider.rs:576 — crates/openshell-tui/src/ui/create_provider.rs:576-583 | crates/openshell-tui/src/ui/create_sandbox.rs:288-296 — before extracting anything, compare `crates/openshell-tui/src/ui/create_provider.rs` and `crates/openshell-tui/src/ui/create_sandbox.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×7
  • Duplicated block (7 lines × 3) crates/openshell-core/src/oauth.rs:298 — crates/openshell-core/src/oauth.rs:298-304 | crates/openshell-providers/src/profiles.rs:3718-3724 | crates/openshell-server/src/auth/oidc.rs:106-115 — before extracting anything, compare `crates/openshell-core/src/oauth.rs` and `crates/openshell-providers/src/profiles.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) crates/openshell-driver-vm/src/rootfs.rs:1098 — crates/openshell-driver-vm/src/rootfs.rs:1098-1104 | crates/openshell-driver-vm/src/rootfs.rs:1128-1134 | crates/openshell-driver-vm/src/rootfs.rs:1157-1165 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/openshell-server/src/compute/mod.rs:1096 — crates/openshell-server/src/compute/mod.rs:1096-1102 | crates/openshell-server/src/compute/mod.rs:8032-8038 | crates/openshell-server/src/grpc/sandbox.rs:1948-1954 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 3) crates/openshell-core/src/grpc_client.rs:729 — crates/openshell-core/src/grpc_client.rs:729-735 | crates/openshell-supervisor-control/src/controller.rs:1281-1287 | crates/openshell-supervisor-control/src/coordinator.rs:409-415 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (7 lines × 3) crates/openshell-core/src/jwt.rs:585 — crates/openshell-core/src/jwt.rs:585-591 | crates/openshell-core/src/jwt.rs:594-600 | crates/openshell-extension-core/src/auth.rs:72-78 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 3) crates/openshell-core/src/paths.rs:32 — crates/openshell-core/src/paths.rs:32-38 | crates/openshell-core/src/paths.rs:54-60 | crates/openshell-core/src/paths.rs:94-100 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) sdk/go/openshell/v1/fake/policy.go:215 — sdk/go/openshell/v1/fake/policy.go:215-221 | sdk/go/openshell/v1/policy_client.go:161-167 | sdk/go/openshell/v1/service_client.go:85-91 — 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.
D17 · Explicit Debt · TodoComment · ×6
  • TodoComment crates/openshell-supervisor-network/src/policy_local.rs:513 — // emit site forgets to redact (TODO: harden the emit sites in — 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 crates/openshell-supervisor-network/src/proxy.rs:15039 — // TODO: exec'ing /bin/sleep (SELinux label bin_t) from a user_home_t test — 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 crates/openshell-supervisor-middleware-builtins/src/regex.rs:83 — // TODO: Allow policies to supply custom replacement expressions after 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.
  • TodoComment crates/openshell-server/src/grpc/policy.rs:1956 — // TODO: share effective-policy lookup with `load_sandbox_policy` / — 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 crates/openshell-driver-kubernetes/src/driver.rs:740 — // TODO: replace with an openshell_core Kubernetes-name helper once available. — 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 crates/openshell-core/src/grpc_client.rs:396 — // TODO: The TLS CA is loaded once here and never re-read. The gateway — 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 · openshell_driver_kubernetes · ×6
  • openshell_driver_kubernetes::driver::spawn_namespace_label_watcher (cognitive 34) crates/openshell-driver-kubernetes/src/driver.rs:8423 — openshell_driver_kubernetes::driver::spawn_namespace_label_watcher has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (19 pts), match/switch 3 (8 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_driver_kubernetes::resource_admission::inventory (cognitive 34) crates/openshell-driver-kubernetes/src/resource_admission.rs:87 — openshell_driver_kubernetes::resource_admission::inventory has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 6 (14 pts), boolean chains 3, match/switch 1 (2 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.
  • openshell_driver_kubernetes::driver::spawn_namespace_file_watcher (cognitive 29) crates/openshell-driver-kubernetes/src/driver.rs:8540 — openshell_driver_kubernetes::driver::spawn_namespace_file_watcher has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 5 (8 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_driver_kubernetes::driver::cluster_wide_watch_stream (cognitive 25) crates/openshell-driver-kubernetes/src/driver.rs:5716 — openshell_driver_kubernetes::driver::cluster_wide_watch_stream has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (18 pts), match/switch 2 (5 pts), boolean chains 1, 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.
  • openshell_driver_kubernetes::driver::apply_workspace_persistence (cognitive 21) crates/openshell-driver-kubernetes/src/driver.rs:7192 — openshell_driver_kubernetes::driver::apply_workspace_persistence has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_driver_kubernetes::driver::sandbox_template_to_k8s_with_validated_config (cognitive 20) crates/openshell-driver-kubernetes/src/driver.rs:7532 — openshell_driver_kubernetes::driver::sandbox_template_to_k8s_with_validated_config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (19 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D31 · IaC & Container Security · Medium IaC · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×6
  • Duplicated block (20 lines × 2) crates/openshell-cli/src/commands/provider.rs:169 — crates/openshell-cli/src/commands/provider.rs:169-188 | crates/openshell-cli/src/commands/provider.rs:252-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.
  • Duplicated block (20 lines × 2) crates/openshell-driver-vm/src/driver.rs:4381 — crates/openshell-driver-vm/src/driver.rs:4381-4400 | crates/openshell-driver-vm/src/driver.rs:4521-4540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/openshell-sdk/src/client.rs:472 — crates/openshell-sdk/src/client.rs:472-491 | crates/openshell-sdk/src/client.rs:1240-1259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:975 — crates/openshell-server/src/grpc/sandbox.rs:975-994 | crates/openshell-server/src/grpc/sandbox.rs:1158-1177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:1479 — crates/openshell-server/src/grpc/sandbox.rs:1479-1498 | crates/openshell-server/src/grpc/sandbox.rs:1610-1629 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/openshell-driver-vm/src/driver.rs:3449 — crates/openshell-driver-vm/src/driver.rs:3449-3468 | crates/openshell-driver-vm/src/driver.rs:3619-3638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×6
  • Duplicated block (10 lines × 3) crates/openshell-driver-kubernetes/src/driver.rs:5023 — crates/openshell-driver-kubernetes/src/driver.rs:5023-5032 | crates/openshell-driver-kubernetes/src/driver.rs:5119-5128 | crates/openshell-driver-kubernetes/src/driver.rs:5162-5171 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/openshell-server/src/grpc/provider_readiness.rs:310 — crates/openshell-server/src/grpc/provider_readiness.rs:310-319 | crates/openshell-server/src/grpc/service.rs:39-48 | crates/openshell-server/src/grpc/service.rs:192-201 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (10 lines × 3) crates/openshell-cli/src/run.rs:4109 — crates/openshell-cli/src/run.rs:4109-4118 | crates/openshell-cli/src/run.rs:4135-4144 | crates/openshell-cli/src/run.rs:4160-4169 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) sdk/go/openshell/v1/exec_client.go:27 — sdk/go/openshell/v1/exec_client.go:27-36 | sdk/go/openshell/v1/exec_client.go:61-70 | sdk/go/openshell/v1/exec_client.go:85-94 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sdk/go/openshell/v1/exec_client.go:74` calls `WithCancel` and `sdk/go/openshell/v1/exec_client.go:40` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) sdk/go/openshell/v1/internal/converter/provider.go:67 — sdk/go/openshell/v1/internal/converter/provider.go:67-76 | sdk/go/openshell/v1/internal/converter/sandbox.go:277-286 | sdk/go/openshell/v1/internal/converter/sandbox.go:490-499 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (10 lines × 3) crates/openshell-sandbox/src/sandbox/linux/landlock.rs:269 — crates/openshell-sandbox/src/sandbox/linux/landlock.rs:269-278 | crates/openshell-sandbox/src/sandbox/linux/landlock.rs:384-393 | crates/openshell-sandbox/src/sandbox/linux/mod.rs:199-208 — 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.
D1 · Cyclomatic Complexity · openshell_core · ×5
  • openshell_core::provider_credentials::compile_static_credential_bindings (cyclomatic 19) crates/openshell-core/src/provider_credentials.rs:957 — openshell_core::provider_credentials::compile_static_credential_bindings has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • openshell_core::driver_utils::validate_upstream_proxy_settings (cyclomatic 18) crates/openshell-core/src/driver_utils.rs:625 — openshell_core::driver_utils::validate_upstream_proxy_settings has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_core::dynamic_credential_key::decode (cyclomatic 18) crates/openshell-core/src/dynamic_credential_key.rs:112 — openshell_core::dynamic_credential_key::decode 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.
  • openshell_core::grpc_client::refresh_token_loop (cyclomatic 17) crates/openshell-core/src/grpc_client.rs:614 — openshell_core::grpc_client::refresh_token_loop 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.
  • openshell_core::driver_utils::parse_upstream_proxy_url (cyclomatic 16) crates/openshell-core/src/driver_utils.rs:243 — openshell_core::driver_utils::parse_upstream_proxy_url 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 · KubernetesComputeDriver · ×5
  • KubernetesComputeDriver::reconcile_sandbox_runtime_resources (cognitive 57) crates/openshell-driver-kubernetes/src/driver.rs:4531 — KubernetesComputeDriver::reconcile_sandbox_runtime_resources has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 8 (17 pts), boolean chains 5, 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.
  • KubernetesComputeDriver::watch_sandboxes_single_namespace (cognitive 37) crates/openshell-driver-kubernetes/src/driver.rs:5273 — KubernetesComputeDriver::watch_sandboxes_single_namespace has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (27 pts), match/switch 3 (8 pts), boolean chains 1, 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.
  • KubernetesComputeDriver::start_sandbox_runtime_generation (cognitive 27) crates/openshell-driver-kubernetes/src/driver.rs:3794 — KubernetesComputeDriver::start_sandbox_runtime_generation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 4 (8 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • KubernetesComputeDriver::validate_capability_free_workload_pod (cognitive 24) crates/openshell-driver-kubernetes/src/driver.rs:2697 — KubernetesComputeDriver::validate_capability_free_workload_pod has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, boolean chains 10. 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.
  • KubernetesComputeDriver::delete_sandbox_inner (cognitive 18) crates/openshell-driver-kubernetes/src/driver.rs:4361 — KubernetesComputeDriver::delete_sandbox_inner has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 4 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D30 · Dependency Vulnerabilities · Medium CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×5
  • Change coupling: main.rs ↔ lib.rs crates/openshell-gateway/src/main.rs:1 — `crates/openshell-gateway/src/main.rs` and `crates/openshell-server/src/lib.rs` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `9ae37607` refactor(compute): register compiled drivers (#2786) (at that commit the file was still `crates/openshell-server/src/main.rs`); `83af7a24` feat(sandbox): inject host gateway hostAliases into sandbox pods (#306) (at that commit the file was still `crates/openshell-server/src/main.rs`); `1535f806` feat(sandbox): add configurable imagePullPolicy for sandbox pods (#256) (at that commit the files were still `crates/navigator-server/src/main.rs` and `crates/navigator-server/src/lib.rs`) — run `git show` on any of them.
  • Change coupling: config.rs ↔ main.rs crates/openshell-core/src/config.rs:1 — `crates/openshell-core/src/config.rs` and `crates/openshell-gateway/src/main.rs` change together 60% of the time (6 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 — 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 6 shared commits counted here, the most recent 3 are `9ae37607` refactor(compute): register compiled drivers (#2786) (at that commit the file was still `crates/openshell-server/src/main.rs`); `83af7a24` feat(sandbox): inject host gateway hostAliases into sandbox pods (#306) (at that commit the file was still `crates/openshell-server/src/main.rs`); `1535f806` feat(sandbox): add configurable imagePullPolicy for sandbox pods (#256) (at that commit the files were still `crates/navigator-core/src/config.rs` and `crates/navigator-server/src/main.rs`) — run `git show` on any of them.
  • Change coupling: lib.rs ↔ main.rs crates/openshell-bootstrap/src/lib.rs:1 — `crates/openshell-bootstrap/src/lib.rs` and `crates/openshell-cli/src/main.rs` change together 59% of the time (17 of the 29 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 17 shared commits counted here, the most recent 3 are `6e6b3c89` refactor(cli): remove local REDACTED image builds (#3214); `047de66b` feat(bootstrap,cli): switch GPU injection to CDI where supported (#495); `1f2a85e8` fix(cli): clear stale last-used sandbox on deletion (#510) — run `git show` on any of them.
  • Change coupling: policy.rs ↔ policy_local.rs crates/openshell-server/src/grpc/policy.rs:1 — `crates/openshell-server/src/grpc/policy.rs` and `crates/openshell-supervisor-network/src/policy_local.rs` change together 57% of the time (8 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 8 shared commits counted here, the most recent 3 are `3f12bdc6` fix(server): audit proposal rejections in the gateway (#4281); `ffb53067` fix(providers): prepare dynamic credentials across HTTP relay paths (…; `718dba34` fix(policy)!: reject removed tls endpoint values (#3414) — run `git show` on any of them.
  • Change coupling: policy.rs ↔ REDACTED crates/openshell-server/src/grpc/policy.rs:1 — `crates/openshell-server/src/grpc/policy.rs` and `REDACTED` change together 54% of the time (7 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 7 shared commits counted here, the most recent 3 are `71440b28` fix(policy): refresh pending proposals when the sandbox policy change…; `679fe4c3` fix(policy): validate the applicable advisor candidate (#2850); `aa483ecb` feat(providers): AWS STS AssumeRole refresh strategy and aws-s3 profi… — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×5
  • Duplicated block (21 lines × 2) crates/openshell-driver-kubernetes/src/config.rs:785 — crates/openshell-driver-kubernetes/src/config.rs:785-805 | crates/openshell-driver-vm/src/driver.rs:528-548 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (21 lines × 2) crates/openshell-sandbox/src/main_session.rs:806 — crates/openshell-sandbox/src/main_session.rs:806-826 | crates/openshell-supervisor-process/src/main_session.rs:352-372 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) crates/openshell-sandbox/src/mechanistic_mapper.rs:262 — crates/openshell-sandbox/src/mechanistic_mapper.rs:262-282 | crates/openshell-supervisor/src/mechanistic_mapper.rs:263-283 — before extracting anything, compare `crates/openshell-sandbox/src/mechanistic_mapper.rs` and `crates/openshell-supervisor/src/mechanistic_mapper.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:6163 — crates/openshell-supervisor-network/src/proxy.rs:6163-6184 | crates/openshell-supervisor-network/src/proxy.rs:6201-6221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) REDACTED:1887 — REDACTED:1887-1907 | crates/openshell-server/src/persistence/sqlite.rs:1715-1736 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) crates/openshell-core/src/secrets.rs:1044 — crates/openshell-core/src/secrets.rs:1044-1062 | crates/openshell-core/src/secrets.rs:1353-1371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) crates/openshell-providers/src/profiles.rs:1883 — crates/openshell-providers/src/profiles.rs:1883-1901 | crates/openshell-providers/src/profiles.rs:1932-1950 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) crates/openshell-sandbox/src/main_session.rs:100 — crates/openshell-sandbox/src/main_session.rs:100-118 | crates/openshell-supervisor-process/src/main_session.rs:76-94 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) REDACTED:2116 — REDACTED:2116-2134 | crates/openshell-server/src/persistence/sqlite.rs:1945-1963 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) sdk/go/openshell/v1/exec_client.go:254 — sdk/go/openshell/v1/exec_client.go:254-272 | sdk/go/openshell/v1/tcp_client.go:317-335 — 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 `sdk/go/openshell/v1/tcp_client.go:317` 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. 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 (13 lines × 3) · ×5
  • Duplicated block (13 lines × 3) crates/openshell-cli/src/commands/provider.rs:1540 — crates/openshell-cli/src/commands/provider.rs:1540-1552 | crates/openshell-cli/src/run.rs:2909-2921 | crates/openshell-cli/src/run.rs:3575-3587 — before extracting anything, compare `crates/openshell-cli/src/commands/provider.rs` and `crates/openshell-cli/src/run.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 3) crates/openshell-driver-vm/src/rootfs.rs:1108 — crates/openshell-driver-vm/src/rootfs.rs:1108-1120 | crates/openshell-driver-vm/src/rootfs.rs:1137-1149 | crates/openshell-driver-vm/src/rootfs.rs:1167-1179 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) crates/openshell-supervisor-network/src/l7/relay.rs:1475 — crates/openshell-supervisor-network/src/l7/relay.rs:1475-1487 | crates/openshell-supervisor-network/src/l7/relay.rs:2219-2231 | crates/openshell-supervisor-network/src/l7/relay.rs:2930-2942 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) crates/openshell-tui/src/ui/create_provider.rs:51 — crates/openshell-tui/src/ui/create_provider.rs:51-63 | crates/openshell-tui/src/ui/create_provider.rs:159-171 | crates/openshell-tui/src/ui/create_provider.rs:260-272 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) crates/openshell-driver-kubernetes/src/driver.rs:6419 — crates/openshell-driver-kubernetes/src/driver.rs:6419-6431 | crates/openshell-driver-kubernetes/src/driver.rs:6434-6450 | crates/openshell-driver-kubernetes/src/driver.rs:6453-6465 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • Low cohesion: Config (LCOM4 19) crates/openshell-core/src/config.rs:216 — Config's methods fall into 19 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 19 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: OpenShellClient (LCOM4 6) crates/openshell-sdk/src/client.rs:37 — OpenShellClient's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MainSession (LCOM4 4) crates/openshell-sandbox/src/main_session.rs:358 — MainSession'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: ObservedUpstream (LCOM4 4) crates/openshell-supervisor-network/src/l7/rest.rs:1296 — ObservedUpstream'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: MainSession (LCOM4 4) crates/openshell-supervisor-process/src/main_session.rs:180 — MainSession'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.
D1 · Cyclomatic Complexity · openshell_policy · ×4
  • openshell_policy::validate_sandbox_policy_with_mcp_presence (cyclomatic 61) crates/openshell-policy/src/lib.rs:1413 — openshell_policy::validate_sandbox_policy_with_mcp_presence has cyclomatic complexity 61 (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.
  • openshell_policy::l7_validate::validate_l7_endpoint_semantics (cyclomatic 23) crates/openshell-policy/src/l7_validate.rs:243 — openshell_policy::l7_validate::validate_l7_endpoint_semantics has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • openshell_policy::middleware::validate (cyclomatic 18) crates/openshell-policy/src/middleware.rs:182 — openshell_policy::middleware::validate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_policy::ambiguity::tokenize_runtime_path_glob (cyclomatic 17) crates/openshell-policy/src/ambiguity.rs:472 — openshell_policy::ambiguity::tokenize_runtime_path_glob 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 · KubernetesComputeDriver · ×4
  • KubernetesComputeDriver::reconcile_sandbox_runtime_resources (cyclomatic 39) crates/openshell-driver-kubernetes/src/driver.rs:4531 — KubernetesComputeDriver::reconcile_sandbox_runtime_resources has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • KubernetesComputeDriver::validate_capability_free_workload_pod (cyclomatic 25) crates/openshell-driver-kubernetes/src/driver.rs:2697 — KubernetesComputeDriver::validate_capability_free_workload_pod has cyclomatic complexity 25 (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.
  • KubernetesComputeDriver::start_sandbox_runtime_generation (cyclomatic 19) crates/openshell-driver-kubernetes/src/driver.rs:3794 — KubernetesComputeDriver::start_sandbox_runtime_generation 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.
  • KubernetesComputeDriver::watch_sandboxes_single_namespace (cyclomatic 17) crates/openshell-driver-kubernetes/src/driver.rs:5273 — KubernetesComputeDriver::watch_sandboxes_single_namespace 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 · openshell_driver_kubernetes · ×4
  • openshell_driver_kubernetes::driver::spawn_namespace_label_watcher (cyclomatic 20) crates/openshell-driver-kubernetes/src/driver.rs:8423 — openshell_driver_kubernetes::driver::spawn_namespace_label_watcher 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.
  • openshell_driver_kubernetes::driver::sandbox_template_to_k8s_with_validated_config (cyclomatic 18) crates/openshell-driver-kubernetes/src/driver.rs:7532 — openshell_driver_kubernetes::driver::sandbox_template_to_k8s_with_validated_config 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.
  • openshell_driver_kubernetes::driver::spawn_namespace_file_watcher (cyclomatic 18) crates/openshell-driver-kubernetes/src/driver.rs:8540 — openshell_driver_kubernetes::driver::spawn_namespace_file_watcher has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • openshell_driver_kubernetes::resource_admission::inventory (cyclomatic 18) crates/openshell-driver-kubernetes/src/resource_admission.rs:87 — openshell_driver_kubernetes::resource_admission::inventory 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.
D2 · Cognitive Complexity · VmDriver · ×4
  • VmDriver::monitor_sandbox (cognitive 41) crates/openshell-driver-vm/src/driver.rs:4568 — VmDriver::monitor_sandbox has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (34 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • VmDriver::provision_sandbox_inner (cognitive 40) crates/openshell-driver-vm/src/driver.rs:1369 — VmDriver::provision_sandbox_inner has cognitive complexity 40 (threshold 15). Drivers by points: if/else 25 (29 pts), match/switch 6, loops 4, 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.
  • VmDriver::restore_persisted_sandboxes (cognitive 21) crates/openshell-driver-vm/src/driver.rs:2234 — VmDriver::restore_persisted_sandboxes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 5 (10 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.
  • VmDriver::validate_launch_plan_backend (cognitive 16) crates/openshell-driver-vm/src/driver.rs:2615 — VmDriver::validate_launch_plan_backend has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. 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 · LayerApplier · ×4
  • LayerApplier::resolve_directory (cognitive 22) crates/openshell-driver-vm/src/layer_applier.rs:327 — LayerApplier::resolve_directory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayerApplier::merge_directory (cognitive 20) crates/openshell-driver-vm/src/layer_applier.rs:110 — LayerApplier::merge_directory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 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.
  • LayerApplier::merge_directory (cognitive 17) crates/openshell-driver-vm/src/layer_applier.rs:185 — LayerApplier::merge_directory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayerApplier::resolve_path_beneath_rootfs (cognitive 17) crates/openshell-driver-vm/src/layer_applier.rs:633 — LayerApplier::resolve_path_beneath_rootfs 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×4
  • Duplicated block (28 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:3825 — crates/openshell-server/src/grpc/sandbox.rs:3825-3852 | crates/openshell-server/src/grpc/sandbox.rs:4085-4112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:2598 — crates/openshell-supervisor-network/src/l7/relay.rs:2598-2625 | crates/openshell-supervisor-network/src/l7/relay.rs:2880-2907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:2635 — crates/openshell-supervisor-network/src/proxy.rs:2635-2662 | crates/openshell-supervisor-network/src/proxy.rs:5466-5493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2) crates/openshell-tui/src/ui/sandbox_draft.rs:899 — crates/openshell-tui/src/ui/sandbox_draft.rs:899-926 | crates/openshell-tui/src/ui/sandbox_draft.rs:929-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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×4
  • Duplicated block (22 lines × 2) crates/openshell-server/src/grpc/policy.rs:3310 — crates/openshell-server/src/grpc/policy.rs:3310-3331 | crates/openshell-server/src/grpc/policy.rs:3375-3396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2) crates/openshell-server/src/grpc/policy.rs:4857 — crates/openshell-server/src/grpc/policy.rs:4857-4878 | crates/openshell-server/src/grpc/policy.rs:4921-4942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2) REDACTED:1310 — REDACTED:1310-1331 | crates/openshell-server/src/persistence/sqlite.rs:1139-1160 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (22 lines × 2) sdk/go/openshell/v1/fake/sandbox.go:617 — sdk/go/openshell/v1/fake/sandbox.go:617-638 | sdk/go/openshell/v1/fake/sandbox.go:683-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×4
  • Duplicated block (15–16 lines × 2) crates/openshell-driver-mxc/src/driver.rs:683 — crates/openshell-driver-mxc/src/driver.rs:683-698 | crates/openshell-driver-mxc/src/driver.rs:753-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15–16 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:2034 — crates/openshell-supervisor-network/src/l7/relay.rs:2034-2048 | crates/openshell-supervisor-network/src/l7/relay.rs:2728-2743 — both copies are in the same file, so extract the block into 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–16 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:1132 — crates/openshell-supervisor-network/src/proxy.rs:1132-1147 | crates/openshell-supervisor-network/src/proxy.rs:1202-1216 — both copies are in the same file, so extract the block into 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–16 lines × 2) sdk/go/openshell/v1/edge/tunnel.go:271 — sdk/go/openshell/v1/edge/tunnel.go:271-286 | sdk/go/openshell/v1/tcp_client.go:229-243 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×4
  • Duplicated block (13–14 lines × 2) crates/openshell-cli/src/commands/provider.rs:1191 — crates/openshell-cli/src/commands/provider.rs:1191-1203 | crates/openshell-cli/src/commands/provider.rs:2828-2841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) crates/openshell-driver-docker/src/lib.rs:5020 — crates/openshell-driver-docker/src/lib.rs:5020-5032 | crates/openshell-driver-docker/src/lib.rs:5382-5395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) crates/openshell-server/src/grpc/policy.rs:4299 — crates/openshell-server/src/grpc/policy.rs:4299-4311 | crates/openshell-server/src/grpc/policy.rs:4356-4369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1428 — crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1428-1441 | crates/openshell-supervisor-network/src/l7/rest/http_response.rs:1484-1496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×4
  • Duplicated block (11–12 lines × 2) crates/openshell-cli/src/commands/provider.rs:1512 — crates/openshell-cli/src/commands/provider.rs:1512-1522 | crates/openshell-cli/src/run.rs:2874-2885 — before extracting anything, compare `crates/openshell-cli/src/commands/provider.rs` and `crates/openshell-cli/src/run.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11–12 lines × 2) crates/openshell-server/src/grpc/provider.rs:4257 — crates/openshell-server/src/grpc/provider.rs:4257-4267 | crates/openshell-supervisor-network/src/token_grant.rs:361-372 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11–12 lines × 2) crates/openshell-server/src/persistence/sqlite.rs:1311 — crates/openshell-server/src/persistence/sqlite.rs:1311-1321 | crates/openshell-server/src/persistence/sqlite.rs:1336-1347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–12 lines × 2) scripts/generate_third_party_notices.py:75 — scripts/generate_third_party_notices.py:75-86 | scripts/generate_third_party_notices.py:143-153 — both copies are in the same file, so extract the 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 `scripts/generate_third_party_notices.py:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×4
  • Duplicated block (10–11 lines × 2) crates/openshell-cli/src/commands/provider.rs:1177 — crates/openshell-cli/src/commands/provider.rs:1177-1186 | crates/openshell-cli/src/commands/provider.rs:2804-2814 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–11 lines × 2) crates/openshell-driver-kubernetes-secrets/src/main.rs:56 — crates/openshell-driver-kubernetes-secrets/src/main.rs:56-66 | crates/openshell-driver-vault/src/main.rs:77-86 — before extracting anything, compare `crates/openshell-driver-kubernetes-secrets/src/main.rs` and `crates/openshell-driver-vault/src/main.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10–11 lines × 2) crates/openshell-server/src/grpc/provider_credentials.rs:264 — crates/openshell-server/src/grpc/provider_credentials.rs:264-273 | crates/openshell-server/src/grpc/provider_credentials.rs:323-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–11 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:2066 — crates/openshell-supervisor-network/src/l7/relay.rs:2066-2075 | crates/openshell-supervisor-network/src/l7/relay.rs:2763-2773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · VmDriver · ×3
  • VmDriver::provision_sandbox_inner (cyclomatic 33) crates/openshell-driver-vm/src/driver.rs:1369 — VmDriver::provision_sandbox_inner has cyclomatic complexity 33 (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.
  • VmDriver::monitor_sandbox (cyclomatic 19) crates/openshell-driver-vm/src/driver.rs:4568 — VmDriver::monitor_sandbox 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. This is NOT this file's highest cyclomatic complexity: openshell_driver_vm::driver::attach_vm_progress_metadata (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • VmDriver::validate_launch_plan_backend (cyclomatic 17) crates/openshell-driver-vm/src/driver.rs:2615 — VmDriver::validate_launch_plan_backend has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: openshell_driver_vm::driver::attach_vm_progress_metadata (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SshHandler · ×3
  • SshHandler::subsystem_request (cyclomatic 19) crates/openshell-supervisor-process/src/ssh.rs:724 — SshHandler::subsystem_request 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.
  • SshHandler::start_exec_spec (cyclomatic 18) crates/openshell-supervisor-process/src/ssh.rs:1265 — SshHandler::start_exec_spec has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SshHandler::data (cyclomatic 17) crates/openshell-supervisor-process/src/ssh.rs:925 — SshHandler::data 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×3
  • Repeated repair: crates/openshell-supervisor-network/src/policy_local.rs crates/openshell-supervisor-network/src/policy_local.rs:607 — crates/openshell-supervisor-network/src/policy_local.rs changed 17 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is openshell_supervisor_network::policy_local::submit_proposal at line 607), 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(supervisor): rename OCSF log files from `.log` to `.jsonl` (#4263)”; “fix(server): audit proposal rejections in the gateway (#4281)”; “fix(sandbox): audit every endpoint in a proposal (#4313)”; “fix(providers): prepare dynamic credentials across HTTP relay paths (#4152)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-supervisor-network/src/policy_local.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: crates/openshell-core/src/secrets.rs crates/openshell-core/src/secrets.rs:1015 — crates/openshell-core/src/secrets.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is openshell_core::secrets::rewrite_request_line at line 1015), 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(core): preserve issued identity in credential aliases (#4390)”; “fix(supervisor): classify credential placeholders in request bodies (#3246)”; “fix(policy): gate uninspected credentialed endpoints (#2493)”; “fix(providers): keep refresh credential handles stable (#2780)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-core/src/secrets.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: crates/openshell-supervisor-network/src/identity.rs crates/openshell-supervisor-network/src/identity.rs:138 — crates/openshell-supervisor-network/src/identity.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 11 (its worst body is BinaryIdentityCache::verify_or_cache_supplied_identity at line 138), 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): restore MSVC lint for CLI and MXC (#4194)”; “fix(identity): assess leaf and ancestor executable identities (#3633)”; “fix(ci): repair RFC 0012 post-merge checks (#3360)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:28:39 +00:00' --until='2026-10-27 04:28:39 +00:00' --full-history --no-merges -- crates/openshell-supervisor-network/src/identity.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.
D2 · Cognitive Complexity · openshell_providers · ×3
  • openshell_providers::profiles::validate_profile_set (cognitive 504) crates/openshell-providers/src/profiles.rs:2138 — openshell_providers::profiles::validate_profile_set has cognitive complexity 504 (threshold 15). Drivers by points: if/else 103 (371 pts), loops 24 (89 pts), boolean chains 41, match/switch 1 (3 pts) (nesting depth added 335). 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.
  • openshell_providers::profiles::validate_token_grant_audience_overrides (cognitive 41) crates/openshell-providers/src/profiles.rs:3409 — openshell_providers::profiles::validate_token_grant_audience_overrides has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 5 (12 pts), boolean chains 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.
  • openshell_providers::discovery::discover_from_profile (cognitive 22) crates/openshell-providers/src/discovery.rs:33 — openshell_providers::discovery::discover_from_profile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openshell_supervisor_process · ×3
  • openshell_supervisor_process::log_push::run_push_loop (cognitive 49) crates/openshell-supervisor-process/src/log_push.rs:184 — openshell_supervisor_process::log_push::run_push_loop has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (39 pts), match/switch 3 (7 pts), loops 2 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_process::supervisor_session::bridge_relay_bytes (cognitive 23) crates/openshell-supervisor-process/src/supervisor_session.rs:1078 — openshell_supervisor_process::supervisor_session::bridge_relay_bytes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (4 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_supervisor_process::supervisor_session::run_single_session (cognitive 21) crates/openshell-supervisor-process/src/supervisor_session.rs:584 — openshell_supervisor_process::supervisor_session::run_single_session has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 3 (6 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 · DockerComputeDriver · ×3
  • DockerComputeDriver::admit_container_resources (cognitive 33) crates/openshell-driver-docker/src/lib.rs:1266 — DockerComputeDriver::admit_container_resources has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DockerComputeDriver::current_snapshots (cognitive 21) crates/openshell-driver-docker/src/lib.rs:1496 — DockerComputeDriver::current_snapshots has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (7 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DockerComputeDriver::provision_sandbox_inner (cognitive 17) crates/openshell-driver-docker/src/lib.rs:1636 — DockerComputeDriver::provision_sandbox_inner has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 9, if/else 6 (8 pts) (nesting depth added 2). 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 · SshHandler · ×3
  • SshHandler::subsystem_request (cognitive 33) crates/openshell-supervisor-process/src/ssh.rs:724 — SshHandler::subsystem_request has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (22 pts), match/switch 3 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SshHandler::start_exec_spec (cognitive 26) crates/openshell-supervisor-process/src/ssh.rs:1265 — SshHandler::start_exec_spec has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 4 (6 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SshHandler::data (cognitive 18) crates/openshell-supervisor-process/src/ssh.rs:925 — SshHandler::data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7 (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 · openshell_driver_podman · ×3
  • openshell_driver_podman::watcher::start_watch (cognitive 28) crates/openshell-driver-podman/src/watcher.rs:133 — openshell_driver_podman::watcher::start_watch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 2 (5 pts), boolean chains 2, loops 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.
  • openshell_driver_podman::container::build_base_spec (cognitive 23) crates/openshell-driver-podman/src/container.rs:1230 — openshell_driver_podman::container::build_base_spec has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 2, match/switch 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.
  • openshell_driver_podman::container::build_env (cognitive 18) crates/openshell-driver-podman/src/container.rs:629 — openshell_driver_podman::container::build_env has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · openshell_driver_mxc · ×3
  • openshell_driver_mxc::driver::run_lifecycle (cognitive 27) crates/openshell-driver-mxc/src/driver.rs:846 — openshell_driver_mxc::driver::run_lifecycle has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 6 (11 pts), boolean chains 2 (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.
  • openshell_driver_mxc::policy_map::map::report_endpoint_l7_losses (cognitive 18) crates/openshell-driver-mxc/src/policy_map/map.rs:505 — openshell_driver_mxc::policy_map::map::report_endpoint_l7_losses has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_driver_mxc::etw_consumer::decode_properties (cognitive 16) crates/openshell-driver-mxc/src/etw_consumer.rs:983 — openshell_driver_mxc::etw_consumer::decode_properties has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openshell_sandbox_backend · ×3
  • openshell_sandbox_backend::sandbox_auth::plan_attach (cognitive 27) crates/openshell-sandbox-backend/src/sandbox_auth.rs:451 — openshell_sandbox_backend::sandbox_auth::plan_attach has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_sandbox_backend::stream_adapter::send (cognitive 17) crates/openshell-sandbox-backend/src/stream_adapter.rs:145 — openshell_sandbox_backend::stream_adapter::send has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • openshell_sandbox_backend::runtime_initiated::accept_loop (cognitive 16) crates/openshell-sandbox-backend/src/runtime_initiated.rs:135 — openshell_sandbox_backend::runtime_initiated::accept_loop has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 2 (7 pts), 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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/openshell-sdk/src/client.rs:201 — crates/openshell-sdk/src/client.rs:201-226 | crates/openshell-sdk/src/client.rs:240-265 | crates/openshell-sdk/src/client.rs:315-344 | crates/openshell-sdk/src/client.rs:505-534 | crates/openshell-sdk/src/client.rs:583-611 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/openshell-supervisor-network/src/l7/relay.rs:1161 — crates/openshell-supervisor-network/src/l7/relay.rs:1161-1637 | crates/openshell-supervisor-network/src/l7/relay.rs:2030-2363 | crates/openshell-supervisor-network/src/l7/relay.rs:2448-2715 | crates/openshell-supervisor-network/src/l7/relay.rs:2727-3003 | crates/openshell-supervisor-network/src/l7/relay.rs:3516-3733 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) sdk/go/openshell/v1/internal/converter/provider.go:15 — sdk/go/openshell/v1/internal/converter/provider.go:15-58 | sdk/go/openshell/v1/internal/converter/sandbox.go:19-55 | sdk/go/openshell/v1/internal/converter/sandbox.go:403-423 | sdk/go/openshell/v1/internal/converter/workspace.go:13-38 | sdk/go/openshell/v1/internal/converter/workspace.go:53-73 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×3
  • Duplicated block (37 lines × 2) crates/openshell-sandbox/src/denial_aggregator.rs:77 — crates/openshell-sandbox/src/denial_aggregator.rs:77-113 | crates/openshell-supervisor/src/denial_aggregator.rs:77-113 — before extracting anything, compare `crates/openshell-sandbox/src/denial_aggregator.rs` and `crates/openshell-supervisor/src/denial_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (37 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:3620 — crates/openshell-server/src/grpc/sandbox.rs:3620-3656 | crates/openshell-server/src/grpc/sandbox.rs:3698-3734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (37 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:2653 — crates/openshell-supervisor-network/src/l7/relay.rs:2653-2689 | crates/openshell-supervisor-network/src/l7/relay.rs:2932-2968 — both copies are in the same file, so extract the 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 (25 lines × 2) · ×3
  • Duplicated block (25 lines × 2) crates/openshell-sandbox/src/main_session.rs:273 — crates/openshell-sandbox/src/main_session.rs:273-297 | crates/openshell-supervisor-process/src/main_session.rs:142-166 — before extracting anything, compare `crates/openshell-sandbox/src/main_session.rs` and `crates/openshell-supervisor-process/src/main_session.rs` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 174 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (25 lines × 2) crates/openshell-server/src/grpc/policy.rs:4474 — crates/openshell-server/src/grpc/policy.rs:4474-4498 | crates/openshell-server/src/grpc/policy.rs:4520-4544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:1548 — crates/openshell-supervisor-network/src/proxy.rs:1548-1572 | crates/openshell-supervisor-process/src/ssh.rs:271-295 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) crates/openshell-driver-kubernetes-secrets/src/main.rs:80 — crates/openshell-driver-kubernetes-secrets/src/main.rs:80-102 | crates/openshell-driver-vault/src/main.rs:132-154 — before extracting anything, compare `crates/openshell-driver-kubernetes-secrets/src/main.rs` and `crates/openshell-driver-vault/src/main.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) crates/openshell-providers/src/profiles.rs:3584 — crates/openshell-providers/src/profiles.rs:3584-3606 | crates/openshell-server/src/grpc/provider.rs:1884-1906 — before extracting anything, compare `crates/openshell-providers/src/profiles.rs` and `crates/openshell-server/src/grpc/provider.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) REDACTED:2180 — REDACTED:2180-2202 | crates/openshell-server/src/persistence/sqlite.rs:2009-2031 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×3
  • Duplicated block (12–13 lines × 2) crates/openshell-sandbox/src/boundary_exec.rs:275 — crates/openshell-sandbox/src/boundary_exec.rs:275-287 | crates/openshell-sandbox/src/boundary_exec.rs:371-382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–13 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:1379 — crates/openshell-server/src/grpc/sandbox.rs:1379-1391 | crates/openshell-server/src/grpc/sandbox.rs:1566-1577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–13 lines × 2) REDACTED:579 — REDACTED:579-591 | REDACTED:901-912 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×3
  • Duplicated block (8 lines × 3) crates/openshell-supervisor-network/src/l7/relay.rs:2380 — crates/openshell-supervisor-network/src/l7/relay.rs:2380-2387 | crates/openshell-supervisor-network/src/l7/websocket.rs:2130-2137 | crates/openshell-supervisor-network/src/proxy.rs:1479-1486 — before extracting anything, compare `crates/openshell-supervisor-network/src/l7/relay.rs` and `crates/openshell-supervisor-network/src/proxy.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) crates/openshell-policy/src/merge.rs:1214 — crates/openshell-policy/src/merge.rs:1214-1221 | crates/openshell-sandbox/src/mechanistic_mapper.rs:250-258 | crates/openshell-supervisor/src/mechanistic_mapper.rs:251-259 — before extracting anything, compare `crates/openshell-sandbox/src/mechanistic_mapper.rs` and `crates/openshell-supervisor/src/mechanistic_mapper.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) crates/openshell-supervisor-network/src/l7/path.rs:382 — crates/openshell-supervisor-network/src/l7/path.rs:382-389 | crates/openshell-supervisor-network/src/l7/rest.rs:696-703 | crates/openshell-supervisor-network/src/l7/rest.rs:1979-1986 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×3
  • Duplicated block (6 lines × 4) crates/openshell-driver-docker/src/lib.rs:1800 — crates/openshell-driver-docker/src/lib.rs:1800-1805 | crates/openshell-driver-docker/src/lib.rs:1822-1827 | crates/openshell-driver-docker/src/lib.rs:1857-1862 | crates/openshell-driver-docker/src/lib.rs:1933-1938 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 4) crates/openshell-tui/src/ui/mod.rs:210 — crates/openshell-tui/src/ui/mod.rs:210-215 | crates/openshell-tui/src/ui/mod.rs:235-240 | crates/openshell-tui/src/ui/mod.rs:257-262 | crates/openshell-tui/src/ui/mod.rs:273-278 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 4) sdk/go/openshell/v1/fake/config.go:26 — sdk/go/openshell/v1/fake/config.go:26-31 | sdk/go/openshell/v1/fake/exec.go:28-33 | sdk/go/openshell/v1/fake/exec.go:39-44 | sdk/go/openshell/v1/fake/exec.go:50-55 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. 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 (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) crates/openshell-ocsf/src/events/api_activity.rs:58 — crates/openshell-ocsf/src/events/api_activity.rs:58-62 | crates/openshell-ocsf/src/events/http_activity.rs:72-76 | crates/openshell-ocsf/src/events/network_activity.rs:68-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) crates/openshell-tui/src/ui/mod.rs:224 — crates/openshell-tui/src/ui/mod.rs:224-228 | crates/openshell-tui/src/ui/mod.rs:316-320 | crates/openshell-tui/src/ui/mod.rs:359-363 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/openshell-server/src/grpc/policy/endpoint_status.rs:217 — crates/openshell-server/src/grpc/policy/endpoint_status.rs:217-221 | crates/openshell-server/src/grpc/policy/endpoint_status.rs:455-459 | crates/openshell-server/src/grpc/policy/endpoint_status.rs:518-522 — 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×3
  • Outbound HTTP without resilience crates/openshell-cli/src/commands/gateway.rs:1490 — `Client::builder(TokioExecutor` 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 crates/openshell-cli/src/oidc_auth.rs:97 — `reqwest::ClientBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience crates/openshell-sdk/src/oidc.rs:143 — `reqwest::ClientBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
X3 · Exception handling · Swallowed exception (empty catch) · ×3
  • Swallowed exception (empty catch) sdk/typescript/src/client.ts:1591 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) sdk/typescript/src/client.ts:1753 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) sdk/typescript/src/client.ts:1898 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×3
  • Swallowed exception (caught, then discarded) sdk/typescript/src/transport.ts:114 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) sdk/go/openshell/v1/tcp_client.go:149 — `if err := tl.acceptAndBridge(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) python/openshell/__init__.py:37 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D1 · Cyclomatic Complexity · ConfigRuntime · ×2
  • ConfigRuntime::reconcile (cyclomatic 51) crates/openshell-supervisor/src/config_runtime.rs:216 — ConfigRuntime::reconcile has cyclomatic complexity 51 (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.
  • ConfigRuntime::apply_delivered_sandbox (cyclomatic 18) crates/openshell-supervisor/src/config_runtime.rs:897 — ConfigRuntime::apply_delivered_sandbox has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChainRunner · ×2
  • ChainRunner::evaluate_described_with_policy_admitted (cyclomatic 36) crates/openshell-supervisor-middleware/src/lib.rs:1684 — ChainRunner::evaluate_described_with_policy_admitted has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ChainRunner::preflight_described_http_response (cyclomatic 30) crates/openshell-supervisor-middleware/src/response/preflight.rs:35 — ChainRunner::preflight_described_http_response has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PodmanComputeDriver · ×2
  • PodmanComputeDriver::create_sandbox (cyclomatic 27) crates/openshell-driver-podman/src/driver.rs:939 — PodmanComputeDriver::create_sandbox has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • PodmanComputeDriver::admit_container_resources (cyclomatic 21) crates/openshell-driver-podman/src/driver.rs:784 — PodmanComputeDriver::admit_container_resources 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 · openshell_sandbox_backend · ×2
  • openshell_sandbox_backend::sandbox_auth::plan_attach (cyclomatic 20) crates/openshell-sandbox-backend/src/sandbox_auth.rs:451 — openshell_sandbox_backend::sandbox_auth::plan_attach 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.
  • openshell_sandbox_backend::stream_adapter::send (cyclomatic 18) crates/openshell-sandbox-backend/src/stream_adapter.rs:145 — openshell_sandbox_backend::stream_adapter::send has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DockerComputeDriver · ×2
  • DockerComputeDriver::admit_container_resources (cyclomatic 19) crates/openshell-driver-docker/src/lib.rs:1266 — DockerComputeDriver::admit_container_resources 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.
  • DockerComputeDriver::provision_sandbox_inner (cyclomatic 16) crates/openshell-driver-docker/src/lib.rs:1636 — DockerComputeDriver::provision_sandbox_inner has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: openshell_driver_docker::parse_memory_limit (cyclomatic 18) 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 · MainSession · ×2
  • MainSession::start_io (cyclomatic 19) crates/openshell-sandbox/src/main_session.rs:581 — MainSession::start_io has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • MainSession::from_boundary (cyclomatic 16) crates/openshell-sandbox/src/main_session.rs:476 — MainSession::from_boundary 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 · ConfigRuntime · ×2
  • ConfigRuntime::reconcile (cognitive 83) crates/openshell-supervisor/src/config_runtime.rs:216 — ConfigRuntime::reconcile has cognitive complexity 83 (threshold 15). Drivers by points: if/else 27 (53 pts), boolean chains 18, match/switch 6 (12 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ConfigRuntime::apply_delivered_sandbox (cognitive 26) crates/openshell-supervisor/src/config_runtime.rs:897 — ConfigRuntime::apply_delivered_sandbox has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChainRunner · ×2
  • ChainRunner::evaluate_described_with_policy_admitted (cognitive 79) crates/openshell-supervisor-middleware/src/lib.rs:1684 — ChainRunner::evaluate_described_with_policy_admitted has cognitive complexity 79 (threshold 15). Drivers by points: if/else 18 (37 pts), match/switch 13 (33 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ChainRunner::preflight_described_http_response (cognitive 62) crates/openshell-supervisor-middleware/src/response/preflight.rs:35 — ChainRunner::preflight_described_http_response has cognitive complexity 62 (threshold 15). Drivers by points: if/else 19 (46 pts), match/switch 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MainSession · ×2
  • MainSession::start_io (cognitive 44) crates/openshell-sandbox/src/main_session.rs:581 — MainSession::start_io has cognitive complexity 44 (threshold 15). Drivers by points: match/switch 6 (17 pts), if/else 4 (14 pts), loops 6 (13 pts) (nesting depth added 28). 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.
  • MainSession::from_boundary (cognitive 35) crates/openshell-sandbox/src/main_session.rs:476 — MainSession::from_boundary has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 3 (7 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SupervisorPool · ×2
  • SupervisorPool::transition_admitting (cognitive 39) crates/openshell-server/src/supervisor_pool.rs:1155 — SupervisorPool::transition_admitting has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 3 (7 pts), boolean chains 3, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SupervisorPool::reconcile_once (cognitive 16) crates/openshell-server/src/supervisor_pool.rs:2043 — SupervisorPool::reconcile_once has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoProxy · ×2
  • NoProxy::direct_addrs (cognitive 38) crates/openshell-supervisor-network/src/upstream_proxy.rs:224 — NoProxy::direct_addrs has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (7 pts), boolean chains 4, match/switch 1 (2 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.
  • NoProxy::parse (cognitive 16) crates/openshell-supervisor-network/src/upstream_proxy.rs:148 — NoProxy::parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PodmanComputeDriver · ×2
  • PodmanComputeDriver::admit_container_resources (cognitive 32) crates/openshell-driver-podman/src/driver.rs:784 — PodmanComputeDriver::admit_container_resources has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 8, match/switch 2 (5 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PodmanComputeDriver::create_sandbox (cognitive 30) crates/openshell-driver-podman/src/driver.rs:939 — PodmanComputeDriver::create_sandbox has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (20 pts), match/switch 7, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · openshell_vfio · ×2
  • openshell_vfio::reconcile::reconcile_stale_bindings (cognitive 30) crates/openshell-vfio/src/reconcile.rs:16 — openshell_vfio::reconcile::reconcile_stale_bindings has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • openshell_vfio::gpu::prepare_gpu_for_passthrough (cognitive 26) crates/openshell-vfio/src/gpu.rs:84 — openshell_vfio::gpu::prepare_gpu_for_passthrough has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActivityAggregator · ×2
  • ActivityAggregator::run (cognitive 28) crates/openshell-sandbox/src/activity_aggregator.rs:50 — ActivityAggregator::run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ActivityAggregator::run (cognitive 28) crates/openshell-supervisor/src/activity_aggregator.rs:50 — ActivityAggregator::run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · openshell_supervisor_middleware · ×2
  • openshell_supervisor_middleware::headers::apply (cognitive 23) crates/openshell-supervisor-middleware/src/headers.rs:124 — openshell_supervisor_middleware::headers::apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, 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.
  • openshell_supervisor_middleware::websocket::validate_message_result (cognitive 17) crates/openshell-supervisor-middleware/src/websocket.rs:1169 — openshell_supervisor_middleware::websocket::validate_message_result has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (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 · DenialAggregator · ×2
  • DenialAggregator::run (cognitive 21) crates/openshell-sandbox/src/denial_aggregator.rs:71 — DenialAggregator::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DenialAggregator::run (cognitive 21) crates/openshell-supervisor/src/denial_aggregator.rs:71 — DenialAggregator::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openshell_driver_vm · ×2
  • openshell_driver_vm::runtime::run_libkrun_vm (cognitive 20) crates/openshell-driver-vm/src/runtime.rs:295 — openshell_driver_vm::runtime::run_libkrun_vm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • openshell_driver_vm::driver::validate_vm_driver_mounts (cognitive 16) crates/openshell-driver-vm/src/driver.rs:5206 — openshell_driver_vm::driver::validate_vm_driver_mounts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpstreamProxyConfig · ×2
  • UpstreamProxyConfig::validate (cognitive 16) crates/openshell-core/src/config.rs:820 — UpstreamProxyConfig::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • UpstreamProxyConfig::from_lookup (cognitive 16) crates/openshell-supervisor-network/src/upstream_proxy.rs:416 — UpstreamProxyConfig::from_lookup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3, boolean chains 2, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/openshell-server/src/grpc/policy.rs:6022 — crates/openshell-server/src/grpc/policy.rs:6022-6154 | crates/openshell-server/src/grpc/policy.rs:6170-6260 | crates/openshell-server/src/grpc/policy.rs:6276-6575 | crates/openshell-server/src/grpc/policy.rs:6580-6640 | crates/openshell-server/src/grpc/policy.rs:6656-6741 | crates/openshell-server/src/grpc/policy.rs:6746-6778 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) sdk/go/openshell/v1/fake/sandbox.go:490 — sdk/go/openshell/v1/fake/sandbox.go:490-514 | sdk/go/openshell/v1/fake/sandbox.go:517-541 | sdk/go/openshell/v1/fake/sandbox.go:583-613 | sdk/go/openshell/v1/fake/sandbox.go:616-658 | sdk/go/openshell/v1/fake/sandbox.go:804-841 | sdk/go/openshell/v1/fake/sandbox.go:847-892 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×2
  • Duplicated block (35 lines × 2) crates/openshell-providers/src/profiles.rs:2821 — crates/openshell-providers/src/profiles.rs:2821-2855 | crates/openshell-providers/src/profiles.rs:2907-2941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (35 lines × 2) crates/openshell-supervisor/src/endpoint_status.rs:167 — crates/openshell-supervisor/src/endpoint_status.rs:167-201 | crates/openshell-supervisor/src/endpoint_status.rs:233-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) crates/openshell-driver-docker/src/lib.rs:2040 — crates/openshell-driver-docker/src/lib.rs:2040-2065 | crates/openshell-driver-docker/src/lib.rs:2102-2127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (26 lines × 2) crates/openshell-tui/src/app.rs:1580 — crates/openshell-tui/src/app.rs:1580-1605 | crates/openshell-tui/src/app.rs:1861-1886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×2
  • Duplicated block (19–21 lines × 2) crates/openshell-core/src/provider_credentials.rs:701 — crates/openshell-core/src/provider_credentials.rs:701-721 | crates/openshell-core/src/provider_credentials.rs:797-815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19–21 lines × 2) crates/openshell-prover/src/containment.rs:1161 — crates/openshell-prover/src/containment.rs:1161-1181 | crates/openshell-supervisor-network/src/l7/token_grant_injection.rs:637-655 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) crates/openshell-sdk/src/edge_tunnel.rs:207 — crates/openshell-sdk/src/edge_tunnel.rs:207-224 | crates/openshell-server/src/ws_tunnel.rs:104-120 — 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–18 lines × 2) crates/openshell-tui/src/lib.rs:975 — crates/openshell-tui/src/lib.rs:975-992 | crates/openshell-tui/src/lib.rs:1106-1122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×2
  • Duplicated block (16–17 lines × 2) crates/openshell-core/src/provider_credentials.rs:277 — crates/openshell-core/src/provider_credentials.rs:277-293 | crates/openshell-core/src/provider_credentials.rs:612-627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16–17 lines × 2) crates/openshell-tui/src/app.rs:2824 — crates/openshell-tui/src/app.rs:2824-2840 | crates/openshell-tui/src/app.rs:3137-3152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) crates/openshell-cli/src/output.rs:274 — crates/openshell-cli/src/output.rs:274-288 | crates/openshell-cli/src/output.rs:318-332 | crates/openshell-cli/src/output.rs:365-379 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (15 lines × 3) crates/openshell-sdk/src/client.rs:330 — crates/openshell-sdk/src/client.rs:330-344 | crates/openshell-sdk/src/client.rs:520-534 | crates/openshell-sdk/src/client.rs:1084-1098 — 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 (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) crates/openshell-driver-vm/src/driver.rs:1951 — crates/openshell-driver-vm/src/driver.rs:1951-1964 | crates/openshell-driver-vm/src/driver.rs:2157-2171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–15 lines × 2) crates/openshell-supervisor-network/src/policy_dns/runtime.rs:163 — crates/openshell-supervisor-network/src/policy_dns/runtime.rs:163-176 | crates/openshell-supervisor-network/src/policy_dns/runtime.rs:277-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×2
  • Duplicated block (12–15 lines × 2) crates/openshell-server/src/grpc/service.rs:193 — crates/openshell-server/src/grpc/service.rs:193-207 | crates/openshell-server/src/grpc/service.rs:305-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–15 lines × 2) crates/openshell-supervisor-middleware/src/websocket.rs:1143 — crates/openshell-supervisor-middleware/src/websocket.rs:1143-1157 | crates/openshell-supervisor-middleware/src/websocket.rs:1211-1222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×2
  • Duplicated block (12–13 lines × 3) crates/openshell-core/src/provider_credentials.rs:272 — crates/openshell-core/src/provider_credentials.rs:272-284 | crates/openshell-core/src/provider_credentials.rs:703-715 | crates/openshell-core/src/provider_credentials.rs:798-809 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12–13 lines × 3) crates/openshell-server/src/certgen.rs:188 — crates/openshell-server/src/certgen.rs:188-199 | crates/openshell-server/src/certgen.rs:257-268 | crates/openshell-server/src/certgen.rs:278-290 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×2
  • Duplicated block (12 lines × 4) crates/openshell-server/src/grpc/policy.rs:6026 — crates/openshell-server/src/grpc/policy.rs:6026-6037 | crates/openshell-server/src/grpc/policy.rs:6174-6185 | crates/openshell-server/src/grpc/policy.rs:6584-6595 | crates/openshell-server/src/grpc/policy.rs:6660-6671 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 4) sdk/go/openshell/v1/fake/sandbox.go:503 — sdk/go/openshell/v1/fake/sandbox.go:503-514 | sdk/go/openshell/v1/fake/sandbox.go:530-541 | sdk/go/openshell/v1/fake/sandbox.go:602-613 | sdk/go/openshell/v1/fake/sandbox.go:647-658 — 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 `sdk/go/openshell/v1/fake/sandbox.go:503` 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. 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–12 lines × 2) · ×2
  • Duplicated block (8–12 lines × 2) crates/openshell-sandbox/src/network_broker.rs:888 — crates/openshell-sandbox/src/network_broker.rs:888-899 | crates/openshell-sandbox/src/network_broker.rs:1308-1315 — both copies are in the same file, so extract the block into 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–12 lines × 2) crates/openshell-server/src/grpc/provider.rs:4752 — crates/openshell-server/src/grpc/provider.rs:4752-4759 | crates/openshell-supervisor-network/src/token_grant.rs:446-457 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×2
  • Duplicated block (11 lines × 6) crates/openshell-server/src/grpc/policy.rs:6023 — crates/openshell-server/src/grpc/policy.rs:6023-6033 | crates/openshell-server/src/grpc/policy.rs:6171-6181 | crates/openshell-server/src/grpc/policy.rs:6277-6287 | crates/openshell-server/src/grpc/policy.rs:6581-6591 | crates/openshell-server/src/grpc/policy.rs:6657-6667 | crates/openshell-server/src/grpc/policy.rs:6747-6757 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 6) sdk/go/openshell/v1/fake/sandbox.go:501 — sdk/go/openshell/v1/fake/sandbox.go:501-511 | sdk/go/openshell/v1/fake/sandbox.go:528-538 | sdk/go/openshell/v1/fake/sandbox.go:600-610 | sdk/go/openshell/v1/fake/sandbox.go:645-655 | sdk/go/openshell/v1/fake/sandbox.go:825-835 | sdk/go/openshell/v1/fake/sandbox.go:876-886 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) crates/openshell-cli/src/run.rs:6114 — crates/openshell-cli/src/run.rs:6114-6123 | crates/openshell-cli/src/run.rs:6306-6314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) crates/openshell-driver-kubernetes/src/sandbox_runtime.rs:96 — crates/openshell-driver-kubernetes/src/sandbox_runtime.rs:96-105 | crates/openshell-supervisor-network/src/l7/tls.rs:46-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×2
  • Duplicated block (7–9 lines × 2) crates/openshell-driver-podman/src/driver.rs:1718 — crates/openshell-driver-podman/src/driver.rs:1718-1724 | crates/openshell-driver-podman/src/driver.rs:1769-1777 — both copies are in the same file, so extract the block into 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) crates/openshell-server/src/grpc/policy/endpoint_status.rs:446 — crates/openshell-server/src/grpc/policy/endpoint_status.rs:446-454 | crates/openshell-server/src/grpc/policy/endpoint_status.rs:511-517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) crates/openshell-supervisor-network/src/l7/relay.rs:1189 — crates/openshell-supervisor-network/src/l7/relay.rs:1189-1196 | crates/openshell-supervisor-network/src/l7/relay.rs:2051-2058 | crates/openshell-supervisor-network/src/l7/relay.rs:2468-2478 | crates/openshell-supervisor-network/src/l7/relay.rs:2748-2755 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 4) sdk/go/openshell/v1/internal/converter/provider.go:30 — sdk/go/openshell/v1/internal/converter/provider.go:30-37 | sdk/go/openshell/v1/internal/converter/sandbox.go:28-35 | sdk/go/openshell/v1/internal/converter/sandbox.go:411-418 | sdk/go/openshell/v1/internal/converter/workspace.go:22-29 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/go/openshell/v1/internal/converter/provider.go:30` 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 (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) crates/openshell-core/src/oauth.rs:293 — crates/openshell-core/src/oauth.rs:293-299 | crates/openshell-providers/src/profiles.rs:3712-3719 — before extracting anything, compare `crates/openshell-core/src/oauth.rs` and `crates/openshell-providers/src/profiles.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7–8 lines × 2) crates/openshell-supervisor-network/src/host.rs:126 — crates/openshell-supervisor-network/src/host.rs:126-133 | crates/openshell-supervisor-network/src/run.rs:491-497 — 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 (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) crates/openshell-sandbox/src/boundary_server.rs:3231 — crates/openshell-sandbox/src/boundary_server.rs:3231-3237 | crates/openshell-sandbox/src/sandbox/linux/landlock.rs:268-275 | crates/openshell-sandbox/src/sandbox/linux/landlock.rs:383-390 | crates/openshell-sandbox/src/sandbox/linux/landlock.rs:423-430 | crates/openshell-sandbox/src/sandbox/linux/mod.rs:198-205 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 5) sdk/go/openshell/v1/internal/converter/provider.go:28 — sdk/go/openshell/v1/internal/converter/provider.go:28-34 | sdk/go/openshell/v1/internal/converter/sandbox.go:26-32 | sdk/go/openshell/v1/internal/converter/sandbox.go:409-415 | sdk/go/openshell/v1/internal/converter/workspace.go:20-26 | sdk/go/openshell/v1/internal/converter/workspace.go:63-69 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/go/openshell/v1/internal/converter/provider.go:28` 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 (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) REDACTED:1380 — REDACTED:1380-1403 | REDACTED:1451-1466 | REDACTED:1485-1500 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (16 lines × 3) crates/openshell-supervisor-network/src/proxy.rs:5588 — crates/openshell-supervisor-network/src/proxy.rs:5588-5603 | crates/openshell-supervisor-network/src/proxy.rs:5735-5752 | crates/openshell-supervisor-network/src/proxy.rs:6231-6246 — 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.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×2
  • Duplicated block (12 lines × 2 locations) sdk/typescript/src/client.ts:782 — sdk/typescript/src/client.ts:782 · sdk/typescript/src/client.ts:799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2 locations) sdk/typescript/src/client.ts:1292 — sdk/typescript/src/client.ts:1292 · sdk/typescript/src/client.ts:1977 — 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.
R4 · Test Coverage · No test reaches this file · ×2
  • No test reaches this file scripts/lint-mermaid/lint-mermaid.mjs: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 fern/components/CustomFooter.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.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · openshell_providers · ×1
  • openshell_providers::profiles::validate_profile_set (cyclomatic 170) crates/openshell-providers/src/profiles.rs:2138 — openshell_providers::profiles::validate_profile_set has cyclomatic complexity 170 (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 · OcsfEvent · ×1
  • OcsfEvent::format_shorthand (cyclomatic 44) crates/openshell-ocsf/src/format/shorthand.rs:231 — OcsfEvent::format_shorthand has cyclomatic complexity 44 (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 · ProviderClient.getCredentials (cyclomatic 27) · ×1
  • ProviderClient.getCredentials (cyclomatic 27) sdk/typescript/src/providers.ts:51 — ProviderClient.getCredentials has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 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 · codex_compatibility_report.validate_review (cyclomatic 26) · ×1
  • codex_compatibility_report.validate_review (cyclomatic 26) tasks/scripts/codex_compatibility_report.py:25 — codex_compatibility_report.validate_review has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BodyPlaceholderGuard · ×1
  • BodyPlaceholderGuard::release (cyclomatic 25) crates/openshell-core/src/secrets_body.rs:193 — BodyPlaceholderGuard::release 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.
D1 · Cyclomatic Complexity · openshell_prover · ×1
  • openshell_prover::containment::resource_limit_reason (cyclomatic 25) crates/openshell-prover/src/containment.rs:1926 — openshell_prover::containment::resource_limit_reason 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.
D1 · Cyclomatic Complexity · resolve_licenses.main (cyclomatic 25) · ×1
  • resolve_licenses.main (cyclomatic 25) REDACTED:400 — resolve_licenses.main 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.
D1 · Cyclomatic Complexity · select-release-candidate.select_candidate (cyclomatic 25) · ×1
  • select-release-candidate.select_candidate (cyclomatic 25) tasks/scripts/select-release-candidate.py:63 — select-release-candidate.select_candidate 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.
D1 · Cyclomatic Complexity · gateway.validateGatewayName (cyclomatic 25) · ×1
  • gateway.validateGatewayName (cyclomatic 25) sdk/go/openshell/v1/gateway/paths.go:97 — gateway.validateGatewayName has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AuthGrpcRouter · ×1
  • AuthGrpcRouter::call (cyclomatic 23) crates/openshell-server/src/multiplex.rs:1210 — AuthGrpcRouter::call 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.
D1 · Cyclomatic Complexity · SupervisorPool · ×1
  • SupervisorPool::transition_admitting (cyclomatic 23) crates/openshell-server/src/supervisor_pool.rs:1155 — SupervisorPool::transition_admitting 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 · sandboxClient.Watch (cyclomatic 23) · ×1
  • sandboxClient.Watch (cyclomatic 23) sdk/go/openshell/v1/sandbox_client.go:372 — sandboxClient.Watch has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 406). 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.
D1 · Cyclomatic Complexity · TlsAcceptor · ×1
  • TlsAcceptor::spawn_reload_worker (cyclomatic 22) crates/openshell-server/src/tls.rs:141 — TlsAcceptor::spawn_reload_worker 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 · WebSocketSession · ×1
  • WebSocketSession::evaluate_text_admitted_inner (cyclomatic 22) crates/openshell-supervisor-middleware/src/websocket.rs:576 — WebSocketSession::evaluate_text_admitted_inner has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SandboxClient.execInteractive (cyclomatic 22) · ×1
  • SandboxClient.execInteractive (cyclomatic 22) sdk/typescript/src/client.ts:1539 — SandboxClient.execInteractive has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (receive, assertInputOpen, settleExit, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ProxyHandle · ×1
  • ProxyHandle::start_with_bind_addr (cyclomatic 21) crates/openshell-supervisor-network/src/proxy.rs:242 — ProxyHandle::start_with_bind_addr 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 · NoProxy · ×1
  • NoProxy::direct_addrs (cyclomatic 21) crates/openshell-supervisor-network/src/upstream_proxy.rs:224 — NoProxy::direct_addrs 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 · verify-python-wheel.verify_wheel (cyclomatic 21) · ×1
  • verify-python-wheel.verify_wheel (cyclomatic 21) tasks/scripts/verify-python-wheel.py:59 — verify-python-wheel.verify_wheel has cyclomatic complexity 21 (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 · openshell_driver_podman · ×1
  • openshell_driver_podman::container::build_base_spec (cyclomatic 20) crates/openshell-driver-podman/src/container.rs:1230 — openshell_driver_podman::container::build_base_spec 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 · oidc.exchangeClientCredentials (cyclomatic 20) · ×1
  • oidc.exchangeClientCredentials (cyclomatic 20) sdk/go/openshell/v1/oidc/credentials.go:91 — oidc.exchangeClientCredentials 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 · OpenShellRunner · ×1
  • OpenShellRunner::cleanup (cyclomatic 19) crates/openshell-conformance/src/lib.rs:482 — OpenShellRunner::cleanup has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · openshell_crypto · ×1
  • openshell_crypto::pki::issuer::issuer_from_der (cyclomatic 19) crates/openshell-crypto/src/pki/issuer.rs:17 — openshell_crypto::pki::issuer::issuer_from_der 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 · SupervisorHostController · ×1
  • SupervisorHostController::run_session (cyclomatic 19) crates/openshell-supervisor-control/src/controller.rs:1135 — SupervisorHostController::run_session 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 · BodyCredentialClassifier · ×1
  • BodyCredentialClassifier::check (cyclomatic 18) crates/openshell-core/src/secrets_body.rs:102 — BodyCredentialClassifier::check 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 · Tracker · ×1
  • Tracker::run_reporter (cyclomatic 18) crates/openshell-supervisor/src/provider_readiness.rs:308 — Tracker::run_reporter has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · openshell_supervisor_process · ×1
  • openshell_supervisor_process::log_push::run_push_loop (cyclomatic 18) crates/openshell-supervisor-process/src/log_push.rs:184 — openshell_supervisor_process::log_push::run_push_loop has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClientCredentialsAuth._exchange (cyclomatic 18) · ×1
  • ClientCredentialsAuth._exchange (cyclomatic 18) python/openshell/sandbox.py:364 — ClientCredentialsAuth._exchange 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 · sandbox._sandbox_ref (cyclomatic 18) · ×1
  • sandbox._sandbox_ref (cyclomatic 18) python/openshell/sandbox.py:1887 — sandbox._sandbox_ref 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 · oidc.Login (cyclomatic 18) · ×1
  • oidc.Login (cyclomatic 18) sdk/go/openshell/v1/oidc/oidc.go:35 — oidc.Login 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 · ssh-validate.validateSshResponse (cyclomatic 18) · ×1
  • ssh-validate.validateSshResponse (cyclomatic 18) sdk/typescript/src/ssh-validate.ts:47 — ssh-validate.validateSshResponse has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · openshell_conformance · ×1
  • openshell_conformance::scenarios::policy_behavior::run_policy_local (cyclomatic 17) crates/openshell-conformance/src/scenarios/policy_behavior.rs:52 — openshell_conformance::scenarios::policy_behavior::run_policy_local has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · KubernetesComputeConfig · ×1
  • KubernetesComputeConfig::validate_workspace_mode (cyclomatic 17) crates/openshell-driver-kubernetes/src/config.rs:869 — KubernetesComputeConfig::validate_workspace_mode 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 · openshell_driver_mxc · ×1
  • openshell_driver_mxc::driver::run_lifecycle (cyclomatic 17) crates/openshell-driver-mxc/src/driver.rs:846 — openshell_driver_mxc::driver::run_lifecycle 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 · BuiltinMiddlewareService · ×1
  • BuiltinMiddlewareService::websocket_stream (cyclomatic 17) crates/openshell-supervisor-middleware-builtins/src/lib.rs:52 — BuiltinMiddlewareService::websocket_stream 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 · UpstreamProxyConfig · ×1
  • UpstreamProxyConfig::from_lookup (cyclomatic 17) crates/openshell-supervisor-network/src/upstream_proxy.rs:416 — UpstreamProxyConfig::from_lookup has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · SandboxClient.from_active_cluster (cyclomatic 17) · ×1
  • SandboxClient.from_active_cluster (cyclomatic 17) python/openshell/sandbox.py:735 — SandboxClient.from_active_cluster 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 · NavCheck.walk (cyclomatic 17) · ×1
  • NavCheck.walk (cyclomatic 17) tasks/scripts/check_docs_nav.py:92 — NavCheck.walk has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · openshell_driver_vm · ×1
  • openshell_driver_vm::runtime::run_libkrun_vm (cyclomatic 16) crates/openshell-driver-vm/src/runtime.rs:295 — openshell_driver_vm::runtime::run_libkrun_vm 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 · openshell_supervisor_middleware · ×1
  • openshell_supervisor_middleware::headers::apply (cyclomatic 16) crates/openshell-supervisor-middleware/src/headers.rs:124 — openshell_supervisor_middleware::headers::apply has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GatewayError.__init__ (cyclomatic 16) · ×1
  • GatewayError.__init__ (cyclomatic 16) python/openshell/errors.py:41 — GatewayError.__init__ 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 · refreshableAuth.GetRequestMetadata (cyclomatic 16) · ×1
  • refreshableAuth.GetRequestMetadata (cyclomatic 16) sdk/go/openshell/v1/auth_refresh.go:81 — refreshableAuth.GetRequestMetadata 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 · oidc.DeviceLogin (cyclomatic 16) · ×1
  • oidc.DeviceLogin (cyclomatic 16) sdk/go/openshell/v1/oidc/device.go:48 — oidc.DeviceLogin 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 · SandboxClient.forward (cyclomatic 16) · ×1
  • SandboxClient.forward (cyclomatic 16) sdk/typescript/src/client.ts:1709 — SandboxClient.forward has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OcsfEvent · ×1
  • OcsfEvent::format_shorthand (cognitive 61) crates/openshell-ocsf/src/format/shorthand.rs:231 — OcsfEvent::format_shorthand has cognitive complexity 61 (threshold 15). Drivers by points: if/else 32 (51 pts), boolean chains 4, match/switch 3 (4 pts), loops 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 · select-release-candidate.select_candidate (cognitive 49) · ×1
  • select-release-candidate.select_candidate (cognitive 49) tasks/scripts/select-release-candidate.py:63 — select-release-candidate.select_candidate has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyPlaceholderGuard · ×1
  • BodyPlaceholderGuard::release (cognitive 46) crates/openshell-core/src/secrets_body.rs:193 — BodyPlaceholderGuard::release has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolve_licenses.main (cognitive 46) · ×1
  • resolve_licenses.main (cognitive 46) REDACTED:400 — resolve_licenses.main has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 9 (13 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebSocketSession · ×1
  • WebSocketSession::evaluate_text_admitted_inner (cognitive 45) crates/openshell-supervisor-middleware/src/websocket.rs:576 — WebSocketSession::evaluate_text_admitted_inner has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (35 pts), match/switch 3 (7 pts), loops 2 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ControlReadiness · ×1
  • ControlReadiness::start (cognitive 39) crates/openshell-supervisor/src/lib.rs:216 — ControlReadiness::start has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 4 (13 pts), boolean chains 1, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProxyHandle · ×1
  • ProxyHandle::start_with_bind_addr (cognitive 37) crates/openshell-supervisor-network/src/proxy.rs:242 — ProxyHandle::start_with_bind_addr has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 6 (14 pts), boolean chains 2, loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NavCheck.walk (cognitive 36) · ×1
  • NavCheck.walk (cognitive 36) tasks/scripts/check_docs_nav.py:92 — NavCheck.walk has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 3 (10 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TlsAcceptor · ×1
  • TlsAcceptor::spawn_reload_worker (cognitive 35) crates/openshell-server/src/tls.rs:141 — TlsAcceptor::spawn_reload_worker has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 3 (6 pts), loops 3 (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.
D2 · Cognitive Complexity · sandboxClient.Watch (cognitive 34) · ×1
  • sandboxClient.Watch (cognitive 34) sdk/go/openshell/v1/sandbox_client.go:372 — sandboxClient.Watch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 3 (11 pts), boolean chains 3, loops 1 (nesting depth added 16). Most of this is not in the body itself: 5 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 406). 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 · Tracker · ×1
  • Tracker::run_reporter (cognitive 33) crates/openshell-supervisor/src/provider_readiness.rs:308 — Tracker::run_reporter has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 4 (8 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · BuiltinMiddlewareService · ×1
  • BuiltinMiddlewareService::websocket_stream (cognitive 33) crates/openshell-supervisor-middleware-builtins/src/lib.rs:52 — BuiltinMiddlewareService::websocket_stream has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 6 (19 pts), if/else 5 (11 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · codex_compatibility_report.validate_review (cognitive 32) · ×1
  • codex_compatibility_report.validate_review (cognitive 32) tasks/scripts/codex_compatibility_report.py:25 — codex_compatibility_report.validate_review has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 9, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SupervisorHostController · ×1
  • SupervisorHostController::run_session (cognitive 30) crates/openshell-supervisor-control/src/controller.rs:1135 — SupervisorHostController::run_session has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (22 pts), match/switch 2 (5 pts), boolean chains 2, 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 · openshell_supervisor_control · ×1
  • openshell_supervisor_control::credential::deliver_credentials (cognitive 29) crates/openshell-supervisor-control/src/credential.rs:25 — openshell_supervisor_control::credential::deliver_credentials has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openshell_bootstrap · ×1
  • openshell_bootstrap::metadata::list_gateways_with_source (cognitive 27) crates/openshell-bootstrap/src/metadata.rs:328 — openshell_bootstrap::metadata::list_gateways_with_source has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReachabilityModel · ×1
  • ReachabilityModel::encode_l7_enforcement (cognitive 27) crates/openshell-prover/src/model.rs:142 — ReachabilityModel::encode_l7_enforcement has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PolicyDnsRuntime · ×1
  • PolicyDnsRuntime::start (cognitive 27) crates/openshell-supervisor-network/src/policy_dns/runtime.rs:186 — PolicyDnsRuntime::start has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update_license_headers.main (cognitive 26) · ×1
  • update_license_headers.main (cognitive 26) scripts/update_license_headers.py:374 — update_license_headers.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · converter.ProviderProfileFromProto (cognitive 26) · ×1
  • converter.ProviderProfileFromProto (cognitive 26) sdk/go/openshell/v1/internal/converter/profile.go:341 — converter.ProviderProfileFromProto has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 4 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProviderTypeProfile · ×1
  • ProviderTypeProfile::validate_before_lowering (cognitive 25) crates/openshell-providers/src/profiles.rs:1037 — ProviderTypeProfile::validate_before_lowering has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update_license_headers.discover_files (cognitive 25) · ×1
  • update_license_headers.discover_files (cognitive 25) scripts/update_license_headers.py:213 — update_license_headers.discover_files has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · refreshableAuth.GetRequestMetadata (cognitive 25) · ×1
  • refreshableAuth.GetRequestMetadata (cognitive 25) sdk/go/openshell/v1/auth_refresh.go:81 — refreshableAuth.GetRequestMetadata has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openshell_crypto · ×1
  • openshell_crypto::pki::issuer::issuer_from_der (cognitive 24) crates/openshell-crypto/src/pki/issuer.rs:17 — openshell_crypto::pki::issuer::issuer_from_der has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (4 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 · KubernetesComputeConfig · ×1
  • KubernetesComputeConfig::validate_workspace_mode (cognitive 24) crates/openshell-driver-kubernetes/src/config.rs:869 — KubernetesComputeConfig::validate_workspace_mode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthGrpcRouter · ×1
  • AuthGrpcRouter::call (cognitive 24) crates/openshell-server/src/multiplex.rs:1210 — AuthGrpcRouter::call has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 4 (10 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · fake.copySandboxPolicy (cognitive 23) · ×1
  • fake.copySandboxPolicy (cognitive 23) sdk/go/openshell/v1/fake/sandbox.go:63 — fake.copySandboxPolicy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SandboxClient.watchLogs (cognitive 23) · ×1
  • SandboxClient.watchLogs (cognitive 23) sdk/typescript/src/client.ts:1469 — SandboxClient.watchLogs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (5 pts), error handling 2 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenShellRunner · ×1
  • OpenShellRunner::cleanup (cognitive 22) crates/openshell-conformance/src/lib.rs:482 — OpenShellRunner::cleanup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 3 (6 pts), boolean chains 4, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalBoundaryExec · ×1
  • LocalBoundaryExec::command (cognitive 22) crates/openshell-sandbox/src/boundary_exec.rs:123 — LocalBoundaryExec::command has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 4 (5 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CredentialRuntime · ×1
  • CredentialRuntime::resolve_provider_handles (cognitive 22) crates/openshell-server/src/credentials.rs:659 — CredentialRuntime::resolve_provider_handles has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (6 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 · verify-python-wheel.verify_wheel (cognitive 22) · ×1
  • verify-python-wheel.verify_wheel (cognitive 22) tasks/scripts/verify-python-wheel.py:59 — verify-python-wheel.verify_wheel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OcsfJsonlLayer · ×1
  • OcsfJsonlLayer::on_event (cognitive 21) crates/openshell-ocsf/src/tracing_layers/jsonl_layer.rs:110 — OcsfJsonlLayer::on_event has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (6 pts), boolean chains 3 (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 · PolicyDnsService · ×1
  • PolicyDnsService::answer_query (cognitive 21) crates/openshell-supervisor-network/src/policy_dns/mod.rs:108 — PolicyDnsService::answer_query has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · converter.policyNetworkEndpointFromProto (cognitive 21) · ×1
  • converter.policyNetworkEndpointFromProto (cognitive 21) sdk/go/openshell/v1/internal/converter/network_policy.go:65 — converter.policyNetworkEndpointFromProto has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oidc.exchangeClientCredentials (cognitive 21) · ×1
  • oidc.exchangeClientCredentials (cognitive 21) sdk/go/openshell/v1/oidc/credentials.go:91 — oidc.exchangeClientCredentials has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 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.
D2 · Cognitive Complexity · ProviderReadinessEvidence · ×1
  • ProviderReadinessEvidence::accept (cognitive 20) crates/openshell-server/src/grpc/provider_readiness.rs:68 — ProviderReadinessEvidence::accept has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GatewayError.__init__ (cognitive 20) · ×1
  • GatewayError.__init__ (cognitive 20) python/openshell/errors.py:41 — GatewayError.__init__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientCredentialsAuth._exchange (cognitive 20) · ×1
  • ClientCredentialsAuth._exchange (cognitive 20) python/openshell/sandbox.py:364 — ClientCredentialsAuth._exchange has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, error handling 2 (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 · SandboxClient.from_active_cluster (cognitive 20) · ×1
  • SandboxClient.from_active_cluster (cognitive 20) python/openshell/sandbox.py:735 — SandboxClient.from_active_cluster has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 pts), boolean chains 4, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oidc.Login (cognitive 20) · ×1
  • oidc.Login (cognitive 20) sdk/go/openshell/v1/oidc/oidc.go:35 — oidc.Login has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · tunnelListener.acceptAndBridge (cognitive 20) · ×1
  • tunnelListener.acceptAndBridge (cognitive 20) sdk/go/openshell/v1/tcp_client.go:174 — tunnelListener.acceptAndBridge has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProviderClient.getCredentials (cognitive 20) · ×1
  • ProviderClient.getCredentials (cognitive 20) sdk/typescript/src/providers.ts:51 — ProviderClient.getCredentials has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 4, error handling 1. Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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 · openshell_policy_schema · ×1
  • openshell_policy_schema::yaml::reject_null_at_path (cognitive 19) crates/openshell-policy-schema/src/yaml.rs:39 — openshell_policy_schema::yaml::reject_null_at_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (6 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 · JwksCache · ×1
  • JwksCache::refresh_keys (cognitive 19) crates/openshell-server/src/auth/oidc.rs:674 — JwksCache::refresh_keys has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SocketTrustedResolver · ×1
  • SocketTrustedResolver::resolve (cognitive 19) crates/openshell-supervisor-network/src/policy_dns/resolver.rs:184 — SocketTrustedResolver::resolve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generate_third_party_notices.format_notices (cognitive 19) · ×1
  • generate_third_party_notices.format_notices (cognitive 19) scripts/generate_third_party_notices.py:181 — generate_third_party_notices.format_notices has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (7 pts), ternaries 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oidc.resolveClientCredentialsConfig (cognitive 19) · ×1
  • oidc.resolveClientCredentialsConfig (cognitive 19) sdk/go/openshell/v1/oidc/credentials.go:39 — oidc.resolveClientCredentialsConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oidc.DeviceLogin (cognitive 19) · ×1
  • oidc.DeviceLogin (cognitive 19) sdk/go/openshell/v1/oidc/device.go:48 — oidc.DeviceLogin has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SandboxClient.waitReady (cognitive 19) · ×1
  • SandboxClient.waitReady (cognitive 19) sdk/typescript/src/client.ts:1324 — SandboxClient.waitReady has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openshell_conformance · ×1
  • openshell_conformance::scenarios::policy_behavior::run_policy_local (cognitive 18) crates/openshell-conformance/src/scenarios/policy_behavior.rs:52 — openshell_conformance::scenarios::policy_behavior::run_policy_local has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, match/switch 2 (5 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecretResolver · ×1
  • SecretResolver::rewrite_text_placeholders (cognitive 18) crates/openshell-core/src/secrets.rs:561 — SecretResolver::rewrite_text_placeholders has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 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 · ExecutionPlan · ×1
  • ExecutionPlan::load (cognitive 18) crates/openshell-gateway-interceptors/src/plan.rs:178 — ExecutionPlan::load has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (7 pts), loops 3 (6 pts), if/else 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutputLog · ×1
  • OutputLog::publish_lossless_with_timeout (cognitive 18) crates/openshell-sandbox/src/main_session.rs:144 — OutputLog::publish_lossless_with_timeout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store · ×1
  • Store::update_message_cas (cognitive 18) crates/openshell-server/src/persistence/mod.rs:1334 — Store::update_message_cas has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, match/switch 1 (2 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 · HttpResponseSession · ×1
  • HttpResponseSession::process_units_from (cognitive 18) crates/openshell-supervisor-middleware/src/response.rs:438 — HttpResponseSession::process_units_from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update_license_headers.process_file (cognitive 18) · ×1
  • update_license_headers.process_file (cognitive 18) scripts/update_license_headers.py:323 — update_license_headers.process_file has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gateway.validateGatewayName (cognitive 18) · ×1
  • gateway.validateGatewayName (cognitive 18) sdk/go/openshell/v1/gateway/paths.go:97 — gateway.validateGatewayName has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), loops 1, match/switch 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BodyCredentialClassifier · ×1
  • BodyCredentialClassifier::check (cognitive 17) crates/openshell-core/src/secrets_body.rs:102 — BodyCredentialClassifier::check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. 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 · openshell_driver_docker · ×1
  • openshell_driver_docker::spawn_docker_control_process (cognitive 17) crates/openshell-driver-docker/src/lib.rs:5248 — openshell_driver_docker::spawn_docker_control_process has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openshell_gateway_interceptors · ×1
  • openshell_gateway_interceptors::plan::normalize_binding (cognitive 17) crates/openshell-gateway-interceptors/src/plan.rs:779 — openshell_gateway_interceptors::plan::normalize_binding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExportWorker · ×1
  • ExportWorker::run (cognitive 17) crates/openshell-otel/src/ocsf.rs:262 — ExportWorker::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (3 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SupervisorSessionRegistry · ×1
  • SupervisorSessionRegistry::open_relay_with_message_until (cognitive 17) crates/openshell-server/src/supervisor_session.rs:951 — SupervisorSessionRegistry::open_relay_with_message_until has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sandbox._sandbox_ref (cognitive 17) · ×1
  • sandbox._sandbox_ref (cognitive 17) python/openshell/sandbox.py:1887 — sandbox._sandbox_ref has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 12, boolean chains 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 · SandboxClient.forward (cognitive 17) · ×1
  • SandboxClient.forward (cognitive 17) sdk/typescript/src/client.ts:1709 — SandboxClient.forward has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 5 (7 pts), error handling 2 (3 pts) (nesting depth added 4). Of this number, 10 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PodmanClient · ×1
  • PodmanClient::events_stream (cognitive 16) crates/openshell-driver-podman/src/client.rs:994 — PodmanClient::events_stream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProtoJsonCodec · ×1
  • ProtoJsonCodec::pointer_intersects_secret (cognitive 16) crates/openshell-gateway-interceptors/src/proto_json.rs:159 — ProtoJsonCodec::pointer_intersects_secret has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 pts) (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 · openshell_ocsf · ×1
  • openshell_ocsf::format::downgrade::downgrade_event (cognitive 16) crates/openshell-ocsf/src/format/downgrade.rs:58 — openshell_ocsf::format::downgrade::downgrade_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientCredentialsAuth._apply_gateway_metadata (cognitive 16) · ×1
  • ClientCredentialsAuth._apply_gateway_metadata (cognitive 16) python/openshell/sandbox.py:326 — ClientCredentialsAuth._apply_gateway_metadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codex_compatibility_report.write_report (cognitive 16) · ×1
  • codex_compatibility_report.write_report (cognitive 16) tasks/scripts/codex_compatibility_report.py:110 — codex_compatibility_report.write_report has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sync_docs_website.sync_docs (cognitive 16) · ×1
  • sync_docs_website.sync_docs (cognitive 16) tasks/scripts/sync_docs_website.py:515 — sync_docs_website.sync_docs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · interactiveSession.readLoop (cognitive 16) · ×1
  • interactiveSession.readLoop (cognitive 16) sdk/go/openshell/v1/exec_client.go:212 — interactiveSession.readLoop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fakePolicyClient.GetStatus (cognitive 16) · ×1
  • fakePolicyClient.GetStatus (cognitive 16) sdk/go/openshell/v1/fake/policy.go:114 — fakePolicyClient.GetStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grpc.NewConnection (cognitive 16) · ×1
  • grpc.NewConnection (cognitive 16) sdk/go/openshell/v1/internal/grpc/conn.go:31 — grpc.NewConnection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · oidc.fetchDiscovery (cognitive 16) · ×1
  • oidc.fetchDiscovery (cognitive 16) sdk/go/openshell/v1/oidc/discovery.go:101 — oidc.fetchDiscovery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Pushable.[Symbol.asyncIterator] (cognitive 16) · ×1
  • Pushable.[Symbol.asyncIterator] (cognitive 16) sdk/typescript/src/client.ts:947 — Pushable.[Symbol.asyncIterator] has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 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 · SandboxClient.waitDeleted (cognitive 16) · ×1
  • SandboxClient.waitDeleted (cognitive 16) sdk/typescript/src/client.ts:1355 — SandboxClient.waitDeleted has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SandboxClient.execInteractive · ×1
  • SandboxClient.execInteractive::receive (cognitive 16) sdk/typescript/src/client.ts:1616 — SandboxClient.execInteractive::receive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (4 pts), match/switch 1 (2 pts), ternaries 1 (2 pts), error handling 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyFunctions · ×1
  • TooManyFunctions: openshell_policy::ambiguity crates/openshell-policy/src/ambiguity.rs:60 — TooManyFunctions — 33 free functions. The bar is 30 free functions; this is 3 over it, 1.10× 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.
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 pair (175 shared lines) · ×1
  • Near-duplicate member pair (175 shared lines) crates/openshell-sandbox/src/mechanistic_mapper.rs:60 — crates/openshell-sandbox/src/mechanistic_mapper.rs:60-242 | crates/openshell-supervisor/src/mechanistic_mapper.rs:60-243 — These two members are variants of one another: 175 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 (84 shared lines) · ×1
  • Near-duplicate member pair (84 shared lines) crates/openshell-server/src/grpc/sandbox.rs:3779 — crates/openshell-server/src/grpc/sandbox.rs:3779-3979 | crates/openshell-server/src/grpc/sandbox.rs:4040-4182 — These two members are variants of one another: 84 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 (62 shared lines) · ×1
  • Near-duplicate member pair (62 shared lines) crates/openshell-sandbox/src/process.rs:483 — crates/openshell-sandbox/src/process.rs:483-631 | crates/openshell-sandbox/src/process.rs:643-752 — These two members are variants of one another: 62 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 (59 shared lines) · ×1
  • Near-duplicate member pair (59 shared lines) crates/openshell-driver-vm/src/driver.rs:4298 — crates/openshell-driver-vm/src/driver.rs:4298-4412 | crates/openshell-driver-vm/src/driver.rs:4423-4557 — These two members are variants of one another: 59 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 (57 shared lines) · ×1
  • Near-duplicate member pair (57 shared lines) REDACTED:1604 — REDACTED:1604-1698 | crates/openshell-server/src/persistence/sqlite.rs:1429-1526 — These two members are variants of one another: 57 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) crates/openshell-server/src/grpc/sandbox.rs:1359 — crates/openshell-server/src/grpc/sandbox.rs:1359-1549 | crates/openshell-server/src/grpc/sandbox.rs:1554-1677 — 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 (53 shared lines) · ×1
  • Near-duplicate member pair (53 shared lines) crates/openshell-tui/src/lib.rs:948 — crates/openshell-tui/src/lib.rs:948-1069 | crates/openshell-tui/src/lib.rs:1083-1198 — These two members are variants of one another: 53 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 (52 shared lines) · ×1
  • Near-duplicate member pair (52 shared lines) crates/openshell-sandbox/src/boundary_exec.rs:208 — crates/openshell-sandbox/src/boundary_exec.rs:208-296 | crates/openshell-sandbox/src/boundary_exec.rs:298-391 — These two members are variants of one another: 52 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 (42 shared lines) · ×1
  • Near-duplicate member pair (42 shared lines) crates/openshell-cli/src/commands/provider.rs:144 — crates/openshell-cli/src/commands/provider.rs:144-217 | crates/openshell-cli/src/commands/provider.rs:227-296 — These two members are variants of one another: 42 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 (39 shared lines) · ×1
  • Near-duplicate member pair (39 shared lines) sdk/go/openshell/v1/ssh_client.go:55 — sdk/go/openshell/v1/ssh_client.go:55-140 | sdk/go/openshell/v1/tcp_client.go:30-84 — These two members are variants of one another: 39 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 (24 shared lines) · ×1
  • Near-duplicate member pair (24 shared lines) REDACTED:358 — REDACTED:358-392 | crates/openshell-server/src/persistence/sqlite.rs:328-356 — These two members are variants of one another: 24 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 (11 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (11 members, 50+ identical tokens) REDACTED:1165 — REDACTED:1165-1184 | REDACTED:1191-1209 | REDACTED:1342-1369 | REDACTED:1379-1414 | REDACTED:1422-1441 | REDACTED:1450-1476 | REDACTED:1484-1509 | crates/openshell-server/src/persistence/sqlite.rs:960-979 | crates/openshell-server/src/persistence/sqlite.rs:986-1004 | crates/openshell-server/src/persistence/sqlite.rs:1171-1198 | crates/openshell-server/src/persistence/sqlite.rs:1277-1296 — These 11 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 11 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 11 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) crates/openshell-server/src/grpc/sandbox.rs:1305 — crates/openshell-server/src/grpc/sandbox.rs:1305-1354 | crates/openshell-server/src/grpc/sandbox.rs:1554-1677 | crates/openshell-server/src/grpc/sandbox.rs:1767-1786 | crates/openshell-server/src/grpc/sandbox.rs:1808-1841 | crates/openshell-server/src/grpc/sandbox.rs:1863-1882 | crates/openshell-server/src/grpc/sandbox.rs:1904-1938 | crates/openshell-server/src/grpc/sandbox.rs:2036-2594 | crates/openshell-server/src/grpc/sandbox.rs:3305-3392 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) crates/openshell-server/src/compute/mod.rs:1534 — crates/openshell-server/src/compute/mod.rs:1534-1775 | crates/openshell-server/src/grpc/provider.rs:148-277 | crates/openshell-server/src/grpc/provider.rs:382-571 | crates/openshell-server/src/grpc/provider.rs:2962-3052 | crates/openshell-server/src/grpc/sandbox.rs:3305-3392 | crates/openshell-server/src/grpc/sandbox.rs:3397-3472 | crates/openshell-server/src/grpc/workspace.rs:484-575 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Duplicated block (93 lines × 2) · ×1
  • Duplicated block (93 lines × 2) crates/openshell-sandbox/src/mechanistic_mapper.rs:62 — crates/openshell-sandbox/src/mechanistic_mapper.rs:62-154 | crates/openshell-supervisor/src/mechanistic_mapper.rs:62-154 — before extracting anything, compare `crates/openshell-sandbox/src/mechanistic_mapper.rs` and `crates/openshell-supervisor/src/mechanistic_mapper.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (76–77 lines × 2) · ×1
  • Duplicated block (76–77 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:1454 — crates/openshell-supervisor-network/src/l7/relay.rs:1454-1529 | crates/openshell-supervisor-network/src/l7/relay.rs:2197-2273 — both copies are in the same file, so extract the 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 (67–68 lines × 2) · ×1
  • Duplicated block (67–68 lines × 2) crates/openshell-cli/src/run.rs:5805 — crates/openshell-cli/src/run.rs:5805-5872 | crates/openshell-cli/src/run.rs:5977-6043 — both copies are in the same file, so extract the 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 (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) crates/openshell-sandbox/src/mechanistic_mapper.rs:158 — crates/openshell-sandbox/src/mechanistic_mapper.rs:158-222 | crates/openshell-supervisor/src/mechanistic_mapper.rs:159-223 — before extracting anything, compare `crates/openshell-sandbox/src/mechanistic_mapper.rs` and `crates/openshell-supervisor/src/mechanistic_mapper.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) crates/openshell-sandbox/src/activity_aggregator.rs:56 — crates/openshell-sandbox/src/activity_aggregator.rs:56-104 | crates/openshell-supervisor/src/activity_aggregator.rs:56-104 — before extracting anything, compare `crates/openshell-sandbox/src/activity_aggregator.rs` and `crates/openshell-supervisor/src/activity_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (47–48 lines × 2) · ×1
  • Duplicated block (47–48 lines × 2) crates/openshell-tui/src/ui/providers.rs:61 — crates/openshell-tui/src/ui/providers.rs:61-107 | crates/openshell-tui/src/ui/providers.rs:166-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (44–45 lines × 2) · ×1
  • Duplicated block (44–45 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:1531 — crates/openshell-supervisor-network/src/l7/relay.rs:1531-1574 | crates/openshell-supervisor-network/src/l7/relay.rs:2274-2318 — both copies are in the same file, so extract the 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 (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) crates/openshell-sandbox/src/mechanistic_mapper.rs:286 — crates/openshell-sandbox/src/mechanistic_mapper.rs:286-328 | crates/openshell-supervisor/src/mechanistic_mapper.rs:287-329 — before extracting anything, compare `crates/openshell-sandbox/src/mechanistic_mapper.rs` and `crates/openshell-supervisor/src/mechanistic_mapper.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:3784 — crates/openshell-server/src/grpc/sandbox.rs:3784-3822 | crates/openshell-server/src/grpc/sandbox.rs:4044-4082 — both copies are in the same file, so extract the 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 (33–35 lines × 2) · ×1
  • Duplicated block (33–35 lines × 2) crates/openshell-server/src/compute/mod.rs:2043 — crates/openshell-server/src/compute/mod.rs:2043-2077 | crates/openshell-server/src/compute/mod.rs:2410-2442 — both copies are in the same file, so extract the 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–35 lines × 2) · ×1
  • Duplicated block (34–35 lines × 2) crates/openshell-tui/src/app.rs:2644 — crates/openshell-tui/src/app.rs:2644-2677 | crates/openshell-tui/src/app.rs:2704-2738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) crates/openshell-sandbox/src/boundary_exec.rs:226 — crates/openshell-sandbox/src/boundary_exec.rs:226-259 | crates/openshell-sandbox/src/boundary_exec.rs:336-369 — both copies are in the same file, so extract the 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 (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) crates/openshell-sandbox/src/mechanistic_mapper.rs:339 — crates/openshell-sandbox/src/mechanistic_mapper.rs:339-371 | crates/openshell-supervisor/src/mechanistic_mapper.rs:340-372 — before extracting anything, compare `crates/openshell-sandbox/src/mechanistic_mapper.rs` and `crates/openshell-supervisor/src/mechanistic_mapper.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (30–32 lines × 2) · ×1
  • Duplicated block (30–32 lines × 2) crates/openshell-sandbox/src/process.rs:505 — crates/openshell-sandbox/src/process.rs:505-536 | crates/openshell-sandbox/src/process.rs:667-696 — both copies are in the same file, so extract the 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 (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) crates/openshell-sdk/src/client.rs:669 — crates/openshell-sdk/src/client.rs:669-700 | crates/openshell-sdk/src/client.rs:1284-1315 — both copies are in the same file, so extract the 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 (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) crates/openshell-sandbox/src/denial_aggregator.rs:129 — crates/openshell-sandbox/src/denial_aggregator.rs:129-157 | crates/openshell-supervisor/src/denial_aggregator.rs:129-157 — before extracting anything, compare `crates/openshell-sandbox/src/denial_aggregator.rs` and `crates/openshell-supervisor/src/denial_aggregator.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (24–28 lines × 2) · ×1
  • Duplicated block (24–28 lines × 2) crates/openshell-driver-vm/src/runtime.rs:82 — crates/openshell-driver-vm/src/runtime.rs:82-105 | crates/openshell-driver-vm/src/runtime.rs:302-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (24–27 lines × 2) · ×1
  • Duplicated block (24–27 lines × 2) crates/openshell-server/src/grpc/sandbox.rs:2635 — crates/openshell-server/src/grpc/sandbox.rs:2635-2661 | crates/openshell-server/src/grpc/sandbox.rs:3214-3237 — both copies are in the same file, so extract the 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 lines × 2) · ×1
  • Duplicated block (27 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:2671 — crates/openshell-supervisor-network/src/proxy.rs:2671-2697 | crates/openshell-supervisor-network/src/proxy.rs:5496-5522 — both copies are in the same file, so extract the 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 (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) crates/openshell-supervisor-network/src/l7/rest/http_response.rs:422 — crates/openshell-supervisor-network/src/l7/rest/http_response.rs:422-446 | crates/openshell-supervisor-network/src/l7/rest/http_response.rs:624-648 | crates/openshell-supervisor-network/src/l7/rest/http_response.rs:682-706 — 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) crates/openshell-driver-vm/src/driver.rs:4303 — crates/openshell-driver-vm/src/driver.rs:4303-4326 | crates/openshell-driver-vm/src/driver.rs:4427-4450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) crates/openshell-tui/src/lib.rs:1015 — crates/openshell-tui/src/lib.rs:1015-1038 | crates/openshell-tui/src/lib.rs:1149-1170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:2787 — crates/openshell-supervisor-network/src/proxy.rs:2787-2809 | crates/openshell-supervisor-network/src/proxy.rs:2830-2851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) crates/openshell-tui/src/ui/create_provider.rs:58 — crates/openshell-tui/src/ui/create_provider.rs:58-77 | crates/openshell-tui/src/ui/create_provider.rs:166-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.
D4 · Code Duplication · Duplicated block (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) crates/openshell-tui/src/ui/providers.rs:59 — crates/openshell-tui/src/ui/providers.rs:59-80 | crates/openshell-tui/src/ui/providers.rs:164-189 | crates/openshell-tui/src/ui/sandboxes.rs:82-111 — before extracting anything, compare `crates/openshell-tui/src/ui/providers.rs` and `crates/openshell-tui/src/ui/sandboxes.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19–22 lines × 2) · ×1
  • Duplicated block (19–22 lines × 2) crates/openshell-cli/src/run.rs:2128 — crates/openshell-cli/src/run.rs:2128-2146 | crates/openshell-cli/src/run.rs:2811-2832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) crates/openshell-supervisor-network/src/proxy.rs:4408 — crates/openshell-supervisor-network/src/proxy.rs:4408-4429 | crates/openshell-supervisor-network/src/proxy.rs:4449-4468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) crates/openshell-tui/src/lib.rs:900 — crates/openshell-tui/src/lib.rs:900-920 | crates/openshell-tui/src/lib.rs:2905-2924 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14–20 lines × 3) · ×1
  • Duplicated block (14–20 lines × 3) crates/openshell-server/src/certgen.rs:861 — crates/openshell-server/src/certgen.rs:861-880 | crates/openshell-server/src/certgen.rs:906-922 | crates/openshell-server/src/certgen.rs:939-952 — 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 (16–20 lines × 2) · ×1
  • Duplicated block (16–20 lines × 2) crates/openshell-sdk/src/client.rs:649 — crates/openshell-sdk/src/client.rs:649-668 | crates/openshell-sdk/src/client.rs:1267-1282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:2074 — crates/openshell-supervisor-network/src/l7/relay.rs:2074-2093 | crates/openshell-supervisor-network/src/l7/relay.rs:2805-2822 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:2754 — crates/openshell-supervisor-network/src/l7/relay.rs:2754-2770 | crates/openshell-supervisor-network/src/l7/relay.rs:2787-2806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15–19 lines × 4) · ×1
  • Duplicated block (15–19 lines × 4) crates/openshell-tui/src/ui/create_provider.rs:58 — crates/openshell-tui/src/ui/create_provider.rs:58-74 | crates/openshell-tui/src/ui/create_provider.rs:166-184 | crates/openshell-tui/src/ui/create_provider.rs:555-569 | crates/openshell-tui/src/ui/create_sandbox.rs:266-280 — before extracting anything, compare `crates/openshell-tui/src/ui/create_provider.rs` and `crates/openshell-tui/src/ui/create_sandbox.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) REDACTED:642 — REDACTED:642-660 | REDACTED:714-732 | REDACTED:939-956 — 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 (14–18 lines × 5) · ×1
  • Duplicated block (14–18 lines × 5) crates/openshell-tui/src/ui/create_provider.rs:60 — crates/openshell-tui/src/ui/create_provider.rs:60-75 | crates/openshell-tui/src/ui/create_provider.rs:168-185 | crates/openshell-tui/src/ui/create_provider.rs:557-570 | crates/openshell-tui/src/ui/create_sandbox.rs:268-281 | crates/openshell-tui/src/ui/splash.rs:73-86 — before extracting anything, compare `crates/openshell-tui/src/ui/create_provider.rs` and `crates/openshell-tui/src/ui/create_sandbox.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) crates/openshell-supervisor-network/src/l7/relay.rs:1457 — crates/openshell-supervisor-network/src/l7/relay.rs:1457-1473 | crates/openshell-supervisor-network/src/l7/relay.rs:2201-2217 | crates/openshell-supervisor-network/src/l7/relay.rs:2912-2928 — 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 (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) crates/openshell-supervisor-network/src/l7/relay.rs:1285 — crates/openshell-supervisor-network/src/l7/relay.rs:1285-1300 | crates/openshell-supervisor-network/src/l7/relay.rs:2750-2764 | crates/openshell-supervisor-network/src/l7/relay.rs:2783-2797 — 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 (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) crates/openshell-sandbox/src/main.rs:916 — crates/openshell-sandbox/src/main.rs:916-931 | crates/openshell-sandbox/src/main.rs:1152-1165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) crates/openshell-supervisor-network/src/l7/rest.rs:1135 — crates/openshell-supervisor-network/src/l7/rest.rs:1135-1150 | crates/openshell-supervisor-network/src/l7/rest.rs:1236-1247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) crates/openshell-supervisor-network/src/l7/relay.rs:1457 — crates/openshell-supervisor-network/src/l7/relay.rs:1457-1471 | crates/openshell-supervisor-network/src/l7/relay.rs:2201-2215 | crates/openshell-supervisor-network/src/l7/relay.rs:2912-2926 | crates/openshell-supervisor-network/src/l7/relay.rs:3622-3636 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (13–15 lines × 3) · ×1
  • Duplicated block (13–15 lines × 3) crates/openshell-supervisor-network/src/l7/relay.rs:2138 — crates/openshell-supervisor-network/src/l7/relay.rs:2138-2152 | crates/openshell-supervisor-network/src/l7/relay.rs:2849-2861 | crates/openshell-supervisor-network/src/proxy.rs:6051-6063 — before extracting anything, compare `crates/openshell-supervisor-network/src/l7/relay.rs` and `crates/openshell-supervisor-network/src/proxy.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×1
  • Duplicated block (14–15 lines × 3) crates/openshell-supervisor/src/endpoint_status.rs:114 — crates/openshell-supervisor/src/endpoint_status.rs:114-128 | crates/openshell-supervisor/src/endpoint_status.rs:195-208 | crates/openshell-supervisor/src/endpoint_status.rs:261-275 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) crates/openshell-tui/src/app.rs:2884 — crates/openshell-tui/src/app.rs:2884-2898 | crates/openshell-tui/src/app.rs:3191-3203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–14 lines × 5) · ×1
  • Duplicated block (13–14 lines × 5) crates/openshell-supervisor-network/src/l7/relay.rs:1680 — crates/openshell-supervisor-network/src/l7/relay.rs:1680-1693 | crates/openshell-supervisor-network/src/l7/relay.rs:2143-2155 | crates/openshell-supervisor-network/src/l7/relay.rs:2852-2864 | crates/openshell-supervisor-network/src/l7/websocket.rs:2087-2099 | crates/openshell-supervisor-network/src/proxy.rs:6054-6066 — before extracting anything, compare `crates/openshell-supervisor-network/src/l7/relay.rs` and `crates/openshell-supervisor-network/src/proxy.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) crates/openshell-server/src/grpc/provider.rs:2824 — crates/openshell-server/src/grpc/provider.rs:2824-2837 | crates/openshell-server/src/grpc/sandbox.rs:989-1002 | crates/openshell-server/src/grpc/sandbox.rs:1172-1185 | crates/openshell-server/src/grpc/service.rs:246-259 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/sandbox.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) crates/openshell-supervisor-middleware/src/lib.rs:1094 — crates/openshell-supervisor-middleware/src/lib.rs:1094-1104 | crates/openshell-supervisor-middleware/src/websocket.rs:1152-1165 | crates/openshell-supervisor-middleware/src/websocket.rs:1220-1230 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) crates/openshell-supervisor-network/src/l7/relay.rs:1624 — crates/openshell-supervisor-network/src/l7/relay.rs:1624-1637 | crates/openshell-supervisor-network/src/l7/relay.rs:2702-2715 | crates/openshell-supervisor-network/src/l7/relay.rs:2990-3003 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–14 lines × 2) · ×1
  • Duplicated block (8–14 lines × 2) crates/openshell-ocsf/src/format/shorthand.rs:279 — crates/openshell-ocsf/src/format/shorthand.rs:279-292 | crates/openshell-ocsf/src/format/shorthand.rs:332-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8–13 lines × 5) · ×1
  • Duplicated block (8–13 lines × 5) crates/openshell-server/src/grpc/provider.rs:4057 — crates/openshell-server/src/grpc/provider.rs:4057-4069 | crates/openshell-server/src/grpc/provider.rs:4824-4831 | crates/openshell-server/src/grpc/provider.rs:5251-5258 | crates/openshell-server/src/grpc/provider.rs:5321-5328 | crates/openshell-server/src/grpc/sandbox.rs:1223-1231 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/sandbox.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) crates/openshell-supervisor/src/endpoint_status.rs:80 — crates/openshell-supervisor/src/endpoint_status.rs:80-92 | crates/openshell-supervisor/src/endpoint_status.rs:111-123 | crates/openshell-supervisor/src/endpoint_status.rs:192-204 | crates/openshell-supervisor/src/endpoint_status.rs:258-270 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:199 — crates/openshell-supervisor-network/src/l7/relay.rs:199-207 | crates/openshell-supervisor-network/src/l7/relay.rs:3251-3263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) crates/openshell-tui/src/lib.rs:627 — crates/openshell-tui/src/lib.rs:627-639 | crates/openshell-tui/src/lib.rs:660-670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) crates/openshell-cli/src/run.rs:5454 — crates/openshell-cli/src/run.rs:5454-5464 | crates/openshell-cli/src/run.rs:5910-5920 | crates/openshell-cli/src/run.rs:6200-6211 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) crates/openshell-supervisor-network/src/l7/relay.rs:1209 — crates/openshell-supervisor-network/src/l7/relay.rs:1209-1218 | crates/openshell-supervisor-network/src/l7/relay.rs:2078-2089 | crates/openshell-supervisor-network/src/l7/relay.rs:2809-2818 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) crates/openshell-supervisor-network/src/l7/relay.rs:1401 — crates/openshell-supervisor-network/src/l7/relay.rs:1401-1412 | crates/openshell-supervisor-network/src/l7/relay.rs:2556-2567 | crates/openshell-supervisor-network/src/l7/relay.rs:2838-2849 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) crates/openshell-cli/src/commands/provider.rs:1418 — crates/openshell-cli/src/commands/provider.rs:1418-1429 | crates/openshell-cli/src/run.rs:3633-3642 — before extracting anything, compare `crates/openshell-cli/src/commands/provider.rs` and `crates/openshell-cli/src/run.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 6) · ×1
  • Duplicated block (10–11 lines × 6) crates/openshell-server/src/grpc/provider.rs:2705 — crates/openshell-server/src/grpc/provider.rs:2705-2714 | crates/openshell-server/src/grpc/provider.rs:4052-4061 | crates/openshell-server/src/grpc/provider.rs:5316-5325 | crates/openshell-server/src/grpc/provider.rs:5400-5409 | crates/openshell-server/src/grpc/workspace.rs:485-495 | crates/openshell-server/src/grpc/workspace.rs:581-591 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/workspace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 4) · ×1
  • Duplicated block (10–11 lines × 4) crates/openshell-server/src/grpc/provider.rs:2787 — crates/openshell-server/src/grpc/provider.rs:2787-2796 | crates/openshell-server/src/grpc/provider.rs:4765-4774 | crates/openshell-server/src/grpc/sandbox.rs:326-336 | crates/openshell-server/src/grpc/workspace.rs:619-629 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/sandbox.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–11 lines × 2) · ×1
  • Duplicated block (7–11 lines × 2) crates/openshell-driver-docker/src/lib.rs:6085 — crates/openshell-driver-docker/src/lib.rs:6085-6095 | crates/openshell-driver-kubernetes/src/driver.rs:5895-5901 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) crates/openshell-sandbox-backend/src/runtime.rs:2034 — crates/openshell-sandbox-backend/src/runtime.rs:2034-2044 | crates/openshell-sandbox-backend/src/runtime.rs:2327-2335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) crates/openshell-supervisor-network/src/l7/relay.rs:1187 — crates/openshell-supervisor-network/src/l7/relay.rs:1187-1194 | crates/openshell-supervisor-network/src/l7/relay.rs:2743-2753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 8) · ×1
  • Duplicated block (10 lines × 8) crates/openshell-server/src/grpc/sandbox.rs:1306 — crates/openshell-server/src/grpc/sandbox.rs:1306-1315 | crates/openshell-server/src/grpc/sandbox.rs:1555-1564 | crates/openshell-server/src/grpc/sandbox.rs:1768-1777 | crates/openshell-server/src/grpc/sandbox.rs:1809-1818 | crates/openshell-server/src/grpc/sandbox.rs:1864-1873 | crates/openshell-server/src/grpc/sandbox.rs:1905-1914 | crates/openshell-server/src/grpc/sandbox.rs:2037-2046 | crates/openshell-server/src/grpc/sandbox.rs:3306-3315 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) crates/openshell-server/src/grpc/provider.rs:2707 — crates/openshell-server/src/grpc/provider.rs:2707-2716 | crates/openshell-server/src/grpc/provider.rs:4054-4063 | crates/openshell-server/src/grpc/provider.rs:4821-4830 | crates/openshell-server/src/grpc/provider.rs:5248-5257 | crates/openshell-server/src/grpc/provider.rs:5318-5327 | crates/openshell-server/src/grpc/sandbox.rs:1038-1047 | crates/openshell-server/src/grpc/sandbox.rs:1220-1229 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/sandbox.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) crates/openshell-server/src/grpc/provider.rs:2789 — crates/openshell-server/src/grpc/provider.rs:2789-2798 | crates/openshell-server/src/grpc/provider.rs:4767-4776 | crates/openshell-server/src/grpc/sandbox.rs:329-338 | crates/openshell-server/src/grpc/sandbox.rs:471-480 | crates/openshell-server/src/grpc/sandbox.rs:1132-1141 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/sandbox.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) crates/openshell-server/src/grpc/policy.rs:6041 — crates/openshell-server/src/grpc/policy.rs:6041-6050 | crates/openshell-server/src/grpc/policy.rs:6187-6196 | crates/openshell-server/src/grpc/policy.rs:6600-6609 | crates/openshell-server/src/grpc/policy.rs:6673-6682 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–10 lines × 4) · ×1
  • Duplicated block (8–10 lines × 4) REDACTED:1324 — REDACTED:1324-1333 | crates/openshell-server/src/persistence/sqlite.rs:1153-1162 | crates/openshell-server/src/persistence/sqlite.rs:1316-1323 | crates/openshell-server/src/persistence/sqlite.rs:1342-1349 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) crates/openshell-server/src/grpc/policy.rs:7643 — crates/openshell-server/src/grpc/policy.rs:7643-7652 | crates/openshell-server/src/grpc/policy.rs:7673-7679 — both copies are in the same file, so extract the 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 × 6) · ×1
  • Duplicated block (9 lines × 6) crates/openshell-server/src/compute/mod.rs:1581 — crates/openshell-server/src/compute/mod.rs:1581-1589 | crates/openshell-server/src/grpc/provider.rs:226-234 | crates/openshell-server/src/grpc/provider.rs:3013-3021 | crates/openshell-server/src/grpc/sandbox.rs:3353-3361 | crates/openshell-server/src/grpc/sandbox.rs:3446-3454 | crates/openshell-server/src/grpc/workspace.rs:535-543 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/sandbox.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) crates/openshell-sdk/src/client.rs:202 — crates/openshell-sdk/src/client.rs:202-210 | crates/openshell-sdk/src/client.rs:241-249 | crates/openshell-sdk/src/client.rs:316-324 | crates/openshell-sdk/src/client.rs:506-514 | crates/openshell-sdk/src/client.rs:584-592 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) crates/openshell-driver-kubernetes/src/driver.rs:4939 — crates/openshell-driver-kubernetes/src/driver.rs:4939-4947 | crates/openshell-driver-kubernetes/src/driver.rs:4982-4990 | crates/openshell-driver-kubernetes/src/driver.rs:5034-5042 | crates/openshell-driver-kubernetes/src/driver.rs:5173-5181 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×1
  • Duplicated block (8–9 lines × 4) crates/openshell-tui/src/ui/global_settings.rs:67 — crates/openshell-tui/src/ui/global_settings.rs:67-74 | crates/openshell-tui/src/ui/providers.rs:97-105 | crates/openshell-tui/src/ui/providers.rs:204-211 | crates/openshell-tui/src/ui/sandboxes.rs:120-128 — before extracting anything, compare `crates/openshell-tui/src/ui/providers.rs` and `crates/openshell-tui/src/ui/sandboxes.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 11) · ×1
  • Duplicated block (8 lines × 11) REDACTED:1177 — REDACTED:1177-1184 | REDACTED:1202-1209 | REDACTED:1362-1369 | REDACTED:1407-1414 | REDACTED:1434-1441 | REDACTED:1469-1476 | REDACTED:1502-1509 | crates/openshell-server/src/persistence/sqlite.rs:972-979 | crates/openshell-server/src/persistence/sqlite.rs:997-1004 | crates/openshell-server/src/persistence/sqlite.rs:1191-1198 | crates/openshell-server/src/persistence/sqlite.rs:1289-1296 — before extracting anything, compare `REDACTED` and `crates/openshell-server/src/persistence/sqlite.rs` as WHOLE FILES: this scan already matched 46 separate duplicated blocks between them, totalling at least 606 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) crates/openshell-supervisor-network/src/proxy.rs:5637 — crates/openshell-supervisor-network/src/proxy.rs:5637-5644 | crates/openshell-supervisor-network/src/proxy.rs:5914-5920 | crates/openshell-supervisor-network/src/proxy.rs:5968-5974 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 10) · ×1
  • Duplicated block (7 lines × 10) crates/openshell-server/src/grpc/provider.rs:2705 — crates/openshell-server/src/grpc/provider.rs:2705-2711 | crates/openshell-server/src/grpc/provider.rs:2787-2793 | crates/openshell-server/src/grpc/provider.rs:4052-4058 | crates/openshell-server/src/grpc/provider.rs:4765-4771 | crates/openshell-server/src/grpc/provider.rs:5316-5322 | crates/openshell-server/src/grpc/provider.rs:5400-5406 | crates/openshell-server/src/grpc/sandbox.rs:326-333 | crates/openshell-server/src/grpc/workspace.rs:485-492 | crates/openshell-server/src/grpc/workspace.rs:581-588 | crates/openshell-server/src/grpc/workspace.rs:619-626 — before extracting anything, compare `crates/openshell-server/src/grpc/provider.rs` and `crates/openshell-server/src/grpc/sandbox.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6–7 lines × 3) · ×1
  • Duplicated block (6–7 lines × 3) crates/openshell-driver-docker/src/lib.rs:6084 — crates/openshell-driver-docker/src/lib.rs:6084-6090 | crates/openshell-driver-kubernetes/src/driver.rs:5895-5900 | crates/openshell-driver-kubernetes/src/driver.rs:6005-6011 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) crates/openshell-tui/src/ui/create_provider.rs:51 — crates/openshell-tui/src/ui/create_provider.rs:51-56 | crates/openshell-tui/src/ui/create_provider.rs:159-164 | crates/openshell-tui/src/ui/create_provider.rs:548-553 | crates/openshell-tui/src/ui/create_provider.rs:799-804 | crates/openshell-tui/src/ui/create_sandbox.rs:41-46 — before extracting anything, compare `crates/openshell-tui/src/ui/create_provider.rs` and `crates/openshell-tui/src/ui/create_sandbox.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) crates/openshell-sandbox/src/process.rs:499 — crates/openshell-sandbox/src/process.rs:499-503 | crates/openshell-sandbox/src/process.rs:660-665 — both copies are in the same file, so extract the 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 × 5) · ×1
  • Duplicated block (5 lines × 5) crates/openshell-tui/src/ui/mod.rs:201 — crates/openshell-tui/src/ui/mod.rs:201-205 | crates/openshell-tui/src/ui/mod.rs:223-227 | crates/openshell-tui/src/ui/mod.rs:245-249 | crates/openshell-tui/src/ui/mod.rs:267-271 | crates/openshell-tui/src/ui/mod.rs:415-419 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) crates/openshell-supervisor-middleware/src/headers.rs:258 — crates/openshell-supervisor-middleware/src/headers.rs:258-277 | crates/openshell-supervisor-network/src/l7/http.rs:69-88 | crates/openshell-supervisor-network/src/l7/rest.rs:575-594 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) crates/openshell-cli/src/commands/gateway.rs:969 — crates/openshell-cli/src/commands/gateway.rs:969-982 | crates/openshell-cli/src/commands/gateway.rs:992-1002 | crates/openshell-cli/src/commands/gateway.rs:1013-1023 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 8) · ×1
  • Duplicated block (8 lines × 8) crates/openshell-tui/src/ui/create_provider.rs:52 — crates/openshell-tui/src/ui/create_provider.rs:52-59 | crates/openshell-tui/src/ui/create_provider.rs:160-167 | crates/openshell-tui/src/ui/create_provider.rs:261-268 | crates/openshell-tui/src/ui/create_provider.rs:549-556 | crates/openshell-tui/src/ui/create_provider.rs:800-807 | crates/openshell-tui/src/ui/create_sandbox.rs:42-49 | crates/openshell-tui/src/ui/create_sandbox.rs:260-267 | crates/openshell-tui/src/ui/sandbox_logs.rs:137-144 — before extracting anything, compare `crates/openshell-tui/src/ui/create_provider.rs` and `crates/openshell-tui/src/ui/create_sandbox.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) sdk/go/openshell/v1/oidc/device.go:49 — sdk/go/openshell/v1/oidc/device.go:49-56 | sdk/go/openshell/v1/oidc/oidc.go:36-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) sdk/go/openshell/v1/fake/provider.go:130 — sdk/go/openshell/v1/fake/provider.go:130-136 | sdk/go/openshell/v1/fake/sandbox.go:481-487 | sdk/go/openshell/v1/fake/sandbox_template.go:133-139 | sdk/go/openshell/v1/profile_client.go:46-52 | sdk/go/openshell/v1/provider_client.go:88-94 | sdk/go/openshell/v1/sandbox_client.go:164-170 | sdk/go/openshell/v1/sandbox_template_client.go:86-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.95 rust-toolchain.toml:1 — rust-toolchain.toml declares Rust 1.95 as this project's toolchain file, and Rust 1.95, superseded by 1.96 on 2026-05-28 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-05-28 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
D5 · Coupling · Unstable project openshell-driver-kubernetes · ×1
  • Unstable project openshell-driver-kubernetes — openshell-driver-kubernetes has instability 0.88 with 1 dependents.
D5 · Coupling · Unstable project openshell-server · ×1
  • Unstable project openshell-server — openshell-server has instability 0.94 with 1 dependents.
D5 · Coupling · Unstable project openshell-supervisor-network · ×1
  • Unstable project openshell-supervisor-network — openshell-supervisor-network has instability 0.82 with 2 dependents.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the vitest suite in sdk/typescript/ ran and not one test passed (FAIL src/client.test.ts [ src/client.test.ts ]), so the coverage report describes the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking tasks/scripts/codex_compatibility.py:69 — `invoke_codex` is async and calls subprocess.run — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) sdk/typescript/src/client.ts:1089 — sdk/typescript/src/client.ts:1089 · sdk/typescript/src/client.ts:1174 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×1
  • Duplicated block (16 lines × 2 locations) sdk/typescript/src/client.ts:1937 — sdk/typescript/src/client.ts:1937 · sdk/typescript/src/client.ts:1954 — both copies are in the same file, so extract the 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 (14 lines × 2 locations) · ×1
  • Duplicated block (14 lines × 2 locations) sdk/typescript/src/client.ts:1235 — sdk/typescript/src/client.ts:1235 · sdk/typescript/src/client.ts:1262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) sdk/typescript/src/client.ts:1139 — sdk/typescript/src/client.ts:1139 · sdk/typescript/src/client.ts:1281 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (10 matched lines × 2 locations) sdk/typescript/src/client.ts:2098 — sdk/typescript/src/client.ts:2098 · sdk/typescript/src/providers.ts:29 — the two spans are one implementation copied and then locally edited — 58 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 (8 lines × 2 locations) · ×1
  • Duplicated block (8 lines × 2 locations) sdk/typescript/src/client.ts:1345 — sdk/typescript/src/client.ts:1345 · sdk/typescript/src/client.ts:1368 — 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 (7 lines × 2 locations) · ×1
  • Duplicated block (7 lines × 2 locations) sdk/typescript/src/client.ts:1324 — sdk/typescript/src/client.ts:1324 · sdk/typescript/src/client.ts:1355 — 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 (6 lines × 2 locations) · ×1
  • Duplicated block (6 lines × 2 locations) fern/components/CustomFooter.tsx:70 — fern/components/CustomFooter.tsx:70 · fern/components/CustomFooter.tsx:76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R2 · Cyclomatic Complexity · Complex function getCredentials (cyclomatic 24, cognitive 17) · ×1
  • Complex function getCredentials (cyclomatic 24, cognitive 17) sdk/typescript/src/providers.ts:51 — getCredentials has cyclomatic complexity 24 and cognitive complexity 17; 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 watchLogs (cyclomatic 21, cognitive 31) · ×1
  • Complex function watchLogs (cyclomatic 21, cognitive 31) sdk/typescript/src/client.ts:1469 — watchLogs has cyclomatic complexity 21 and cognitive complexity 31; 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 validateSshResponse (cyclomatic 18, cognitive 14) · ×1
  • Complex function validateSshResponse (cyclomatic 18, cognitive 14) sdk/typescript/src/ssh-validate.ts:47 — validateSshResponse has cyclomatic complexity 18 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 receive (cyclomatic 15, cognitive 16) · ×1
  • Complex function receive (cyclomatic 15, cognitive 16) sdk/typescript/src/client.ts:1616 — receive has cyclomatic complexity 15 and cognitive complexity 16; 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 execInteractive (cyclomatic 15, cognitive 14) · ×1
  • Complex function execInteractive (cyclomatic 15, cognitive 14) sdk/typescript/src/client.ts:1539 — execInteractive has cyclomatic complexity 15 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 execStream (cyclomatic 15, cognitive 13) · ×1
  • Complex function execStream (cyclomatic 15, cognitive 13) sdk/typescript/src/client.ts:1381 — execStream has cyclomatic complexity 15 and cognitive complexity 13; 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 (anonymous) (cyclomatic 13, cognitive 11) · ×1
  • Complex function (anonymous) (cyclomatic 13, cognitive 11) sdk/typescript/src/client.test.ts:866 — (anonymous) has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function waitReady (cyclomatic 12, cognitive 19) · ×1
  • Complex function waitReady (cyclomatic 12, cognitive 19) sdk/typescript/src/client.ts:1324 — waitReady has cyclomatic complexity 12 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 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 evaluate (cyclomatic 12, cognitive 15) · ×1
  • Complex function evaluate (cyclomatic 12, cognitive 15) tasks/scripts/check_issue_acceptance.cjs:16 — evaluate has cyclomatic complexity 12 and cognitive complexity 15; 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 forwardConnection (cyclomatic 12, cognitive 13) · ×1
  • Complex function forwardConnection (cyclomatic 12, cognitive 13) sdk/typescript/src/client.ts:1824 — forwardConnection has cyclomatic complexity 12 and cognitive complexity 13; 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 #exchange (cyclomatic 12, cognitive 12) · ×1
  • Complex function #exchange (cyclomatic 12, cognitive 12) sdk/typescript/src/oidc.ts:161 — #exchange has cyclomatic complexity 12 and cognitive complexity 12; 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 create (cyclomatic 12, cognitive 11) · ×1
  • Complex function create (cyclomatic 12, cognitive 11) sdk/typescript/src/client.ts:1213 — create 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 forward (cyclomatic 11, cognitive 13) · ×1
  • Complex function forward (cyclomatic 11, cognitive 13) sdk/typescript/src/client.ts:1709 — forward has cyclomatic complexity 11 and cognitive complexity 13; 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 sandboxRef (cyclomatic 11, cognitive 10) · ×1
  • Complex function sandboxRef (cyclomatic 11, cognitive 10) sdk/typescript/src/client.ts:626 — sandboxRef has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · sdk/typescript/src/client.ts · ×1
  • sdk/typescript/src/client.ts: 1954 lines of code sdk/typescript/src/client.ts:1 — sdk/typescript/src/client.ts has 1954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R8 · Dependency Hygiene · Unused dependency '@bufbuild/protoc-gen-es' · ×1
  • Unused dependency '@bufbuild/protoc-gen-es' — Declared in sdk/typescript/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.
S1 · Web-Security Posture · Weak hash algorithm · ×1
  • Weak hash algorithm crates/openshell-supervisor-network/src/l7/rest.rs:2735 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap tasks/scripts/sync_docs_website.py:284 — `prefix_navigation_paths` is public and takes `value: object` from its caller, and it calls itself at line 284 (`prefix_navigation_paths`) with a piece of `value` (and at line 287) — and nowhere in `prefix_navigation_paths` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `prefix_navigation_paths` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Minor — 108 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging crates/openshell-supervisor-process/src/ssh.rs:644 — `warn!` at line 644 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 crates/openshell-supervisor-process/src/ssh.rs:658 — `warn!` at line 658 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 crates/openshell-supervisor-process/src/ssh.rs:939 — `warn!` at line 939 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 crates/openshell-supervisor-process/src/ssh.rs:1029 — `warn!` at line 1029 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 crates/openshell-supervisor-process/src/ssh.rs:1210 — `warn!` at line 1210 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 crates/openshell-supervisor-network/src/identity.rs:228 — `debug!` at line 228 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 crates/openshell-supervisor-network/src/identity.rs:236 — `debug!` at line 236 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 crates/openshell-supervisor-network/src/identity.rs:272 — `debug!` at line 272 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 crates/openshell-supervisor-network/src/opa.rs:2126 — `debug!` at line 2126 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 crates/openshell-supervisor-network/src/opa.rs:2529 — `info!` at line 2529 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 crates/openshell-supervisor-network/src/opa.rs:2536 — `debug!` at line 2536 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 crates/openshell-supervisor-network/src/opa.rs:2542 — `warn!` at line 2542 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 crates/openshell-supervisor-network/src/opa.rs:2551 — `warn!` at line 2551 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 crates/openshell-supervisor-network/src/opa.rs:2560 — `warn!` at line 2560 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 crates/openshell-supervisor-network/src/procfs.rs:593 — `debug!` at line 593 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 crates/openshell-supervisor-network/src/proxy.rs:4130 — `warn!` at line 4130 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 crates/openshell-supervisor-network/src/proxy.rs:4288 — `debug!` at line 4288 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 crates/openshell-supervisor-network/src/run.rs:393 — `warn!` at line 393 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 crates/openshell-supervisor-network/src/run.rs:409 — `warn!` at line 409 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 crates/openshell-supervisor-middleware/src/binding_policy.rs:60 — `warn!` at line 60 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 crates/openshell-supervisor-middleware/src/binding_policy.rs:84 — `info!` at line 84 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 crates/openshell-supervisor/src/lib.rs:2511 — `warn!` at line 2511 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 crates/openshell-supervisor/src/lib.rs:4044 — `warn!` at line 4044 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 crates/openshell-supervisor/src/sandbox_instance_host.rs:947 — `info!` at line 947 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 crates/openshell-server/src/certgen.rs:386 — `warn!` at line 386 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`.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate sdk/go/openshell/v1/oidc/device.go:68 — `gwCfg.OIDCIssuer == "" || gwCfg.OIDCClientID == ""` appears character-identically in 2 files — sdk/go/openshell/v1/oidc/device.go, sdk/go/openshell/v1/oidc/oidc.go. 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 sdk/go/openshell/v1/oidc/authcode.go:215 — `resp.StatusCode != http.StatusOK || tokResp.Error != ""` appears character-identically in 2 files — sdk/go/openshell/v1/oidc/authcode.go, sdk/go/openshell/v1/oidc/credentials.go. 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 sdk/go/openshell/v1/fake/sandbox.go:411 — `spec.LogLevel != "" || len(spec.Environment) > 0 || spec.Template != nil || spec.GPU || spec.GPUCount != nil` appears character-identically in 2 files — sdk/go/openshell/v1/fake/sandbox.go, sdk/go/openshell/v1/sandbox_client.go. 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 sdk/typescript/src/ssh-validate.ts:35 — `host.startsWith('[') && host.endsWith(']')` appears character-identically in 2 files — sdk/typescript/src/ssh-validate.ts, sdk/typescript/src/transport.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/openshell-supervisor-middleware/src/headers.rs:180 — `!exists || action == ExistingHeaderAction::Append` appears character-identically in 2 files — crates/openshell-supervisor-middleware/src/headers.rs, crates/openshell-supervisor-network/src/l7/rest.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 crates/openshell-cli/src/commands/provider.rs:2239 — `!parsed.username().is_empty() || parsed.password().is_some()` appears character-identically in 2 files — crates/openshell-cli/src/commands/provider.rs, crates/openshell-core/src/driver_utils.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 crates/openshell-core/src/config.rs:852 — `!proxy_secure && self.proxy_auth_allow_insecure != Some(true)` appears character-identically in 2 files — crates/openshell-core/src/config.rs, crates/openshell-driver-kubernetes/src/config.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 crates/openshell-driver-docker/src/lib.rs:3342 — `!request.sandbox_id.is_empty() && request.sandbox_id != sandbox.id` appears character-identically in 3 files — crates/openshell-driver-docker/src/lib.rs, crates/openshell-driver-vm/src/driver.rs, crates/openshell-server/src/compute/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/openshell-core/src/jwt.rs:1239 — `!value.is_empty() && value.len() <= 253 && !value.chars().any(char::is_whitespace)` appears character-identically in 2 files — crates/openshell-core/src/jwt.rs, crates/openshell-supervisor-control/src/controller.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 crates/openshell-driver-docker/src/lib.rs:4047 — `!value.is_finite() || value.fract() != 0.0` appears character-identically in 2 files — crates/openshell-driver-docker/src/lib.rs, crates/openshell-driver-podman/src/container.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 crates/openshell-providers/src/profiles.rs:3602 — `(*first_label == "*" || *second_label == "*" || first_label == second_label) && host_pattern_labels_can_overlap(first_rest, second_rest)` appears character-identically in 2 files — crates/openshell-providers/src/profiles.rs, crates/openshell-server/src/grpc/provider.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 crates/openshell-sandbox/src/main_session.rs:821 — `attachment_expected || state.active != 0` appears character-identically in 2 files — crates/openshell-sandbox/src/main_session.rs, crates/openshell-supervisor-process/src/main_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.
  • Duplicated predicate crates/openshell-driver-docker/src/tests.rs:771 — `attribute.key.as_str() == "rpc.method" && attribute.value.to_string() == "openshell.compute.v1.ComputeDriver/GetCapabilities"` appears character-identically in 3 files — crates/openshell-driver-docker/src/tests.rs, crates/openshell-driver-kubernetes/src/grpc.rs, crates/openshell-driver-podman/src/grpc.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 crates/openshell-driver-docker/src/tests.rs:1014 — `attribute.key.as_str() == "rpc.response.status_code" && attribute.value.to_string() == "INVALID_ARGUMENT"` appears character-identically in 2 files — crates/openshell-driver-docker/src/tests.rs, crates/openshell-driver-podman/src/grpc.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 crates/openshell-driver-docker/src/tests.rs:979 — `attribute.key.as_str() == "rpc.response.status_code" && attribute.value.to_string() == "OK"` appears character-identically in 4 files — crates/openshell-driver-docker/src/tests.rs, crates/openshell-driver-kubernetes/src/grpc.rs, crates/openshell-driver-podman/src/grpc.rs, crates/openshell-otel/src/grpc.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 crates/openshell-cli/src/commands/common.rs:580 — `condition.r#type == "Ready" && condition.status.eq_ignore_ascii_case("false")` appears character-identically in 2 files — crates/openshell-cli/src/commands/common.rs, crates/openshell-cli/src/run.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 crates/openshell-cli/src/run.rs:284 — `condition.r#type == "Ready" && condition.status.eq_ignore_ascii_case("false") && condition.reason == "ContainerExited"` appears character-identically in 2 files — crates/openshell-cli/src/run.rs, crates/openshell-driver-docker/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 crates/openshell-cli/src/run.rs:272 — `condition.r#type == "Ready" && condition.status.eq_ignore_ascii_case("false") && condition.reason == "MainProcessFailed"` appears character-identically in 2 files — crates/openshell-cli/src/run.rs, crates/openshell-server/src/compute/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/openshell-sandbox/src/mechanistic_mapper.rs:105 — `denial.l7_inspection_active || !denial.l7_request_samples.is_empty()` appears character-identically in 2 files — crates/openshell-sandbox/src/mechanistic_mapper.rs, crates/openshell-supervisor/src/mechanistic_mapper.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 crates/openshell-providers/src/profiles.rs:4047 — `endpoint.host == "api.github.com" && endpoint.protocol == "graphql" && endpoint.path == "/graphql" && endpoint.access == openshell_core::pro…` appears character-identically in 2 files — crates/openshell-providers/src/profiles.rs, crates/openshell-server/src/grpc/policy.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 crates/openshell-server/src/grpc/policy.rs:25076 — `err.message().contains("modified concurrently") || err.message().contains("resource_version")` appears character-identically in 3 files — crates/openshell-server/src/grpc/policy.rs, crates/openshell-server/src/grpc/provider.rs, crates/openshell-server/src/grpc/sandbox.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 crates/openshell-cli/src/commands/common.rs:983 — `first == b'_' || first.is_ascii_alphabetic()` appears character-identically in 2 files — crates/openshell-cli/src/commands/common.rs, crates/openshell-server/src/grpc/provider.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 crates/openshell-policy/src/lib.rs:1696 — `first_label.contains("**") && first_label != "**"` appears character-identically in 2 files — crates/openshell-policy/src/lib.rs, crates/openshell-supervisor-network/src/l7/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/openshell-sandbox/src/mechanistic_mapper.rs:416 — `hex_only.len() >= 16 && segment.len() == hex_only.len()` appears character-identically in 2 files — crates/openshell-sandbox/src/mechanistic_mapper.rs, crates/openshell-supervisor/src/mechanistic_mapper.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 crates/openshell-sandbox/src/mechanistic_mapper.rs:412 — `hex_only.len() >= 24 && segment.contains('-')` appears character-identically in 2 files — crates/openshell-sandbox/src/mechanistic_mapper.rs, crates/openshell-supervisor/src/mechanistic_mapper.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.
D7 · Architectural Integrity · Classify ADR enforcement · ×9
  • Classify ADR enforcement: Current Shape Appendix rfc/0005-sandbox-proxy-egress-adapter/current-shape.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: Implementation Plan rfc/0005-sandbox-proxy-egress-adapter/implementation-plan.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: Technical Design Appendix rfc/0005-sandbox-proxy-egress-adapter/technical-design.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: Appendix: Deployment Options rfc/0009-supervisor-middleware/appendices/deployment-options.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: Appendix: Extension Authentication (Alpha) rfc/0009-supervisor-middleware/appendices/extension-authentication.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: Appendix: Protocol Extensions rfc/0009-supervisor-middleware/appendices/protocol-extensions.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: RFC 0014 Supplement - Build Matrix rfc/0014-release-stability/build-matrix.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: RFC 0014 Supplement - Release Qualification rfc/0014-release-stability/release-qualification.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: RFC 0014 Supplement - Release Version Selection rfc/0014-release-stability/release-version-selection.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
X7 · Silent fallback defaults · Silent fallback default on Err · ×9
  • Silent fallback default on Err crates/openshell-cli/src/commands/common.rs:79 — `format_epoch_ms` turns every `Err` into `"-".to_string()` — 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 crates/openshell-cli/src/completers.rs:19 — `complete_gateway_names` 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 crates/openshell-cli/src/completers.rs:117 — `workspace_from_args` turns every `Err` into `"default".to_string()` — 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 crates/openshell-core/src/forward.rs:538 — `stop_forwards_for_sandbox` turns every `Err` into `Ok(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 crates/openshell-core/src/forward.rs:581 — `list_forwards` turns every `Err` into `Ok(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 crates/openshell-server/src/config_file.rs:882 — `detected_version` turns every `Err` into `"unavailable".to_string()` — 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 crates/openshell-supervisor-network/src/policy_local.rs:493 — `read_recent_denial_lines` 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 crates/openshell-supervisor-network/src/procfs.rs:277 — `cmdline_absolute_paths` turns every `Err` into `vec![]` — 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 crates/openshell-supervisor-network/src/proxy.rs:4857 — `forward_telemetry_path` turns every `Err` into `"/[INVALID_REQUEST_TARGET]".to_string()` — 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.
D34 · Knowledge Freshness · Orphaned file · ×7
  • Orphaned file fern/components/CustomFooter.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/openshell-vfio/src/sysfs.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 crates/openshell-vfio/src/gpu.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 crates/openshell-vfio/src/reconcile.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 crates/openshell-providers/src/providers/google_cloud.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 crates/openshell-providers/src/providers/vertex.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 crates/openshell-prover/src/finding.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.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 10 significant file(s) lose their only recent owner: crates/openshell-sandbox/src/boundary_exec.rs, crates/openshell-driver-kubernetes/src/isolation.rs, crates/openshell-sandbox/src/boundary_io.rs, crates/openshell-sandbox/src/sftp.rs, crates/openshell-driver-kubernetes/src/resource_admission.rs, crates/openshell-sandbox/src/managed_children.rs, crates/openshell-sandbox/src/linux/task_memory.rs, crates/openshell-driver-vm/src/isolation/mod.rs (+2 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 4 significant file(s) lose their only recent owner: crates/openshell-supervisor-network/src/l7/jsonrpc.rs, crates/openshell-supervisor-network/src/l7/mcp.rs, crates/openshell-core/src/policy_identity.rs, crates/openshell-core/src/mcp.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 9 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 (26 single-owned of 568 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; 568 of the 702 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (2 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)) (+3 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/openshell-driver-vm/src/layer_applier.rs, crates/openshell-conformance/src/scenarios/sandbox_lifecycle.rs, crates/openshell-sandbox/src/linux/proc_fd.rs, crates/openshell-core/build_version.rs, sdk/go/openshell/v1/auth_refresh.go, sdk/go/openshell/v1/types/log.go, crates/openshell-cli/src/color.rs, crates/openshell-prover-cli/src/main.rs (+4 more).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 4 of 41 project(s) overshoot their size bounds, lowering Project Cohesion to 8.2/10. The most over is `crates/openshell-server` (162355 LoC, 287 module-visible types across 8 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 7 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: fern/components/CustomFooter.tsx, crates/openshell-vfio/src/sysfs.rs, crates/openshell-vfio/src/gpu.rs, crates/openshell-vfio/src/reconcile.rs, crates/openshell-providers/src/providers/google_cloud.rs, crates/openshell-providers/src/providers/vertex.rs, crates/openshell-prover/src/finding.rs (9 orphaned of 568 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; 568 of the 702 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 26/30 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/openshell-extension-core`, `crates/openshell-prover-cli`, `sdk/typescript`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
S1 · Web-Security Posture · Security headers incomplete · ×1
  • Security headers incomplete — Set: Content-Security-Policy. Missing: Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — 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.(−1.5 on this card.) The server: `axum::serve(` (crates/openshell-server/src/lib.rs:993).
X5 · Nullable reference types · Null assertions (`!`) reduce the strict null checking score · ×1
  • Null assertions (`!`) reduce the strict null checking score — ~1.0 `!` null assertions per 1k TypeScript source lines — 3 assertion(s) across the 3105 source line(s) of the 11 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: sdk/typescript/src/client.ts (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Minor — 5 finding(s)
D12 · Dependency Hygiene · Outdated · ×5
  • Outdated: github.com/stretchr/testify — `github.com/stretchr/testify` is required at v1.11.1 in REDACTED, but v1.12.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/stretchr/testify@v1.12.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/oauth2 — `golang.org/x/oauth2` is required at v0.36.0 in REDACTED, but v0.37.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/oauth2@v0.37.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sync — `golang.org/x/sync` is required at v0.22.0 in REDACTED, but v0.24.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sync@v0.24.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: google.golang.org/grpc — `google.golang.org/grpc` is required at v1.83.2 in REDACTED, but v1.84.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get google.golang.org/grpc@v1.84.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: google.golang.org/protobuf — `google.golang.org/protobuf` is required at v1.36.11 in REDACTED, but v1.36.12 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get google.golang.org/protobuf@v1.36.12 && go mod tidy` and commit the updated REDACTED and go.sum.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-d181631858ea45c59e8f5cd293d257d3/history.json --exit-code 0 --source .4artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-d181631858ea45c59e8f5cd293d257d3/tree.json --exit-code 0 --source .4artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude crates/openshell-ocsf/schemas --exclude sdk/go/proto .30artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update31artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .14artifacts/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. semgrep could not parse 2 file(s) — `sdk/go/openshell/v1/internal/options/options.go`, `sdk/go/openshell/v1/watch.go` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a17c92-729a-7d47-be85-036611b4c40f · 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