Public report — deno, published 29 Jul 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 29-07-2026 @ 17:41 UTC Public
Code Health Audit

Denoland/deno

50% Weak
CriticalWeakAdequateStrongExemplary
upper third — near Adequate

Very large · 617,047 LoC · rebuild ~6.1 person-years · weakest lens: Readiness (39%)

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

42/43dimensions tool-verifieddeterministic · confidence 1.0 · 1 LLM-assisted, advisory
1356findings with an exact file:lineof 1372 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
43/113dimensions across the health lenses617047 LoC — wide & deep

Executive summary

Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.

denoland/deno carries serious gaps (50%). Several issues below can materially affect correctness, security, or the cost of changing it — and propagate to everything that depends on it.

It is strongest in Event Sourcing (100%) — its event log is trustworthy to replay. Domain Modelling (100%) is solid too.

The area that most needs attention is Readiness (39%) — releases are harder to depend on — versioning, release notes and dependency hygiene are thin, so consumers can't easily tell what changed or trust an upgrade. Code Health (39%) is the next concern — changes there are slower and more error-prone.

Leadership focus, highest impact first: tests that import the unreached modules (directly or through… (Test Coverage); unused dependencies, declare unlisted imports explicitly,… (Dependency Hygiene); Break down the listed branch-heavy functions (Cyclomatic Complexity).

For scale: Very large (~617,047 production lines); rebuilding it from scratch would take roughly ~6.1 person-years (~3–12 engineers). Approximate, ±~30%.

It builds on a genuinely strong Event Sourcing foundation (100%); the priorities above are the highest-leverage way to bring the rest up to that level.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Readiness 39% · 46% weightCode Health 39% · 25% weightSecurity 67% · 14% weightMaturity 78% · 8% weightArchitecture 85% · 4% weightDomain Modelling 100% · 2% weightEvent Sourcing 100% · 1% weight

Raise Readiness 39 → 70 (the Healthy floor) ⇒ headline 50 → ~58.

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

241 finding(s) are new versus the previous scan (2026-07-20) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.

  • D1 · Workspace::diagnostics::check_all_configs (cyclomatic 28) libs/config/workspace/mod.rs
  • D1 · #loop (cyclomatic 27) ext/fetch/27_eventsource.js
  • D1 · turbocall::compile_trampoline::convert (cyclomatic 23) ext/ffi/turbocall.rs
  • D1 · request (cyclomatic 23) ext/web/locks.js
  • D1 · x509::op_node_x509_verify (cyclomatic 22) ext/node_crypto/x509.rs
  • D1 · #handle (cyclomatic 21) ext/fetch/27_eventsource.js
  • D1 · clean::clean_node_modules (cyclomatic 19) cli/tools/clean.rs
  • D1 · Workspace::diagnostics::check_member_diagnostics (cyclomatic 19) libs/config/workspace/mod.rs
  • D1 · EszipV2::from_graph::visit_module (cyclomatic 18) libs/eszip/v2.rs
  • D1 · (anonymous) (cyclomatic 16) runtime/js/99_main.js
  • D2 · constructor (cognitive 56) ext/fetch/23_request.js
  • D2 · Workspace::diagnostics::check_all_configs (cognitive 49) libs/config/workspace/mod.rs
  • D2 · decode (cognitive 30) ext/web/08_text_encoding.js
  • D2 · (computed) (cognitive 29) ext/websocket/01_websocket.js
  • D2 · request (cognitive 29) ext/web/locks.js
  • D2 · #loop (cognitive 29) ext/fetch/27_eventsource.js
  • D2 · #handle (cognitive 28) ext/fetch/27_eventsource.js
  • D2 · EszipV2::from_graph::visit_module (cognitive 27) libs/eszip/v2.rs
  • D2 · (anonymous) (cognitive 26) runtime/js/99_main.js
  • D2 · analysis::try_reverse_map_package_json_exports::try_reverse_map_package_json_exports_inner (cognitive 21) cli/lsp/analysis.rs
  • D2 · graph::tarjan_scc::strongconnect (cognitive 21) libs/npm/resolution/graph.rs
  • D2 · pipe::uv_pipe_connect (cognitive 20) libs/core/uv_compat/pipe.rs
  • D2 · ByonmNpmResolver::resolve_pkg_json_and_alias_for_req::resolve_alias_from_pkg_json (cognitive 20) libs/resolver/npm/byonm.rs
  • D2 · clean::clean_node_modules (cognitive 19) cli/tools/clean.rs
  • D2 · js_native_api::create_external_string (cognitive 19) ext/napi/js_native_api.rs
  • D2 · ReplSession::evaluate_line_and_get_output::inner (cognitive 18) cli/tools/repl/session.rs
  • D2 · unfurl::unfurl_specifiers (cognitive 18) cli/tools/pack/unfurl.rs
  • D2 · Workspace::diagnostics::check_member_diagnostics (cognitive 18) libs/config/workspace/mod.rs
  • D2 · ByonmNpmResolver::resolve_package_folder_from_package::inner (cognitive 18) libs/resolver/npm/byonm.rs
  • D2 · #receiveDatagrams (cognitive 18) ext/web/webtransport.js
  • D2 · pm::find_package_and_select_version_for_req::select (cognitive 17) cli/tools/pm/mod.rs
  • D2 · pipe::uv_pipe_connect (cognitive 17) libs/core/uv_compat/pipe.rs
  • D2 · ini::parse_quoted_string::take_inner_text (cognitive 17) libs/npmrc/ini.rs
  • D2 · cache (cognitive 17) runtime/js/10_permissions.js
  • D2 · turbocall::compile_trampoline::convert (cognitive 16) ext/ffi/turbocall.rs
  • D2 · WorkspaceDirectory::discover::resolve_start_dir (cognitive 16) libs/config/workspace/mod.rs
  • D3 · FileTooLong: args/flags.rs cli/args/flags.rs
  • D3 · FileTooLong: http/http_next.rs ext/http/http_next.rs
  • D3 · FileTooLong: lsp/language_server.rs cli/lsp/language_server.rs
  • D3 · FileTooLong: permissions/lib.rs runtime/permissions/lib.rs
  • D3 · FileTooLong: node_crypto/keys.rs ext/node_crypto/keys.rs
  • D3 · FileTooLong: tools/desktop.rs cli/tools/desktop.rs
  • D3 · FileTooLong: napi/js_native_api.rs ext/napi/js_native_api.rs
  • D3 · FileTooLong: console/inspect.rs ext/web/console/inspect.rs
  • D3 · FileTooLong: node_shim/lib.rs libs/node_shim/lib.rs
  • D3 · FileTooLong: ops/tls_wrap.rs ext/node/ops/tls_wrap.rs
  • D3 · FileTooLong: ops/fs.rs ext/node/ops/fs.rs
  • D3 · FileTooLong: modules/map.rs libs/core/modules/map.rs
  • D3 · FileTooLong: ast_buffer/ts_estree.rs cli/tools/lint/ast_buffer/ts_estree.rs
  • D3 · FileTooLong: web/geometry.rs ext/web/geometry.rs
  • D3 · FileTooLong: src/convert.rs libs/cli_parser/src/convert.rs
  • D3 · FileTooLong: workspace/mod.rs libs/config/workspace/mod.rs
  • D3 · FileTooLong: resolution/graph.rs libs/npm/resolution/graph.rs
  • D3 · FileTooLong: node_resolver/resolution.rs libs/node_resolver/resolution.rs
  • D3 · FileTooLong: http2/session.rs ext/node/ops/http2/session.rs
  • D3 · FileTooLong: node_sqlite/database.rs ext/node_sqlite/database.rs
  • D3 · FileTooLong: ast_buffer/swc.rs cli/tools/lint/ast_buffer/swc.rs
  • D3 · FileTooLong: runtime/jsruntime.rs libs/core/runtime/jsruntime.rs
  • D3 · FileTooLong: bundle/mod.rs cli/tools/bundle/mod.rs
  • D3 · FileTooLong: uv_compat/tty.rs libs/core/uv_compat/tty.rs
  • D3 · FileTooLong: deno_json/mod.rs libs/config/deno_json/mod.rs
  • D3 · FileTooLong: lsp/documents.rs cli/lsp/documents.rs
  • D3 · FileTooLong: core/error.rs libs/core/error.rs
  • D3 · FileTooLong: ops/wasi.rs ext/node/ops/wasi.rs
  • D3 · FileTooLong: fs/ops.rs ext/fs/ops.rs
  • D3 · FileTooLong: cli/module_loader.rs cli/module_loader.rs
  • D3 · FileTooLong: ops/vm.rs ext/node/ops/vm.rs
  • D3 · FileTooLong: crypto/subtle_import_key.rs ext/crypto/subtle_import_key.rs
  • D3 · FileTooLong: node_crypto/lib.rs ext/node_crypto/lib.rs
  • D3 · FileTooLong: lsp/diagnostics.rs cli/lsp/diagnostics.rs
  • D3 · FileTooLong: lsp/config.rs cli/lsp/config.rs
  • D3 · FileTooLong: process/lib.rs ext/process/lib.rs
  • D3 · FileTooLong: npm_installer/local.rs libs/npm_installer/local.rs
  • D3 · FileTooLong: rt/run.rs cli/rt/run.rs
  • D3 · FileTooLong: core/inspector.rs libs/core/inspector.rs
  • D3 · FileTooLong: tools/upgrade.rs cli/tools/upgrade.rs
  • D3 · FileTooLong: resolver/deno_json.rs libs/resolver/deno_json.rs
  • D3 · FileTooLong: http/lib.rs ext/http/lib.rs
  • D3 · FileTooLong: resolver/workspace.rs libs/resolver/workspace.rs
  • D3 · FileTooLong: args/mod.rs cli/args/mod.rs
  • D3 · FileTooLong: web/css_value.rs ext/web/css_value.rs
  • D3 · FileTooLong: op2/signature.rs libs/ops/op2/signature.rs
  • D3 · FileTooLong: eszip/v2.rs libs/eszip/v2.rs
  • D3 · FileTooLong: console/mod.rs ext/web/console/mod.rs
  • D3 · FileTooLong: rt/file_system.rs cli/rt/file_system.rs
  • D3 · FileTooLong: uv_compat/pipe.rs libs/core/uv_compat/pipe.rs
  • D3 · FileTooLong: fetch/lib.rs ext/fetch/lib.rs
  • D3 · FileTooLong: tools/fmt.rs cli/tools/fmt.rs
  • D3 · FileTooLong: rt_desktop/lib.rs cli/rt_desktop/lib.rs
  • D3 · FileTooLong: lsp/resolver.rs cli/lsp/resolver.rs
  • D3 · FileTooLong: ops/stream_wrap.rs ext/node/ops/stream_wrap.rs
  • D3 · FileTooLong: runtime/bindings.rs libs/core/runtime/bindings.rs
  • D3 · FileTooLong: node_crypto/cipher.rs ext/node_crypto/cipher.rs
  • D3 · FileTooLong: http_h1/conn.rs libs/http_h1/conn.rs
  • D3 · FileTooLong: cli/type_checker.rs cli/type_checker.rs
  • D3 · FileTooLong: cli/factory.rs cli/factory.rs
  • D3 · FileTooLong: tsc/tsconfig_gen.rs cli/tsc/tsconfig_gen.rs
  • D3 · FileTooLong: npm/registry.rs libs/npm/registry.rs
  • D3 · FileTooLong: ops/desktop.rs runtime/ops/desktop.rs
  • D3 · FileTooLong: napi/uv.rs ext/napi/uv.rs

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

Rebuild cost & value ~ Modeled — €300,000–€1,500,000
Cost to rebuild€300,000–€1,500,000 (2.9–9.3 person-years (4,922–15,614 h), ~3–12 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 50% quality) — the last 20% of quality is most of the work
Size & shapeVery large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

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

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

Top priorities

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

1
Add tests that import the unreached modules (directly or through their public entry).
+9.9 pts · Medium effort · Test Coverage
2
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
+9.9 pts · Medium effort · Dependency Hygiene
3
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
+9.6 pts · Medium effort · Cyclomatic Complexity

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Very large asset (~6.1 person-years to rebuild), and its weakest lens is Readiness at 39%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Very large, ~6.1 person-years rebuild (617,047 LoC) · weakest lens: Readiness 39%
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add tests that import the unreached modules (directly or through their public entry). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add tests that import the unreached modules (directly or through their public entry).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.6/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 4–8% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2 complexity, D4 duplication, D6 cohesion: averaging 6.6/10 across the code-quality signals
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

At a glance — Code Health · 39% · Weak · gated by D2, R2, R3

At a glance — Architecture · 85% · Strong

At a glance — Maturity · 78% · Strong

At a glance — Readiness · 39% · Weak · gated by R4, R8

At a glance — Security · 67% · Adequate · gated by D28, D29

At a glance — Domain Modelling · 100% · Exemplary

At a glance — Event Sourcing · 100% · Exemplary

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A06:2021 — Vulnerable & Outdated Components12High / Critical
A03:2021 — Injection9High / Critical
A02:2021 — Cryptographic Failures2High / Critical
A05:2021 — Security Misconfiguration2High / Critical

Roadmap

First, expand test coverage by adding tests for unreached modules to ensure critical code paths are validated. Next, improve dependency hygiene by removing unused packages, explicitly declaring imports, and moving type- or test-only dependencies to development scopes. Then, reduce cyclomatic complexity by breaking down branch-heavy functions and splitting large files into smaller, focused components. Finally, integrate static analysis and security scanning into the CI pipeline to automatically fail builds on regressions.

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

Do thisHelpsEffortDimension
Add tests that import the unreached modules (directly or through their public entry).+9.9 ptsMediumTest Coverage
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+9.9 ptsMediumDependency Hygiene
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.+9.6 ptsMediumCyclomatic Complexity
Split the oversized components into smaller, focused ones.+9.6 ptsMediumLarge Files
Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.+9.5 ptsMediumSecurity & performance tooling
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.+9.5 ptsMediumRelease Hygiene
Migrate the remaining .js/.jsx files to TypeScript.+9.4 ptsMediumType Safety
Resolve the 9 High finding(s) in Static Analysis (SAST) — start with promote_to_release.generated.yml (5), npm_publish.generated.yml (2), start_release.generated.yml.+1.6 ptsLowStatic Analysis (SAST)

File quality

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

FileScoreBandWorst signal
Cargo.lock3.0SlopOSV Dependency Vulnerabilities: High vulnerability: [GHSA redacted]
.github/workflows/promote_to_release.generated.yml4.6MixedStatic Analysis (SAST): High: run-shell-injection
runtime/js/99_main.js5.6MixedCyclomatic Complexity: bootstrapMainRuntime (cyclomatic 18)
.github/workflows/npm_publish.generated.yml5.8MixedStatic Analysis (SAST): High: run-shell-injection
.devcontainer/Dockerfile5.8MixedIaC & Container Security: High IaC: DS-0002
ext/node/lib.rs5.9MixedGod Classes: FileTooLong: node/lib.rs
ext/web/console/inspect.rs7.0MixedCyclomatic Complexity: inspect::format_raw (cyclomatic 97)
libs/core/uv_compat/pipe.rs7.0MixedCyclomatic Complexity: pipe::poll_pipe_handle (cyclomatic 86)
cli/args/flags.rs7.0MixedCyclomatic Complexity: flags::flags_from_vec_with_initial_cwd (cyclomatic 80)
libs/core/uv_compat/tty.rs7.0MixedCyclomatic Complexity: tty::poll_tty_handle (cyclomatic 67)
ext/http/http_next.rs7.0MixedCyclomatic Complexity: http_next::serve_http11_raw (cyclomatic 58)
libs/npm/resolution/graph.rs7.0MixedCyclomatic Complexity: GraphDependencyResolver::resolve_peers_of_node (cyclomatic 56)
cli/tools/desktop.rs7.0MixedCyclomatic Complexity: desktop::compile_desktop (cyclomatic 51)
ext/web/console/mod.rs7.0MixedCyclomatic Complexity: console::apply_options (cyclomatic 48)
ext/node_crypto/cipher.rs7.0MixedCyclomatic Complexity: Cipher::new (cyclomatic 46)
ext/node_crypto/keys.rs7.0MixedCyclomatic Complexity: KeyObjectHandle::new_asymmetric_private_key_from_js (cyclomatic 39)
ext/crypto/subtle_import_key.rs7.0MixedCyclomatic Complexity: subtle_import_key::import_key_ec (cyclomatic 38)
ext/node/ops/tls_wrap.rs7.0MixedCyclomatic Complexity: tls_wrap::build_client_config (cyclomatic 36)
cli/lsp/tsc.rs7.0MixedCyclomatic Complexity: CompletionEntry::as_completion_item (cyclomatic 31)
ext/node_sqlite/database.rs7.0MixedCyclomatic Complexity: DatabaseSyncOptions::from_v8 (cyclomatic 31)

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. 42 of 43 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 1 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.6 — 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 — 43 dimensions across the health lenses
D1D2D3D4D8D13D15D16D21D28D29D31D33D34D35D36D37D38AX9DM2DM4DM5DM6ES1ES2M1M2M3M4P1P3P4P6R1R10R2R3R4R5R6R7R8R9

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, 1356 of 1372 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
jscpdCode duplication✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.302✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.302✓ 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✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 019faef7-9907-7714-8946-f87e270fc741.

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.

  • D19 Documentation Quality — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
  • D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.

Repo exclusion declarations: 2 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 (jscpd) — 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.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • 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.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • 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").
  • 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.
  • D33 JS/npm Dependency Vulnerabilities: JS/npm CVE matching reads package manifests and lockfiles — risk from how a dependency is used, and advisories not yet published, fall outside this scan.
  • 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.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (2): D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity6.0 / 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: DocumentedVerifiedPrevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Prevented

367 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was swc::serialize_expr at 106. A further 46 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 tty::get_vt100_fn_key at 137 — they are counted neither in the figure above nor in this dimension's score.

inspect::format_raw (cyclomatic 97) · ×11ext/web/console/inspect.rs:1920
subtle_import_key::import_key_ec (cyclomatic 38) · ×6ext/crypto/subtle_import_key.rs:1075
process::search_path_join_test (cyclomatic 29) · ×5runtime/subprocess_windows/src/process.rs:837
tty::poll_tty_handle (cyclomatic 67) · ×4libs/core/uv_compat/tty.rs:2176
http_next::serve_http11_raw (cyclomatic 58) · ×4ext/http/http_next.rs:4357

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

What to do

  1. Resolve the 11 inspect finding(s) in Cyclomatic Complexity — start with inspect.rs (11). — One of this dimension's main actionable groups (11 warning-level).
  2. Resolve the 6 subtle_import_key finding(s) in Cyclomatic Complexity — start with subtle_import_key.rs (6). — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 5 process finding(s) in Cyclomatic Complexity — start with process.rs (5). — One of this dimension's main actionable groups (5 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity3.7 / 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: DocumentedVerifiedPrevented · effective 3.7 / 10 · rule-coverage 100% · ceiling Prevented

701 method(s) exceeded the cognitive complexity threshold of 15; the worst was pipe::poll_pipe_handle at 208.

inspect::format_raw (cognitive 170) · ×15ext/web/console/inspect.rs:1920
desktop::compile_desktop (cognitive 94) · ×10cli/tools/desktop.rs:176
tsc::display_parts_to_string (cognitive 67) · ×9cli/lsp/tsc.rs:2005
subtle_import_key::import_key_ec (cognitive 52) · ×9ext/crypto/subtle_import_key.rs:1075
tty::poll_tty_handle (cognitive 204) · ×8libs/core/uv_compat/tty.rs:2176

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

What to do

  1. Resolve the 15 inspect finding(s) in Cognitive Complexity — start with inspect.rs (15). — One of this dimension's main actionable groups (15 warning-level).
  2. Resolve the 10 desktop finding(s) in Cognitive Complexity — start with desktop.rs (10). — One of this dimension's main actionable groups (10 warning-level).
  3. Resolve the 9 tsc finding(s) in Cognitive Complexity — start with tsc.rs (6), mod.rs (3). — One of this dimension's main actionable groups (9 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.4 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 8.4 / 10 · rule-coverage 100% · ceiling Prevented

243 god class(es) detected.

FileTooLong: args/flags.rs · ×191cli/args/flags.rs:0
TooManyFunctions: crate::args::flags · ×33cli/args/flags.rs:80
TooManyMethods: TsEsTreeBuilder · ×19cli/tools/lint/ast_buffer/ts_estree.rs:476

What to do

  1. Resolve the 191 FileTooLong finding(s) in God Classes — start with lib.rs (21), mod.rs (15), flags.rs (2). — One of this dimension's main actionable groups (191 warning-level).
  2. Resolve the 33 TooManyFunctions finding(s) in God Classes — start with ops.rs (2), mod.rs (2), flags.rs. — One of this dimension's main actionable groups (33 warning-level).
  3. Resolve the 19 TooManyMethods finding(s) in God Classes — start with mod.rs (4), geometry.rs (2), lib.rs (2). — One of this dimension's main actionable groups (19 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 Duplication10.0 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 duplicated block group(s) detected.

✓ On the Gold path — maintain.

Detailed fixes: d4_recommendation.md.

D8 · Code Coverage9.4 / 10Exemplary✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Verified

Line coverage 62.9% — read from a committed lcov report (tests/testdata/coverage/complex_expected.lcov); the in-image collector couldn't run the suite (commonly external-service dependencies). A real measurement, but from a committed artifact rather than a fresh in-image run.

Coverage read from a committed report

✓ On the Gold path — maintain.

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

D13 · Secret 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: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots9.7 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: cli/args/flags.rs (91×80=7280); ext/node/polyfills/01_require.js (76×59=4484); cli/lib.rs (29×70=2030)

Hotspot: cli/args/flags.rs · ×10cli/args/flags.rs

✓ On the Gold path — maintain.

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

D16 · Bus Factor9.3 / 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: DocumentedVerifiedPrevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Documented

54 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is libs/eszip/v2.rs.

Off-boarding risk: anonymized user #1 · ×5
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.

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

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

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

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D28 · Secrets (history)3.0 / 10Weak✓ Tool-verified

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

Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.

Maturity: DocumentedVerifiedPrevented · effective 3.0 / 10 · rule-coverage 100% · ceiling Documented

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

Secret: private-keytools/wpt/certs/cacert.key:1detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed

What to do

  1. Resolve the 1 Secret finding(s) in Secrets (history) — start with cacert.key. — 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)2.1 / 10Critical✓ Tool-verified

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 2.1 / 10 · rule-coverage 100% · ceiling Documented

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

High: run-shell-injection · ×9.github/workflows/npm_publish.generated.yml:36detected by semgrep finding

What to do

  1. Resolve the 9 High finding(s) in Static Analysis (SAST) — start with promote_to_release.generated.yml (5), npm_publish.generated.yml (2), start_release.generated.yml. — One of this dimension's main actionable groups (9 issue-level).

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

D31 · IaC & Container Security9.3 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Documented

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

High IaC: DS-0002 · ×2.devcontainer/Dockerfiledetected by trivy finding

✓ On the Gold path — maintain.

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

D33 · JS/npm Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether JavaScript/npm dependencies have known published vulnerabilities (CVEs) — the npm ecosystem's biggest risk.

Method: JS/npm CVE scan via trivy fs --scanners vuln over JS manifests (package.json/yarn.lock/pnpm-lock/bun.lockb); 0-10 tight normalizer. NotApplicable without JS manifests. Exhaustive, deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No known-vulnerable JS/npm dependencies.

✓ On the Gold path — maintain.

Detailed fixes: d33_recommendation.md.

D34 · Knowledge Freshness9.9 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

12 of 791 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is ext/http/compressible.rs.

Orphaned knowledgeext/http/compressible.rs
Further orphaned files (smaller)

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.8 / 10Exemplary✓ Tool-verified

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: global.rs↔local.rs 70%; lib.rs↔cp_sync.ts 67%; 99_main.js↔worker_bootstrap.rs 64%

Change coupling: global.rs ↔ local.rs · ×10libs/resolver/npm/managed/global.rs

✓ On the Gold path — maintain.

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: DocumentedVerifiedPrevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Documented

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

PR-triggered workflow without a permissions block
No build provenance
No SBOM

What to do

  1. Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 No SBOM finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-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: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D38 · OSV Dependency Vulnerabilities7.3 / 10Strong✓ Tool-verified

What it measures: Whether dependencies have known published vulnerabilities (CVEs) per the OSV database — read natively from whatever lockfile the repository ships (Cargo, npm, Go, Python, Maven, RubyGems, …). D33 and D30 add ecosystem-specific scanners on top for npm and .NET.

Method: Multi-ecosystem dependency-CVE scan via osv-scanner --recursive (queries the osv.dev database + parses lockfiles natively across ecosystems: npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven/Gradle pom.xml/gradle.lockfile, PyPI requirements.txt/poetry.lock/Pipfile.lock, Composer composer.lock, RubyGems Gemfile.lock, Hex mix.lock, pub pubspec.lock, Swift Package.resolved); severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer (8.0). NotApplicable only when the repo declares no supported non-.NET dependency lockfile (a NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain); coverage needs a resolved lockfile. Additive to D33 (trivy fs); exhaustive + deterministic, DB kept fresh.

Maturity: DocumentedVerifiedPrevented · effective 7.3 / 10 · rule-coverage 100% · ceiling Documented

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

High vulnerability: [GHSA redacted]Cargo.lockdetected by osv-scanner finding
Medium advisory (unmaintained): RUSTSEC-2025-0056 · ×4Cargo.lockdetected by osv-scanner finding
Medium advisory (unsound): RUSTSEC-2026-0190 · ×4Cargo.lockdetected by osv-scanner finding
Medium vulnerability: RUSTSEC-2026-0204 · ×2Cargo.lockdetected by osv-scanner finding
Medium CVE: RUSTSEC-2023-0071Cargo.lockdetected by osv-scanner finding

What to do

  1. Resolve the 1 High vulnerability finding(s) in OSV Dependency Vulnerabilities — start with Cargo.lock. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 4 Medium advisory (unmaintained) finding(s) in OSV Dependency Vulnerabilities — start with Cargo.lock (4). — One of this dimension's main actionable groups (4 warning-level).
  3. Resolve the 4 Medium advisory (unsound) finding(s) in OSV Dependency Vulnerabilities — start with Cargo.lock (4). — One of this dimension's main actionable groups (4 warning-level).

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

Frontend & cross-cutting dimensions

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

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.

  • `SerializeDeserialize.get_shared_array_buffer_id` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — ops_builtin_v8.rs:637
  • `SerializeDeserialize.get_wasm_module_transfer_id` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — ops_builtin_v8.rs:665

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.
DM2 · Strongly-typed ids9.9 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether domain identifiers are strongly typed (a newtype wrapper) rather than raw primitives — consistency once an idiom exists.

Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. Deterministic, adoption percentage.

Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.

  • `SessionContainer.next_local_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value. — inspector.rs:1465
  • `SessionContainer.main_session_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value. — inspector.rs:1470
  • `SessionContainer.next_worker_id` is a raw primitive id while the repo already defines newtype typed-ids — an inconsistently-adopted typed-id idiom. Give this identity its own newtype so it can't be confused with another entity's id or a plain value. — inspector.rs:1471

What to do

  • Adopt the repo's newtype typed-id idiom consistently — wrap every entity identity in its own newtype.
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified

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

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

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

DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

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

Method: Roslyn (DDD-gated): public setters on entities detected; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

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

DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

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

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

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

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)8.1 / 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 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 20 of 71 project(s) that lack one — worth up to 0.6 pts.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

  • No Architecture Decision Records found — decisions aren't captured for future maintainers.

What to do

  • Start an ADR log (docs/adr/) recording significant decisions and their rationale.
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◐ Sampled · advisory

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

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

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.

P3 · Security & performance tooling5.0 / 10Adequate✓ Tool-verified

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

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

What to do

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

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

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

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.

What to do

  • Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
R1 · Type Safety4.4 / 10Weak✓ 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.

  • 389 typed · 499 plain JS

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication9.2 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm over JS/TS tokens, D-386).

Method: Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm run over JS/TS tokens). Deterministic.

  • ext/fetch/26_fetch.js:194 · ext/node/polyfills/_http_client.js:146 — 26_fetch.js:194
  • ext/fs/30_fs.js:970 · ext/node/polyfills/internal/http2/util.ts:1050 · ext/node/polyfills/internal/readline/interface.mjs:1401 — 30_fs.js:970
  • ext/node/polyfills/internal/constants.ts:80 · ext/node/polyfills/internal/streams/utils.js:352 — constants.ts:80
  • ext/node/polyfills/_http_agent.js:76 · ext/node/polyfills/net.ts:336 — _http_agent.js:76
  • ext/node/polyfills/_zlib_binding.mjs:91 · ext/node/polyfills/internal/constants.ts:97 · ext/node/polyfills/internal/streams/utils.js:370 — _zlib_binding.mjs:91
  • ext/node/polyfills/dns.ts:1086 · ext/node/polyfills/internal/constants.ts:79 · ext/node/polyfills/internal/streams/utils.js:351 · ext/node/polyfills/internal/webstreams/readablestream.js:156 — dns.ts:1086
  • ext/node/polyfills/internal/crypto/sig.ts:7 · ext/node/polyfills/internal/util.mjs:29 — sig.ts:7
  • ext/node/polyfills/internal/crypto/util.ts:483 · ext/node/polyfills/path/_posix.ts:524 · ext/node/polyfills/path/_win32.ts:1205 — util.ts:483

What to do

  • Extract the duplicated blocks into shared functions/components.
R2 · Cyclomatic Complexity3.0 / 10Weak✓ 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.

  • Branch-heavy code is where defects cluster — extract decisions into smaller functions. (×8) — url.ts:262, utils.mjs:121, _fs_glob.ts:880, …

What to do

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

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

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

  • 134 file(s) over 400 lines

What to do

  • Split the oversized components into smaller, focused ones.
R4 · Test Coverage0.5 / 10Critical✓ 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 — its behavior is unverified. (×8) — 06_streams.js, http2.ts, errors.ts, …

What to do

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

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

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D33). Deterministic.

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.

  • 1749 file(s) (~376611 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) (~1 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. — esm
  • 1 file(s) (~13 LoC) were excluded from dead-code analysis. This package DOES declare main/module/exports — but every declared target is missing from the scanned tree, which is what a build-output entry (dist/, lib/, out/) looks like before the package is built. Point a declared target at the source entry, or build the package before scanning, so reachability can follow it. — 1.0.0
R8 · Dependency Hygiene0.0 / 10Critical✓ Tool-verified

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

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

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×3) — wpt.ts:43, process.d.cts:112, index.js:2
  • Declared in tests/registry/npm/@denotest/file-dep/1.0.0/package.json but never imported anywhere in that package or its workspace members — dead weight and attack surface. Verify against build tooling before removing.
  • Declared in tests/registry/npm/@denotest/mjs-reexport-cjs/1.0.0/package.json but never imported anywhere in that package or its workspace members — dead weight and attack surface. Verify against build tooling before removing.
  • Declared in tests/registry/npm/@denotest/non-existent-dep/1.0.0/package.json but never imported anywhere in that package or its workspace members — dead weight and attack surface. Verify against build tooling before removing.

What to do

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

  • ext/node/polyfills/stream.ts → ext/node/polyfills/stream/promises.js → ext/node/polyfills/stream.ts — stream.ts
  • libs/core_testing/integration/dyn_import_circular/a.js → libs/core_testing/integration/dyn_import_circular/b.js → libs/core_testing/integration/dyn_import_circular/a.js — a.js

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.

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 Health39%Weak — gated by D2, R2, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture85%StrongSolid.
Maturity78%StrongSolid.
Readiness39%Weak — gated by R4, R8Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security67%Adequate — gated by D28, D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100%ExemplarySolid.
Event Sourcing100%ExemplaryStrongest area.
Not included — 70 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — no DI registrations detected
  • AX10 Code composition — not assessed — code composition is computed by ROLE over the .NET document set and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — no singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over the .NET project-reference graph and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over the .NET project-reference graph and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from the .NET project graph (projects, types, namespaces) and no such graph was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over the .NET type surface and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — not assessed — test isolation is computed from the .NET project graph (which projects are test projects, and what they reference) and no such graph was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AXB2 Runtime readiness — no data
  • C1 Data Protection — Not assessed: these personal data controls are read from C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C3 Audit Trail — Not assessed: these audit controls are read from C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~210861 lines of test source are present (.rs, .ts, .tsx, .mts, .cts, .js, .mjs) but the test-quality collector reads C# only, so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Cargo manifest), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
  • D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
  • 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.
  • D19 Documentation Quality — LLM evaluation failed
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Production source is present (.rs, .ts) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["Acme.Billing"]`, `Catalog: ["Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR ruleset is bundled (the public p/gdpr semgrep pack was retired) — data compliance is not assessed in this scan.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is .rs, .ts, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D9 Test Distribution — Test source is present (.rs, .ts, .tsx, .mts, .cts, .js, .mjs) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Aggregate boundaries — not gated in Rust source-only: aggregate-vs-value-object classification is not 0-FP-separable (every struct-holding-struct reads alike), and a child COLLECTION (legitimate membership) vs a single embedded aggregate is indistinguishable — advisory (the Swift/Dart parity)
  • DM3 Integration-event coupling — not gated in Rust source-only: a cross-crate domain leak is not 0-FP-separable from a legitimate shared-kernel crate, and the corpus is predominantly single-crate — advisory (candidate-demote, schema §6.1/§13)
  • DM7 Repository granularity — not gated in Rust source-only: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable; the softest gated dim (schema §6.1 sanctions the advisory demote) — advisory
  • ED2 Event/command shape — not gated in Rust source-only: a command with >1 competing handler needs a dispatch/call graph the source-only frontend cannot resolve (inferred/generic call owners decline) — advisory
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • GD1 Unfinished & placeholder code — no source files
  • IC1 Incompleteness & stubs — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — no data
  • P2 Observability — Observability was not assessed: this check reads .NET source (ILogger/Serilog, OpenTelemetry, health checks) and no such source carries this repository's product — because it is written in another language, or because the solution failed to load. Absence of a .NET logging idiom is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
  • P8 Schema migrations — not assessed — schema-migration practice is read from EF Core usage in .NET source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo llvm-cov --lcov --output-path lcov.info`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance was not assessed: this lens reads .NET source (allocation-aware APIs — Span/Memory, ArrayPool/ObjectPool, stackalloc — and a BenchmarkDotNet suite) and no such source was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF2 Allocation hygiene — Performance was not assessed: this lens reads .NET source (allocation-aware APIs — Span/Memory, ArrayPool/ObjectPool, stackalloc — and a BenchmarkDotNet suite) and no such source was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF3 Async & latency hygiene — Performance was not assessed: this lens reads .NET source (allocation-aware APIs — Span/Memory, ArrayPool/ObjectPool, stackalloc — and a BenchmarkDotNet suite) and no such source was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — no data
  • X1 Async correctness — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • X3 Exception handling — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • X4 Structured logging — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository

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.

Issue — 14 finding(s)
D29 · Static Analysis (SAST) · High · ×9
  • High: run-shell-injection .github/workflows/npm_publish.generated.yml:36 — Using variable interpolation `${{...}}` with a workflow input in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. A workflow input is not bounded by this step and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/npm_publish.generated.yml:295 — Using variable interpolation `${{...}}` with a workflow input in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. A workflow input is not bounded by this step and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/promote_to_release.generated.yml:44 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/promote_to_release.generated.yml:59 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/promote_to_release.generated.yml:128 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/promote_to_release.generated.yml:136 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/promote_to_release.generated.yml:162 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/start_release.generated.yml:40 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/version_bump.generated.yml:44 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
D31 · IaC & Container Security · High IaC · ×2
  • High IaC: DS-0002 .devcontainer/Dockerfile — Image user should not be 'root'
  • High IaC: DS-0029 .devcontainer/Dockerfile — 'apt-get' missing '--no-install-recommends'
D28 · Secrets (history) · Secret · ×1
  • Secret: private-key tools/wpt/certs/cacert.key:1 — matched rule 'private-key'
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge ext/http/compressible.rs — 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.
D38 · OSV Dependency Vulnerabilities · High vulnerability · ×1
  • High vulnerability: [GHSA redacted] Cargo.lock — hickory-proto 0.25.2: [GHSA redacted] — no fixed version has been published yet. Track the advisory, and remove or replace hickory-proto if the exposure is not acceptable until one lands. One upgrade of hickory-proto 0.25.2 clears all 2 advisories it raises: [GHSA redacted], [GHSA redacted].
Warning — 1344 finding(s)
D3 · God Classes · FileTooLong · ×191
  • FileTooLong: args/flags.rs cli/args/flags.rs:0 — FileTooLong — 6829 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: web/06_streams.js ext/web/06_streams.js:0 — FileTooLong — 4960 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units).
  • FileTooLong: http/http_next.rs ext/http/http_next.rs:0 — FileTooLong — 4114 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: lsp/language_server.rs cli/lsp/language_server.rs:0 — FileTooLong — 3701 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: permissions/lib.rs runtime/permissions/lib.rs:0 — FileTooLong — 3669 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: node_crypto/keys.rs ext/node_crypto/keys.rs:0 — FileTooLong — 3430 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: tools/desktop.rs cli/tools/desktop.rs:0 — FileTooLong — 3414 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: napi/js_native_api.rs ext/napi/js_native_api.rs:0 — FileTooLong — 2933 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: console/inspect.rs ext/web/console/inspect.rs:0 — FileTooLong — 2860 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: node_shim/lib.rs libs/node_shim/lib.rs:0 — FileTooLong — 2854 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: ops/tls_wrap.rs ext/node/ops/tls_wrap.rs:0 — FileTooLong — 2721 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: ops/fs.rs ext/node/ops/fs.rs:0 — FileTooLong — 2574 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: modules/map.rs libs/core/modules/map.rs:0 — FileTooLong — 2458 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: ast_buffer/ts_estree.rs cli/tools/lint/ast_buffer/ts_estree.rs:0 — FileTooLong — 2347 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: web/geometry.rs ext/web/geometry.rs:0 — FileTooLong — 2290 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: src/convert.rs libs/cli_parser/src/convert.rs:0 — FileTooLong — 2279 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: workspace/mod.rs libs/config/workspace/mod.rs:0 — FileTooLong — 2255 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: resolution/graph.rs libs/npm/resolution/graph.rs:0 — FileTooLong — 2213 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: node_resolver/resolution.rs libs/node_resolver/resolution.rs:0 — FileTooLong — 2204 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: http2/session.rs ext/node/ops/http2/session.rs:0 — FileTooLong — 2182 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: node_sqlite/database.rs ext/node_sqlite/database.rs:0 — FileTooLong — 2154 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: ast_buffer/swc.rs cli/tools/lint/ast_buffer/swc.rs:0 — FileTooLong — 2150 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: runtime/jsruntime.rs libs/core/runtime/jsruntime.rs:0 — FileTooLong — 2137 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: bundle/mod.rs cli/tools/bundle/mod.rs:0 — FileTooLong — 2040 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • FileTooLong: uv_compat/tty.rs libs/core/uv_compat/tty.rs:0 — FileTooLong — 1975 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted).
  • + 166 more in this group — see findings.md.
D3 · God Classes · TooManyFunctions · ×33
  • TooManyFunctions: crate::args::flags cli/args/flags.rs:80 — TooManyFunctions — 236 free functions.
  • TooManyFunctions: crate::js_native_api ext/napi/js_native_api.rs:189 — TooManyFunctions — 137 free functions.
  • TooManyFunctions: crate::http_next ext/http/http_next.rs:683 — TooManyFunctions — 112 free functions.
  • TooManyFunctions: crate::convert libs/cli_parser/src/convert.rs:27 — TooManyFunctions — 101 free functions.
  • TooManyFunctions: crate::ops::fs ext/node/ops/fs.rs:39 — TooManyFunctions — 92 free functions.
  • TooManyFunctions: crate::console::inspect ext/web/console/inspect.rs:277 — TooManyFunctions — 92 free functions.
  • TooManyFunctions: crate::keys ext/node_crypto/keys.rs:362 — TooManyFunctions — 87 free functions.
  • TooManyFunctions: crate::tools::desktop cli/tools/desktop.rs:43 — TooManyFunctions — 84 free functions.
  • TooManyFunctions: crate::ops ext/fs/ops.rs:115 — TooManyFunctions — 79 free functions.
  • TooManyFunctions: crate::uv ext/napi/uv.rs:18 — TooManyFunctions — 69 free functions.
  • TooManyFunctions: crate ext/node_crypto/lib.rs:196 — TooManyFunctions — 67 free functions.
  • TooManyFunctions: crate::tools::lint::ast_buffer::swc cli/tools/lint/ast_buffer/swc.rs:107 — TooManyFunctions — 49 free functions.
  • TooManyFunctions: crate::ops::vm ext/node/ops/vm.rs:30 — TooManyFunctions — 48 free functions.
  • TooManyFunctions: crate::ops::http2::session ext/node/ops/http2/session.rs:98 — TooManyFunctions — 47 free functions.
  • TooManyFunctions: crate::tools::bundle cli/tools/bundle/mod.rs:93 — TooManyFunctions — 46 free functions.
  • TooManyFunctions: crate::ops::v8 ext/node/ops/v8.rs:32 — TooManyFunctions — 46 free functions.
  • TooManyFunctions: crate::ops_builtin_v8 libs/core/ops_builtin_v8.rs:31 — TooManyFunctions — 45 free functions.
  • TooManyFunctions: crate::tools::upgrade cli/tools/upgrade.rs:235 — TooManyFunctions — 41 free functions.
  • TooManyFunctions: crate::tsc::tsconfig_gen cli/tsc/tsconfig_gen.rs:31 — TooManyFunctions — 40 free functions.
  • TooManyFunctions: crate::error libs/core/error.rs:261 — TooManyFunctions — 40 free functions.
  • TooManyFunctions: crate::uv_compat::tty libs/core/uv_compat/tty.rs:762 — TooManyFunctions — 37 free functions.
  • TooManyFunctions: crate::tools::fmt cli/tools/fmt.rs:58 — TooManyFunctions — 36 free functions.
  • TooManyFunctions: crate::ops ext/net/ops.rs:102 — TooManyFunctions — 36 free functions.
  • TooManyFunctions: crate::ops::tls_wrap ext/node/ops/tls_wrap.rs:247 — TooManyFunctions — 36 free functions.
  • TooManyFunctions: crate::node_api ext/napi/node_api.rs:26 — TooManyFunctions — 35 free functions.
  • + 8 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×19
  • TooManyMethods: TsEsTreeBuilder cli/tools/lint/ast_buffer/ts_estree.rs:476 — TooManyMethods — 155 methods.
  • TooManyMethods: CliOptions cli/args/mod.rs:556 — TooManyMethods — 87 methods.
  • TooManyMethods: DOMMatrixReadOnly ext/web/geometry.rs:1256 — TooManyMethods — 86 methods.
  • TooManyMethods: Inner cli/lsp/language_server.rs:305 — TooManyMethods — 75 methods.
  • TooManyMethods: ModuleMap libs/core/modules/map.rs:274 — TooManyMethods — 73 methods.
  • TooManyMethods: CliFactory cli/factory.rs:337 — TooManyMethods — 65 methods.
  • TooManyMethods: JsRuntime libs/core/runtime/jsruntime.rs:439 — TooManyMethods — 64 methods.
  • TooManyMethods: DOMMatrix ext/web/geometry.rs:2413 — TooManyMethods — 59 methods.
  • TooManyMethods: PermissionsContainer runtime/permissions/lib.rs:3988 — TooManyMethods — 55 methods.
  • TooManyMethods: UnaryPermission runtime/permissions/lib.rs:930 — TooManyMethods — 53 methods.
  • TooManyMethods: Workspace libs/config/workspace/mod.rs:540 — TooManyMethods — 51 methods.
  • TooManyMethods: TLSWrap ext/node/ops/tls_wrap.rs:2069 — TooManyMethods — 50 methods.
  • TooManyMethods: ConfigFile libs/config/deno_json/mod.rs:1730 — TooManyMethods — 48 methods.
  • TooManyMethods: NodeResolver libs/node_resolver/resolution.rs:334 — TooManyMethods — 48 methods.
  • TooManyMethods: WasiContext ext/node/ops/wasi.rs:416 — TooManyMethods — 47 methods.
  • TooManyMethods: WorkspaceDirectory libs/config/workspace/mod.rs:1918 — TooManyMethods — 39 methods.
  • TooManyMethods: LibUvStreamWrap ext/node/ops/stream_wrap.rs:210 — TooManyMethods — 37 methods.
  • TooManyMethods: GPUSupportedLimits ext/webgpu/adapter.rs:263 — TooManyMethods — 35 methods.
  • TooManyMethods: HttpRecord ext/http/service.rs:792 — TooManyMethods — 31 methods.
D2 · Cognitive Complexity · inspect · ×15
  • inspect::format_raw (cognitive 170) ext/web/console/inspect.rs:1920 — inspect::format_raw has cognitive complexity 170 (threshold 15). Drivers by points: if/else 136, boolean chains 21, match/switch 12, loops 1 (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • inspect::add_prototype_properties (cognitive 96) ext/web/console/inspect.rs:1494 — inspect::add_prototype_properties has cognitive complexity 96 (threshold 15). Drivers by points: if/else 84, loops 9, match/switch 2, boolean chains 1 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • inspect::get_constructor_name (cognitive 69) ext/web/console/inspect.rs:1669 — inspect::get_constructor_name has cognitive complexity 69 (threshold 15). Drivers by points: if/else 59, match/switch 6, boolean chains 3, loops 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • inspect::format_property (cognitive 65) ext/web/console/inspect.rs:3528 — inspect::format_property has cognitive complexity 65 (threshold 15). Drivers by points: if/else 54, match/switch 9, boolean chains 2 (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.
  • inspect::reduce_to_single_string (cognitive 51) ext/web/console/inspect.rs:3742 — inspect::reduce_to_single_string has cognitive complexity 51 (threshold 15). Drivers by points: if/else 48, boolean chains 3 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • inspect::group_array_elements (cognitive 45) ext/web/console/inspect.rs:3855 — inspect::group_array_elements has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27, loops 15, boolean chains 3 (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.
  • inspect::get_keys (cognitive 42) ext/web/console/inspect.rs:1279 — inspect::get_keys has cognitive complexity 42 (threshold 15). Drivers by points: if/else 28, loops 10, match/switch 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.
  • inspect::try_custom_inspect (cognitive 34) ext/web/console/inspect.rs:677 — inspect::try_custom_inspect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 25, match/switch 7, 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.
  • inspect::format_value (cognitive 32) ext/web/console/inspect.rs:562 — inspect::format_value has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23, boolean chains 3, loops 3, match/switch 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.
  • inspect::format_special_array (cognitive 30) ext/web/console/inspect.rs:3028 — inspect::format_special_array has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, loops 3, boolean chains 1, match/switch 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.
  • inspect::format_primitive (cognitive 27) ext/web/console/inspect.rs:1122 — inspect::format_primitive has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, loops 6, 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.
  • inspect::get_class_base (cognitive 21) ext/web/console/inspect.rs:2664 — inspect::get_class_base has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, 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.
  • inspect::get_function_base (cognitive 21) ext/web/console/inspect.rs:2764 — inspect::get_function_base has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 4 (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.
  • inspect::sort_output (cognitive 20) ext/web/console/inspect.rs:2409 — inspect::sort_output has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, loops 5, match/switch 5 (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.
  • inspect::get_user_options (cognitive 18) ext/web/console/inspect.rs:806 — inspect::get_user_options has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, match/switch 5, loops 3, 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.
D1 · Cyclomatic Complexity · inspect · ×11
  • inspect::format_raw (cyclomatic 97) ext/web/console/inspect.rs:1920 — inspect::format_raw has cyclomatic complexity 97 (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.
  • inspect::format_property (cyclomatic 32) ext/web/console/inspect.rs:3528 — inspect::format_property 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.
  • inspect::add_prototype_properties (cyclomatic 28) ext/web/console/inspect.rs:1494 — inspect::add_prototype_properties 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.
  • inspect::get_constructor_name (cyclomatic 26) ext/web/console/inspect.rs:1669 — inspect::get_constructor_name 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.
  • inspect::group_array_elements (cyclomatic 20) ext/web/console/inspect.rs:3855 — inspect::group_array_elements 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.
  • inspect::format_value (cyclomatic 19) ext/web/console/inspect.rs:562 — inspect::format_value 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.
  • inspect::try_custom_inspect (cyclomatic 18) ext/web/console/inspect.rs:677 — inspect::try_custom_inspect 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.
  • inspect::get_keys (cyclomatic 18) ext/web/console/inspect.rs:1279 — inspect::get_keys 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.
  • inspect::reduce_to_single_string (cyclomatic 18) ext/web/console/inspect.rs:3742 — inspect::reduce_to_single_string 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.
  • inspect::get_user_options (cyclomatic 16) ext/web/console/inspect.rs:806 — inspect::get_user_options 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.
  • inspect::get_function_base (cyclomatic 16) ext/web/console/inspect.rs:2764 — inspect::get_function_base has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: cli/args/flags.rs cli/args/flags.rs — cli/args/flags.rs changed 91 times in last 90 days, max complexity 80. 29 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: ext/node/polyfills/01_require.js ext/node/polyfills/01_require.js — ext/node/polyfills/01_require.js changed 76 times in last 90 days, max complexity 59. 45 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: cli/lib.rs cli/lib.rs — cli/lib.rs changed 29 times in last 90 days, max complexity 70. 6 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: libs/node_shim/lib.rs libs/node_shim/lib.rs — libs/node_shim/lib.rs changed 17 times in last 90 days, max complexity 111. 13 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: ext/node/polyfills/internal/child_process.ts ext/node/polyfills/internal/child_process.ts — ext/node/polyfills/internal/child_process.ts changed 29 times in last 90 days, max complexity 59. 14 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: ext/node/polyfills/worker_threads.ts ext/node/polyfills/worker_threads.ts — ext/node/polyfills/worker_threads.ts changed 26 times in last 90 days, max complexity 61. 9 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: ext/node/polyfills/_http_client.js ext/node/polyfills/_http_client.js — ext/node/polyfills/_http_client.js changed 18 times in last 90 days, max complexity 88. 5 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: .github/workflows/ci.ts .github/workflows/ci.ts — .github/workflows/ci.ts changed 30 times in last 90 days, max complexity 49. 3 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: libs/config/workspace/mod.rs libs/config/workspace/mod.rs — libs/config/workspace/mod.rs changed 23 times in last 90 days, max complexity 61. 10 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: cli/tools/desktop.rs cli/tools/desktop.rs — cli/tools/desktop.rs changed 26 times in last 90 days, max complexity 51. 14 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
D2 · Cognitive Complexity · desktop · ×10
  • desktop::compile_desktop (cognitive 94) cli/tools/desktop.rs:176 — desktop::compile_desktop has cognitive complexity 94 (threshold 15). Drivers by points: if/else 68, match/switch 11, loops 8, boolean chains 7 (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.
  • desktop::extract_laufey_archive (cognitive 38) cli/tools/desktop.rs:2148 — desktop::extract_laufey_archive has cognitive complexity 38 (threshold 15). Drivers by points: if/else 33, loops 4, boolean chains 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.
  • desktop::apply_desktop_config_to_flags (cognitive 29) cli/tools/desktop.rs:101 — desktop::apply_desktop_config_to_flags has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, boolean chains 7, match/switch 3 (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.
  • desktop::package_linux_app_dir (cognitive 24) cli/tools/desktop.rs:1701 — desktop::package_linux_app_dir has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, match/switch 6 (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.
  • desktop::codesign_macos_bundle (cognitive 21) cli/tools/desktop.rs:2533 — desktop::codesign_macos_bundle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, 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.
  • desktop::build_deb_data_tar (cognitive 21) cli/tools/desktop.rs:3802 — desktop::build_deb_data_tar has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 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.
  • desktop::run_desktop_hmr (cognitive 20) cli/tools/desktop.rs:1234 — desktop::run_desktop_hmr has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 3, match/switch 2 (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.
  • desktop::create_windows_msi (cognitive 19) cli/tools/desktop.rs:4218 — desktop::create_windows_msi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 7, boolean chains 2 (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.
  • desktop::package_macos_app_bundle (cognitive 18) cli/tools/desktop.rs:3007 — desktop::package_macos_app_bundle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, match/switch 7 (nesting depth added 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.
  • desktop::msi_sort_tables_by_string_id (cognitive 18) cli/tools/desktop.rs:4874 — desktop::msi_sort_tables_by_string_id has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 6, 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.
D35 · Change Coupling · Change coupling · ×10
  • Change coupling: global.rs ↔ local.rs libs/resolver/npm/managed/global.rs — `libs/resolver/npm/managed/global.rs` and `libs/resolver/npm/managed/local.rs` change together 70% of the time (51 of the 73 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. They already sit in the same directory, so if they share structure, extract the common part into one unit; otherwise break the coupling.
  • Change coupling: lib.rs ↔ cp_sync.ts ext/node/lib.rs — `ext/node/lib.rs` and `ext/node/polyfills/_fs/cp/cp_sync.ts` change together 67% of the time (8 of the 12 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. If they belong together, co-locate them; if not, break the coupling.
  • Change coupling: 99_main.js ↔ worker_bootstrap.rs runtime/js/99_main.js — `runtime/js/99_main.js` and `runtime/worker_bootstrap.rs` change together 64% of the time (38 of the 59 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. If they belong together, co-locate them; if not, break the coupling.
  • Change coupling: lib.rs ↔ cp.ts ext/node/lib.rs — `ext/node/lib.rs` and `ext/node/polyfills/_fs/cp/cp.ts` change together 62% of the time (8 of the 13 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. If they belong together, co-locate them; if not, break the coupling.
  • Change coupling: child_process.ts ↔ ipc.rs ext/node/polyfills/internal/child_process.ts — `ext/node/polyfills/internal/child_process.ts` and `ext/process/ipc.rs` change together 60% of the time (6 of the 10 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. If they belong together, co-locate them; if not, break the coupling.
  • Change coupling: snapshot_info.rs ↔ worker.rs runtime/snapshot_info.rs — `runtime/snapshot_info.rs` and `runtime/worker.rs` change together 58% of the time (18 of the 31 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. They already sit in the same directory, so if they share structure, extract the common part into one unit; otherwise break the coupling.
  • Change coupling: lib.rs ↔ promises.ts ext/node/lib.rs — `ext/node/lib.rs` and `ext/node/polyfills/internal/fs/promises.ts` change together 58% of the time (11 of the 19 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. If they belong together, co-locate them; if not, break the coupling.
  • Change coupling: snapshot.rs ↔ worker.rs runtime/snapshot.rs — `runtime/snapshot.rs` and `runtime/worker.rs` change together 56% of the time (37 of the 66 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. They already sit in the same directory, so if they share structure, extract the common part into one unit; otherwise break the coupling.
  • Change coupling: js.rs ↔ worker.rs runtime/js.rs — `runtime/js.rs` and `runtime/worker.rs` change together 55% of the time (11 of the 20 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. They already sit in the same directory, so if they share structure, extract the common part into one unit; otherwise break the coupling.
  • Change coupling: js.rs ↔ web_worker.rs runtime/js.rs — `runtime/js.rs` and `runtime/web_worker.rs` change together 55% of the time (11 of the 20 commits that touched the less-changed of the two, renames followed) with no explicit dependency — a hidden/logical coupling. They already sit in the same directory, so if they share structure, extract the common part into one unit; otherwise break the coupling.
D2 · Cognitive Complexity · tsc · ×9
  • tsc::display_parts_to_string (cognitive 67) cli/lsp/tsc.rs:2005 — tsc::display_parts_to_string has cognitive complexity 67 (threshold 15). Drivers by points: if/else 58, loops 4, boolean chains 3, match/switch 2 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tsc::parse_code_actions (cognitive 31) cli/lsp/tsc.rs:3622 — tsc::parse_code_actions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, loops 5 (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.
  • tsc::get_parameters_from_parts (cognitive 31) cli/lsp/tsc.rs:3919 — tsc::get_parameters_from_parts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, boolean chains 5, 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.
  • tsc::load_for_tsc (cognitive 30) cli/tsc/mod.rs:1140 — tsc::load_for_tsc has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, match/switch 8 (nesting depth added 12). Of this number, 29 points are the body's own statements and 1 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tsc::op_script_names (cognitive 26) cli/lsp/tsc.rs:5589 — tsc::op_script_names has cognitive complexity 26 (threshold 15). Drivers by points: loops 14, if/else 11, boolean chains 1 (nesting depth added 13). 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.
  • tsc::resolve_specifier_for_tsc (cognitive 26) cli/tsc/mod.rs:997 — tsc::resolve_specifier_for_tsc has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13, match/switch 9, boolean chains 4 (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.
  • tsc::get_tag_documentation (cognitive 24) cli/lsp/tsc.rs:1621 — tsc::get_tag_documentation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tsc::find_mergeable_named_import (cognitive 18) cli/lsp/tsc.rs:3749 — tsc::find_mergeable_named_import has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tsc::resolve_graph_specifier_types (cognitive 17) cli/tsc/mod.rs:695 — tsc::resolve_graph_specifier_types has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 14, if/else 3 (nesting depth added 8). 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 · subtle_import_key · ×9
  • subtle_import_key::import_key_ec (cognitive 52) ext/crypto/subtle_import_key.rs:1075 — subtle_import_key::import_key_ec has cognitive complexity 52 (threshold 15). Drivers by points: if/else 34, match/switch 9, loops 6, boolean chains 3 (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.
  • subtle_import_key::import_key_rsa (cognitive 50) ext/crypto/subtle_import_key.rs:340 — subtle_import_key::import_key_rsa has cognitive complexity 50 (threshold 15). Drivers by points: if/else 36, loops 6, match/switch 5, boolean chains 3 (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.
  • subtle_import_key::import_key_okp (cognitive 45) ext/crypto/subtle_import_key.rs:1374 — subtle_import_key::import_key_okp has cognitive complexity 45 (threshold 15). Drivers by points: if/else 36, loops 6, boolean chains 2, match/switch 1 (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.
  • subtle_import_key::import_key_kmac (cognitive 38) ext/crypto/subtle_import_key.rs:1665 — subtle_import_key::import_key_kmac has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26, loops 6, boolean chains 5, match/switch 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.
  • subtle_import_key::import_key_ml_kem (cognitive 32) ext/crypto/subtle_import_key.rs:645 — subtle_import_key::import_key_ml_kem has cognitive complexity 32 (threshold 15). Drivers by points: if/else 28, match/switch 4 (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.
  • subtle_import_key::import_key_ml_dsa (cognitive 23) ext/crypto/subtle_import_key.rs:786 — subtle_import_key::import_key_ml_dsa has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, match/switch 4 (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.
  • subtle_import_key::import_key_slh_dsa (cognitive 20) ext/crypto/subtle_import_key.rs:909 — subtle_import_key::import_key_slh_dsa has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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.
  • subtle_import_key::validate_jwk_akp (cognitive 17) ext/crypto/subtle_import_key.rs:1031 — subtle_import_key::validate_jwk_akp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, 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.
  • subtle_import_key::validate_jwk_oct (cognitive 17) ext/crypto/subtle_import_key.rs:1844 — subtle_import_key::validate_jwk_oct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, 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 · tty · ×8
  • tty::poll_tty_handle (cognitive 204) libs/core/uv_compat/tty.rs:2176 — tty::poll_tty_handle has cognitive complexity 204 (threshold 15). Drivers by points: if/else 142, match/switch 34, loops 15, boolean chains 13 (nesting depth added 138). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tty::tty_try_read_raw (cognitive 61) libs/core/uv_compat/tty.rs:1040 — tty::tty_try_read_raw has cognitive complexity 61 (threshold 15). Drivers by points: if/else 47, match/switch 6, boolean chains 5, loops 3 (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.
  • tty::uv_tty_init (cognitive 50) libs/core/uv_compat/tty.rs:1251 — tty::uv_tty_init has cognitive complexity 50 (threshold 15). Drivers by points: if/else 39, match/switch 7, boolean chains 3, 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.
  • tty::uv_tty_set_mode (cognitive 31) libs/core/uv_compat/tty.rs:1506 — tty::uv_tty_set_mode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21, loops 4, boolean chains 3, match/switch 3 (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.
  • tty::write_tty (cognitive 24) libs/core/uv_compat/tty.rs:1825 — tty::write_tty has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, match/switch 6, loops 4, 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.
  • tty::select_thread_main (cognitive 22) libs/core/uv_compat/tty.rs:2874 — tty::select_thread_main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tty::op_set_raw (cognitive 21) runtime/ops/tty.rs:121 — tty::op_set_raw has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, match/switch 2, boolean chains 1 (nesting depth added 6). Of this number, 20 points are the body's own statements and 1 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tty::tty_try_write (cognitive 17) libs/core/uv_compat/tty.rs:792 — tty::tty_try_write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, match/switch 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 · GraphDependencyResolver · ×8
  • GraphDependencyResolver::resolve_peers_of_node (cognitive 129) libs/npm/resolution/graph.rs:1846 — GraphDependencyResolver::resolve_peers_of_node has cognitive complexity 129 (threshold 15). Drivers by points: if/else 78, loops 38, boolean chains 7, match/switch 6 (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GraphDependencyResolver::run_dedup_pass (cognitive 83) libs/npm/resolution/graph.rs:3018 — GraphDependencyResolver::run_dedup_pass has cognitive complexity 83 (threshold 15). Drivers by points: if/else 49, loops 30, boolean chains 4 (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.
  • GraphDependencyResolver::find_peers_cache_hit_inner (cognitive 43) libs/npm/resolution/graph.rs:2332 — GraphDependencyResolver::find_peers_cache_hit_inner has cognitive complexity 43 (threshold 15). Drivers by points: if/else 32, loops 7, match/switch 3, 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.
  • GraphDependencyResolver::drain_pending_parallel (cognitive 39) libs/npm/resolution/graph.rs:2440 — GraphDependencyResolver::drain_pending_parallel has cognitive complexity 39 (threshold 15). Drivers by points: if/else 27, loops 9, match/switch 2, boolean chains 1 (nesting depth added 22). Of this number, 29 points are the body's own statements and 10 belong to 2 function items declared inside it. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GraphDependencyResolver::apply_dedup_mappings (cognitive 26) libs/npm/resolution/graph.rs:1776 — GraphDependencyResolver::apply_dedup_mappings has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, loops 10 (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.
  • GraphDependencyResolver::auto_install_missing_peers (cognitive 25) libs/npm/resolution/graph.rs:1479 — GraphDependencyResolver::auto_install_missing_peers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, loops 5, match/switch 4, boolean chains 3 (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.
  • GraphDependencyResolver::add_peer_deps_to_path (cognitive 21) libs/npm/resolution/graph.rs:2810 — GraphDependencyResolver::add_peer_deps_to_path has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9, loops 6, match/switch 6 (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.
  • GraphDependencyResolver::dedup_dep_paths (cognitive 17) libs/npm/resolution/graph.rs:1652 — GraphDependencyResolver::dedup_dep_paths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 6, 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 · convert · ×7
  • convert::validate_permission_args (cognitive 51) libs/cli_parser/src/convert.rs:1132 — convert::validate_permission_args has cognitive complexity 51 (threshold 15). Drivers by points: if/else 31, loops 14, boolean chains 6 (nesting depth added 23). Of this number, 45 points are the body's own statements and 6 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • convert::apply_node_options (cognitive 40) libs/cli_parser/src/convert.rs:2872 — convert::apply_node_options has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17, loops 9, match/switch 9, boolean chains 5 (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.
  • convert::serialize_command_def (cognitive 24) libs/cli_parser/src/convert.rs:3145 — convert::serialize_command_def has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 3, 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.
  • convert::default_parse (cognitive 23) libs/cli_parser/src/convert.rs:225 — convert::default_parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 5 (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.
  • convert::test_parse (cognitive 22) libs/cli_parser/src/convert.rs:1541 — convert::test_parse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, match/switch 10, 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.
  • convert::escape_and_split_commas (cognitive 19) libs/cli_parser/src/convert.rs:1266 — convert::escape_and_split_commas has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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.
  • convert::install_parse (cognitive 16) libs/cli_parser/src/convert.rs:2139 — convert::install_parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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 · WasiContext · ×7
  • WasiContext::fd_read (cognitive 39) ext/node/ops/wasi.rs:829 — WasiContext::fd_read has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23, match/switch 10, loops 6 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WasiContext::poll_oneoff (cognitive 38) ext/node/ops/wasi.rs:1919 — WasiContext::poll_oneoff has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17, match/switch 16, boolean chains 3, loops 2 (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.
  • WasiContext::fd_write (cognitive 28) ext/node/ops/wasi.rs:762 — WasiContext::fd_write has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, loops 8, match/switch 6 (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.
  • WasiContext::path_open (cognitive 25) ext/node/ops/wasi.rs:1378 — WasiContext::path_open has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14, match/switch 7, boolean chains 4 (nesting depth added 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.
  • WasiContext::fd_pread (cognitive 19) ext/node/ops/wasi.rs:2138 — WasiContext::fd_pread has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, match/switch 6, loops 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.
  • WasiContext::fd_readdir (cognitive 16) ext/node/ops/wasi.rs:1291 — WasiContext::fd_readdir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 6, boolean chains 1, 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.
  • WasiContext::fd_pwrite (cognitive 16) ext/node/ops/wasi.rs:2203 — WasiContext::fd_pwrite has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, match/switch 7, 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.
D1 · Cyclomatic Complexity · subtle_import_key · ×6
  • subtle_import_key::import_key_ec (cyclomatic 38) ext/crypto/subtle_import_key.rs:1075 — subtle_import_key::import_key_ec 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.
  • subtle_import_key::import_key_rsa (cyclomatic 35) ext/crypto/subtle_import_key.rs:340 — subtle_import_key::import_key_rsa 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.
  • subtle_import_key::import_key_okp (cyclomatic 23) ext/crypto/subtle_import_key.rs:1374 — subtle_import_key::import_key_okp 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.
  • subtle_import_key::import_key_ml_kem (cyclomatic 21) ext/crypto/subtle_import_key.rs:645 — subtle_import_key::import_key_ml_kem 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.
  • subtle_import_key::import_key_kmac (cyclomatic 21) ext/crypto/subtle_import_key.rs:1665 — subtle_import_key::import_key_kmac 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.
  • subtle_import_key::import_key_ml_dsa (cyclomatic 17) ext/crypto/subtle_import_key.rs:786 — subtle_import_key::import_key_ml_dsa 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.
D2 · Cognitive Complexity · pipe · ×6
  • pipe::poll_pipe_handle (cognitive 208) libs/core/uv_compat/pipe.rs:1715 — pipe::poll_pipe_handle has cognitive complexity 208 (threshold 15). Drivers by points: if/else 168, match/switch 21, boolean chains 12, loops 7 (nesting depth added 116). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • pipe::poll_pipe_handle (cognitive 146) libs/core/uv_compat/pipe.rs:1360 — pipe::poll_pipe_handle has cognitive complexity 146 (threshold 15). Drivers by points: if/else 112, match/switch 19, boolean chains 14, loops 1 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • pipe::uv_pipe_open (cognitive 35) libs/core/uv_compat/pipe.rs:324 — pipe::uv_pipe_open has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22, match/switch 13 (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.
  • pipe::try_write_pipe (cognitive 22) libs/core/uv_compat/pipe.rs:1085 — pipe::try_write_pipe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, match/switch 8, boolean chains 1 (nesting depth added 7). 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.
  • pipe::uv_pipe_connect (cognitive 20) libs/core/uv_compat/pipe.rs:946 — pipe::uv_pipe_connect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, 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.
  • pipe::uv_pipe_connect (cognitive 17) libs/core/uv_compat/pipe.rs:726 — pipe::uv_pipe_connect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (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 · http_next · ×6
  • http_next::serve_http11_raw (cognitive 155) ext/http/http_next.rs:4357 — http_next::serve_http11_raw has cognitive complexity 155 (threshold 15). Drivers by points: if/else 111, match/switch 29, boolean chains 14, loops 1 (nesting depth added 99). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • http_next::write_h1_stream_response (cognitive 32) ext/http/http_next.rs:4029 — http_next::write_h1_stream_response has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18, match/switch 9, boolean chains 4, 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.
  • http_next::write_h1_stream_response_shared (cognitive 28) ext/http/http_next.rs:4170 — http_next::write_h1_stream_response_shared has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, match/switch 9, boolean chains 4, 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.
  • http_next::op_http_get_request_headers (cognitive 22) ext/http/http_next.rs:2360 — http_next::op_http_get_request_headers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, loops 3 (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.
  • http_next::is_normal_close (cognitive 19) ext/http/http_next.rs:5398 — http_next::is_normal_close has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (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.
  • http_next::write_h1_flat_response (cognitive 18) ext/http/http_next.rs:3554 — http_next::write_h1_flat_response has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, match/switch 5, 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 · error_fmt · ×6
  • error_fmt::format_error (cognitive 121) ext/web/console/error_fmt.rs:687 — error_fmt::format_error has cognitive complexity 121 (threshold 15). Drivers by points: if/else 95, match/switch 13, boolean chains 7, loops 6 (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • error_fmt::get_duplicate_error_frame_ranges (cognitive 71) ext/web/console/error_fmt.rs:264 — error_fmt::get_duplicate_error_frame_ranges has cognitive complexity 71 (threshold 15). Drivers by points: if/else 52, loops 14, boolean chains 3, match/switch 2 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • error_fmt::improve_stack (cognitive 30) ext/web/console/error_fmt.rs:131 — error_fmt::improve_stack has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, match/switch 6, boolean chains 4 (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.
  • error_fmt::match_null_proto_error_start (cognitive 23) ext/web/console/error_fmt.rs:202 — error_fmt::match_null_proto_error_start has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 4 (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.
  • error_fmt::get_stack_frames (cognitive 20) ext/web/console/error_fmt.rs:413 — error_fmt::get_stack_frames has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 2, 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.
  • error_fmt::identical_sequence_range (cognitive 16) ext/web/console/error_fmt.rs:390 — error_fmt::identical_sequence_range has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 5, 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 · tsconfig_gen · ×6
  • tsconfig_gen::generate_npm_paths (cognitive 50) cli/tsc/tsconfig_gen.rs:1174 — tsconfig_gen::generate_npm_paths has cognitive complexity 50 (threshold 15). Drivers by points: if/else 37, loops 6, match/switch 6, boolean chains 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.
  • tsconfig_gen::build_tsconfig (cognitive 46) cli/tsc/tsconfig_gen.rs:758 — tsconfig_gen::build_tsconfig has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19, match/switch 18, loops 7, boolean chains 2 (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.
  • tsconfig_gen::generate_jsr_paths (cognitive 46) cli/tsc/tsconfig_gen.rs:1314 — tsconfig_gen::generate_jsr_paths has cognitive complexity 46 (threshold 15). Drivers by points: if/else 32, loops 7, match/switch 7 (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.
  • tsconfig_gen::strip_top_level_type_decls (cognitive 40) cli/tsc/tsconfig_gen.rs:623 — tsconfig_gen::strip_top_level_type_decls has cognitive complexity 40 (threshold 15). Drivers by points: loops 17, if/else 11, boolean chains 6, match/switch 6 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tsconfig_gen::strip_declare_namespace (cognitive 23) cli/tsc/tsconfig_gen.rs:696 — tsconfig_gen::strip_declare_namespace has cognitive complexity 23 (threshold 15). Drivers by points: loops 11, if/else 6, match/switch 5, boolean chains 1 (nesting depth added 15). 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.
  • tsconfig_gen::build_check_root_overlay (cognitive 16) cli/tsc/tsconfig_gen.rs:50 — tsconfig_gen::build_check_root_overlay has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 3, boolean chains 1, match/switch 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 · NodeResolver · ×6
  • NodeResolver::resolve_package_target_string (cognitive 47) libs/node_resolver/resolution.rs:1399 — NodeResolver::resolve_package_target_string has cognitive complexity 47 (threshold 15). Drivers by points: if/else 29, match/switch 16, boolean chains 2 (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.
  • NodeResolver::finalize_resolution (cognitive 32) libs/node_resolver/resolution.rs:802 — NodeResolver::finalize_resolution has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, match/switch 6, boolean chains 3, loops 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.
  • NodeResolver::resolve_package_target_inner (cognitive 28) libs/node_resolver/resolution.rs:1642 — NodeResolver::resolve_package_target_inner has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15, match/switch 7, loops 4, boolean chains 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.
  • NodeResolver::legacy_main_resolve (cognitive 28) libs/node_resolver/resolution.rs:2239 — NodeResolver::legacy_main_resolve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, match/switch 5, loops 2, 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.
  • NodeResolver::path_to_declaration_path (cognitive 20) libs/node_resolver/resolution.rs:1223 — NodeResolver::path_to_declaration_path has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to one function item declared inside it (probe_extensions). 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.
  • NodeResolver::package_exports_resolve_internal (cognitive 16) libs/node_resolver/resolution.rs:1788 — NodeResolver::package_exports_resolve_internal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 2, match/switch 2, 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.
D1 · Cyclomatic Complexity · process · ×5
  • process::search_path_join_test (cyclomatic 29) runtime/subprocess_windows/src/process.rs:837 — process::search_path_join_test 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.
  • process::search_path (cyclomatic 29) runtime/subprocess_windows/src/process.rs:971 — process::search_path 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.
  • process::uv__kill (cyclomatic 28) runtime/subprocess_windows/src/process.rs:1111 — process::uv__kill 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.
  • process::spawn (cyclomatic 24) runtime/subprocess_windows/src/process.rs:521 — process::spawn has cyclomatic complexity 24 (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.
  • process::append_bat_arg (cyclomatic 16) runtime/subprocess_windows/src/process.rs:1516 — process::append_bat_arg 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 · console · ×5
  • console::apply_options (cognitive 74) ext/web/console/mod.rs:278 — console::apply_options has cognitive complexity 74 (threshold 15). Drivers by points: if/else 52, loops 14, match/switch 6, boolean chains 2 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • console::inspect_args_impl (cognitive 69) ext/web/console/mod.rs:677 — console::inspect_args_impl has cognitive complexity 69 (threshold 15). Drivers by points: if/else 59, match/switch 5, loops 3, 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.
  • console::js_parse_float (cognitive 32) ext/web/console/mod.rs:547 — console::js_parse_float has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16, boolean chains 10, loops 6 (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.
  • console::filter_destructive_ansi (cognitive 24) cli/util/console.rs:38 — console::filter_destructive_ansi has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9, boolean chains 5, loops 5, match/switch 5 (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.
  • console::op_console_quote_string (cognitive 17) ext/web/console/mod.rs:937 — console::op_console_quote_string has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 4 (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 · process · ×5
  • process::search_path (cognitive 60) runtime/subprocess_windows/src/process.rs:971 — process::search_path has cognitive complexity 60 (threshold 15). Drivers by points: if/else 40, boolean chains 10, loops 10 (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.
  • process::uv__kill (cognitive 56) runtime/subprocess_windows/src/process.rs:1111 — process::uv__kill has cognitive complexity 56 (threshold 15). Drivers by points: if/else 35, loops 14, boolean chains 4, match/switch 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.
  • process::spawn (cognitive 39) runtime/subprocess_windows/src/process.rs:521 — process::spawn has cognitive complexity 39 (threshold 15). Drivers by points: if/else 34, boolean chains 3, loops 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.
  • process::search_path_join_test (cognitive 34) runtime/subprocess_windows/src/process.rs:837 — process::search_path_join_test has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18, boolean chains 16 (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.
  • process::append_bat_arg (cognitive 22) runtime/subprocess_windows/src/process.rs:1516 — process::append_bat_arg has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, boolean chains 5, 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 · Workspace · ×5
  • Workspace::split_cli_args_by_deno_json_folder (cognitive 59) libs/config/workspace/mod.rs:1625 — Workspace::split_cli_args_by_deno_json_folder has cognitive complexity 59 (threshold 15). Drivers by points: if/else 32, loops 15, match/switch 7, boolean chains 5 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Workspace::diagnostics::check_all_configs (cognitive 49) libs/config/workspace/mod.rs:1320 — Workspace::diagnostics::check_all_configs has cognitive complexity 49 (threshold 15). Drivers by points: if/else 33, loops 9, boolean chains 7 (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.
  • Workspace::config_folders_sorted_by_dependencies (cognitive 27) libs/config/workspace/mod.rs:713 — Workspace::config_folders_sorted_by_dependencies has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9, loops 7, match/switch 6, boolean chains 5 (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.
  • Workspace::diagnostics (cognitive 24) libs/config/workspace/mod.rs:1203 — Workspace::diagnostics has cognitive complexity 24 (threshold 15). Drivers by points: if/else 69, boolean chains 13, loops 11 (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.
  • Workspace::diagnostics::check_member_diagnostics (cognitive 18) libs/config/workspace/mod.rs:1204 — Workspace::diagnostics::check_member_diagnostics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 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 · completions · ×5
  • completions::get_candidates (cognitive 53) libs/cli_parser/src/completions.rs:379 — completions::get_candidates has cognitive complexity 53 (threshold 15). Drivers by points: if/else 42, boolean chains 7, loops 4 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • completions::get_import_completions (cognitive 36) cli/lsp/completions.rs:184 — completions::get_import_completions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21, match/switch 15 (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.
  • completions::generate_fish (cognitive 21) libs/cli_parser/src/completions.rs:179 — completions::generate_fish has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • completions::generate_zsh (cognitive 20) libs/cli_parser/src/completions.rs:110 — completions::generate_zsh has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 5, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • completions::get_jsr_completions (cognitive 16) cli/lsp/completions.rs:551 — completions::get_jsr_completions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 3, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Inner · ×5
  • Inner::code_action (cognitive 49) cli/lsp/language_server.rs:2151 — Inner::code_action has cognitive complexity 49 (threshold 15). Drivers by points: if/else 35, match/switch 8, boolean chains 5, loops 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.
  • Inner::walk_workspace (cognitive 46) cli/lsp/language_server.rs:1066 — Inner::walk_workspace has cognitive complexity 46 (threshold 15). Drivers by points: if/else 29, loops 9, boolean chains 4, match/switch 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.
  • Inner::code_action_resolve (cognitive 37) cli/lsp/language_server.rs:2451 — Inner::code_action_resolve has cognitive complexity 37 (threshold 15). Drivers by points: if/else 34, match/switch 2, 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.
  • Inner::did_change_watched_files (cognitive 24) cli/lsp/language_server.rs:1670 — Inner::did_change_watched_files has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, boolean chains 6, match/switch 5, 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.
  • Inner::initialize (cognitive 17) cli/lsp/language_server.rs:933 — Inner::initialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4 (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 · js_native_api · ×5
  • js_native_api::napi_define_properties (cognitive 37) ext/napi/js_native_api.rs:773 — js_native_api::napi_define_properties has cognitive complexity 37 (threshold 15). Drivers by points: if/else 33, match/switch 2, boolean chains 1, 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.
  • js_native_api::napi_define_class (cognitive 27) ext/napi/js_native_api.rs:242 — js_native_api::napi_define_class has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, loops 3, match/switch 3, 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.
  • js_native_api::create_external_string (cognitive 19) ext/napi/js_native_api.rs:1643 — js_native_api::create_external_string has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • js_native_api::napi_get_typedarray_info (cognitive 18) ext/napi/js_native_api.rs:3802 — js_native_api::napi_get_typedarray_info has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (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.
  • js_native_api::node_api_create_object_with_properties (cognitive 17) ext/napi/js_native_api.rs:1019 — js_native_api::node_api_create_object_with_properties has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · local · ×5
  • local::url_to_local_sub_path (cognitive 32) libs/cache_dir/local.rs:559 — local::url_to_local_sub_path has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17, boolean chains 7, match/switch 7, loops 1 (nesting depth added 5). Most of this is not in the body itself: 12 of the 32 points are its own statements and the rest belongs to 5 function items declared inside it (short_hash, should_hash_part, has_forbidden_chars, …). 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.
  • local::sync_types_command (cognitive 31) cli/tools/installer/local.rs:251 — local::sync_types_command has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16, match/switch 6, loops 5, 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.
  • local::categorize_installed_npm_deps (cognitive 28) cli/tools/installer/local.rs:52 — local::categorize_installed_npm_deps has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16, loops 6, match/switch 6 (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.
  • local::remove_stale_member_symlinks (cognitive 24) libs/npm_installer/local.rs:1781 — local::remove_stale_member_symlinks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, loops 5, boolean chains 2, match/switch 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.
  • local::cleanup_unused_packages (cognitive 22) libs/npm_installer/local.rs:2104 — local::cleanup_unused_packages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 4, 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.
D2 · Cognitive Complexity · ByonmNpmResolver · ×5
  • ByonmNpmResolver::resolve_folder_in_root_node_modules (cognitive 30) libs/resolver/npm/byonm.rs:347 — ByonmNpmResolver::resolve_folder_in_root_node_modules has cognitive complexity 30 (threshold 15). Drivers by points: if/else 29, 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.
  • ByonmNpmResolver::resolve_pkg_json_and_alias_for_req (cognitive 25) libs/resolver/npm/byonm.rs:213 — ByonmNpmResolver::resolve_pkg_json_and_alias_for_req has cognitive complexity 25 (threshold 15). Drivers by points: if/else 32, boolean chains 5, loops 5, match/switch 3 (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.
  • ByonmNpmResolver::resolve_pkg_json_and_alias_for_req::resolve_alias_from_pkg_json (cognitive 20) libs/resolver/npm/byonm.rs:221 — ByonmNpmResolver::resolve_pkg_json_and_alias_for_req::resolve_alias_from_pkg_json has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, match/switch 3, boolean chains 2, 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.
  • ByonmNpmResolver::resolve_package_folder_from_package::inner (cognitive 18) libs/resolver/npm/byonm.rs:443 — ByonmNpmResolver::resolve_package_folder_from_package::inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, 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.
  • ByonmNpmResolver::resolve_pkg_folder_from_deno_module_req (cognitive 16) libs/resolver/npm/byonm.rs:132 — ByonmNpmResolver::resolve_pkg_folder_from_deno_module_req has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, loops 1, match/switch 1 (nesting depth added 6). Of this number, 9 points are the body's own statements and 7 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · global · ×5
  • global::setup_config_dir (cognitive 24) cli/tools/installer/global.rs:422 — global::setup_config_dir has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 2, loops 2 (nesting depth added 5). Of this number, 22 points are the body's own statements and 2 belong to one function item declared inside it. 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.
  • global::resolve_shim_data (cognitive 24) cli/tools/installer/global.rs:906 — global::resolve_shim_data has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, match/switch 4, loops 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.
  • global::install_global (cognitive 22) cli/tools/installer/global.rs:55 — global::install_global has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, loops 6, match/switch 3, boolean chains 2 (nesting depth added 7). 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.
  • global::rewrite_relative_import_map_paths (cognitive 22) cli/tools/installer/global.rs:713 — global::rewrite_relative_import_map_paths has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, boolean chains 4, loops 3 (nesting depth added 7). Of this number, 12 points are the body's own statements and 10 belong to 3 function items declared inside it. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • global::uninstall (cognitive 18) cli/tools/installer/global.rs:238 — global::uninstall has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, loops 6, boolean chains 2, match/switch 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.
D1 · Cyclomatic Complexity · tty · ×4
  • tty::poll_tty_handle (cyclomatic 67) libs/core/uv_compat/tty.rs:2176 — tty::poll_tty_handle 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.
  • tty::uv_tty_init (cyclomatic 29) libs/core/uv_compat/tty.rs:1251 — tty::uv_tty_init 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.
  • tty::tty_try_read_raw (cyclomatic 28) libs/core/uv_compat/tty.rs:1040 — tty::tty_try_read_raw 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.
  • tty::uv_tty_set_mode (cyclomatic 25) libs/core/uv_compat/tty.rs:1506 — tty::uv_tty_set_mode 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 · http_next · ×4
  • http_next::serve_http11_raw (cyclomatic 58) ext/http/http_next.rs:4357 — http_next::serve_http11_raw has cyclomatic complexity 58 (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.
  • http_next::write_h1_stream_response (cyclomatic 21) ext/http/http_next.rs:4029 — http_next::write_h1_stream_response 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.
  • http_next::write_h1_stream_response_shared (cyclomatic 19) ext/http/http_next.rs:4170 — http_next::write_h1_stream_response_shared 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.
  • http_next::write_h1_flat_response (cyclomatic 16) ext/http/http_next.rs:3554 — http_next::write_h1_flat_response 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.
D1 · Cyclomatic Complexity · GraphDependencyResolver · ×4
  • GraphDependencyResolver::resolve_peers_of_node (cyclomatic 56) libs/npm/resolution/graph.rs:1846 — GraphDependencyResolver::resolve_peers_of_node has cyclomatic complexity 56 (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.
  • GraphDependencyResolver::run_dedup_pass (cyclomatic 41) libs/npm/resolution/graph.rs:3018 — GraphDependencyResolver::run_dedup_pass has cyclomatic complexity 41 (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.
  • GraphDependencyResolver::find_peers_cache_hit_inner (cyclomatic 19) libs/npm/resolution/graph.rs:2332 — GraphDependencyResolver::find_peers_cache_hit_inner 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.
  • GraphDependencyResolver::drain_pending_parallel (cyclomatic 16) libs/npm/resolution/graph.rs:2440 — GraphDependencyResolver::drain_pending_parallel has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function items declared inside it. 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 · console · ×4
  • console::apply_options (cyclomatic 48) ext/web/console/mod.rs:278 — console::apply_options has cyclomatic complexity 48 (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.
  • console::inspect_args_impl (cyclomatic 25) ext/web/console/mod.rs:677 — console::inspect_args_impl 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.
  • console::js_parse_float (cyclomatic 23) ext/web/console/mod.rs:547 — console::js_parse_float 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.
  • console::filter_destructive_ansi (cyclomatic 20) cli/util/console.rs:38 — console::filter_destructive_ansi has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Flags · ×4
  • Flags::to_permission_args (cyclomatic 40) cli/args/flags.rs:283 — Flags::to_permission_args has cyclomatic complexity 40 (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.
  • Flags::parse (cyclomatic 22) libs/ops/op2/config.rs:236 — Flags::parse 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.
  • Flags::otel_config (cyclomatic 18) cli/args/flags.rs:513 — Flags::otel_config has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Flags::config_path_args (cyclomatic 16) cli/args/flags.rs:586 — Flags::config_path_args has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 2 function items declared inside it. 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 · KeyObjectHandle · ×4
  • KeyObjectHandle::new_asymmetric_private_key_from_js (cyclomatic 39) ext/node_crypto/keys.rs:991 — KeyObjectHandle::new_asymmetric_private_key_from_js has cyclomatic complexity 39 (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.
  • KeyObjectHandle::new_asymmetric_public_key_from_js (cyclomatic 28) ext/node_crypto/keys.rs:1545 — KeyObjectHandle::new_asymmetric_public_key_from_js has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • KeyObjectHandle::verify_prehashed (cyclomatic 23) ext/node_crypto/sign.rs:496 — KeyObjectHandle::verify_prehashed 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.
  • KeyObjectHandle::sign_prehashed (cyclomatic 20) ext/node_crypto/sign.rs:302 — KeyObjectHandle::sign_prehashed has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Workspace · ×4
  • Workspace::diagnostics::check_all_configs (cyclomatic 28) libs/config/workspace/mod.rs:1320 — Workspace::diagnostics::check_all_configs 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.
  • Workspace::split_cli_args_by_deno_json_folder (cyclomatic 22) libs/config/workspace/mod.rs:1625 — Workspace::split_cli_args_by_deno_json_folder 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.
  • Workspace::config_folders_sorted_by_dependencies (cyclomatic 21) libs/config/workspace/mod.rs:713 — Workspace::config_folders_sorted_by_dependencies has cyclomatic complexity 21 (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.
  • Workspace::diagnostics::check_member_diagnostics (cyclomatic 19) libs/config/workspace/mod.rs:1204 — Workspace::diagnostics::check_member_diagnostics 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 · Inner · ×4
  • Inner::code_action (cyclomatic 26) cli/lsp/language_server.rs:2151 — Inner::code_action 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.
  • Inner::walk_workspace (cyclomatic 24) cli/lsp/language_server.rs:1066 — Inner::walk_workspace has cyclomatic complexity 24 (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.
  • Inner::did_change_watched_files (cyclomatic 21) cli/lsp/language_server.rs:1670 — Inner::did_change_watched_files has cyclomatic complexity 21 (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.
  • Inner::initialize (cyclomatic 16) cli/lsp/language_server.rs:933 — Inner::initialize 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 · WasiContext · ×4
  • WasiContext::poll_oneoff (cyclomatic 26) ext/node/ops/wasi.rs:1919 — WasiContext::poll_oneoff has cyclomatic complexity 26 (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.
  • WasiContext::path_open (cyclomatic 20) ext/node/ops/wasi.rs:1378 — WasiContext::path_open 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.
  • WasiContext::fd_read (cyclomatic 18) ext/node/ops/wasi.rs:829 — WasiContext::fd_read 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.
  • WasiContext::fd_write (cyclomatic 17) ext/node/ops/wasi.rs:762 — WasiContext::fd_write 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 · tsc · ×4
  • tsc::resolve_specifier_for_tsc (cyclomatic 21) cli/tsc/mod.rs:997 — tsc::resolve_specifier_for_tsc 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.
  • tsc::display_parts_to_string (cyclomatic 20) cli/lsp/tsc.rs:2005 — tsc::display_parts_to_string 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.
  • tsc::get_parameters_from_parts (cyclomatic 19) cli/lsp/tsc.rs:3919 — tsc::get_parameters_from_parts 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.
  • tsc::load_for_tsc (cyclomatic 19) cli/tsc/mod.rs:1140 — tsc::load_for_tsc has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function item declared inside it. 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 · subtle_export_key · ×4
  • subtle_export_key::export_ec (cyclomatic 19) ext/crypto/subtle_export_key.rs:510 — subtle_export_key::export_ec 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.
  • subtle_export_key::jwk_alg_for_symmetric (cyclomatic 18) ext/crypto/subtle_export_key.rs:332 — subtle_export_key::jwk_alg_for_symmetric 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.
  • subtle_export_key::export_okp (cyclomatic 18) ext/crypto/subtle_export_key.rs:613 — subtle_export_key::export_okp 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.
  • subtle_export_key::jwk_to_object (cyclomatic 17) ext/crypto/subtle_export_key.rs:157 — subtle_export_key::jwk_to_object 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.
D2 · Cognitive Complexity · DenoCompileBinaryWriter · ×4
  • DenoCompileBinaryWriter::write_standalone_binary (cognitive 109) cli/standalone/binary.rs:565 — DenoCompileBinaryWriter::write_standalone_binary has cognitive complexity 109 (threshold 15). Drivers by points: if/else 63, match/switch 31, loops 13, boolean chains 2 (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.
  • DenoCompileBinaryWriter::build_vfs_consolidating_global_npm_cache (cognitive 34) cli/standalone/binary.rs:1397 — DenoCompileBinaryWriter::build_vfs_consolidating_global_npm_cache has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20, loops 9, match/switch 4, 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.
  • DenoCompileBinaryWriter::fill_npm_vfs (cognitive 28) cli/standalone/binary.rs:1303 — DenoCompileBinaryWriter::fill_npm_vfs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, loops 8, boolean chains 1, match/switch 1 (nesting depth added 15). Of this number, 27 points are the body's own statements and 1 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DenoCompileBinaryWriter::fill_bundle_native_addon_vfs (cognitive 16) cli/standalone/binary.rs:1217 — DenoCompileBinaryWriter::fill_bundle_native_addon_vfs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 3, loops 2, match/switch 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 · parse · ×4
  • parse::parse_args (cognitive 96) libs/cli_parser/src/parse.rs:112 — parse::parse_args has cognitive complexity 96 (threshold 15). Drivers by points: if/else 60, loops 22, boolean chains 10, match/switch 4 (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.
  • parse::parse_long_flag (cognitive 31) libs/cli_parser/src/parse.rs:352 — parse::parse_long_flag has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17, boolean chains 6, loops 4, match/switch 4 (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.
  • parse::resolve_subcommand (cognitive 29) libs/cli_parser/src/parse.rs:48 — parse::resolve_subcommand has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, boolean chains 5, 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.
  • parse::parse_short_flag (cognitive 24) libs/cli_parser/src/parse.rs:452 — parse::parse_short_flag has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, match/switch 5, boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · signature · ×4
  • signature::parse_type (cognitive 92) libs/ops/op2/signature.rs:1699 — signature::parse_type has cognitive complexity 92 (threshold 15). Drivers by points: if/else 46, match/switch 44, boolean chains 2 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • signature::parse_generics (cognitive 27) libs/ops/op2/signature.rs:1228 — signature::parse_generics has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, loops 3, 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.
  • signature::parse_cppgc (cognitive 21) libs/ops/op2/signature.rs:1604 — signature::parse_cppgc has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 12, if/else 7, boolean chains 2 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • signature::parse_attribute (cognitive 20) libs/ops/op2/signature.rs:1337 — signature::parse_attribute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 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 · EszipV2 · ×4
  • EszipV2::parse_with_version (cognitive 56) libs/eszip/v2.rs:734 — EszipV2::parse_with_version has cognitive complexity 56 (threshold 15). Drivers by points: if/else 29, match/switch 16, loops 9, boolean chains 2 (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.
  • EszipV2::from_graph::visit_module (cognitive 27) libs/eszip/v2.rs:1349 — EszipV2::from_graph::visit_module has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13, loops 7, match/switch 7 (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.
  • EszipV2::into_bytes (cognitive 19) libs/eszip/v2.rs:1109 — EszipV2::into_bytes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, loops 8, match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • EszipV2::from_graph (cognitive 17) libs/eszip/v2.rs:1281 — EszipV2::from_graph has cognitive complexity 17 (threshold 15). Drivers by points: if/else 25, loops 14, match/switch 7 (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 · discovery · ×4
  • discovery::discover_workspace_config_files_for_single_dir (cognitive 54) libs/config/workspace/discovery.rs:235 — discovery::discover_workspace_config_files_for_single_dir has cognitive complexity 54 (threshold 15). Drivers by points: if/else 42, match/switch 8, boolean chains 3, loops 1 (nesting depth added 25). Of this number, 53 points are the body's own statements and 1 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • discovery::resolve_workspace_for_config_folder (cognitive 51) libs/config/workspace/discovery.rs:682 — discovery::resolve_workspace_for_config_folder has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20, match/switch 14, loops 12, boolean chains 5 (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.
  • discovery::handle_workspace_with_members (cognitive 19) libs/config/workspace/discovery.rs:580 — discovery::handle_workspace_with_members has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 3, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • discovery::resolve_auto_link_config_folders (cognitive 18) libs/config/workspace/discovery.rs:1303 — discovery::resolve_auto_link_config_folders has cognitive complexity 18 (threshold 15). Drivers by points: loops 8, if/else 7, match/switch 3 (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 · npm_compat · ×4
  • npm_compat::install_http_modules (cognitive 47) cli/tools/installer/npm_compat.rs:1113 — npm_compat::install_http_modules has cognitive complexity 47 (threshold 15). Drivers by points: if/else 27, match/switch 10, boolean chains 6, loops 4 (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.
  • npm_compat::generate_npm_cache_projects (cognitive 23) cli/tools/installer/npm_compat.rs:164 — npm_compat::generate_npm_cache_projects has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, loops 8, 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.
  • npm_compat::expand_member_patterns (cognitive 17) cli/tools/installer/npm_compat.rs:739 — npm_compat::expand_member_patterns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • npm_compat::install_jsr_packages (cognitive 16) cli/tools/installer/npm_compat.rs:889 — npm_compat::install_jsr_packages has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 11, if/else 4, loops 1 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · flags · ×4
  • flags::flags_from_vec_with_initial_cwd (cognitive 46) cli/args/flags.rs:1060 — flags::flags_from_vec_with_initial_cwd has cognitive complexity 46 (threshold 15). Drivers by points: if/else 31, match/switch 9, boolean chains 6 (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.
  • flags::permission_args (cognitive 33) cli/args/flags.rs:5095 — flags::permission_args has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, boolean chains 2 (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.
  • flags::permission_args_parse (cognitive 21) cli/args/flags.rs:8538 — flags::permission_args_parse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 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.
  • flags::escape_and_split_commas (cognitive 19) cli/args/flags.rs:8484 — flags::escape_and_split_commas has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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 · bindings · ×4
  • bindings::initialize_deno_core_ops_bindings (cognitive 46) libs/core/runtime/bindings.rs:421 — bindings::initialize_deno_core_ops_bindings has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28, loops 17, boolean chains 1 (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.
  • bindings::upgrade_snapshotted_ops_with_fast_calls (cognitive 27) libs/core/runtime/bindings.rs:613 — bindings::upgrade_snapshotted_ops_with_fast_calls has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, loops 6, 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.
  • bindings::op_ctx_template_or_accessor (cognitive 18) libs/core/runtime/bindings.rs:808 — bindings::op_ctx_template_or_accessor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (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.
  • bindings::op_ctx_function_or_accessor (cognitive 16) libs/core/runtime/bindings.rs:906 — bindings::op_ctx_function_or_accessor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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 · KeyObjectHandle · ×4
  • KeyObjectHandle::new_asymmetric_private_key_from_js (cognitive 43) ext/node_crypto/keys.rs:991 — KeyObjectHandle::new_asymmetric_private_key_from_js has cognitive complexity 43 (threshold 15). Drivers by points: if/else 26, match/switch 17 (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.
  • KeyObjectHandle::verify_prehashed (cognitive 43) ext/node_crypto/sign.rs:496 — KeyObjectHandle::verify_prehashed has cognitive complexity 43 (threshold 15). Drivers by points: if/else 36, match/switch 7 (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.
  • KeyObjectHandle::sign_prehashed (cognitive 23) ext/node_crypto/sign.rs:302 — KeyObjectHandle::sign_prehashed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, match/switch 3, 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.
  • KeyObjectHandle::new_asymmetric_public_key_from_js (cognitive 18) ext/node_crypto/keys.rs:1545 — KeyObjectHandle::new_asymmetric_public_key_from_js has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 12, if/else 6 (nesting depth added 8). 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 · ModuleMap · ×4
  • ModuleMap::new_module_from_js_source_with_pending (cognitive 41) libs/core/modules/map.rs:953 — ModuleMap::new_module_from_js_source_with_pending has cognitive complexity 41 (threshold 15). Drivers by points: if/else 32, match/switch 5, boolean chains 3, 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.
  • ModuleMap::drain_dyn_imports (cognitive 31) libs/core/modules/map.rs:2520 — ModuleMap::drain_dyn_imports has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 16, if/else 14, loops 1 (nesting depth added 21). 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.
  • ModuleMap::resolve_callback (cognitive 23) libs/core/modules/map.rs:1657 — ModuleMap::resolve_callback has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, match/switch 5, 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.
  • ModuleMap::mod_evaluate (cognitive 20) libs/core/modules/map.rs:1927 — ModuleMap::mod_evaluate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, match/switch 3, 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 · stream · ×4
  • stream::write_pipe (cognitive 35) libs/core/uv_compat/stream.rs:797 — stream::write_pipe has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17, loops 8, match/switch 7, boolean chains 3 (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.
  • stream::uv_try_writev (cognitive 30) libs/core/uv_compat/stream.rs:256 — stream::uv_try_writev has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, loops 4, match/switch 2, 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.
  • stream::uv_writev_owned (cognitive 25) libs/core/uv_compat/stream.rs:448 — stream::uv_writev_owned has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, match/switch 5, loops 3, 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.
  • stream::uv_shutdown (cognitive 17) libs/core/uv_compat/stream.rs:648 — stream::uv_shutdown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 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 · upgrade · ×4
  • upgrade::upgrade_from_pr (cognitive 33) cli/tools/upgrade.rs:609 — upgrade::upgrade_from_pr has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27, loops 6 (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.
  • upgrade::upgrade (cognitive 31) cli/tools/upgrade.rs:985 — upgrade::upgrade has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, boolean chains 2, match/switch 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.
  • upgrade::try_delta_upgrade (cognitive 25) cli/tools/upgrade.rs:1659 — upgrade::try_delta_upgrade has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, match/switch 5, 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.
  • upgrade::upgrade_from_branch (cognitive 20) cli/tools/upgrade.rs:828 — upgrade::upgrade_from_branch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 3 (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.
D2 · Cognitive Complexity · swc · ×4
  • swc::serialize_expr (cognitive 33) cli/tools/lint/ast_buffer/swc.rs:660 — swc::serialize_expr has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 30, if/else 3 (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.
  • swc::serialize_module_decl (cognitive 19) cli/tools/lint/ast_buffer/swc.rs:153 — swc::serialize_module_decl has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 12, if/else 7 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • swc::serialize_ts_type (cognitive 19) cli/tools/lint/ast_buffer/swc.rs:2498 — swc::serialize_ts_type has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 16, if/else 3 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • swc::serialize_decl (cognitive 16) cli/tools/lint/ast_buffer/swc.rs:1352 — swc::serialize_decl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, match/switch 7 (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 · publish · ×4
  • publish::get_auth_headers (cognitive 28) cli/tools/publish/mod.rs:611 — publish::get_auth_headers has cognitive complexity 28 (threshold 15). Drivers by points: loops 13, if/else 11, match/switch 4 (nesting depth added 16). 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.
  • publish::publish (cognitive 26) cli/tools/publish/mod.rs:77 — publish::publish has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 5, match/switch 2, 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.
  • publish::collect_excluded_module_diagnostics (cognitive 26) cli/tools/publish/mod.rs:1216 — publish::collect_excluded_module_diagnostics has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, loops 6, match/switch 4 (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.
  • publish::perform_publish (cognitive 16) cli/tools/publish/mod.rs:887 — publish::perform_publish has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, loops 7, match/switch 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 · Flags · ×4
  • Flags::parse (cognitive 25) libs/ops/op2/config.rs:236 — Flags::parse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, match/switch 2, boolean chains 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.
  • Flags::config_path_args (cognitive 23) cli/args/flags.rs:586 — Flags::config_path_args has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, match/switch 3, boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 2 function items declared inside it (resolve_single_folder_path, resolve_multiple_files). 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.
  • Flags::to_permission_args (cognitive 20) cli/args/flags.rs:283 — Flags::to_permission_args has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 19, if/else 1. 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.
  • Flags::otel_config (cognitive 19) cli/args/flags.rs:513 — Flags::otel_config has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, match/switch 6, boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fs · ×4
  • fs::op_node_cp_on_link (cognitive 20) ext/node/ops/fs.rs:3122 — fs::op_node_cp_on_link has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • fs::op_node_cp_on_link_sync (cognitive 20) ext/node/ops/fs.rs:3325 — fs::op_node_cp_on_link_sync has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • fs::check_parent_paths_impl (cognitive 16) ext/node/ops/fs.rs:2541 — fs::check_parent_paths_impl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, match/switch 6, boolean chains 2, 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.
  • fs::check_parent_paths_impl_sync (cognitive 16) ext/node/ops/fs.rs:2634 — fs::check_parent_paths_impl_sync has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, match/switch 6, boolean chains 2, 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.
D38 · OSV Dependency Vulnerabilities · Medium advisory (unmaintained) · ×4
  • Medium advisory (unmaintained): RUSTSEC-2025-0056 Cargo.lock — adler 1.0.2: RUSTSEC-2025-0056 — no fixed version exists: the advisory reports the package as unmaintained. adler is not declared in this repo's manifests: it is pulled in transitively by miniz_oxide 0.7.2, so the action is on the dependency that requires it — upgrade or replace that dependent.
  • Medium advisory (unmaintained): RUSTSEC-2025-0141 Cargo.lock — bincode 1.3.3: RUSTSEC-2025-0141 — no fixed version exists: the advisory reports the package as unmaintained. Replace bincode with a maintained alternative, or vendor and maintain a fork.
  • Medium advisory (unmaintained): RUSTSEC-2024-0436 Cargo.lock — paste 1.0.15: RUSTSEC-2024-0436 — no fixed version exists: the advisory reports the package as unmaintained. Replace paste with a maintained alternative, or vendor and maintain a fork.
  • Medium advisory (unmaintained): RUSTSEC-2025-0134 Cargo.lock — rustls-pemfile 2.1.2: RUSTSEC-2025-0134 — no fixed version exists: the advisory reports the package as unmaintained. Replace rustls-pemfile with a maintained alternative, or vendor and maintain a fork.
D38 · OSV Dependency Vulnerabilities · Medium advisory (unsound) · ×4
  • Medium advisory (unsound): RUSTSEC-2026-0190 Cargo.lock — anyhow 1.0.98: RUSTSEC-2026-0190 — upgrade to 1.0.103
  • Medium advisory (unsound): RUSTSEC-2026-0186 Cargo.lock — memmap2 0.9.5: RUSTSEC-2026-0186 — upgrade to 0.9.11
  • Medium advisory (unsound): RUSTSEC-2026-0097 Cargo.lock — rand 0.8.5: RUSTSEC-2026-0097 — upgrade to 0.8.6
  • Medium advisory (unsound): RUSTSEC-2026-0205 Cargo.lock — scc 3.7.1: RUSTSEC-2026-0205 — scc is not declared in this repo's manifests: it is pulled in transitively by zeromq 0.6.0, so upgrade the dependency that requires it (or force it with `cargo update -p scc@3.7.1 --precise 3.8.4`, or a `[patch.crates-io]` entry).
D1 · Cyclomatic Complexity · swc · ×3
  • swc::serialize_expr (cyclomatic 106) cli/tools/lint/ast_buffer/swc.rs:660 — swc::serialize_expr has cyclomatic complexity 106 (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.
  • swc::serialize_ts_type (cyclomatic 42) cli/tools/lint/ast_buffer/swc.rs:2498 — swc::serialize_ts_type has cyclomatic complexity 42 (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.
  • swc::serialize_module_decl (cyclomatic 25) cli/tools/lint/ast_buffer/swc.rs:153 — swc::serialize_module_decl has cyclomatic complexity 25 (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 · pipe · ×3
  • pipe::poll_pipe_handle (cyclomatic 86) libs/core/uv_compat/pipe.rs:1715 — pipe::poll_pipe_handle 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.
  • pipe::poll_pipe_handle (cyclomatic 72) libs/core/uv_compat/pipe.rs:1360 — pipe::poll_pipe_handle has cyclomatic complexity 72 (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.
  • pipe::try_write_pipe (cyclomatic 18) libs/core/uv_compat/pipe.rs:1085 — pipe::try_write_pipe 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 · flags · ×3
  • flags::flags_from_vec_with_initial_cwd (cyclomatic 80) cli/args/flags.rs:1060 — flags::flags_from_vec_with_initial_cwd has cyclomatic complexity 80 (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.
  • flags::permission_args (cyclomatic 30) cli/args/flags.rs:5095 — flags::permission_args 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.
  • flags::permission_args_parse (cyclomatic 22) cli/args/flags.rs:8538 — flags::permission_args_parse 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 · deno · ×3
  • deno::run_subcommand (cyclomatic 70) cli/lib.rs:122 — deno::run_subcommand has cyclomatic complexity 70 (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.
  • deno::resolve_flags_and_init (cyclomatic 23) cli/lib.rs:952 — deno::resolve_flags_and_init 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.
  • deno::initialize_tunnel (cyclomatic 21) cli/lib.rs:1342 — deno::initialize_tunnel 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 · desktop · ×3
  • desktop::compile_desktop (cyclomatic 51) cli/tools/desktop.rs:176 — desktop::compile_desktop 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.
  • desktop::apply_desktop_config_to_flags (cyclomatic 21) cli/tools/desktop.rs:101 — desktop::apply_desktop_config_to_flags 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.
  • desktop::create_windows_msi (cyclomatic 17) cli/tools/desktop.rs:4218 — desktop::create_windows_msi 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 · Decipher · ×3
  • Decipher::new (cyclomatic 46) ext/node_crypto/cipher.rs:1282 — Decipher::new has cyclomatic complexity 46 (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.
  • Decipher::r#final (cyclomatic 33) ext/node_crypto/cipher.rs:1558 — Decipher::r#final 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.
  • Decipher::decrypt (cyclomatic 19) ext/node_crypto/cipher.rs:1492 — Decipher::decrypt has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · deno_crypto · ×3
  • deno_crypto::verify_key_sync (cyclomatic 40) ext/crypto/lib.rs:526 — deno_crypto::verify_key_sync has cyclomatic complexity 40 (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.
  • deno_crypto::sign_key_sync (cyclomatic 31) ext/crypto/lib.rs:310 — deno_crypto::sign_key_sync has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • deno_crypto::derive_bits_sync (cyclomatic 23) ext/crypto/lib.rs:731 — deno_crypto::derive_bits_sync 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 · keys · ×3
  • keys::op_node_get_asymmetric_key_details (cyclomatic 29) ext/node_crypto/keys.rs:2758 — keys::op_node_get_asymmetric_key_details has cyclomatic complexity 29 (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.
  • keys::parse_rsa_pss_params (cyclomatic 20) ext/node_crypto/keys.rs:1901 — keys::parse_rsa_pss_params has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • keys::parse_legacy_encrypted_pem (cyclomatic 16) ext/node_crypto/keys.rs:3666 — keys::parse_legacy_encrypted_pem has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · convert · ×3
  • convert::validate_permission_args (cyclomatic 29) libs/cli_parser/src/convert.rs:1132 — convert::validate_permission_args has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function item declared inside it. 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.
  • convert::apply_node_options (cyclomatic 26) libs/cli_parser/src/convert.rs:2872 — convert::apply_node_options has cyclomatic complexity 26 (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.
  • convert::test_parse (cyclomatic 17) libs/cli_parser/src/convert.rs:1541 — convert::test_parse 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 · NodeResolver · ×3
  • NodeResolver::resolve_package_target_string (cyclomatic 20) libs/node_resolver/resolution.rs:1399 — NodeResolver::resolve_package_target_string 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.
  • NodeResolver::finalize_resolution (cyclomatic 18) libs/node_resolver/resolution.rs:802 — NodeResolver::finalize_resolution 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.
  • NodeResolver::path_to_declaration_path (cyclomatic 18) libs/node_resolver/resolution.rs:1223 — NodeResolver::path_to_declaration_path has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function item declared inside it (probe_extensions). 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.
D2 · Cognitive Complexity · deno · ×3
  • deno::run_subcommand (cognitive 71) cli/lib.rs:122 — deno::run_subcommand has cognitive complexity 71 (threshold 15). Drivers by points: if/else 51, match/switch 17, boolean chains 3 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • deno::resolve_flags_and_init (cognitive 31) cli/lib.rs:952 — deno::resolve_flags_and_init has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21, match/switch 8, boolean chains 2 (nesting depth added 9). 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.
  • deno::initialize_tunnel (cognitive 22) cli/lib.rs:1342 — deno::initialize_tunnel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, match/switch 3, boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceResolver · ×3
  • WorkspaceResolver::resolve (cognitive 68) libs/resolver/workspace.rs:1354 — WorkspaceResolver::resolve has cognitive complexity 68 (threshold 15). Drivers by points: if/else 41, loops 10, match/switch 10, boolean chains 7 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WorkspaceResolver::from_workspace (cognitive 35) libs/resolver/workspace.rs:856 — WorkspaceResolver::from_workspace has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20, match/switch 8, boolean chains 4, loops 3 (nesting depth added 10). Most of this is not in the body itself: 0 of the 35 points are its own statements and the rest belongs to 4 function items declared inside it (resolve_import_map, resolve_import_map::expand_catalog_specifiers::expand_entries, resolve_import_map::expand_catalog_specifiers, …). 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.
  • WorkspaceResolver::maybe_resolve_specifier_to_workspace_jsr_pkg (cognitive 20) libs/resolver/workspace.rs:1585 — WorkspaceResolver::maybe_resolve_specifier_to_workspace_jsr_pkg has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 2, match/switch 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.
D2 · Cognitive Complexity · GraphWalker · ×3
  • GraphWalker::resolve_pending (cognitive 64) cli/type_checker.rs:1113 — GraphWalker::resolve_pending has cognitive complexity 64 (threshold 15). Drivers by points: if/else 42, match/switch 9, loops 8, boolean chains 5 (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.
  • GraphWalker::add_unresolved_dts_entrypoint_imports (cognitive 20) cli/type_checker.rs:1386 — GraphWalker::add_unresolved_dts_entrypoint_imports has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 3, match/switch 3, 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.
  • GraphWalker::maybe_get_check_entry (cognitive 17) cli/type_checker.rs:1259 — GraphWalker::maybe_get_check_entry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, match/switch 3, 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 · path_to_regex · ×3
  • path_to_regex::lexer (cognitive 54) cli/lsp/path_to_regex.rs:66 — path_to_regex::lexer has cognitive complexity 54 (threshold 15). Drivers by points: if/else 40, loops 7, boolean chains 5, match/switch 2 (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.
  • path_to_regex::tokens_to_regex (cognitive 53) cli/lsp/path_to_regex.rs:638 — path_to_regex::tokens_to_regex has cognitive complexity 53 (threshold 15). Drivers by points: if/else 41, match/switch 9, boolean chains 2, loops 1 (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.
  • path_to_regex::parse (cognitive 32) cli/lsp/path_to_regex.rs:525 — path_to_regex::parse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29, boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmbeddedModuleLoader · ×3
  • EmbeddedModuleLoader::load_default (cognitive 53) cli/rt/run.rs:411 — EmbeddedModuleLoader::load_default has cognitive complexity 53 (threshold 15). Drivers by points: match/switch 31, if/else 21, boolean chains 1 (nesting depth added 29). 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.
  • EmbeddedModuleLoader::load (cognitive 25) cli/rt/run.rs:730 — EmbeddedModuleLoader::load has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 15, if/else 9, boolean chains 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.
  • EmbeddedModuleLoader::resolve_inner (cognitive 19) cli/rt/run.rs:173 — EmbeddedModuleLoader::resolve_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, match/switch 6, 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 · compile · ×3
  • compile::compile_inner (cognitive 49) cli/tools/compile.rs:70 — compile::compile_inner has cognitive complexity 49 (threshold 15). Drivers by points: if/else 38, loops 8, boolean chains 3 (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.
  • compile::get_module_roots_and_include_paths (cognitive 23) cli/tools/compile.rs:1161 — compile::get_module_roots_and_include_paths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 6, boolean chains 1, match/switch 1 (nesting depth added 8). Of this number, 12 points are the body's own statements and 11 belong to 3 function items declared inside it. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • compile::compile_binary (cognitive 20) cli/tools/compile.rs:636 — compile::compile_binary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 5, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session · ×3
  • session::on_stream_read_callback (cognitive 48) ext/node/ops/http2/session.rs:1410 — session::on_stream_read_callback has cognitive complexity 48 (threshold 15). Drivers by points: if/else 45, boolean chains 3 (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.
  • session::on_frame_recv_callback (cognitive 31) ext/node/ops/http2/session.rs:782 — session::on_frame_recv_callback has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29, 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.
  • session::h2_read_cb (cognitive 16) ext/node/ops/http2/session.rs:271 — session::h2_read_cb has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css · ×3
  • css::parse_css (cognitive 48) ext/web/console/css.rs:342 — css::parse_css has cognitive complexity 48 (threshold 15). Drivers by points: if/else 36, loops 8, boolean chains 2, match/switch 2 (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.
  • css::parse_css_color (cognitive 24) ext/web/console/css.rs:185 — css::parse_css_color has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • css::css_to_ansi (cognitive 21) ext/web/console/css.rs:502 — css::css_to_ansi has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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 · pm · ×3
  • pm::add (cognitive 46) cli/tools/pm/mod.rs:536 — pm::add has cognitive complexity 46 (threshold 15). Drivers by points: if/else 29, match/switch 11, boolean chains 3, loops 3 (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.
  • pm::remove (cognitive 26) cli/tools/pm/mod.rs:1133 — pm::remove has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14, loops 7, match/switch 3, 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.
  • pm::find_package_and_select_version_for_req::select (cognitive 17) cli/tools/pm/mod.rs:897 — pm::find_package_and_select_version_for_req::select has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, match/switch 3 (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 · clean · ×3
  • clean::clean_except (cognitive 45) cli/tools/clean.rs:254 — clean::clean_except has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24, match/switch 11, loops 6, boolean chains 4 (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.
  • clean::clean_node_modules (cognitive 19) cli/tools/clean.rs:573 — clean::clean_node_modules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, match/switch 3, boolean chains 1, 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.
  • clean::walk_removing (cognitive 17) cli/tools/clean.rs:526 — clean::walk_removing has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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 · html · ×3
  • html::attr_value (cognitive 43) cli/tools/bundle/html.rs:191 — html::attr_value has cognitive complexity 43 (threshold 15). Drivers by points: loops 18, if/else 16, boolean chains 9 (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.
  • html::inject_scripts_and_css (cognitive 22) cli/tools/bundle/html.rs:619 — html::inject_scripts_and_css has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 3, 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.
  • html::find_next_tag (cognitive 19) cli/tools/bundle/html.rs:139 — html::find_next_tag has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 3, 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 · SpecifierUnfurler · ×3
  • SpecifierUnfurler::unfurl_specifier (cognitive 41) cli/tools/publish/unfurl.rs:421 — SpecifierUnfurler::unfurl_specifier has cognitive complexity 41 (threshold 15). Drivers by points: match/switch 33, if/else 8 (nesting depth added 27). 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.
  • SpecifierUnfurler::unfurl_to_changes (cognitive 35) cli/tools/publish/unfurl.rs:905 — SpecifierUnfurler::unfurl_to_changes has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19, match/switch 10, loops 5, 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.
  • SpecifierUnfurler::find_types_package_version_req (cognitive 18) cli/tools/publish/unfurl.rs:688 — SpecifierUnfurler::find_types_package_version_req has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 6, 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 · DepManager · ×3
  • DepManager::run_dependency_resolution (cognitive 40) cli/tools/pm/deps.rs:723 — DepManager::run_dependency_resolution has cognitive complexity 40 (threshold 15). Drivers by points: if/else 26, loops 9, match/switch 4, 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.
  • DepManager::commit_changes (cognitive 36) cli/tools/pm/deps.rs:1066 — DepManager::commit_changes has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24, match/switch 9, 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.
  • DepManager::load_latest_versions (cognitive 25) cli/tools/pm/deps.rs:885 — DepManager::load_latest_versions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, loops 5, match/switch 2, 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.
D2 · Cognitive Complexity · TsServer · ×3
  • TsServer::provide_code_actions (cognitive 37) cli/lsp/ts_server.rs:325 — TsServer::provide_code_actions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19, match/switch 10, loops 5, boolean chains 3 (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.
  • TsServer::provide_references (cognitive 21) cli/lsp/ts_server.rs:147 — TsServer::provide_references has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 5, boolean chains 1, match/switch 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.
  • TsServer::provide_will_rename_files (cognitive 18) cli/lsp/ts_server.rs:1131 — TsServer::provide_will_rename_files has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 5, match/switch 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 · desktop_devtools · ×3
  • desktop_devtools::run_unified_session (cognitive 37) cli/tools/desktop_devtools.rs:900 — desktop_devtools::run_unified_session has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23, match/switch 8, loops 6 (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.
  • desktop_devtools::handle_upgrade (cognitive 18) cli/tools/desktop_devtools.rs:509 — desktop_devtools::handle_upgrade has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, match/switch 6, 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.
  • desktop_devtools::route_client_text (cognitive 18) cli/tools/desktop_devtools.rs:1134 — desktop_devtools::route_client_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, match/switch 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 · SharedConn · ×3
  • SharedConn::poll_read_body_chunk_limited_with (cognitive 37) libs/http_h1/conn.rs:898 — SharedConn::poll_read_body_chunk_limited_with has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, match/switch 8, boolean chains 1, 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.
  • SharedConn::poll_next_request_with (cognitive 26) libs/http_h1/conn.rs:804 — SharedConn::poll_next_request_with has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, 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.
  • SharedConn::poll_write_response_chunk_with (cognitive 19) libs/http_h1/conn.rs:1272 — SharedConn::poll_write_response_chunk_with has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 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 · bump_version · ×3
  • bump_version::bump_workspace_conventional (cognitive 34) cli/tools/bump_version.rs:450 — bump_version::bump_workspace_conventional has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19, loops 9, match/switch 4, 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.
  • bump_version::parse_commit (cognitive 24) cli/tools/bump_version.rs:798 — bump_version::parse_commit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, match/switch 5, loops 1 (nesting depth added 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.
  • bump_version::rewrite_import_map (cognitive 19) cli/tools/bump_version.rs:1026 — bump_version::rewrite_import_map has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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.
D2 · Cognitive Complexity · deno_crypto · ×3
  • deno_crypto::verify_key_sync (cognitive 33) ext/crypto/lib.rs:526 — deno_crypto::verify_key_sync has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 28, if/else 5 (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.
  • deno_crypto::derive_bits_sync (cognitive 30) ext/crypto/lib.rs:731 — deno_crypto::derive_bits_sync has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15, match/switch 15 (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.
  • deno_crypto::sign_key_sync (cognitive 17) ext/crypto/lib.rs:310 — deno_crypto::sign_key_sync has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 13, if/else 4 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DatabaseSync · ×3
  • DatabaseSync::function (cognitive 32) ext/node_sqlite/database.rs:1115 — DatabaseSync::function has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30, 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.
  • DatabaseSync::deserialize (cognitive 18) ext/node_sqlite/database.rs:2029 — DatabaseSync::deserialize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 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.
  • DatabaseSync::apply_changeset (cognitive 16) ext/node_sqlite/database.rs:1319 — DatabaseSync::apply_changeset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 5). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function items declared inside it (conflict_handler, filter_handler). 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.
D2 · Cognitive Complexity · analysis · ×3
  • analysis::import_map_lookup_inner (cognitive 27) cli/lsp/analysis.rs:292 — analysis::import_map_lookup_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, boolean chains 4, match/switch 4, 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.
  • analysis::try_reverse_map_package_json_exports::try_reverse_map_package_json_exports_inner (cognitive 21) cli/lsp/analysis.rs:722 — analysis::try_reverse_map_package_json_exports::try_reverse_map_package_json_exports_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, match/switch 2, 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.
  • analysis::fix_ts_import_changes (cognitive 17) cli/lsp/analysis.rs:764 — analysis::fix_ts_import_changes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 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 · bundle · ×3
  • bundle::prepare_inputs (cognitive 25) cli/tools/bundle/mod.rs:93 — bundle::prepare_inputs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, loops 12 (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.
  • bundle::flatten_declarations (cognitive 17) cli/tools/bundle/mod.rs:594 — bundle::flatten_declarations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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.
  • bundle::inline_declarations (cognitive 17) cli/tools/bundle/mod.rs:768 — bundle::inline_declarations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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 · pack · ×3
  • pack::pack (cognitive 24) cli/tools/pack/mod.rs:42 — pack::pack has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 2, match/switch 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.
  • pack::collect_asset_files (cognitive 17) cli/tools/pack/mod.rs:447 — pack::collect_asset_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 3, loops 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • pack::process_single_module (cognitive 16) cli/tools/pack/mod.rs:706 — pack::process_single_module has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 3, 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 · graph · ×3
  • graph::get_import_prefix_missing_error (cognitive 23) libs/resolver/graph.rs:1005 — graph::get_import_prefix_missing_error has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 4, match/switch 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.
  • graph::tarjan_scc::strongconnect (cognitive 21) libs/npm/resolution/graph.rs:315 — graph::tarjan_scc::strongconnect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 4 (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.
  • graph::format_deno_graph_error (cognitive 19) libs/resolver/graph.rs:1076 — graph::format_deno_graph_error has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 6 (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 · ops_builtin_v8 · ×3
  • ops_builtin_v8::op_serialize (cognitive 22) libs/core/ops_builtin_v8.rs:823 — ops_builtin_v8::op_serialize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, loops 3, match/switch 3, 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.
  • ops_builtin_v8::op_deserialize (cognitive 19) libs/core/ops_builtin_v8.rs:936 — ops_builtin_v8::op_deserialize has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 12, if/else 4, loops 3 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • ops_builtin_v8::op_current_user_call_site (cognitive 16) libs/core/ops_builtin_v8.rs:1487 — ops_builtin_v8::op_current_user_call_site has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, match/switch 4, boolean chains 2, 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 · database · ×3
  • database::open_db (cognitive 16) ext/node_sqlite/database.rs:699 — database::open_db has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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.
  • database::custom_aggregate_step_base (cognitive 16) ext/node_sqlite/database.rs:2252 — database::custom_aggregate_step_base has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 1, match/switch 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.
  • database::custom_aggregate_value_base (cognitive 16) ext/node_sqlite/database.rs:2361 — database::custom_aggregate_value_base has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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.
D1 · Cyclomatic Complexity · coverage · ×2
  • coverage::generate_coverage_report (cyclomatic 57) cli/tools/coverage/mod.rs:126 — coverage::generate_coverage_report has cyclomatic complexity 57 (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.
  • coverage::cover_files (cyclomatic 25) cli/tools/coverage/mod.rs:690 — coverage::cover_files has cyclomatic complexity 25 (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 · signature · ×2
  • signature::parse_type (cyclomatic 52) libs/ops/op2/signature.rs:1699 — signature::parse_type has cyclomatic complexity 52 (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.
  • signature::parse_attribute (cyclomatic 28) libs/ops/op2/signature.rs:1337 — signature::parse_attribute has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · error_fmt · ×2
  • error_fmt::format_error (cyclomatic 48) ext/web/console/error_fmt.rs:687 — error_fmt::format_error has cyclomatic complexity 48 (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.
  • error_fmt::get_duplicate_error_frame_ranges (cyclomatic 27) ext/web/console/error_fmt.rs:264 — error_fmt::get_duplicate_error_frame_ranges has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JsRuntime · ×2
  • JsRuntime::poll_event_loop_inner (cyclomatic 47) libs/core/runtime/jsruntime.rs:2420 — JsRuntime::poll_event_loop_inner has cyclomatic complexity 47 (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.
  • JsRuntime::new_inner (cyclomatic 19) libs/core/runtime/jsruntime.rs:798 — JsRuntime::new_inner 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 · Cipher · ×2
  • Cipher::new (cyclomatic 46) ext/node_crypto/cipher.rs:826 — Cipher::new has cyclomatic complexity 46 (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.
  • Cipher::encrypt (cyclomatic 19) ext/node_crypto/cipher.rs:1006 — Cipher::encrypt has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · deno_process · ×2
  • deno_process::create_command (cyclomatic 45) ext/process/lib.rs:581 — deno_process::create_command 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.
  • deno_process::op_spawn_sync (cyclomatic 27) ext/process/lib.rs:1554 — deno_process::op_spawn_sync has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 belong to one function item declared inside it. 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 · PackumentIndexer · ×2
  • PackumentIndexer::on_string (cyclomatic 45) libs/npm/fast_registry_json.rs:1052 — PackumentIndexer::on_string 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.
  • PackumentIndexer::on_operator (cyclomatic 17) libs/npm/fast_registry_json.rs:1172 — PackumentIndexer::on_operator 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 · dispatch_slow · ×2
  • dispatch_slow::from_arg (cyclomatic 44) libs/ops/op2/dispatch_slow.rs:425 — dispatch_slow::from_arg has cyclomatic complexity 44 (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.
  • dispatch_slow::generate_dispatch_slow (cyclomatic 16) libs/ops/op2/dispatch_slow.rs:76 — dispatch_slow::generate_dispatch_slow 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 · parse · ×2
  • parse::parse_args (cyclomatic 42) libs/cli_parser/src/parse.rs:112 — parse::parse_args has cyclomatic complexity 42 (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.
  • parse::parse_long_flag (cyclomatic 22) libs/cli_parser/src/parse.rs:352 — parse::parse_long_flag 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 · fmt_editorconfig · ×2
  • fmt_editorconfig::glob_to_regex_depth (cyclomatic 38) cli/tools/fmt_editorconfig.rs:427 — fmt_editorconfig::glob_to_regex_depth 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.
  • fmt_editorconfig::parse (cyclomatic 25) cli/tools/fmt_editorconfig.rs:278 — fmt_editorconfig::parse 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 · transpile · ×2
  • transpile::restore_block_comment_newlines (cyclomatic 36) cli/tools/transpile.rs:388 — transpile::restore_block_comment_newlines 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.
  • transpile::transpile (cyclomatic 24) cli/tools/transpile.rs:26 — transpile::transpile has cyclomatic complexity 24 (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 · tls_wrap · ×2
  • tls_wrap::build_client_config (cyclomatic 36) ext/node/ops/tls_wrap.rs:4057 — tls_wrap::build_client_config 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.
  • tls_wrap::build_server_config (cyclomatic 34) ext/node/ops/tls_wrap.rs:4562 — tls_wrap::build_server_config 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.
D1 · Cyclomatic Complexity · EszipV2 · ×2
  • EszipV2::parse_with_version (cyclomatic 36) libs/eszip/v2.rs:734 — EszipV2::parse_with_version 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.
  • EszipV2::from_graph::visit_module (cyclomatic 18) libs/eszip/v2.rs:1349 — EszipV2::from_graph::visit_module has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · clean · ×2
  • clean::clean_except (cyclomatic 33) cli/tools/clean.rs:254 — clean::clean_except 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.
  • clean::clean_node_modules (cyclomatic 19) cli/tools/clean.rs:573 — clean::clean_node_modules 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 · fmt_errors · ×2
  • fmt_errors::get_message_suggestions_inner (cyclomatic 33) runtime/fmt_errors.rs:472 — fmt_errors::get_message_suggestions_inner 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.
  • fmt_errors::format_js_error_inner (cyclomatic 24) runtime/fmt_errors.rs:271 — fmt_errors::format_js_error_inner has cyclomatic complexity 24 (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 · WorkspaceResolver · ×2
  • WorkspaceResolver::resolve (cyclomatic 32) libs/resolver/workspace.rs:1354 — WorkspaceResolver::resolve 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.
  • WorkspaceResolver::from_workspace (cyclomatic 23) libs/resolver/workspace.rs:856 — WorkspaceResolver::from_workspace has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points are its own statements and the rest belongs to 4 function items declared inside it (resolve_import_map, resolve_import_map::child_import_map_config, resolve_import_map::expand_catalog_specifiers::expand_entries, …). 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 · tsconfig_gen · ×2
  • tsconfig_gen::build_tsconfig (cyclomatic 29) cli/tsc/tsconfig_gen.rs:758 — tsconfig_gen::build_tsconfig 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.
  • tsconfig_gen::strip_top_level_type_decls (cyclomatic 17) cli/tsc/tsconfig_gen.rs:623 — tsconfig_gen::strip_top_level_type_decls has cyclomatic complexity 17 (threshold 15). 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.
D1 · Cyclomatic Complexity · css · ×2
  • css::parse_css (cyclomatic 29) ext/web/console/css.rs:342 — css::parse_css 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.
  • css::parse_css_color (cyclomatic 19) ext/web/console/css.rs:185 — css::parse_css_color 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 · discovery · ×2
  • discovery::discover_workspace_config_files_for_single_dir (cyclomatic 28) libs/config/workspace/discovery.rs:235 — discovery::discover_workspace_config_files_for_single_dir has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belong to one function item declared inside it. 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.
  • discovery::resolve_workspace_for_config_folder (cyclomatic 27) libs/config/workspace/discovery.rs:682 — discovery::resolve_workspace_for_config_folder has cyclomatic complexity 27 (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 · uv_compat · ×2
  • uv_compat::io_error_to_uv (cyclomatic 28) libs/core/uv_compat.rs:109 — uv_compat::io_error_to_uv has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • uv_compat::uv_guess_handle (cyclomatic 22) libs/core/uv_compat.rs:875 — uv_compat::uv_guess_handle 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 · path_to_regex · ×2
  • path_to_regex::lexer (cyclomatic 27) cli/lsp/path_to_regex.rs:66 — path_to_regex::lexer 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.
  • path_to_regex::tokens_to_regex (cyclomatic 20) cli/lsp/path_to_regex.rs:638 — path_to_regex::tokens_to_regex has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · url · ×2
  • url::parse_simple_special_url (cyclomatic 27) ext/web/url.rs:112 — url::parse_simple_special_url 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.
  • url::simple_special_host_is_canonical (cyclomatic 22) ext/web/url.rs:223 — url::simple_special_host_is_canonical 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 · EmbeddedModuleLoader · ×2
  • EmbeddedModuleLoader::load_default (cyclomatic 25) cli/rt/run.rs:411 — EmbeddedModuleLoader::load_default has cyclomatic complexity 25 (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.
  • EmbeddedModuleLoader::resolve_inner (cyclomatic 19) cli/rt/run.rs:173 — EmbeddedModuleLoader::resolve_inner has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · global · ×2
  • global::resolve_shim_data (cyclomatic 23) cli/tools/installer/global.rs:906 — global::resolve_shim_data 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.
  • global::setup_config_dir (cyclomatic 19) cli/tools/installer/global.rs:422 — global::setup_config_dir has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function item declared inside it. 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 · turbocall · ×2
  • turbocall::compile_trampoline::convert (cyclomatic 23) ext/ffi/turbocall.rs:107 — turbocall::compile_trampoline::convert 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.
  • turbocall::compile_trampoline (cyclomatic 18) ext/ffi/turbocall.rs:62 — turbocall::compile_trampoline 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 · session · ×2
  • session::on_stream_read_callback (cyclomatic 21) ext/node/ops/http2/session.rs:1410 — session::on_stream_read_callback 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.
  • session::on_frame_recv_callback (cyclomatic 19) ext/node/ops/http2/session.rs:782 — session::on_frame_recv_callback 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 · SpecifierUnfurler · ×2
  • SpecifierUnfurler::unfurl_specifier (cyclomatic 20) cli/tools/publish/unfurl.rs:421 — SpecifierUnfurler::unfurl_specifier has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • SpecifierUnfurler::unfurl_to_changes (cyclomatic 19) cli/tools/publish/unfurl.rs:905 — SpecifierUnfurler::unfurl_to_changes 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 · local · ×2
  • local::sync_types_command (cyclomatic 20) cli/tools/installer/local.rs:251 — local::sync_types_command has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • local::categorize_installed_npm_deps (cyclomatic 17) cli/tools/installer/local.rs:52 — local::categorize_installed_npm_deps 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 · deno_fetch · ×2
  • deno_fetch::op_fetch (cyclomatic 20) ext/fetch/lib.rs:429 — deno_fetch::op_fetch 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.
  • deno_fetch::create_http_client (cyclomatic 17) ext/fetch/lib.rs:1023 — deno_fetch::create_http_client 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 · cipher · ×2
  • cipher::aes_unwrap_key (cyclomatic 20) ext/node_crypto/cipher.rs:198 — cipher::aes_unwrap_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.
  • cipher::aes_wrap_key (cyclomatic 16) ext/node_crypto/cipher.rs:52 — cipher::aes_wrap_key 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 · upgrade · ×2
  • upgrade::upgrade_from_pr (cyclomatic 19) cli/tools/upgrade.rs:609 — upgrade::upgrade_from_pr 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.
  • upgrade::upgrade (cyclomatic 19) cli/tools/upgrade.rs:985 — upgrade::upgrade 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 · TLSWrapInner · ×2
  • TLSWrapInner::clear_out_process (cyclomatic 19) ext/node/ops/tls_wrap.rs:1508 — TLSWrapInner::clear_out_process 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.
  • TLSWrapInner::dispatch_clear_out_callbacks (cyclomatic 18) ext/node/ops/tls_wrap.rs:1700 — TLSWrapInner::dispatch_clear_out_callbacks 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 · stream · ×2
  • stream::write_pipe (cyclomatic 19) libs/core/uv_compat/stream.rs:797 — stream::write_pipe 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.
  • stream::uv_try_writev (cyclomatic 16) libs/core/uv_compat/stream.rs:256 — stream::uv_try_writev 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 · editor · ×2
  • editor::highlight_line (cyclomatic 18) cli/tools/repl/editor.rs:398 — editor::highlight_line 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.
  • editor::validate (cyclomatic 17) cli/tools/repl/editor.rs:264 — editor::validate 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 · transforms · ×2
  • transforms::transform4_to_5 (cyclomatic 18) libs/lockfile/transforms.rs:239 — transforms::transform4_to_5 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.
  • transforms::transform3_to_4 (cyclomatic 17) libs/lockfile/transforms.rs:83 — transforms::transform3_to_4 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 · js_native_api · ×2
  • js_native_api::napi_get_typedarray_info (cyclomatic 17) ext/napi/js_native_api.rs:3802 — js_native_api::napi_get_typedarray_info 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.
  • js_native_api::napi_define_class (cyclomatic 16) ext/napi/js_native_api.rs:242 — js_native_api::napi_define_class 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 · tcp · ×2
  • tcp::poll_tcp_handle (cognitive 161) libs/core/uv_compat/tcp.rs:1271 — tcp::poll_tcp_handle has cognitive complexity 161 (threshold 15). Drivers by points: if/else 100, loops 31, match/switch 18, boolean chains 12 (nesting depth added 93). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tcp::uv_listen (cognitive 26) libs/core/uv_compat/tcp.rs:1130 — tcp::uv_listen has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14, match/switch 12 (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 · coverage · ×2
  • coverage::generate_coverage_report (cognitive 141) cli/tools/coverage/mod.rs:126 — coverage::generate_coverage_report has cognitive complexity 141 (threshold 15). Drivers by points: if/else 97, loops 28, boolean chains 16 (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • coverage::cover_files (cognitive 30) cli/tools/coverage/mod.rs:690 — coverage::cover_files has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13, match/switch 12, boolean chains 3, 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 · fmt_editorconfig · ×2
  • fmt_editorconfig::glob_to_regex_depth (cognitive 113) cli/tools/fmt_editorconfig.rs:427 — fmt_editorconfig::glob_to_regex_depth has cognitive complexity 113 (threshold 15). Drivers by points: if/else 61, loops 33, match/switch 11, boolean chains 8 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • fmt_editorconfig::parse (cognitive 35) cli/tools/fmt_editorconfig.rs:278 — fmt_editorconfig::parse has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23, match/switch 8, boolean chains 3, 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 · deno_dotenv · ×2
  • deno_dotenv::parse_env_content_hook_impl (cognitive 104) libs/dotenv/lib.rs:151 — deno_dotenv::parse_env_content_hook_impl has cognitive complexity 104 (threshold 15). Drivers by points: if/else 80, loops 14, boolean chains 8, match/switch 2 (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.
  • deno_dotenv::apply_value_substitution (cognitive 32) libs/dotenv/lib.rs:419 — deno_dotenv::apply_value_substitution has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23, loops 8, 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.
D2 · Cognitive Complexity · diagnostics · ×2
  • diagnostics::diagnose_resolution (cognitive 82) cli/lsp/diagnostics.rs:1152 — diagnostics::diagnose_resolution has cognitive complexity 82 (threshold 15). Drivers by points: if/else 58, match/switch 20, boolean chains 2, loops 2 (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.
  • diagnostics::diagnose_dependency (cognitive 18) cli/lsp/diagnostics.rs:1399 — diagnostics::diagnose_dependency has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, 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.
D2 · Cognitive Complexity · collectors · ×2
  • collectors::visit_call_expr (cognitive 76) cli/lsp/testing/collectors.rs:139 — collectors::visit_call_expr has cognitive complexity 76 (threshold 15). Drivers by points: if/else 45, match/switch 24, loops 6, 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.
  • collectors::parse_test_context_param (cognitive 27) cli/lsp/testing/collectors.rs:74 — collectors::parse_test_context_param has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, match/switch 8, loops 2, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deno_process · ×2
  • deno_process::create_command (cognitive 75) ext/process/lib.rs:581 — deno_process::create_command has cognitive complexity 75 (threshold 15). Drivers by points: if/else 52, match/switch 12, loops 6, boolean chains 5 (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.
  • deno_process::op_spawn_sync (cognitive 43) ext/process/lib.rs:1554 — deno_process::op_spawn_sync has cognitive complexity 43 (threshold 15). Drivers by points: if/else 32, match/switch 5, boolean chains 3, loops 3 (nesting depth added 17). Of this number, 28 points are the body's own statements and 15 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · JsRuntime · ×2
  • JsRuntime::poll_event_loop_inner (cognitive 75) libs/core/runtime/jsruntime.rs:2420 — JsRuntime::poll_event_loop_inner has cognitive complexity 75 (threshold 15). Drivers by points: if/else 62, boolean chains 11, loops 2 (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.
  • JsRuntime::new_inner (cognitive 22) libs/core/runtime/jsruntime.rs:798 — JsRuntime::new_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 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.
D2 · Cognitive Complexity · subtle_crypto · ×2
  • subtle_crypto::supports_params_valid (cognitive 74) ext/crypto/subtle_crypto.rs:648 — subtle_crypto::supports_params_valid has cognitive complexity 74 (threshold 15). Drivers by points: if/else 42, boolean chains 21, match/switch 11 (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.
  • subtle_crypto::supports_inner (cognitive 16) ext/crypto/subtle_crypto.rs:515 — subtle_crypto::supports_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, match/switch 5, 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 · tls_wrap · ×2
  • tls_wrap::build_server_config (cognitive 71) ext/node/ops/tls_wrap.rs:4562 — tls_wrap::build_server_config has cognitive complexity 71 (threshold 15). Drivers by points: if/else 38, loops 16, match/switch 12, boolean chains 5 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • tls_wrap::build_client_config (cognitive 60) ext/node/ops/tls_wrap.rs:4057 — tls_wrap::build_client_config has cognitive complexity 60 (threshold 15). Drivers by points: if/else 39, match/switch 10, loops 6, boolean chains 5 (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 · denort_desktop · ×2
  • denort_desktop::run_desktop (cognitive 66) cli/rt_desktop/lib.rs:1611 — denort_desktop::run_desktop has cognitive complexity 66 (threshold 15). Drivers by points: if/else 51, boolean chains 6, loops 6, match/switch 3 (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.
  • denort_desktop::v8_to_laufey_value (cognitive 28) cli/rt_desktop/lib.rs:939 — denort_desktop::v8_to_laufey_value has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, loops 5 (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 · transpile · ×2
  • transpile::restore_block_comment_newlines (cognitive 65) cli/tools/transpile.rs:388 — transpile::restore_block_comment_newlines has cognitive complexity 65 (threshold 15). Drivers by points: if/else 36, loops 14, boolean chains 10, match/switch 5 (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.
  • transpile::transpile (cognitive 35) cli/tools/transpile.rs:26 — transpile::transpile has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, boolean chains 6, loops 2, 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 · CompletionEntry · ×2
  • CompletionEntry::as_completion_item (cognitive 63) cli/lsp/tsc.rs:4422 — CompletionEntry::as_completion_item has cognitive complexity 63 (threshold 15). Drivers by points: if/else 54, boolean chains 5, loops 3, match/switch 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.
  • CompletionEntry::get_filter_text (cognitive 33) cli/lsp/tsc.rs:4367 — CompletionEntry::get_filter_text has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, loops 4, 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.
D2 · Cognitive Complexity · Decipher · ×2
  • Decipher::new (cognitive 59) ext/node_crypto/cipher.rs:1282 — Decipher::new has cognitive complexity 59 (threshold 15). Drivers by points: if/else 54, match/switch 3, boolean chains 2 (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.
  • Decipher::r#final (cognitive 32) ext/node_crypto/cipher.rs:1558 — Decipher::r#final has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30, boolean chains 1, match/switch 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 · PackumentIndexer · ×2
  • PackumentIndexer::on_string (cognitive 57) libs/npm/fast_registry_json.rs:1052 — PackumentIndexer::on_string has cognitive complexity 57 (threshold 15). Drivers by points: if/else 39, boolean chains 14, match/switch 4 (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.
  • PackumentIndexer::on_operator (cognitive 26) libs/npm/fast_registry_json.rs:1172 — PackumentIndexer::on_operator has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, match/switch 3, 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.
D2 · Cognitive Complexity · fmt · ×2
  • fmt::get_typescript_config_builder (cognitive 54) cli/tools/fmt.rs:1274 — fmt::get_typescript_config_builder has cognitive complexity 54 (threshold 15). Drivers by points: match/switch 28, if/else 25, boolean chains 1 (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • fmt::format (cognitive 20) cli/tools/fmt.rs:58 — fmt::format has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, loops 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.
D2 · Cognitive Complexity · StatementSync · ×2
  • StatementSync::bind_params (cognitive 54) ext/node_sqlite/statement.rs:495 — StatementSync::bind_params has cognitive complexity 54 (threshold 15). Drivers by points: if/else 40, loops 12, boolean chains 2 (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.
  • StatementSync::columns (cognitive 16) ext/node_sqlite/statement.rs:1065 — StatementSync::columns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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 · transforms · ×2
  • transforms::transform3_to_4 (cognitive 54) libs/lockfile/transforms.rs:83 — transforms::transform3_to_4 has cognitive complexity 54 (threshold 15). Drivers by points: if/else 28, loops 26 (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.
  • transforms::transform4_to_5 (cognitive 41) libs/lockfile/transforms.rs:239 — transforms::transform4_to_5 has cognitive complexity 41 (threshold 15). Drivers by points: if/else 29, loops 12 (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 · fmt_errors · ×2
  • fmt_errors::format_js_error_inner (cognitive 51) runtime/fmt_errors.rs:271 — fmt_errors::format_js_error_inner has cognitive complexity 51 (threshold 15). Drivers by points: if/else 31, loops 11, match/switch 6, boolean chains 3 (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.
  • fmt_errors::get_message_suggestions_inner (cognitive 37) runtime/fmt_errors.rs:472 — fmt_errors::get_message_suggestions_inner has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, boolean chains 10 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · map · ×2
  • map::render_js_wasm_module (cognitive 46) libs/core/modules/map.rs:3676 — map::render_js_wasm_module has cognitive complexity 46 (threshold 15). Drivers by points: if/else 32, loops 14 (nesting depth added 22). Of this number, 45 points are the body's own statements and 1 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • map::strip_script_prologue (cognitive 17) libs/core/modules/map.rs:3527 — map::strip_script_prologue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · outdated · ×2
  • outdated::update (cognitive 45) cli/tools/pm/outdated/mod.rs:441 — outdated::update has cognitive complexity 45 (threshold 15). Drivers by points: if/else 31, loops 8, boolean chains 4, match/switch 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.
  • outdated::choose_new_version_req (cognitive 28) cli/tools/pm/outdated/mod.rs:357 — outdated::choose_new_version_req has cognitive complexity 28 (threshold 15). Drivers by points: if/else 24, 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.
D2 · Cognitive Complexity · info · ×2
  • info::add_npm_packages_to_json (cognitive 45) cli/tools/info.rs:310 — info::add_npm_packages_to_json has cognitive complexity 45 (threshold 15). Drivers by points: if/else 32, loops 9, boolean chains 4 (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.
  • info::info (cognitive 26) cli/tools/info.rs:45 — info::info has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 16, if/else 10 (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.
D2 · Cognitive Complexity · url · ×2
  • url::parse_simple_special_url (cognitive 45) ext/web/url.rs:112 — url::parse_simple_special_url has cognitive complexity 45 (threshold 15). Drivers by points: if/else 28, boolean chains 7, loops 6, match/switch 4 (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.
  • url::simple_special_host_is_canonical (cognitive 34) ext/web/url.rs:223 — url::simple_special_host_is_canonical has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21, boolean chains 8, loops 3, match/switch 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.
D2 · Cognitive Complexity · unfurl · ×2
  • unfurl::unfurl_dynamic_specifier (cognitive 41) cli/tools/pack/unfurl.rs:222 — unfurl::unfurl_dynamic_specifier has cognitive complexity 41 (threshold 15). Drivers by points: if/else 34, boolean chains 6, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • unfurl::unfurl_specifiers (cognitive 18) cli/tools/pack/unfurl.rs:41 — unfurl::unfurl_specifiers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 4, match/switch 4 (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 · x · ×2
  • x::run (cognitive 40) cli/tools/x.rs:535 — x::run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 32, boolean chains 3, match/switch 3, 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.
  • x::autoinstall_package (cognitive 18) cli/tools/x.rs:803 — x::autoinstall_package has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, match/switch 6, boolean chains 1 (nesting depth added 8). Of this number, 13 points are the body's own statements and 5 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · hoisted · ×2
  • hoisted::compute_hoisted_layout (cognitive 40) libs/npm_installer/hoisted.rs:98 — hoisted::compute_hoisted_layout has cognitive complexity 40 (threshold 15). Drivers by points: if/else 25, loops 9, boolean chains 4, match/switch 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.
  • hoisted::cleanup_hoisted_packages (cognitive 19) libs/npm_installer/hoisted.rs:1035 — hoisted::cleanup_hoisted_packages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 6, boolean chains 1 (nesting depth added 11). Of this number, 18 points are the body's own statements and 1 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · pnpm_lockfile_import · ×2
  • pnpm_lockfile_import::pnpm_lock_to_deno_lock_v5 (cognitive 40) libs/resolver/pnpm_lockfile_import.rs:41 — pnpm_lockfile_import::pnpm_lock_to_deno_lock_v5 has cognitive complexity 40 (threshold 15). Drivers by points: if/else 27, loops 13 (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.
  • pnpm_lockfile_import::collect_importer_specifiers (cognitive 17) libs/resolver/pnpm_lockfile_import.rs:425 — pnpm_lockfile_import::collect_importer_specifiers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, match/switch 4, loops 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 · TLSWrapInner · ×2
  • TLSWrapInner::clear_out_process (cognitive 39) ext/node/ops/tls_wrap.rs:1508 — TLSWrapInner::clear_out_process has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22, match/switch 10, loops 5, boolean chains 2 (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.
  • TLSWrapInner::dispatch_clear_out_callbacks (cognitive 29) ext/node/ops/tls_wrap.rs:1700 — TLSWrapInner::dispatch_clear_out_callbacks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 28, 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 · dispatch_slow · ×2
  • dispatch_slow::from_arg (cognitive 39) libs/ops/op2/dispatch_slow.rs:425 — dispatch_slow::from_arg has cognitive complexity 39 (threshold 15). Drivers by points: if/else 26, match/switch 13 (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.
  • dispatch_slow::generate_dispatch_slow (cognitive 27) libs/ops/op2/dispatch_slow.rs:76 — dispatch_slow::generate_dispatch_slow has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, boolean chains 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 · binding · ×2
  • binding::consume_read_callback (cognitive 38) ext/node/ops/llhttp/binding.rs:730 — binding::consume_read_callback has cognitive complexity 38 (threshold 15). Drivers by points: if/else 33, boolean chains 5 (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.
  • binding::on_headers_complete (cognitive 22) ext/node/ops/llhttp/binding.rs:446 — binding::on_headers_complete has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Graph · ×2
  • Graph::compute_all_npm_pkg_ids (cognitive 34) libs/npm/resolution/graph.rs:541 — Graph::compute_all_npm_pkg_ids has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15, loops 12, boolean chains 4, match/switch 3 (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.
  • Graph::resolve_packages_for_snapshot_with_maybe_restart (cognitive 16) libs/npm/resolution/graph.rs:802 — Graph::resolve_packages_for_snapshot_with_maybe_restart has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 5, match/switch 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.
D2 · Cognitive Complexity · native_addons · ×2
  • native_addons::collect_bundle_required_packages (cognitive 33) cli/standalone/native_addons.rs:113 — native_addons::collect_bundle_required_packages has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23, loops 9, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • native_addons::find_byonm_native_addon_packages (cognitive 22) cli/standalone/native_addons.rs:210 — native_addons::find_byonm_native_addon_packages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 6 (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 · wasm · ×2
  • wasm::collect_import_records (cognitive 32) cli/tools/publish/wasm.rs:154 — wasm::collect_import_records has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, match/switch 7, loops 4, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • wasm::render_js_wasm_module (cognitive 20) cli/tools/bundle/wasm.rs:29 — wasm::render_js_wasm_module has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, loops 10 (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 · cipher · ×2
  • cipher::aes_unwrap_key (cognitive 32) ext/node_crypto/cipher.rs:198 — cipher::aes_unwrap_key has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24, boolean chains 4, loops 3, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • cipher::aes_wrap_key (cognitive 23) ext/node_crypto/cipher.rs:52 — cipher::aes_wrap_key has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeActivityStats · ×2
  • RuntimeActivityStats::diff (cognitive 32) libs/core/runtime/stats.rs:418 — RuntimeActivityStats::diff has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23, loops 9 (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.
  • RuntimeActivityStats::dump (cognitive 21) libs/core/runtime/stats.rs:359 — RuntimeActivityStats::dump has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, loops 9 (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 · registries · ×2
  • registries::get_completion_type (cognitive 30) cli/lsp/registries.rs:95 — registries::get_completion_type has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, match/switch 2, loops 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.
  • registries::validate_config (cognitive 26) cli/lsp/registries.rs:302 — registries::validate_config has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15, loops 8, boolean chains 3 (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 · execution · ×2
  • execution::as_queue_and_filters (cognitive 30) cli/lsp/testing/execution.rs:53 — execution::as_queue_and_filters has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, loops 3, boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • execution::extract_env_files_from_command (cognitive 16) cli/lsp/testing/execution.rs:645 — execution::extract_env_files_from_command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 4, 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 · type_checker · ×2
  • type_checker::get_leading_comments (cognitive 30) cli/type_checker.rs:1681 — type_checker::get_leading_comments has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16, loops 11, match/switch 2, 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.
  • type_checker::maybe_ts_suppression_comment (cognitive 19) cli/type_checker.rs:1513 — type_checker::maybe_ts_suppression_comment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 3, 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 · CjsModuleExportAnalyzer · ×2
  • CjsModuleExportAnalyzer::resolve (cognitive 30) libs/node_resolver/analyze.rs:495 — CjsModuleExportAnalyzer::resolve has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, boolean chains 2, loops 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CjsModuleExportAnalyzer::analyze_reexports (cognitive 20) libs/node_resolver/analyze.rs:338 — CjsModuleExportAnalyzer::analyze_reexports has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, match/switch 6, 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.
D2 · Cognitive Complexity · editor · ×2
  • editor::highlight_line (cognitive 29) cli/tools/repl/editor.rs:398 — editor::highlight_line has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 14, if/else 12, boolean chains 2, loops 1 (nesting depth added 17). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • editor::validate (cognitive 22) cli/tools/repl/editor.rs:264 — editor::validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, match/switch 9, 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 · error · ×2
  • error::format_frame (cognitive 29) libs/core/error.rs:2449 — error::format_frame has cognitive complexity 29 (threshold 15). Drivers by points: if/else 25, 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.
  • error::format_location (cognitive 17) libs/core/error.rs:2376 — error::format_location has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliModuleLoader · ×2
  • CliModuleLoader::prepare_load (cognitive 28) cli/module_loader.rs:1569 — CliModuleLoader::prepare_load has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, boolean chains 5 (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.
  • CliModuleLoader::load (cognitive 19) cli/module_loader.rs:1386 — CliModuleLoader::load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 4, match/switch 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.
D2 · Cognitive Complexity · NpmPackageVersionResolver · ×2
  • NpmPackageVersionResolver::strongest_trust_evidence_before (cognitive 28) libs/npm/resolution/common.rs:322 — NpmPackageVersionResolver::strongest_trust_evidence_before has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, loops 3, boolean chains 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.
  • NpmPackageVersionResolver::resolve_best_package_version_info (cognitive 16) libs/npm/resolution/common.rs:419 — NpmPackageVersionResolver::resolve_best_package_version_info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 2, match/switch 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 · TaskRunner · ×2
  • TaskRunner::run_tasks_in_parallel (cognitive 27) cli/tools/task.rs:475 — TaskRunner::run_tasks_in_parallel has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, loops 5, match/switch 5, 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.
  • TaskRunner::run_all_tasks (cognitive 22) cli/tools/task.rs:413 — TaskRunner::run_all_tasks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, match/switch 3, 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 · (anonymous) (cognitive 26) · ×2
  • (anonymous) (cognitive 26) runtime/js/99_main.js:936 — (anonymous) has cognitive complexity 26 (threshold 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.
  • (anonymous) (cognitive 26) ext/image/01_image.js:219 — (anonymous) has cognitive complexity 26 (threshold 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 · framework · ×2
  • framework::strip_comments (cognitive 25) cli/tools/framework.rs:437 — framework::strip_comments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, loops 9, match/switch 3, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • framework::detect_framework (cognitive 23) cli/tools/framework.rs:123 — framework::detect_framework has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, boolean chains 10 (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 · impl_ · ×2
  • impl_::serialize_v8_value (cognitive 25) ext/node/ops/ipc.rs:75 — impl_::serialize_v8_value has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, loops 4, 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.
  • impl_::ab_view_to_index (cognitive 17) ext/node/ops/ipc.rs:319 — impl_::ab_view_to_index has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (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 · ConfigFile · ×2
  • ConfigFile::to_exports_config (cognitive 25) libs/config/deno_json/mod.rs:2022 — ConfigFile::to_exports_config has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, match/switch 4, loops 3, boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 2 function items declared inside it (validate_key, validate_value). 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.
  • ConfigFile::dependencies (cognitive 22) libs/config/deno_json/mod.rs:2766 — ConfigFile::dependencies has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 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 · code_lens · ×2
  • code_lens::find_test_fn_body (cognitive 23) cli/lsp/code_lens.rs:104 — code_lens::find_test_fn_body has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 11, if/else 8, boolean chains 2, loops 2 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • code_lens::collect_tsc (cognitive 17) cli/lsp/code_lens.rs:658 — code_lens::collect_tsc has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 8, if/else 7, boolean chains 2 (nesting depth added 8). 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 · args · ×2
  • args::flags_to_permissions_options (cognitive 23) cli/args/mod.rs:1715 — args::flags_to_permissions_options has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, match/switch 7 (nesting depth added 5). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 2 function items declared inside it (handle_allow, handle_deny_or_ignore). 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.
  • args::get_root_cert_store (cognitive 23) cli/lib/args.rs:129 — args::get_root_cert_store has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10, match/switch 8, loops 4, 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 · VfsBuilder · ×2
  • VfsBuilder::ensure_canonical_dir_inner (cognitive 23) cli/lib/standalone/virtual_fs.rs:836 — VfsBuilder::ensure_canonical_dir_inner has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, match/switch 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.
  • VfsBuilder::build (cognitive 17) cli/lib/standalone/virtual_fs.rs:1254 — VfsBuilder::build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, match/switch 7, loops 2 (nesting depth added 8). Of this number, 14 points are the body's own statements and 3 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · repl · ×2
  • repl::run_json (cognitive 22) cli/tools/repl/mod.rs:278 — repl::run_json has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, match/switch 6, loops 3 (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.
  • repl::run (cognitive 17) cli/tools/repl/mod.rs:155 — repl::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, match/switch 3, 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 · task · ×2
  • task::execute_script (cognitive 22) cli/tools/task.rs:58 — task::execute_script has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • task::get_available_tasks (cognitive 21) cli/tools/task.rs:1356 — task::get_available_tasks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, loops 7, 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.
D2 · Cognitive Complexity · deno_http · ×2
  • deno_http::parse_serve_address (cognitive 22) ext/http/lib.rs:1858 — deno_http::parse_serve_address has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 16, if/else 6 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • deno_http::op_http_write_resource (cognitive 16) ext/http/lib.rs:1514 — deno_http::op_http_write_resource has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 4, 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 · turbocall · ×2
  • turbocall::compile_trampoline (cognitive 21) ext/ffi/turbocall.rs:62 — turbocall::compile_trampoline has cognitive complexity 21 (threshold 15). Drivers by points: if/else 28, loops 5, match/switch 4 (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.
  • turbocall::compile_trampoline::convert (cognitive 16) ext/ffi/turbocall.rs:107 — turbocall::compile_trampoline::convert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NpmOverrides · ×2
  • NpmOverrides::get_override_for (cognitive 21) libs/npm/resolution/overrides.rs:197 — NpmOverrides::get_override_for has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, match/switch 8, boolean chains 2, 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.
  • NpmOverrides::for_child (cognitive 19) libs/npm/resolution/overrides.rs:134 — NpmOverrides::for_child has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 3, match/switch 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IsCjsResolver · ×2
  • IsCjsResolver::check_based_on_pkg_json (cognitive 21) libs/resolver/cjs/mod.rs:311 — IsCjsResolver::check_based_on_pkg_json has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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.
  • IsCjsResolver::get_known_mode_with_is_script (cognitive 19) libs/resolver/cjs/mod.rs:245 — IsCjsResolver::get_known_mode_with_is_script has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, match/switch 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 · vm · ×2
  • vm::property_definer (cognitive 20) ext/node/ops/vm.rs:1112 — vm::property_definer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 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.
  • vm::op_vm_compile_function (cognitive 18) ext/node/ops/vm.rs:1489 — vm::op_vm_compile_function has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 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.
D2 · Cognitive Complexity · resolution · ×2
  • resolution::resolve_pkg_json_import (cognitive 20) libs/node_resolver/resolution.rs:2504 — resolution::resolve_pkg_json_import has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, 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.
  • resolution::peer_dep_diagnostics_to_display_tree (cognitive 16) libs/npm_installer/resolution.rs:435 — resolution::peer_dep_diagnostics_to_display_tree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (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 · (anonymous) (cognitive 20) · ×2
  • (anonymous) (cognitive 20) runtime/js/11_workers.js:282 — (anonymous) has cognitive complexity 20 (threshold 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.
  • (anonymous) (cognitive 20) ext/webidl/00_webidl.js:836 — (anonymous) has cognitive complexity 20 (threshold 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 · list · ×2
  • list::list (cognitive 18) cli/tools/pm/list.rs:296 — list::list has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 2, match/switch 2, loops 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.
  • list::print_tree (cognitive 16) cli/tools/pm/list.rs:228 — list::print_tree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 6). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function item declared inside it (walk). 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.
D2 · Cognitive Complexity · bitmap · ×2
  • bitmap::parse_args (cognitive 18) ext/image/bitmap.rs:283 — bitmap::parse_args has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, match/switch 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.
  • bitmap::op_create_image_bitmap (cognitive 16) ext/image/bitmap.rs:371 — bitmap::op_create_image_bitmap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, match/switch 5, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ops · ×2
  • ops::op_net_connect_tcp_inner (cognitive 18) ext/net/ops.rs:539 — ops::op_net_connect_tcp_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, match/switch 4, boolean chains 2, loops 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.
  • ops::op_dns_resolve (cognitive 16) ext/net/ops.rs:1056 — ops::op_dns_resolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 1, loops 1, match/switch 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.
D2 · Cognitive Complexity · TLSWrap · ×2
  • TLSWrap::read_start (cognitive 18) ext/node/ops/tls_wrap.rs:2472 — TLSWrap::read_start has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 4 (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.
  • TLSWrap::set_alpn_protocols (cognitive 16) ext/node/ops/tls_wrap.rs:3046 — TLSWrap::set_alpn_protocols has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, 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 · subtle_export_key · ×2
  • subtle_export_key::export_okp (cognitive 17) ext/crypto/subtle_export_key.rs:613 — subtle_export_key::export_okp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, match/switch 6 (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.
  • subtle_export_key::jwk_to_object (cognitive 16) ext/crypto/subtle_export_key.rs:157 — subtle_export_key::jwk_to_object has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 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 · write · ×2
  • write::write_response_head_inner (cognitive 17) libs/http_h1/write.rs:213 — write::write_response_head_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, loops 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.
  • write::write_response_head_to_inner (cognitive 17) libs/http_h1/write.rs:282 — write::write_response_head_to_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, loops 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 · uv · ×2
  • uv::uv_ref (cognitive 16) ext/napi/uv.rs:1085 — uv::uv_ref has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • uv::uv_unref (cognitive 16) ext/napi/uv.rs:1128 — uv::uv_unref has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D38 · OSV Dependency Vulnerabilities · Medium vulnerability · ×2
  • Medium vulnerability: RUSTSEC-2026-0204 Cargo.lock — crossbeam-epoch 0.9.18: RUSTSEC-2026-0204 — crossbeam-epoch is not declared in this repo's manifests: it is pulled in transitively by crossbeam-deque 0.8.5 and moka 0.12.10, so upgrade the dependency that requires it (or force it with `cargo update -p crossbeam-epoch@0.9.18 --precise 0.9.20`, or a `[patch.crates-io]` entry).
  • Medium vulnerability: RUSTSEC-2026-0194 Cargo.lock — quick-xml 0.39.4: RUSTSEC-2026-0194 — quick-xml is not declared in this repo's manifests: it is pulled in transitively by plist 1.9.0, so upgrade the dependency that requires it (or add a `[patch.crates-io]` entry for quick-xml — 0.41.0 is not semver-compatible with the resolved 0.39.4, so `cargo update --precise` cannot select it). One upgrade of quick-xml 0.39.4 clears all 2 advisories it raises: RUSTSEC-2026-0194, RUSTSEC-2026-0195.
D1 · Cyclomatic Complexity · LocalNpmPackageInstaller · ×1
  • LocalNpmPackageInstaller::sync_resolution_with_fs (cyclomatic 85) libs/npm_installer/local.rs:199 — LocalNpmPackageInstaller::sync_resolution_with_fs has cyclomatic complexity 85 (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 · tcp · ×1
  • tcp::poll_tcp_handle (cyclomatic 70) libs/core/uv_compat/tcp.rs:1271 — tcp::poll_tcp_handle has cyclomatic complexity 70 (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 · callback · ×1
  • callback::do_ffi_callback (cyclomatic 61) ext/ffi/callback.rs:212 — callback::do_ffi_callback 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.
D1 · Cyclomatic Complexity · mainFetch (cyclomatic 59) · ×1
  • mainFetch (cyclomatic 59) ext/fetch/26_fetch.js:386 — mainFetch has cyclomatic complexity 59 (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 · OptionsParser · ×1
  • OptionsParser::parse (cyclomatic 58) libs/node_shim/lib.rs:2801 — OptionsParser::parse has cyclomatic complexity 58 (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 · DenoCompileBinaryWriter · ×1
  • DenoCompileBinaryWriter::write_standalone_binary (cyclomatic 57) cli/standalone/binary.rs:565 — DenoCompileBinaryWriter::write_standalone_binary has cyclomatic complexity 57 (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 · subtle_crypto · ×1
  • subtle_crypto::supports_params_valid (cyclomatic 55) ext/crypto/subtle_crypto.rs:648 — subtle_crypto::supports_params_valid has cyclomatic complexity 55 (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 · fmt · ×1
  • fmt::get_typescript_config_builder (cyclomatic 53) cli/tools/fmt.rs:1274 — fmt::get_typescript_config_builder has cyclomatic complexity 53 (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 · node_shim · ×1
  • node_shim::translate_to_deno_args (cyclomatic 50) libs/node_shim/lib.rs:3453 — node_shim::translate_to_deno_args 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.
D1 · Cyclomatic Complexity · Console · ×1
  • Console::table_impl (cyclomatic 47) ext/web/console/mod.rs:1421 — Console::table_impl has cyclomatic complexity 47 (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 · constructor (cyclomatic 47) · ×1
  • constructor (cyclomatic 47) ext/fetch/23_request.js:370 — constructor has cyclomatic complexity 47 (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 · parseSelector (cyclomatic 43) · ×1
  • parseSelector (cyclomatic 43) cli/js/40_lint_selector.js:475 — parseSelector has cyclomatic complexity 43 (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 · benchMeasure (cyclomatic 42) · ×1
  • benchMeasure (cyclomatic 42) cli/js/40_bench.js:244 — benchMeasure has cyclomatic complexity 42 (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 · JsRuntimeInspectorState · ×1
  • JsRuntimeInspectorState::poll_sessions (cyclomatic 41) libs/core/inspector.rs:522 — JsRuntimeInspectorState::poll_sessions has cyclomatic complexity 41 (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 · deno_dotenv · ×1
  • deno_dotenv::parse_env_content_hook_impl (cyclomatic 41) libs/dotenv/lib.rs:151 — deno_dotenv::parse_env_content_hook_impl has cyclomatic complexity 41 (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 · Lockfile · ×1
  • Lockfile::set_workspace_config (cyclomatic 41) libs/lockfile/lib.rs:813 — Lockfile::set_workspace_config has cyclomatic complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to one function item declared inside it. 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 · JsError · ×1
  • JsError::inner_from_v8_exception (cyclomatic 40) libs/core/error.rs:1016 — JsError::inner_from_v8_exception 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.
D1 · Cyclomatic Complexity · respondWith (cyclomatic 40) · ×1
  • respondWith (cyclomatic 40) ext/http/01_http.js:197 — respondWith has cyclomatic complexity 40 (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 · ModuleRegistry · ×1
  • ModuleRegistry::get_completions (cyclomatic 38) cli/lsp/registries.rs:653 — ModuleRegistry::get_completions 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.
D1 · Cyclomatic Complexity · width · ×1
  • width::ansi_sequence_len (cyclomatic 38) ext/web/console/width.rs:13 — width::ansi_sequence_len has cyclomatic complexity 38 (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 · constructor (cyclomatic 38) · ×1
  • constructor (cyclomatic 38) ext/websocket/01_websocket.js:253 — constructor has cyclomatic complexity 38 (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 · isSimpleSpecialHostCanonical (cyclomatic 37) · ×1
  • isSimpleSpecialHostCanonical (cyclomatic 37) ext/web/00_url.js:492 — isSimpleSpecialHostCanonical has cyclomatic complexity 37 (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 · EnvironmentOptions · ×1
  • EnvironmentOptions::check_options (cyclomatic 36) libs/node_shim/lib.rs:422 — EnvironmentOptions::check_options 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.
D1 · Cyclomatic Complexity · parseSimpleSpecialUrl (cyclomatic 36) · ×1
  • parseSimpleSpecialUrl (cyclomatic 36) ext/web/00_url.js:604 — parseSimpleSpecialUrl has cyclomatic complexity 36 (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 · HoistedNpmPackageInstaller · ×1
  • HoistedNpmPackageInstaller::sync_resolution_with_fs (cyclomatic 35) libs/npm_installer/hoisted.rs:349 — HoistedNpmPackageInstaller::sync_resolution_with_fs 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.
D1 · Cyclomatic Complexity · NpmRc · ×1
  • NpmRc::parse (cyclomatic 35) libs/npmrc/lib.rs:200 — NpmRc::parse 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.
D1 · Cyclomatic Complexity · serverRequestInner (cyclomatic 35) · ×1
  • serverRequestInner (cyclomatic 35) cli/tsc/98_lsp.js:428 — serverRequestInner has cyclomatic complexity 35 (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 · TestRun · ×1
  • TestRun::exec (cyclomatic 34) cli/lsp/testing/execution.rs:235 — TestRun::exec has cyclomatic complexity 34 (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 · subtle_derive_bits · ×1
  • subtle_derive_bits::run (cyclomatic 34) ext/crypto/subtle_derive_bits.rs:417 — subtle_derive_bits::run 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.
D1 · Cyclomatic Complexity · ZstdCompress · ×1
  • ZstdCompress::init (cyclomatic 34) ext/node/ops/zlib/mod.rs:999 — ZstdCompress::init has cyclomatic complexity 34 (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 · util · ×1
  • util::parse_iso8601_duration (cyclomatic 34) libs/config/util.rs:168 — util::parse_iso8601_duration 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.
D1 · Cyclomatic Complexity · dispatch (cyclomatic 34) · ×1
  • dispatch (cyclomatic 34) ext/web/02_event.js:563 — dispatch has cyclomatic complexity 34 (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 · collectors · ×1
  • collectors::visit_call_expr (cyclomatic 33) cli/lsp/testing/collectors.rs:139 — collectors::visit_call_expr 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.
D1 · Cyclomatic Complexity · virtual_fs · ×1
  • virtual_fs::vfs_as_display_tree (cyclomatic 33) cli/standalone/virtual_fs.rs:36 — virtual_fs::vfs_as_display_tree has cyclomatic complexity 33 (threshold 15). Of this number, 17 points are the body's own statements and 16 belong to 8 function items declared inside it. 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 · inspector · ×1
  • inspector::pump_inspector_session_messages (cyclomatic 33) libs/core/inspector.rs:2051 — inspector::pump_inspector_session_messages 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.
D1 · Cyclomatic Complexity · TsResponseImportMapper · ×1
  • TsResponseImportMapper::check_specifier (cyclomatic 32) cli/lsp/analysis.rs:367 — TsResponseImportMapper::check_specifier has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belong to one function item declared inside it. 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 · NpmInstallDepsProvider · ×1
  • NpmInstallDepsProvider::from_workspace (cyclomatic 32) libs/npm_installer/package_json.rs:161 — NpmInstallDepsProvider::from_workspace 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.
D1 · Cyclomatic Complexity · PackageJson · ×1
  • PackageJson::load_from_value (cyclomatic 32) libs/package_json/lib.rs:510 — PackageJson::load_from_value has cyclomatic complexity 32 (threshold 15). Of this number, 23 points are the body's own statements and 9 belong to 5 function items declared inside it. 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 · cpuprof · ×1
  • cpuprof::generate_markdown_report (cyclomatic 32) runtime/cpu_profiler/cpuprof.rs:59 — cpuprof::generate_markdown_report has cyclomatic complexity 32 (threshold 15). Of this number, 23 points are the body's own statements and 9 belong to 2 function items declared inside it. 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 · CompletionEntry · ×1
  • CompletionEntry::as_completion_item (cyclomatic 31) cli/lsp/tsc.rs:4422 — CompletionEntry::as_completion_item has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cache_deps · ×1
  • cache_deps::cache_top_level_deps (cyclomatic 31) cli/tools/pm/cache_deps.rs:34 — cache_deps::cache_top_level_deps has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · denort_desktop · ×1
  • denort_desktop::run_desktop (cyclomatic 31) cli/rt_desktop/lib.rs:1611 — denort_desktop::run_desktop has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DatabaseSyncOptions · ×1
  • DatabaseSyncOptions::from_v8 (cyclomatic 31) ext/node_sqlite/database.rs:84 — DatabaseSyncOptions::from_v8 has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GraphWalker · ×1
  • GraphWalker::resolve_pending (cyclomatic 30) cli/type_checker.rs:1113 — GraphWalker::resolve_pending 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 · pm · ×1
  • pm::add (cyclomatic 30) cli/tools/pm/mod.rs:536 — pm::add 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 · fast_registry_json · ×1
  • fast_registry_json::pluck_versions_from_tokens (cyclomatic 30) libs/npm/fast_registry_json.rs:798 — fast_registry_json::pluck_versions_from_tokens 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 · npm_lockfile_import · ×1
  • npm_lockfile_import::package_lock_to_deno_lock_v5 (cyclomatic 30) libs/resolver/npm_lockfile_import.rs:62 — npm_lockfile_import::package_lock_to_deno_lock_v5 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 · checkIsComplete (cyclomatic 30) · ×1
  • checkIsComplete (cyclomatic 30) cli/js/jupyter_kernel.js:624 — checkIsComplete 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.
D1 · Cyclomatic Complexity · FilePatterns · ×1
  • FilePatterns::split_by_base (cyclomatic 29) libs/config/glob/mod.rs:132 — FilePatterns::split_by_base 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.
D1 · Cyclomatic Complexity · testInner (cyclomatic 29) · ×1
  • testInner (cyclomatic 29) cli/js/40_test.js:364 — testInner has cyclomatic complexity 29 (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 · bitmap · ×1
  • bitmap::parse_args (cyclomatic 28) ext/image/bitmap.rs:283 — bitmap::parse_args has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PermissionsContainer · ×1
  • PermissionsContainer::check_special_file (cyclomatic 28) runtime/permissions/lib.rs:4437 — PermissionsContainer::check_special_file has cyclomatic complexity 28 (threshold 15). Of this number, 20 points are the body's own statements and 8 belong to 2 function items declared inside it. 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 · next (cyclomatic 28) · ×1
  • next (cyclomatic 28) cli/js/40_lint_selector.js:220 — next has cyclomatic complexity 28 (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 · why · ×1
  • why::why (cyclomatic 27) cli/tools/pm/why.rs:59 — why::why has cyclomatic complexity 27 (threshold 15). 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.
D1 · Cyclomatic Complexity · run · ×1
  • run::run_with_options (cyclomatic 27) cli/rt/run.rs:1314 — run::run_with_options has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · subtle_encrypt · ×1
  • subtle_encrypt::run (cyclomatic 27) ext/crypto/subtle_encrypt.rs:480 — subtle_encrypt::run has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · subtle_decrypt · ×1
  • subtle_decrypt::run (cyclomatic 27) ext/crypto/subtle_decrypt.rs:423 — subtle_decrypt::run has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Prime · ×1
  • Prime::generate_with_options (cyclomatic 27) ext/node_crypto/primes.rs:33 — Prime::generate_with_options has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MacroConfig · ×1
  • MacroConfig::from_metas (cyclomatic 27) libs/ops/op2/config.rs:96 — MacroConfig::from_metas has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ByonmNpmResolver · ×1
  • ByonmNpmResolver::resolve_pkg_json_and_alias_for_req (cyclomatic 27) libs/resolver/npm/byonm.rs:213 — ByonmNpmResolver::resolve_pkg_json_and_alias_for_req has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 belong to one function item declared inside it. 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 · decode (cyclomatic 27) · ×1
  • decode (cyclomatic 27) ext/web/08_text_encoding.js:128 — decode has cyclomatic complexity 27 (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 · #loop (cyclomatic 27) · ×1
  • #loop (cyclomatic 27) ext/fetch/27_eventsource.js:229 — #loop has cyclomatic complexity 27 (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 · npm_compat · ×1
  • npm_compat::install_http_modules (cyclomatic 26) cli/tools/installer/npm_compat.rs:1113 — npm_compat::install_http_modules 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 · subtle_generate_key · ×1
  • subtle_generate_key::run (cyclomatic 26) ext/crypto/subtle_generate_key.rs:311 — subtle_generate_key::run has cyclomatic complexity 26 (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 · import_key · ×1
  • import_key::import_key_ec (cyclomatic 26) ext/crypto/import_key.rs:723 — import_key::import_key_ec 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 · SloppyImportsResolver · ×1
  • SloppyImportsResolver::resolve (cyclomatic 26) libs/resolver/workspace.rs:425 — SloppyImportsResolver::resolve has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belong to one function item declared inside it. 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 · extractBody (cyclomatic 26) · ×1
  • extractBody (cyclomatic 26) ext/fetch/22_body.js:460 — extractBody has cyclomatic complexity 26 (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 · diagnostics · ×1
  • diagnostics::diagnose_resolution (cyclomatic 25) cli/lsp/diagnostics.rs:1152 — diagnostics::diagnose_resolution 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 · DOMMatrixReadOnly · ×1
  • DOMMatrixReadOnly::exec_css_transform (cyclomatic 25) ext/web/geometry.rs:1785 — DOMMatrixReadOnly::exec_css_transform has cyclomatic complexity 25 (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 · RawDenoResolver · ×1
  • RawDenoResolver::resolve (cyclomatic 25) libs/resolver/lib.rs:321 — RawDenoResolver::resolve 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 · constructor (cyclomatic 25) · ×1
  • constructor (cyclomatic 25) ext/web/00_url.js:127 — constructor has cyclomatic complexity 25 (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 · httpRedirectFetch (cyclomatic 25) · ×1
  • httpRedirectFetch (cyclomatic 25) ext/fetch/26_fetch.js:749 — httpRedirectFetch has cyclomatic complexity 25 (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 · interactive_picker · ×1
  • interactive_picker::select_items (cyclomatic 24) cli/tools/pm/interactive_picker.rs:22 — interactive_picker::select_items has cyclomatic complexity 24 (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 · x · ×1
  • x::run (cyclomatic 24) cli/tools/x.rs:535 — x::run has cyclomatic complexity 24 (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 · subtle_get_public_key · ×1
  • subtle_get_public_key::run (cyclomatic 24) ext/crypto/subtle_get_public_key.rs:38 — subtle_get_public_key::run has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · help · ×1
  • help::render_help (cyclomatic 24) libs/cli_parser/src/help.rs:9 — help::render_help has cyclomatic complexity 24 (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 · completions · ×1
  • completions::get_candidates (cyclomatic 24) libs/cli_parser/src/completions.rs:379 — completions::get_candidates has cyclomatic complexity 24 (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 · (anonymous) (cyclomatic 24) · ×1
  • (anonymous) (cyclomatic 24) ext/image/01_image.js:219 — (anonymous) has cyclomatic complexity 24 (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 · handleExecute (cyclomatic 24) · ×1
  • handleExecute (cyclomatic 24) cli/js/jupyter_kernel.js:682 — handleExecute has cyclomatic complexity 24 (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 · framework · ×1
  • framework::detect_framework (cyclomatic 23) cli/tools/framework.rs:123 — framework::detect_framework 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 · desktop_devtools · ×1
  • desktop_devtools::run_unified_session (cyclomatic 23) cli/tools/desktop_devtools.rs:900 — desktop_devtools::run_unified_session 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 · html · ×1
  • html::attr_value (cyclomatic 23) cli/tools/bundle/html.rs:191 — html::attr_value has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · export_key · ×1
  • export_key::export_key_ec (cyclomatic 23) ext/crypto/export_key.rs:252 — export_key::export_key_ec 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 · LibUvStreamWrap · ×1
  • LibUvStreamWrap::writev (cyclomatic 23) ext/node/ops/stream_wrap.rs:1501 — LibUvStreamWrap::writev 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 · ModuleMap · ×1
  • ModuleMap::new_module_from_js_source_with_pending (cyclomatic 23) libs/core/modules/map.rs:953 — ModuleMap::new_module_from_js_source_with_pending 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 · UvLoopInner · ×1
  • UvLoopInner::has_alive_handles (cyclomatic 23) libs/core/uv_compat.rs:341 — UvLoopInner::has_alive_handles 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 · op2 · ×1
  • op2::generate_op2 (cyclomatic 23) libs/ops/op2/mod.rs:203 — op2::generate_op2 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 · request (cyclomatic 23) · ×1
  • request (cyclomatic 23) ext/web/locks.js:99 — request has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · measure (cyclomatic 23) · ×1
  • measure (cyclomatic 23) ext/web/15_performance.js:723 — measure has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · bench (cyclomatic 23) · ×1
  • bench (cyclomatic 23) cli/js/40_bench.js:64 — bench has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ModuleGraphBuilder · ×1
  • ModuleGraphBuilder::build_graph_with_npm_resolution_and_build_options (cyclomatic 22) cli/graph_util.rs:1002 — ModuleGraphBuilder::build_graph_with_npm_resolution_and_build_options 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 · check · ×1
  • check::native_check (cyclomatic 22) cli/tools/check.rs:53 — check::native_check 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 · compile · ×1
  • compile::compile_inner (cyclomatic 22) cli/tools/compile.rs:70 — compile::compile_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 · bump_version · ×1
  • bump_version::bump_workspace_conventional (cyclomatic 22) cli/tools/bump_version.rs:450 — bump_version::bump_workspace_conventional 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 · subtle_wrap_key · ×1
  • subtle_wrap_key::jwk_to_utf8 (cyclomatic 22) ext/crypto/subtle_wrap_key.rs:291 — subtle_wrap_key::jwk_to_utf8 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 · binding · ×1
  • binding::consume_read_callback (cyclomatic 22) ext/node/ops/llhttp/binding.rs:730 — binding::consume_read_callback 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 · AsymmetricPrivateKey · ×1
  • AsymmetricPrivateKey::export_der (cyclomatic 22) ext/node_crypto/keys.rs:2412 — AsymmetricPrivateKey::export_der has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · x509 · ×1
  • x509::op_node_x509_verify (cyclomatic 22) ext/node_crypto/x509.rs:1072 — x509::op_node_x509_verify has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ImageData · ×1
  • ImageData::constructor (cyclomatic 22) ext/web/image_data.rs:199 — ImageData::constructor 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 · LockfileContent · ×1
  • LockfileContent::from_json (cyclomatic 22) libs/lockfile/lib.rs:362 — LockfileContent::from_json has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 3 function items declared inside it. 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.
D1 · Cyclomatic Complexity · hoisted · ×1
  • hoisted::compute_hoisted_layout (cyclomatic 22) libs/npm_installer/hoisted.rs:98 — hoisted::compute_hoisted_layout 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 · pnpm_lockfile_import · ×1
  • pnpm_lockfile_import::pnpm_lock_to_deno_lock_v5 (cyclomatic 22) libs/resolver/pnpm_lockfile_import.rs:41 — pnpm_lockfile_import::pnpm_lock_to_deno_lock_v5 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 · Http2Options · ×1
  • Http2Options::new (cyclomatic 21) ext/node/ops/http2/session.rs:388 — Http2Options::new 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 · AdvancedIpcDeserializerDelegate · ×1
  • AdvancedIpcDeserializerDelegate::read_host_object (cyclomatic 21) ext/node/ops/ipc.rs:555 — AdvancedIpcDeserializerDelegate::read_host_object has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ConfigFile · ×1
  • ConfigFile::to_exports_config (cyclomatic 21) libs/config/deno_json/mod.rs:2022 — ConfigFile::to_exports_config has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 2 function items declared inside it (validate_key, validate_value). 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 · web_worker · ×1
  • web_worker::run_web_worker (cyclomatic 21) runtime/web_worker.rs:1137 — web_worker::run_web_worker 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 · flamegraph · ×1
  • flamegraph::generate_flamegraph_svg (cyclomatic 21) runtime/cpu_profiler/flamegraph.rs:15 — flamegraph::generate_flamegraph_svg has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to one function item declared inside it. 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 · readableByteStreamControllerPullInto (cyclomatic 21) · ×1
  • readableByteStreamControllerPullInto (cyclomatic 21) ext/web/06_streams.js:2437 — readableByteStreamControllerPullInto has cyclomatic complexity 21 (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 · getTypeSizeAndAlignment (cyclomatic 21) · ×1
  • getTypeSizeAndAlignment (cyclomatic 21) ext/ffi/00_ffi.js:339 — getTypeSizeAndAlignment has cyclomatic complexity 21 (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 · #handle (cyclomatic 21) · ×1
  • #handle (cyclomatic 21) ext/fetch/27_eventsource.js:75 — #handle has cyclomatic complexity 21 (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 · _dump (cyclomatic 21) · ×1
  • _dump (cyclomatic 21) cli/js/40_lint.js:1455 — _dump has cyclomatic complexity 21 (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 · GraphDisplayContext · ×1
  • GraphDisplayContext::build_module_info (cyclomatic 20) cli/tools/info.rs:636 — GraphDisplayContext::build_module_info has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · merge · ×1
  • merge::merge_range_tree_children (cyclomatic 20) cli/tools/coverage/merge.rs:243 — merge::merge_range_tree_children has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · outdated · ×1
  • outdated::update (cyclomatic 20) cli/tools/pm/outdated/mod.rs:441 — outdated::update has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · info · ×1
  • info::add_npm_packages_to_json (cyclomatic 20) cli/tools/info.rs:310 — info::add_npm_packages_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.
D1 · Cyclomatic Complexity · shell · ×1
  • shell::scan_and_split (cyclomatic 20) ext/node/ops/shell.rs:34 — shell::scan_and_split has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bindings · ×1
  • bindings::initialize_deno_core_ops_bindings (cyclomatic 20) libs/core/runtime/bindings.rs:421 — bindings::initialize_deno_core_ops_bindings has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · constructor (cyclomatic 20) · ×1
  • constructor (cyclomatic 20) ext/web/02_event.js:1311 — constructor has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · parseFileInfo (cyclomatic 20) · ×1
  • parseFileInfo (cyclomatic 20) ext/fs/30_fs.js:431 — parseFileInfo has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · parse (cyclomatic 20) · ×1
  • parse (cyclomatic 20) ext/fetch/21_formdata.js:477 — parse has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · getAttrPathValue (cyclomatic 20) · ×1
  • getAttrPathValue (cyclomatic 20) cli/js/40_lint.js:981 — getAttrPathValue has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · DenoDiagnostic · ×1
  • DenoDiagnostic::code (cyclomatic 19) cli/lsp/diagnostics.rs:759 — DenoDiagnostic::code has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LspScopedResolver · ×1
  • LspScopedResolver::configured_auto_import_roots (cyclomatic 19) cli/lsp/resolver.rs:394 — LspScopedResolver::configured_auto_import_roots 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 · TestServer · ×1
  • TestServer::new (cyclomatic 19) cli/lsp/testing/server.rs:63 — TestServer::new 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 · CliModuleLoader · ×1
  • CliModuleLoader::prepare_load (cyclomatic 19) cli/module_loader.rs:1569 — CliModuleLoader::prepare_load 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 · DiagnosticsByFolderRealIterator · ×1
  • DiagnosticsByFolderRealIterator::check_diagnostics_in_folder (cyclomatic 19) cli/type_checker.rs:626 — DiagnosticsByFolderRealIterator::check_diagnostics_in_folder has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belong to one function item declared inside it. 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 · unfurl · ×1
  • unfurl::unfurl_dynamic_specifier (cyclomatic 19) cli/tools/pack/unfurl.rs:222 — unfurl::unfurl_dynamic_specifier 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 · subtle_sign · ×1
  • subtle_sign::run (cyclomatic 19) ext/crypto/subtle_sign.rs:409 — subtle_sign::run 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 · UpgradeStream · ×1
  • UpgradeStream::write (cyclomatic 19) ext/http/http_next.rs:5622 — UpgradeStream::write 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 · HttpRecordResponse · ×1
  • HttpRecordResponse::poll_frame (cyclomatic 19) ext/http/service.rs:1217 — HttpRecordResponse::poll_frame 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 · ZlibInner · ×1
  • ZlibInner::do_write (cyclomatic 19) ext/node/ops/zlib/mod.rs:96 — ZlibInner::do_write 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 · map · ×1
  • map::render_js_wasm_module (cyclomatic 19) libs/core/modules/map.rs:3676 — map::render_js_wasm_module has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belong to one function item declared inside it. 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 · SerializedNpmResolutionSnapshot · ×1
  • SerializedNpmResolutionSnapshot::dedup_equivalent_peer_variants (cyclomatic 19) libs/npm/resolution/snapshot.rs:204 — SerializedNpmResolutionSnapshot::dedup_equivalent_peer_variants 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 · dispatch_fast · ×1
  • dispatch_fast::generate_dispatch_fast (cyclomatic 19) libs/ops/op2/dispatch_fast.rs:415 — dispatch_fast::generate_dispatch_fast 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 · deno_resolver · ×1
  • deno_resolver::patch_react_cves (cyclomatic 19) libs/resolver/lib.rs:715 — deno_resolver::patch_react_cves 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 · TtyPrompter · ×1
  • TtyPrompter::prompt (cyclomatic 19) runtime/permissions/prompter.rs:416 — TtyPrompter::prompt 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 · DepManager · ×1
  • DepManager::run_dependency_resolution (cyclomatic 18) cli/tools/pm/deps.rs:723 — DepManager::run_dependency_resolution 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 · subtle_verify · ×1
  • subtle_verify::run (cyclomatic 18) ext/crypto/subtle_verify.rs:228 — subtle_verify::run 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 · deno_http · ×1
  • deno_http::handle_error_otel (cyclomatic 18) ext/http/lib.rs:638 — deno_http::handle_error_otel has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ContextifyScript · ×1
  • ContextifyScript::eval_machine (cyclomatic 18) ext/node/ops/vm.rs:216 — ContextifyScript::eval_machine 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 · dns · ×1
  • dns::getaddrinfo_inner (cyclomatic 18) ext/node/ops/dns.rs:86 — dns::getaddrinfo_inner 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 · DatabaseSync · ×1
  • DatabaseSync::function (cyclomatic 18) ext/node_sqlite/database.rs:1115 — DatabaseSync::function 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 · css_stylesheet · ×1
  • css_stylesheet::split_top_level_rules (cyclomatic 18) ext/web/css_stylesheet.rs:60 — css_stylesheet::split_top_level_rules 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 · FileCollector · ×1
  • FileCollector::collect_file_patterns (cyclomatic 18) libs/config/glob/collector.rs:71 — FileCollector::collect_file_patterns has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function item declared inside it. 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 · RuntimeActivityStats · ×1
  • RuntimeActivityStats::diff (cyclomatic 18) libs/core/runtime/stats.rs:418 — RuntimeActivityStats::diff 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 · SharedConn · ×1
  • SharedConn::poll_read_body_chunk_limited_with (cyclomatic 18) libs/http_h1/conn.rs:898 — SharedConn::poll_read_body_chunk_limited_with 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 · Graph · ×1
  • Graph::compute_all_npm_pkg_ids (cyclomatic 18) libs/npm/resolution/graph.rs:541 — Graph::compute_all_npm_pkg_ids 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 · TarballCache · ×1
  • TarballCache::create_setup_future (cyclomatic 18) libs/npm_cache/tarball.rs:162 — TarballCache::create_setup_future 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 · bun_lockfile_import · ×1
  • bun_lockfile_import::bun_lock_to_deno_lock_v5 (cyclomatic 18) libs/resolver/bun_lockfile_import.rs:38 — bun_lockfile_import::bun_lock_to_deno_lock_v5 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 · npmrc · ×1
  • npmrc::discover_npmrc (cyclomatic 18) libs/resolver/npmrc.rs:83 — npmrc::discover_npmrc has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 3 function items declared inside it. 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 · bootstrapMainRuntime (cyclomatic 18) · ×1
  • bootstrapMainRuntime (cyclomatic 18) runtime/js/99_main.js:882 — bootstrapMainRuntime has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · listOnTimeout (cyclomatic 18) · ×1
  • listOnTimeout (cyclomatic 18) libs/core/02_timers.js:270 — listOnTimeout has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · postMessage (cyclomatic 18) · ×1
  • postMessage (cyclomatic 18) ext/web/13_message_port.js:262 — postMessage has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · structuredClone (cyclomatic 18) · ×1
  • structuredClone (cyclomatic 18) ext/web/02_structured_clone.js:65 — structuredClone has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · innerInvokeEventListeners (cyclomatic 18) · ×1
  • innerInvokeEventListeners (cyclomatic 18) ext/web/02_event.js:734 — innerInvokeEventListeners has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · createHttpClient (cyclomatic 18) · ×1
  • createHttpClient (cyclomatic 18) ext/fetch/22_http_client.js:23 — createHttpClient has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · WorkspaceSettings · ×1
  • WorkspaceSettings::from_raw_settings (cyclomatic 17) cli/lsp/config.rs:655 — WorkspaceSettings::from_raw_settings has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item declared inside it. 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 · Compiler · ×1
  • Compiler::to_path (cyclomatic 17) cli/lsp/path_to_regex.rs:822 — Compiler::to_path 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 · TsServer · ×1
  • TsServer::provide_code_actions (cyclomatic 17) cli/lsp/ts_server.rs:325 — TsServer::provide_code_actions 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 · WorkspaceLinter · ×1
  • WorkspaceLinter::lint_files (cyclomatic 17) cli/tools/lint/mod.rs:292 — WorkspaceLinter::lint_files has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belong to one function item declared inside it. 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 · GraphDiagnosticsCollector · ×1
  • GraphDiagnosticsCollector::collect_diagnostics_for_graph (cyclomatic 17) cli/tools/publish/graph.rs:40 — GraphDiagnosticsCollector::collect_diagnostics_for_graph 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 · native_addons · ×1
  • native_addons::collect_bundle_required_packages (cyclomatic 17) cli/standalone/native_addons.rs:113 — native_addons::collect_bundle_required_packages 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 · args · ×1
  • args::flags_to_permissions_options (cyclomatic 17) cli/args/mod.rs:1715 — args::flags_to_permissions_options has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 2 function items declared inside it (handle_allow, handle_deny_or_ignore). 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 · wasm · ×1
  • wasm::collect_import_records (cyclomatic 17) cli/tools/publish/wasm.rs:154 — wasm::collect_import_records 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 · socket_dev · ×1
  • socket_dev::print_firewall_report (cyclomatic 17) cli/tools/pm/audit.rs:744 — socket_dev::print_firewall_report 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 · Session · ×1
  • Session::send_pending_data (cyclomatic 17) ext/node/ops/http2/session.rs:2547 — Session::send_pending_data 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 · stream_wrap · ×1
  • stream_wrap::on_uv_read (cyclomatic 17) ext/node/ops/stream_wrap.rs:617 — stream_wrap::on_uv_read 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 · impl_ · ×1
  • impl_::serialize_v8_value (cyclomatic 17) ext/node/ops/ipc.rs:75 — impl_::serialize_v8_value 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 · StatementSync · ×1
  • StatementSync::bind_params (cyclomatic 17) ext/node_sqlite/statement.rs:495 — StatementSync::bind_params 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 · JsRuntimeInspector · ×1
  • JsRuntimeInspector::capture_network_event (cyclomatic 17) libs/core/inspector.rs:1255 — JsRuntimeInspector::capture_network_event 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 · CjsModuleExportAnalyzer · ×1
  • CjsModuleExportAnalyzer::resolve (cyclomatic 17) libs/node_resolver/analyze.rs:495 — CjsModuleExportAnalyzer::resolve 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 · PreparedModuleLoader · ×1
  • PreparedModuleLoader::load_prepared_module_or_defer_emit (cyclomatic 17) libs/resolver/loader/module_loader.rs:499 — PreparedModuleLoader::load_prepared_module_or_defer_emit 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 · NetDescriptor · ×1
  • NetDescriptor::parse_inner (cyclomatic 17) runtime/permissions/lib.rs:2068 — NetDescriptor::parse_inner 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 · cache (cyclomatic 17) · ×1
  • cache (cyclomatic 17) runtime/js/10_permissions.js:134 — cache 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 · observe (cyclomatic 17) · ×1
  • observe (cyclomatic 17) ext/web/15_performance.js:499 — observe 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 · readableStreamPipeTo (cyclomatic 17) · ×1
  • readableStreamPipeTo (cyclomatic 17) ext/web/06_streams.js:3247 — readableStreamPipeTo 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 · composedPath (cyclomatic 17) · ×1
  • composedPath (cyclomatic 17) ext/web/02_event.js:206 — composedPath 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 · matchAttrValue (cyclomatic 17) · ×1
  • matchAttrValue (cyclomatic 17) cli/js/40_lint_selector.js:1211 — matchAttrValue 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 · CliFactory · ×1
  • CliFactory::npm_installer_factory (cyclomatic 16) cli/factory.rs:571 — CliFactory::npm_installer_factory has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ConfiguredDepResolutions · ×1
  • ConfiguredDepResolutions::new (cyclomatic 16) cli/lsp/resolver.rs:784 — ConfiguredDepResolutions::new 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 · CompletionEntryDetails · ×1
  • CompletionEntryDetails::as_completion_item (cyclomatic 16) cli/lsp/tsc.rs:3992 — CompletionEntryDetails::as_completion_item 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 · TaskRunner · ×1
  • TaskRunner::run_tasks_in_parallel (cyclomatic 16) cli/tools/task.rs:475 — TaskRunner::run_tasks_in_parallel 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 · approve_scripts · ×1
  • approve_scripts::approve_scripts (cyclomatic 16) cli/tools/pm/approve_scripts.rs:40 — approve_scripts::approve_scripts 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.
D1 · Cyclomatic Complexity · publish · ×1
  • publish::publish (cyclomatic 16) cli/tools/publish/mod.rs:77 — publish::publish 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 · npm · ×1
  • npm::call_audits_api (cyclomatic 16) cli/tools/pm/audit.rs:240 — npm::call_audits_api 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.
D1 · Cyclomatic Complexity · assert · ×1
  • assert::get_first_expression (cyclomatic 16) ext/node/ops/assert.rs:92 — assert::get_first_expression 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 · buffer · ×1
  • buffer::op_node_encoding_slice (cyclomatic 16) ext/node/ops/buffer.rs:186 — buffer::op_node_encoding_slice 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 · deno_node_crypto · ×1
  • deno_node_crypto::op_node_ecdh_compute_secret (cyclomatic 16) ext/node_crypto/lib.rs:1338 — deno_node_crypto::op_node_ecdh_compute_secret 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 · console_exporter · ×1
  • console_exporter::format_span (cyclomatic 16) ext/telemetry/console_exporter.rs:55 — console_exporter::format_span 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.
D1 · Cyclomatic Complexity · extension_set · ×1
  • extension_set::into_sources_and_source_maps (cyclomatic 16) libs/core/extension_set.rs:313 — extension_set::into_sources_and_source_maps 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 · error · ×1
  • error::format_frame (cyclomatic 16) libs/core/error.rs:2449 — error::format_frame 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 · dispatch_async · ×1
  • dispatch_async::generate_dispatch_async (cyclomatic 16) libs/ops/op2/dispatch_async.rs:59 — dispatch_async::generate_dispatch_async 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 · graph · ×1
  • graph::get_import_prefix_missing_error (cyclomatic 16) libs/resolver/graph.rs:1005 — graph::get_import_prefix_missing_error 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 · (anonymous) (cyclomatic 16) · ×1
  • (anonymous) (cyclomatic 16) runtime/js/99_main.js:936 — (anonymous) 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.
D1 · Cyclomatic Complexity · search (cyclomatic 16) · ×1
  • search (cyclomatic 16) runtime/cpu_profiler/flamegraph.js:294 — search 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.
D1 · Cyclomatic Complexity · (computed) (cyclomatic 16) · ×1
  • (computed) (cyclomatic 16) ext/websocket/01_websocket.js:754 — (computed) 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.
D1 · Cyclomatic Complexity · parseMimeType (cyclomatic 16) · ×1
  • parseMimeType (cyclomatic 16) ext/web/01_mimesniff.js:50 — parseMimeType 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.
D1 · Cyclomatic Complexity · flushTestSnapshots (cyclomatic 16) · ×1
  • flushTestSnapshots (cyclomatic 16) cli/js/40_test_snapshot.js:398 — flushTestSnapshots 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.
D1 · Cyclomatic Complexity · getFromRawValue (cyclomatic 16) · ×1
  • getFromRawValue (cyclomatic 16) cli/js/40_lint_selector.js:387 — getFromRawValue 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.
D19 · Documentation Quality · LLM evaluation failed · ×1
  • LLM evaluation failed — JSON parse error: Expected end of string, but instead reached end of data. Path: $.findings[1].issue | LineNumber: 0 | BytePositionInLine: 1147.
D2 · Cognitive Complexity · OptionsParser · ×1
  • OptionsParser::parse (cognitive 205) libs/node_shim/lib.rs:2801 — OptionsParser::parse has cognitive complexity 205 (threshold 15). Drivers by points: if/else 159, loops 34, boolean chains 9, match/switch 3 (nesting depth added 129). To reduce it, split the body into named stages: move each independent 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 · LocalNpmPackageInstaller · ×1
  • LocalNpmPackageInstaller::sync_resolution_with_fs (cognitive 174) libs/npm_installer/local.rs:199 — LocalNpmPackageInstaller::sync_resolution_with_fs has cognitive complexity 174 (threshold 15). Drivers by points: if/else 114, loops 25, match/switch 18, boolean chains 17 (nesting depth added 81). To reduce it, split the body into named stages: move each independent 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 · ModuleRegistry · ×1
  • ModuleRegistry::get_completions (cognitive 170) cli/lsp/registries.rs:653 — ModuleRegistry::get_completions has cognitive complexity 170 (threshold 15). Drivers by points: if/else 132, loops 16, match/switch 15, boolean chains 7 (nesting depth added 124). To reduce it, split the body into named stages: move each independent 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 · JsRuntimeInspectorState · ×1
  • JsRuntimeInspectorState::poll_sessions (cognitive 136) libs/core/inspector.rs:522 — JsRuntimeInspectorState::poll_sessions has cognitive complexity 136 (threshold 15). Drivers by points: if/else 100, match/switch 18, loops 15, boolean chains 3 (nesting depth added 100). To reduce it, split the body into named stages: move each independent 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 · Lockfile · ×1
  • Lockfile::set_workspace_config (cognitive 106) libs/lockfile/lib.rs:813 — Lockfile::set_workspace_config has cognitive complexity 106 (threshold 15). Drivers by points: if/else 71, loops 25, boolean chains 5, match/switch 5 (nesting depth added 65). Of this number, 104 points are the body's own statements and 2 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · NpmInstallDepsProvider · ×1
  • NpmInstallDepsProvider::from_workspace (cognitive 102) libs/npm_installer/package_json.rs:161 — NpmInstallDepsProvider::from_workspace has cognitive complexity 102 (threshold 15). Drivers by points: if/else 73, match/switch 14, loops 9, boolean chains 6 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsError · ×1
  • JsError::inner_from_v8_exception (cognitive 99) libs/core/error.rs:1016 — JsError::inner_from_v8_exception has cognitive complexity 99 (threshold 15). Drivers by points: if/else 63, match/switch 15, loops 13, boolean chains 8 (nesting depth added 56). To reduce it, split the body into named stages: move each independent 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 · parseSelector (cognitive 97) · ×1
  • parseSelector (cognitive 97) cli/js/40_lint_selector.js:475 — parseSelector has cognitive complexity 97 (threshold 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 · benchMeasure (cognitive 94) · ×1
  • benchMeasure (cognitive 94) cli/js/40_bench.js:244 — benchMeasure has cognitive complexity 94 (threshold 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 · Console · ×1
  • Console::table_impl (cognitive 90) ext/web/console/mod.rs:1421 — Console::table_impl has cognitive complexity 90 (threshold 15). Drivers by points: if/else 41, match/switch 27, loops 15, boolean chains 7 (nesting depth added 41). To reduce it, split the body into named stages: move each independent 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 · cache_deps · ×1
  • cache_deps::cache_top_level_deps (cognitive 89) cli/tools/pm/cache_deps.rs:34 — cache_deps::cache_top_level_deps has cognitive complexity 89 (threshold 15). Drivers by points: if/else 70, loops 12, boolean chains 4, match/switch 3 (nesting depth added 57). To reduce it, split the body into named stages: move each independent 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 · mainFetch (cognitive 84) · ×1
  • mainFetch (cognitive 84) ext/fetch/26_fetch.js:386 — mainFetch has cognitive complexity 84 (threshold 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 · node_shim · ×1
  • node_shim::translate_to_deno_args (cognitive 80) libs/node_shim/lib.rs:3453 — node_shim::translate_to_deno_args has cognitive complexity 80 (threshold 15). Drivers by points: if/else 70, boolean chains 7, loops 3 (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 · respondWith (cognitive 79) · ×1
  • respondWith (cognitive 79) ext/http/01_http.js:197 — respondWith has cognitive complexity 79 (threshold 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 · NpmRc · ×1
  • NpmRc::parse (cognitive 71) libs/npmrc/lib.rs:200 — NpmRc::parse has cognitive complexity 71 (threshold 15). Drivers by points: if/else 41, match/switch 23, boolean chains 6, loops 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent 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 · TsResponseImportMapper · ×1
  • TsResponseImportMapper::check_specifier (cognitive 67) cli/lsp/analysis.rs:367 — TsResponseImportMapper::check_specifier has cognitive complexity 67 (threshold 15). Drivers by points: if/else 55, boolean chains 6, loops 5, match/switch 1 (nesting depth added 34). Of this number, 66 points are the body's own statements and 1 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · callback · ×1
  • callback::do_ffi_callback (cognitive 67) ext/ffi/callback.rs:212 — callback::do_ffi_callback has cognitive complexity 67 (threshold 15). Drivers by points: if/else 61, match/switch 5, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serverRequestInner (cognitive 65) · ×1
  • serverRequestInner (cognitive 65) cli/tsc/98_lsp.js:428 — serverRequestInner has cognitive complexity 65 (threshold 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 · Prime · ×1
  • Prime::generate_with_options (cognitive 63) ext/node_crypto/primes.rs:33 — Prime::generate_with_options has cognitive complexity 63 (threshold 15). Drivers by points: if/else 56, loops 4, boolean chains 3 (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.
D2 · Cognitive Complexity · fast_registry_json · ×1
  • fast_registry_json::pluck_versions_from_tokens (cognitive 60) libs/npm/fast_registry_json.rs:798 — fast_registry_json::pluck_versions_from_tokens has cognitive complexity 60 (threshold 15). Drivers by points: if/else 49, boolean chains 8, match/switch 2, loops 1 (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.
D2 · Cognitive Complexity · cpuprof · ×1
  • cpuprof::generate_markdown_report (cognitive 60) runtime/cpu_profiler/cpuprof.rs:59 — cpuprof::generate_markdown_report has cognitive complexity 60 (threshold 15). Drivers by points: if/else 39, loops 18, boolean chains 2, match/switch 1 (nesting depth added 21). Of this number, 48 points are the body's own statements and 12 belong to 2 function items declared inside it. To reduce it, split the body into named stages: move each independent 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 · Cipher · ×1
  • Cipher::new (cognitive 59) ext/node_crypto/cipher.rs:826 — Cipher::new has cognitive complexity 59 (threshold 15). Drivers by points: if/else 54, match/switch 3, boolean chains 2 (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 · dispatch (cognitive 59) · ×1
  • dispatch (cognitive 59) ext/web/02_event.js:563 — dispatch has cognitive complexity 59 (threshold 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 · checkIsComplete (cognitive 59) · ×1
  • checkIsComplete (cognitive 59) cli/js/jupyter_kernel.js:624 — checkIsComplete has cognitive complexity 59 (threshold 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 · HoistedNpmPackageInstaller · ×1
  • HoistedNpmPackageInstaller::sync_resolution_with_fs (cognitive 57) libs/npm_installer/hoisted.rs:349 — HoistedNpmPackageInstaller::sync_resolution_with_fs has cognitive complexity 57 (threshold 15). Drivers by points: if/else 31, loops 15, match/switch 6, boolean chains 5 (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 · SerializedNpmResolutionSnapshot · ×1
  • SerializedNpmResolutionSnapshot::dedup_equivalent_peer_variants (cognitive 56) libs/npm/resolution/snapshot.rs:204 — SerializedNpmResolutionSnapshot::dedup_equivalent_peer_variants has cognitive complexity 56 (threshold 15). Drivers by points: if/else 30, loops 26 (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.
D2 · Cognitive Complexity · constructor (cognitive 56) · ×1
  • constructor (cognitive 56) ext/fetch/23_request.js:370 — constructor has cognitive complexity 56 (threshold 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 · TestServer · ×1
  • TestServer::new (cognitive 54) cli/lsp/testing/server.rs:63 — TestServer::new has cognitive complexity 54 (threshold 15). Drivers by points: if/else 36, loops 8, match/switch 8, boolean chains 2 (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 · PackageJson · ×1
  • PackageJson::load_from_value (cognitive 54) libs/package_json/lib.rs:510 — PackageJson::load_from_value has cognitive complexity 54 (threshold 15). Drivers by points: if/else 33, loops 10, match/switch 10, boolean chains 1 (nesting depth added 20). Of this number, 41 points are the body's own statements and 13 belong to 5 function items declared inside it. To reduce it, split the body into named stages: move each independent 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 · merge · ×1
  • merge::merge_range_tree_children (cognitive 53) cli/tools/coverage/merge.rs:243 — merge::merge_range_tree_children has cognitive complexity 53 (threshold 15). Drivers by points: if/else 31, loops 20, match/switch 2 (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.
D2 · Cognitive Complexity · npm_lockfile_import · ×1
  • npm_lockfile_import::package_lock_to_deno_lock_v5 (cognitive 53) libs/resolver/npm_lockfile_import.rs:62 — npm_lockfile_import::package_lock_to_deno_lock_v5 has cognitive complexity 53 (threshold 15). Drivers by points: if/else 32, loops 12, match/switch 7, boolean chains 2 (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 · width · ×1
  • width::ansi_sequence_len (cognitive 52) ext/web/console/width.rs:13 — width::ansi_sequence_len has cognitive complexity 52 (threshold 15). Drivers by points: loops 20, boolean chains 17, if/else 15 (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 · inspector · ×1
  • inspector::pump_inspector_session_messages (cognitive 52) libs/core/inspector.rs:2051 — inspector::pump_inspector_session_messages has cognitive complexity 52 (threshold 15). Drivers by points: if/else 40, match/switch 6, loops 5, boolean chains 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.
D2 · Cognitive Complexity · constructor (cognitive 52) · ×1
  • constructor (cognitive 52) ext/websocket/01_websocket.js:253 — constructor has cognitive complexity 52 (threshold 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 · constructor (cognitive 50) · ×1
  • constructor (cognitive 50) ext/web/00_url.js:127 — constructor has cognitive complexity 50 (threshold 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 · Compiler · ×1
  • Compiler::to_path (cognitive 49) cli/lsp/path_to_regex.rs:822 — Compiler::to_path has cognitive complexity 49 (threshold 15). Drivers by points: if/else 34, loops 6, match/switch 5, boolean chains 4 (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.
D2 · Cognitive Complexity · FilePatterns · ×1
  • FilePatterns::split_by_base (cognitive 49) libs/config/glob/mod.rs:132 — FilePatterns::split_by_base has cognitive complexity 49 (threshold 15). Drivers by points: if/else 34, loops 6, boolean chains 5, match/switch 4 (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 · flamegraph · ×1
  • flamegraph::generate_flamegraph_svg (cognitive 48) runtime/cpu_profiler/flamegraph.rs:15 — flamegraph::generate_flamegraph_svg has cognitive complexity 48 (threshold 15). Drivers by points: if/else 38, loops 8, boolean chains 1, match/switch 1 (nesting depth added 23). Of this number, 37 points are the body's own statements and 11 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · interactive_picker · ×1
  • interactive_picker::select_items (cognitive 47) cli/tools/pm/interactive_picker.rs:22 — interactive_picker::select_items has cognitive complexity 47 (threshold 15). Drivers by points: if/else 34, loops 7, match/switch 5, boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · help · ×1
  • help::render_help (cognitive 47) libs/cli_parser/src/help.rs:9 — help::render_help has cognitive complexity 47 (threshold 15). Drivers by points: if/else 32, loops 8, match/switch 6, boolean chains 1 (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 · parseSimpleSpecialUrl (cognitive 47) · ×1
  • parseSimpleSpecialUrl (cognitive 47) ext/web/00_url.js:604 — parseSimpleSpecialUrl has cognitive complexity 47 (threshold 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 · ContextifyScript · ×1
  • ContextifyScript::eval_machine (cognitive 46) ext/node/ops/vm.rs:216 — ContextifyScript::eval_machine has cognitive complexity 46 (threshold 15). Drivers by points: if/else 44, boolean chains 2 (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 · UpgradeStream · ×1
  • UpgradeStream::write (cognitive 45) ext/http/http_next.rs:5622 — UpgradeStream::write has cognitive complexity 45 (threshold 15). Drivers by points: if/else 25, loops 15, match/switch 5 (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.
D2 · Cognitive Complexity · removeEventListener (cognitive 44) · ×1
  • removeEventListener (cognitive 44) ext/web/03_abort_signal.js:278 — removeEventListener has cognitive complexity 44 (threshold 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 · isSimpleSpecialHostCanonical (cognitive 44) · ×1
  • isSimpleSpecialHostCanonical (cognitive 44) ext/web/00_url.js:492 — isSimpleSpecialHostCanonical has cognitive complexity 44 (threshold 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 · why · ×1
  • why::why (cognitive 43) cli/tools/pm/why.rs:59 — why::why has cognitive complexity 43 (threshold 15). Drivers by points: loops 21, if/else 19, boolean chains 3 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · import_key · ×1
  • import_key::import_key_ec (cognitive 43) ext/crypto/import_key.rs:723 — import_key::import_key_ec has cognitive complexity 43 (threshold 15). Drivers by points: if/else 34, match/switch 9 (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 · util · ×1
  • util::parse_iso8601_duration (cognitive 43) libs/config/util.rs:168 — util::parse_iso8601_duration has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29, loops 6, boolean chains 5, match/switch 3 (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 · SloppyImportsResolver · ×1
  • SloppyImportsResolver::resolve (cognitive 43) libs/resolver/workspace.rs:425 — SloppyImportsResolver::resolve has cognitive complexity 43 (threshold 15). Drivers by points: if/else 31, match/switch 9, boolean chains 2, loops 1 (nesting depth added 18). Of this number, 42 points are the body's own statements and 1 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · DenoTestCollector · ×1
  • DenoTestCollector::visit_var_decl (cognitive 42) cli/lsp/code_lens.rs:319 — DenoTestCollector::visit_var_decl has cognitive complexity 42 (threshold 15). Drivers by points: if/else 24, match/switch 9, loops 6, boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LibUvStreamWrap · ×1
  • LibUvStreamWrap::writev (cognitive 42) ext/node/ops/stream_wrap.rs:1501 — LibUvStreamWrap::writev has cognitive complexity 42 (threshold 15). Drivers by points: if/else 36, loops 5, 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.
D2 · Cognitive Complexity · PermissionsContainer · ×1
  • PermissionsContainer::check_special_file (cognitive 42) runtime/permissions/lib.rs:4437 — PermissionsContainer::check_special_file has cognitive complexity 42 (threshold 15). Drivers by points: if/else 32, boolean chains 10 (nesting depth added 11). Of this number, 28 points are the body's own statements and 14 belong to 2 function items declared inside it. To reduce it, split the body into named stages: move each independent 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 · runPluginsForFile (cognitive 42) · ×1
  • runPluginsForFile (cognitive 42) cli/js/40_lint.js:1224 — runPluginsForFile has cognitive complexity 42 (threshold 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 · parse (cognitive 41) · ×1
  • parse (cognitive 41) ext/fetch/21_formdata.js:477 — parse has cognitive complexity 41 (threshold 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 · publish_order · ×1
  • publish_order::build_pkg_deps (cognitive 40) cli/tools/publish/publish_order.rs:162 — publish_order::build_pkg_deps has cognitive complexity 40 (threshold 15). Drivers by points: if/else 30, loops 9, boolean chains 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.
D2 · Cognitive Complexity · EnvironmentOptions · ×1
  • EnvironmentOptions::check_options (cognitive 40) libs/node_shim/lib.rs:422 — EnvironmentOptions::check_options has cognitive complexity 40 (threshold 15). Drivers by points: if/else 33, boolean chains 7 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · subtle_derive_bits · ×1
  • subtle_derive_bits::run (cognitive 39) ext/crypto/subtle_derive_bits.rs:417 — subtle_derive_bits::run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 33, match/switch 5, 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.
D2 · Cognitive Complexity · handleExecute (cognitive 39) · ×1
  • handleExecute (cognitive 39) cli/js/jupyter_kernel.js:682 — handleExecute has cognitive complexity 39 (threshold 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 · package_json · ×1
  • package_json::convert_exports (cognitive 38) cli/tools/pack/package_json.rs:113 — package_json::convert_exports has cognitive complexity 38 (threshold 15). Drivers by points: if/else 32, loops 6 (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 · LockfileContent · ×1
  • LockfileContent::from_json (cognitive 38) libs/lockfile/lib.rs:362 — LockfileContent::from_json has cognitive complexity 38 (threshold 15). Drivers by points: loops 23, if/else 7, match/switch 7, boolean chains 1 (nesting depth added 17). Of this number, 30 points are the body's own statements and 8 belong to 3 function items declared inside it. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · RawDenoResolver · ×1
  • RawDenoResolver::resolve (cognitive 38) libs/resolver/lib.rs:321 — RawDenoResolver::resolve has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25, match/switch 10, boolean chains 3 (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 · bootstrapMainRuntime (cognitive 38) · ×1
  • bootstrapMainRuntime (cognitive 38) runtime/js/99_main.js:882 — bootstrapMainRuntime has cognitive complexity 38 (threshold 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 · testInner (cognitive 38) · ×1
  • testInner (cognitive 38) cli/js/40_test.js:364 — testInner has cognitive complexity 38 (threshold 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 · LspScopedResolver · ×1
  • LspScopedResolver::configured_auto_import_roots (cognitive 37) cli/lsp/resolver.rs:394 — LspScopedResolver::configured_auto_import_roots has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, boolean chains 4, loops 4, match/switch 3 (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 · GraphDisplayContext · ×1
  • GraphDisplayContext::build_module_info (cognitive 37) cli/tools/info.rs:636 — GraphDisplayContext::build_module_info has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 15, if/else 13, loops 8, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabaseSyncOptions · ×1
  • DatabaseSyncOptions::from_v8 (cognitive 37) ext/node_sqlite/database.rs:84 — DatabaseSyncOptions::from_v8 has cognitive complexity 37 (threshold 15). Drivers by points: if/else 22, boolean chains 13, 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 · ConfiguredDepResolutions · ×1
  • ConfiguredDepResolutions::new (cognitive 36) cli/lsp/resolver.rs:784 — ConfiguredDepResolutions::new has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22, loops 13, boolean chains 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.
D2 · Cognitive Complexity · RecursiveModuleLoad · ×1
  • RecursiveModuleLoad::register_and_recurse_inner (cognitive 36) libs/core/modules/recursive_load.rs:426 — RecursiveModuleLoad::register_and_recurse_inner has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20, match/switch 10, boolean chains 3, loops 3 (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 · LaxSingleProcessFsFlag · ×1
  • LaxSingleProcessFsFlag::lock (cognitive 36) libs/npm_installer/flag.rs:143 — LaxSingleProcessFsFlag::lock has cognitive complexity 36 (threshold 15). Drivers by points: match/switch 18, if/else 11, loops 6, boolean chains 1 (nesting depth added 25). 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 · web_worker · ×1
  • web_worker::run_web_worker (cognitive 36) runtime/web_worker.rs:1137 — web_worker::run_web_worker has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, boolean chains 2, match/switch 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 · traverse (cognitive 36) · ×1
  • traverse (cognitive 36) cli/js/40_lint.js:1355 — traverse has cognitive complexity 36 (threshold 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 · TestStepCollector · ×1
  • TestStepCollector::visit_var_decl (cognitive 35) cli/lsp/testing/collectors.rs:443 — TestStepCollector::visit_var_decl has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19, match/switch 8, loops 6, boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check · ×1
  • check::native_check (cognitive 35) cli/tools/check.rs:53 — check::native_check has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, boolean chains 6, loops 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.
D2 · Cognitive Complexity · export_key · ×1
  • export_key::export_key_ec (cognitive 35) ext/crypto/export_key.rs:252 — export_key::export_key_ec has cognitive complexity 35 (threshold 15). Drivers by points: if/else 24, match/switch 11 (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 · extractBody (cognitive 35) · ×1
  • extractBody (cognitive 35) ext/fetch/22_body.js:460 — extractBody has cognitive complexity 35 (threshold 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 · bench (cognitive 35) · ×1
  • bench (cognitive 35) cli/js/40_bench.js:64 — bench has cognitive complexity 35 (threshold 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 · ModuleGraphBuilder · ×1
  • ModuleGraphBuilder::build_graph_with_npm_resolution_and_build_options (cognitive 34) cli/graph_util.rs:1002 — ModuleGraphBuilder::build_graph_with_npm_resolution_and_build_options has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18, loops 9, boolean chains 6, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NpmRegistryReadPermissionChecker · ×1
  • NpmRegistryReadPermissionChecker::ensure_read_permission (cognitive 34) cli/lib/npm/permission_checker.rs:50 — NpmRegistryReadPermissionChecker::ensure_read_permission has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, match/switch 8, boolean chains 2 (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 · run · ×1
  • run::run_with_options (cognitive 34) cli/rt/run.rs:1314 — run::run_with_options has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23, match/switch 7, loops 3, 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.
D2 · Cognitive Complexity · deno_fetch · ×1
  • deno_fetch::op_fetch (cognitive 34) ext/fetch/lib.rs:429 — deno_fetch::op_fetch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19, match/switch 10, boolean chains 3, 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.
D2 · Cognitive Complexity · HttpRecordResponse · ×1
  • HttpRecordResponse::poll_frame (cognitive 34) ext/http/service.rs:1217 — HttpRecordResponse::poll_frame has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, match/switch 6, boolean chains 2, loops 2 (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 · ZlibInner · ×1
  • ZlibInner::do_write (cognitive 34) ext/node/ops/zlib/mod.rs:96 — ZlibInner::do_write has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, match/switch 5, boolean chains 3, 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 · op2 · ×1
  • op2::generate_op2 (cognitive 34) libs/ops/op2/mod.rs:203 — op2::generate_op2 has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, boolean chains 4, loops 3, match/switch 3 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TestCollector · ×1
  • TestCollector::visit_var_decl (cognitive 33) cli/lsp/testing/collectors.rs:581 — TestCollector::visit_var_decl has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22, match/switch 6, loops 4, 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 · deno_resolver · ×1
  • deno_resolver::patch_react_cves (cognitive 33) libs/resolver/lib.rs:715 — deno_resolver::patch_react_cves has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, loops 4, match/switch 2, 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.
D2 · Cognitive Complexity · TestRun · ×1
  • TestRun::exec (cognitive 32) cli/lsp/testing/execution.rs:235 — TestRun::exec has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17, match/switch 10, loops 5 (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 · PublishPreparer · ×1
  • PublishPreparer::build_and_check_graph_for_publish (cognitive 32) cli/tools/publish/mod.rs:367 — PublishPreparer::build_and_check_graph_for_publish has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21, loops 11 (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 · subtle_encrypt · ×1
  • subtle_encrypt::run (cognitive 32) ext/crypto/subtle_encrypt.rs:480 — subtle_encrypt::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24, match/switch 5, boolean chains 3 (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 · shell · ×1
  • shell::scan_and_split (cognitive 32) ext/node/ops/shell.rs:34 — shell::scan_and_split has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17, boolean chains 10, loops 5 (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 · ImageData · ×1
  • ImageData::constructor (cognitive 32) ext/web/image_data.rs:199 — ImageData::constructor has cognitive complexity 32 (threshold 15). Drivers by points: if/else 25, boolean chains 5, match/switch 2 (nesting depth added 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.
D2 · Cognitive Complexity · css_stylesheet · ×1
  • css_stylesheet::split_top_level_rules (cognitive 32) ext/web/css_stylesheet.rs:60 — css_stylesheet::split_top_level_rules has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21, loops 7, boolean chains 4 (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 · extension_set · ×1
  • extension_set::into_sources_and_source_maps (cognitive 32) libs/core/extension_set.rs:313 — extension_set::into_sources_and_source_maps has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19, loops 11, boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bun_lockfile_import · ×1
  • bun_lockfile_import::bun_lock_to_deno_lock_v5 (cognitive 32) libs/resolver/bun_lockfile_import.rs:38 — bun_lockfile_import::bun_lock_to_deno_lock_v5 has cognitive complexity 32 (threshold 15). Drivers by points: if/else 25, loops 6, 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.
D2 · Cognitive Complexity · _dump (cognitive 32) · ×1
  • _dump (cognitive 32) cli/js/40_lint.js:1455 — _dump has cognitive complexity 32 (threshold 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 · CompletionEntryDetails · ×1
  • CompletionEntryDetails::as_completion_item (cognitive 31) cli/lsp/tsc.rs:3992 — CompletionEntryDetails::as_completion_item has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, match/switch 3, 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.
D2 · Cognitive Complexity · object_wrap · ×1
  • object_wrap::generate_impl_ops (cognitive 31) libs/ops/op2/object_wrap.rs:75 — object_wrap::generate_impl_ops has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29, loops 1, match/switch 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.
D2 · Cognitive Complexity · NpmReqResolver · ×1
  • NpmReqResolver::resolve_if_for_npm_pkg (cognitive 31) libs/resolver/npm/mod.rs:559 — NpmReqResolver::resolve_if_for_npm_pkg has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15, match/switch 15, boolean chains 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.
D2 · Cognitive Complexity · postMessage (cognitive 31) · ×1
  • postMessage (cognitive 31) ext/web/13_message_port.js:262 — postMessage has cognitive complexity 31 (threshold 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 · subtle_decrypt · ×1
  • subtle_decrypt::run (cognitive 30) ext/crypto/subtle_decrypt.rs:423 — subtle_decrypt::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, match/switch 5, 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.
D2 · Cognitive Complexity · udp · ×1
  • udp::resolve_ipv6_interface (cognitive 30) ext/node/ops/udp.rs:179 — udp::resolve_ipv6_interface has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, loops 2, boolean chains 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.
D2 · Cognitive Complexity · decode (cognitive 30) · ×1
  • decode (cognitive 30) ext/web/08_text_encoding.js:128 — decode has cognitive complexity 30 (threshold 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 · WatchEnvTracker · ×1
  • WatchEnvTracker::load_env_file_inner (cognitive 29) cli/util/env.rs:144 — WatchEnvTracker::load_env_file_inner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, match/switch 5, loops 2 (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 · virtual_fs · ×1
  • virtual_fs::vfs_as_display_tree (cognitive 29) cli/standalone/virtual_fs.rs:36 — virtual_fs::vfs_as_display_tree has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, match/switch 8, loops 4 (nesting depth added 3). Most of this is not in the body itself: 9 of the 29 points are its own statements and the rest belongs to 8 function items declared inside it (analyze_dir, file_size::add_offset_to_size, dir_size, …). 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.
D2 · Cognitive Complexity · UvLoopInner · ×1
  • UvLoopInner::has_alive_handles (cognitive 29) libs/core/uv_compat.rs:341 — UvLoopInner::has_alive_handles has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15, boolean chains 7, loops 7 (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 · listOnTimeout (cognitive 29) · ×1
  • listOnTimeout (cognitive 29) libs/core/02_timers.js:270 — listOnTimeout has cognitive complexity 29 (threshold 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 · (computed) (cognitive 29) · ×1
  • (computed) (cognitive 29) ext/websocket/01_websocket.js:754 — (computed) has cognitive complexity 29 (threshold 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 · request (cognitive 29) · ×1
  • request (cognitive 29) ext/web/locks.js:99 — request has cognitive complexity 29 (threshold 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 · composedPath (cognitive 29) · ×1
  • composedPath (cognitive 29) ext/web/02_event.js:206 — composedPath has cognitive complexity 29 (threshold 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 · innerInvokeEventListeners (cognitive 29) · ×1
  • innerInvokeEventListeners (cognitive 29) ext/web/02_event.js:734 — innerInvokeEventListeners has cognitive complexity 29 (threshold 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 · #loop (cognitive 29) · ×1
  • #loop (cognitive 29) ext/fetch/27_eventsource.js:229 — #loop has cognitive complexity 29 (threshold 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 · httpRedirectFetch (cognitive 29) · ×1
  • httpRedirectFetch (cognitive 29) ext/fetch/26_fetch.js:749 — httpRedirectFetch has cognitive complexity 29 (threshold 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 · WorkspaceSettings · ×1
  • WorkspaceSettings::from_raw_settings (cognitive 28) cli/lsp/config.rs:655 — WorkspaceSettings::from_raw_settings has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, match/switch 1 (nesting depth added 12). Of this number, 26 points are the body's own statements and 2 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · NavigationTree · ×1
  • NavigationTree::collect_document_symbols (cognitive 28) cli/lsp/tsc.rs:2526 — NavigationTree::collect_document_symbols has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 3, match/switch 3, boolean chains 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 · Transform · ×1
  • Transform::visit_mut_program (cognitive 28) cli/util/extract.rs:1032 — Transform::visit_mut_program has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 22, if/else 4, loops 2 (nesting depth added 18). 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 · stream_wrap · ×1
  • stream_wrap::on_uv_read (cognitive 28) ext/node/ops/stream_wrap.rs:617 — stream_wrap::on_uv_read has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · assert · ×1
  • assert::get_first_expression (cognitive 28) ext/node/ops/assert.rs:92 — assert::get_first_expression has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 4, loops 1, match/switch 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 · FileCollector · ×1
  • FileCollector::collect_file_patterns (cognitive 28) libs/config/glob/collector.rs:71 — FileCollector::collect_file_patterns has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17, loops 6, boolean chains 3, match/switch 2 (nesting depth added 9). Of this number, 26 points are the body's own statements and 2 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · dispatch_fast · ×1
  • dispatch_fast::generate_dispatch_fast (cognitive 28) libs/ops/op2/dispatch_fast.rs:415 — dispatch_fast::generate_dispatch_fast has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, boolean chains 4, 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.
D2 · Cognitive Complexity · checkObject (cognitive 28) · ×1
  • checkObject (cognitive 28) tools/lint.js:586 — checkObject has cognitive complexity 28 (threshold 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 · #handle (cognitive 28) · ×1
  • #handle (cognitive 28) ext/fetch/27_eventsource.js:75 — #handle has cognitive complexity 28 (threshold 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 · GraphDiagnosticsCollector · ×1
  • GraphDiagnosticsCollector::collect_diagnostics_for_graph (cognitive 27) cli/tools/publish/graph.rs:40 — GraphDiagnosticsCollector::collect_diagnostics_for_graph has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, loops 8, boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · ignore_directives · ×1
  • ignore_directives::parse_range_ignore_directives (cognitive 27) cli/tools/coverage/ignore_directives.rs:59 — ignore_directives::parse_range_ignore_directives has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 4, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · doc · ×1
  • doc::doc (cognitive 27) cli/tools/doc.rs:212 — doc::doc has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, loops 4, match/switch 4, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · node_interop · ×1
  • node_interop::build_algorithm_dict_from_v8 (cognitive 27) ext/crypto/node_interop.rs:403 — node_interop::build_algorithm_dict_from_v8 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, boolean chains 3 (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 · BiPipeRead · ×1
  • BiPipeRead::recv_with_fd (cognitive 27) ext/io/bi_pipe.rs:151 — BiPipeRead::recv_with_fd has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, loops 9, match/switch 2, 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.
D2 · Cognitive Complexity · Session · ×1
  • Session::send_pending_data (cognitive 27) ext/node/ops/http2/session.rs:2547 — Session::send_pending_data has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, loops 5, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HttpClientAdapter · ×1
  • HttpClientAdapter::send_no_follow (cognitive 26) cli/file_fetcher.rs:133 — HttpClientAdapter::send_no_follow has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, match/switch 5, loops 1 (nesting depth added 9). Of this number, 24 points are the body's own statements and 2 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · DenoTestStepCollector · ×1
  • DenoTestStepCollector::visit_var_decl (cognitive 26) cli/lsp/code_lens.rs:448 — DenoTestStepCollector::visit_var_decl has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14, match/switch 6, loops 4, boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · subtle_wrap_key · ×1
  • subtle_wrap_key::jwk_to_utf8 (cognitive 26) ext/crypto/subtle_wrap_key.rs:291 — subtle_wrap_key::jwk_to_utf8 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, loops 2 (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.
D2 · Cognitive Complexity · deno_node_crypto · ×1
  • deno_node_crypto::op_node_ecdh_compute_secret (cognitive 26) ext/node_crypto/lib.rs:1338 — deno_node_crypto::op_node_ecdh_compute_secret has cognitive complexity 26 (threshold 15). Drivers by points: if/else 25, 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.
D2 · Cognitive Complexity · IpcJsonStream · ×1
  • IpcJsonStream::read_msg_and_raw_fd (cognitive 26) ext/process/ipc.rs:504 — IpcJsonStream::read_msg_and_raw_fd has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, match/switch 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypesVersions · ×1
  • TypesVersions::map (cognitive 26) libs/node_resolver/resolution.rs:2973 — TypesVersions::map has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 4, 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.
D2 · Cognitive Complexity · dispatch_async · ×1
  • dispatch_async::generate_dispatch_async (cognitive 26) libs/ops/op2/dispatch_async.rs:59 — dispatch_async::generate_dispatch_async has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, boolean chains 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 · NetDescriptor · ×1
  • NetDescriptor::parse_inner (cognitive 26) runtime/permissions/lib.rs:2068 — NetDescriptor::parse_inner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bootstrapWorkerRuntime (cognitive 26) · ×1
  • bootstrapWorkerRuntime (cognitive 26) runtime/js/99_main.js:1145 — bootstrapWorkerRuntime has cognitive complexity 26 (threshold 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 · measure (cognitive 26) · ×1
  • measure (cognitive 26) ext/web/15_performance.js:723 — measure has cognitive complexity 26 (threshold 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 · DrawThread · ×1
  • DrawThread::maybe_start_draw_thread (cognitive 25) cli/util/draw_thread.rs:159 — DrawThread::maybe_start_draw_thread has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 5, boolean chains 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.
D2 · Cognitive Complexity · LocalCacheManifest · ×1
  • LocalCacheManifest::insert_data (cognitive 25) libs/cache_dir/local.rs:810 — LocalCacheManifest::insert_data has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, loops 3, 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.
D2 · Cognitive Complexity · TtyPrompter · ×1
  • TtyPrompter::prompt (cognitive 25) runtime/permissions/prompter.rs:416 — TtyPrompter::prompt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 3, boolean chains 2, match/switch 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · (anonymous) (cognitive 25) · ×1
  • (anonymous) (cognitive 25) ext/web/10_filereader.js:165 — (anonymous) has cognitive complexity 25 (threshold 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 · exec (cognitive 25) · ×1
  • exec (cognitive 25) ext/web/01_urlpattern.js:362 — exec has cognitive complexity 25 (threshold 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 · createHttpClient (cognitive 25) · ×1
  • createHttpClient (cognitive 25) ext/fetch/22_http_client.js:23 — createHttpClient has cognitive complexity 25 (threshold 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 · flushTestSnapshots (cognitive 25) · ×1
  • flushTestSnapshots (cognitive 25) cli/js/40_test_snapshot.js:398 — flushTestSnapshots has cognitive complexity 25 (threshold 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 · LocalCronHandler · ×1
  • LocalCronHandler::cron_loop (cognitive 24) ext/cron/local.rs:82 — LocalCronHandler::cron_loop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 3, 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.
D2 · Cognitive Complexity · NodeServerCertVerifier · ×1
  • NodeServerCertVerifier::verify_server_cert (cognitive 24) ext/node/ops/tls_wrap.rs:3853 — NodeServerCertVerifier::verify_server_cert has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, match/switch 4, 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.
D2 · Cognitive Complexity · IpcAdvancedStream · ×1
  • IpcAdvancedStream::read_msg_bytes_and_raw_fd (cognitive 24) ext/process/ipc.rs:365 — IpcAdvancedStream::read_msg_bytes_and_raw_fd has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · yarn_lockfile_import · ×1
  • yarn_lockfile_import::parse_yarn_v1 (cognitive 24) libs/resolver/yarn_lockfile_import.rs:208 — yarn_lockfile_import::parse_yarn_v1 has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, match/switch 7, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · uv_compat · ×1
  • uv_compat::uv_guess_handle (cognitive 23) libs/core/uv_compat.rs:875 — uv_compat::uv_guess_handle has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 4, 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.
D2 · Cognitive Complexity · BinEntries · ×1
  • BinEntries::for_each_entry (cognitive 23) libs/npm_installer/bin_entries.rs:130 — BinEntries::for_each_entry has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, loops 5, match/switch 3, 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.
D2 · Cognitive Complexity · observe (cognitive 23) · ×1
  • observe (cognitive 23) ext/web/15_performance.js:499 — observe has cognitive complexity 23 (threshold 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 · constructor (cognitive 23) · ×1
  • constructor (cognitive 23) ext/web/02_event.js:1311 — constructor has cognitive complexity 23 (threshold 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 · parseMimeType (cognitive 23) · ×1
  • parseMimeType (cognitive 23) ext/web/01_mimesniff.js:50 — parseMimeType has cognitive complexity 23 (threshold 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 · initializeAResponse (cognitive 23) · ×1
  • initializeAResponse (cognitive 23) ext/fetch/23_response.js:509 — initializeAResponse has cognitive complexity 23 (threshold 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 · next (cognitive 23) · ×1
  • next (cognitive 23) cli/js/40_lint_selector.js:220 — next has cognitive complexity 23 (threshold 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 · DiagnosticsByFolderRealIterator · ×1
  • DiagnosticsByFolderRealIterator::check_diagnostics_in_folder (cognitive 22) cli/type_checker.rs:626 — DiagnosticsByFolderRealIterator::check_diagnostics_in_folder has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 6, loops 3 (nesting depth added 2). Of this number, 21 points are the body's own statements and 1 belong to one function item declared inside it. 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 · deps · ×1
  • deps::add_deps_from_catalogs (cognitive 22) cli/tools/pm/deps.rs:447 — deps::add_deps_from_catalogs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, loops 7, boolean chains 1, 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 · subtle_generate_key · ×1
  • subtle_generate_key::run (cognitive 22) ext/crypto/subtle_generate_key.rs:311 — subtle_generate_key::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, match/switch 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · console_exporter · ×1
  • console_exporter::format_span (cognitive 22) ext/telemetry/console_exporter.rs:55 — console_exporter::format_span has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, loops 9, match/switch 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 · TarballCache · ×1
  • TarballCache::create_setup_future (cognitive 22) libs/npm_cache/tarball.rs:162 — TarballCache::create_setup_future has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 4, match/switch 4 (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 · tarball_extract · ×1
  • tarball_extract::extract_tarball (cognitive 22) libs/npm_cache/tarball_extract.rs:312 — tarball_extract::extract_tarball has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 3, match/switch 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.
D2 · Cognitive Complexity · emit · ×1
  • emit::ensure_no_import_assertion (cognitive 22) libs/resolver/emit.rs:705 — emit::ensure_no_import_assertion has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, match/switch 5, boolean chains 4, loops 1 (nesting depth added 12). Of this number, 21 points are the body's own statements and 1 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · search (cognitive 22) · ×1
  • search (cognitive 22) runtime/cpu_profiler/flamegraph.js:294 — search has cognitive complexity 22 (threshold 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 · createDependentAbortSignal (cognitive 22) · ×1
  • createDependentAbortSignal (cognitive 22) ext/web/03_abort_signal.js:387 — createDependentAbortSignal has cognitive complexity 22 (threshold 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 · buildDiffLines (cognitive 22) · ×1
  • buildDiffLines (cognitive 22) cli/js/40_test_snapshot.js:178 — buildDiffLines has cognitive complexity 22 (threshold 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 · ModuleGraphCreator · ×1
  • ModuleGraphCreator::create_publish_graph (cognitive 21) cli/graph_util.rs:540 — ModuleGraphCreator::create_publish_graph has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 2, match/switch 1 (nesting depth added 5). Of this number, 20 points are the body's own statements and 1 belong to one function item declared inside it. 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 · Http2Options · ×1
  • Http2Options::new (cognitive 21) ext/node/ops/http2/session.rs:388 — Http2Options::new has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 5, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · dns · ×1
  • dns::getaddrinfo_inner (cognitive 21) ext/node/ops/dns.rs:86 — dns::getaddrinfo_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 2, match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageJsonDepValue · ×1
  • PackageJsonDepValue::parse (cognitive 21) libs/package_json/lib.rs:209 — PackageJsonDepValue::parse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, match/switch 3, boolean chains 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 2 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · DiskCache · ×1
  • DiskCache::get_cache_filename (cognitive 21) libs/resolver/cache/disk_cache.rs:55 — DiskCache::get_cache_filename has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, match/switch 9, 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.
D2 · Cognitive Complexity · constructor (cognitive 21) · ×1
  • constructor (cognitive 21) ext/ffi/00_ffi.js:461 — constructor has cognitive complexity 21 (threshold 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 · fillHeaderList (cognitive 21) · ×1
  • fillHeaderList (cognitive 21) ext/fetch/20_headers.js:221 — fillHeaderList has cognitive complexity 21 (threshold 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 · getModuleLiteralImportKind (cognitive 21) · ×1
  • getModuleLiteralImportKind (cognitive 21) cli/tsc/97_ts_host.js:873 — getModuleLiteralImportKind has cognitive complexity 21 (threshold 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 · getFromRawValue (cognitive 21) · ×1
  • getFromRawValue (cognitive 21) cli/js/40_lint_selector.js:387 — getFromRawValue has cognitive complexity 21 (threshold 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 · ConfigTree · ×1
  • ConfigTree::refresh (cognitive 20) cli/lsp/config.rs:1924 — ConfigTree::refresh has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RangeTree · ×1
  • RangeTree::normalize (cognitive 20) cli/tools/coverage/range_tree.rs:80 — RangeTree::normalize has cognitive complexity 20 (threshold 15). Drivers by points: loops 13, if/else 4, match/switch 2, boolean chains 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · WorkspaceLinter · ×1
  • WorkspaceLinter::lint_files (cognitive 20) cli/tools/lint/mod.rs:292 — WorkspaceLinter::lint_files has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 2 (nesting depth added 2). Of this number, 18 points are the body's own statements and 2 belong to one function item declared inside it. 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 · AddRmPackageReq · ×1
  • AddRmPackageReq::parse (cognitive 20) cli/tools/pm/mod.rs:1030 — AddRmPackageReq::parse has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 11, if/else 8, loops 1 (nesting depth added 8). Of this number, 14 points are the body's own statements and 6 belong to 2 function items declared inside it. 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 · audit · ×1
  • audit::apply_fixes (cognitive 20) cli/tools/pm/audit.rs:73 — audit::apply_fixes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, loops 6, match/switch 4 (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 · extract · ×1
  • extract::extract_markdown_fenced_blocks (cognitive 20) cli/util/extract.rs:157 — extract::extract_markdown_fenced_blocks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 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.
D2 · Cognitive Complexity · DesktopHmrRunner · ×1
  • DesktopHmrRunner::handle_change (cognitive 20) cli/rt/hmr.rs:471 — DesktopHmrRunner::handle_change has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, match/switch 7, boolean chains 1, 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 · algorithm · ×1
  • algorithm::compute_key_length (cognitive 20) ext/crypto/algorithm.rs:383 — algorithm::compute_key_length has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, match/switch 4, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiBackendDbHandler · ×1
  • MultiBackendDbHandler::open (cognitive 20) ext/kv/dynamic.rs:57 — MultiBackendDbHandler::open has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 3, match/switch 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 · buffer · ×1
  • buffer::op_node_encoding_slice (cognitive 20) ext/node/ops/buffer.rs:186 — buffer::op_node_encoding_slice has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · keys · ×1
  • keys::dsa_generate_components (cognitive 20) ext/node_crypto/keys.rs:3119 — keys::dsa_generate_components has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 7, 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.
D2 · Cognitive Complexity · JsRuntimeInspector · ×1
  • JsRuntimeInspector::capture_network_event (cognitive 20) libs/core/inspector.rs:1255 — JsRuntimeInspector::capture_network_event has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, 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 · Protocol · ×1
  • Protocol::chunked_body_chunk (cognitive 20) libs/http_h1/protocol.rs:210 — Protocol::chunked_body_chunk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, match/switch 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.
D2 · Cognitive Complexity · fs_util · ×1
  • fs_util::hard_link_file (cognitive 20) libs/npm_cache/fs_util.rs:89 — fs_util::hard_link_file has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20 (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 · deno_npm_cache · ×1
  • deno_npm_cache::write_slim_version (cognitive 20) libs/npm_cache/lib.rs:478 — deno_npm_cache::write_slim_version has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 1, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lifecycle_scripts · ×1
  • lifecycle_scripts::compute_lifecycle_script_layers (cognitive 20) libs/npm_installer/lifecycle_scripts.rs:338 — lifecycle_scripts::compute_lifecycle_script_layers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, loops 10 (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 · bin_entries · ×1
  • bin_entries::sort_by_depth (cognitive 20) libs/npm_installer/bin_entries.rs:290 — bin_entries::sort_by_depth has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 4, match/switch 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.
D2 · Cognitive Complexity · serializeJsMessageData (cognitive 20) · ×1
  • serializeJsMessageData (cognitive 20) ext/web/13_message_port.js:863 — serializeJsMessageData has cognitive complexity 20 (threshold 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 · slice (cognitive 20) · ×1
  • slice (cognitive 20) ext/web/09_file.js:301 — slice has cognitive complexity 20 (threshold 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 · fastPipeTo (cognitive 20) · ×1
  • fastPipeTo (cognitive 20) ext/web/06_streams.js:3155 — fastPipeTo has cognitive complexity 20 (threshold 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 · getAttrPathValue (cognitive 20) · ×1
  • getAttrPathValue (cognitive 20) cli/js/40_lint.js:981 — getAttrPathValue has cognitive complexity 20 (threshold 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 · DocumentModules · ×1
  • DocumentModules::resolve (cognitive 19) cli/lsp/documents.rs:1851 — DocumentModules::resolve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, match/switch 5, 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 · DenoPluginHandler · ×1
  • DenoPluginHandler::bundle_load (cognitive 19) cli/tools/bundle/mod.rs:2090 — DenoPluginHandler::bundle_load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, match/switch 7 (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 · BinaryNameAndUrl · ×1
  • BinaryNameAndUrl::resolve (cognitive 19) cli/tools/installer/global.rs:1042 — BinaryNameAndUrl::resolve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 2, boolean chains 1, match/switch 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 2 belong to one function item declared inside it. To reduce it, split the body into named stages: move each independent 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 · npm_tarball · ×1
  • npm_tarball::create_npm_tarball (cognitive 19) cli/tools/pack/npm_tarball.rs:113 — npm_tarball::create_npm_tarball has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 9 (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 · windows · ×1
  • windows::ensure_stdio_open (cognitive 19) cli/util/windows.rs:185 — windows::ensure_stdio_open has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, match/switch 6, 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 · installer · ×1
  • installer::print_install_report (cognitive 19) cli/tools/installer/mod.rs:261 — installer::print_install_report has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, loops 8, 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 · graph_util · ×1
  • graph_util::resolution_error_for_tsc_diagnostic (cognitive 19) cli/graph_util.rs:338 — graph_util::resolution_error_for_tsc_diagnostic has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 14, if/else 5 (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.
D2 · Cognitive Complexity · subtle_sign · ×1
  • subtle_sign::run (cognitive 19) ext/crypto/subtle_sign.rs:409 — subtle_sign::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proxy · ×1
  • proxy::tunnel (cognitive 19) ext/fetch/proxy.rs:725 — proxy::tunnel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, match/switch 3, 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 · TsFn · ×1
  • TsFn::call (cognitive 19) ext/napi/node_api.rs:1064 — TsFn::call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalLspHttpCache · ×1
  • LocalLspHttpCache::get_remote_url (cognitive 19) libs/cache_dir/local.rs:110 — LocalLspHttpCache::get_remote_url has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalHttpCache · ×1
  • LocalHttpCache::get (cognitive 19) libs/cache_dir/local.rs:445 — LocalHttpCache::get has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, match/switch 4, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LockfilePackageGraph · ×1
  • LockfilePackageGraph::from_lockfile (cognitive 19) libs/lockfile/graphs.rs:116 — LockfilePackageGraph::from_lockfile has cognitive complexity 19 (threshold 15). Drivers by points: loops 7, if/else 6, match/switch 6 (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 · NpmResolutionSnapshot · ×1
  • NpmResolutionSnapshot::as_valid_serialized_for_system (cognitive 19) libs/npm/resolution/snapshot.rs:613 — NpmResolutionSnapshot::as_valid_serialized_for_system has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, loops 7, 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 · DictionaryField · ×1
  • DictionaryField::try_from (cognitive 19) libs/ops/webidl/dictionary.rs:170 — DictionaryField::try_from has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 9, if/else 6, loops 4 (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.
D2 · Cognitive Complexity · DenoGraphLoader · ×1
  • DenoGraphLoader::load_or_cache (cognitive 19) libs/resolver/file_fetcher.rs:508 — DenoGraphLoader::load_or_cache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, match/switch 8 (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 · process_stdio · ×1
  • process_stdio::uv_stdio_create (cognitive 19) runtime/subprocess_windows/src/process_stdio.rs:248 — process_stdio::uv_stdio_create has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, match/switch 5, 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 · pump (cognitive 19) · ×1
  • pump (cognitive 19) ext/web/06_streams.js:3413 — pump has cognitive complexity 19 (threshold 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 · HttpClient · ×1
  • HttpClient::get_redirected_response (cognitive 18) cli/http_util.rs:402 — HttpClient::get_redirected_response has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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.
D2 · Cognitive Complexity · ExternalsMatcher · ×1
  • ExternalsMatcher::new (cognitive 18) cli/tools/bundle/externals.rs:75 — ExternalsMatcher::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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 · PackagePath · ×1
  • PackagePath::new (cognitive 18) cli/tools/publish/paths.rs:63 — PackagePath::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 2, 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 · ReplSession · ×1
  • ReplSession::evaluate_line_and_get_output::inner (cognitive 18) cli/tools/repl/session.rs:509 — ReplSession::evaluate_line_and_ge...

    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.