Public report — svelte, published 1 Oct 2026. Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches, dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase survey Measured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this survey Filed cd_00e17580c3a34704b701b21201c3a701 Filed 1 October 2026, 15:52 UTC Public

Sveltejs/svelte

Measured 1 October 2026, 15:22 UTC

58% At Risk

Medium · 57,677 LoC · 2 projects · rebuild ~1.2 person-years · weakest lens: Maturity (54%)

Findings by grade

22 critical 574 serious 4851 minor 33 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
1 October 2026, 15:22 UTC

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

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

51/55dimensions tool-verifieddeterministic · confidence 1.0 · 4 LLM-assisted, advisory
5428findings with an exact file:lineof 5447 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
55/132dimensions across the health lenses57677 LoC · 2 projects — wide & deep
Chapters

Executive summary

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

The system holds a moderate standing with an overall health score of 58%, indicating it is a workable asset carrying real risk. While the codebase is substantial, comprising nearly 58,000 lines of production code, its current state requires careful stewardship to avoid escalating costs and delivery delays. The primary concern is not immediate failure, but the compounding drag on velocity and the operational fragility that comes with low maturity.

The most significant risk is a persistent velocity tax on every change. Code quality signals suggest that modifications in weaker areas cost 8–19% more effort than in clean code. This inefficiency acts as a hidden tax on the team, slowing down feature delivery and increasing the likelihood of defects. Over time, this drag compounds, making the system progressively harder and more expensive to evolve without targeted intervention.

Operational maturity is the second critical area. With a maturity score of 54%, the system lacks the documentation and decision records needed for new teams to pick up work efficiently. This gap creates a high dependency on tribal knowledge, increasing the risk of errors during onboarding and maintenance. The cost of rebuilding this asset is estimated at roughly €180,000, highlighting the value tied up in its current structure and the importance of preserving institutional knowledge.

The most effective immediate action is to add a build and run section to the root README. This small change, requiring only a few days of effort, pays for itself within months by reducing onboarding time and preventing the annual drag of 10–60 engineer-days. It is the highest-leverage move available, offering immediate relief to the velocity tax and improving the system’s accessibility for new contributors.

Strengths include a solid security posture and good accessibility, which protect the business from exposure and ensure broad usability. However, the lack of measured data on domain modeling and event-driven architecture means the full picture is partial. Leadership should prioritize the README update and documentation improvements to stabilize the system and unlock faster, cheaper delivery.

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.
Maturity 54% · 46% weightPerformance 60% · 25% weightArchitecture 61% · 14% weightCode Health 62% · 8% weightReadiness 63% · 4% weightSecurity 66% · 2% weightAccessibility 75% · 1% weight

Raise Maturity 54 → 70 (the Healthy floor) ⇒ headline 58 → ~61.

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

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

  • D1 · animate (cyclomatic 21) packages/svelte/src/internal/client/dom/elements/transitions.js
  • D1 · LetDirective.LetDirective (cyclomatic 18) packages/svelte/src/compiler/phases/2-analyze/visitors/LetDirective.js
  • D1 · Boundary.#handle_error (cyclomatic 16) packages/svelte/src/internal/client/dom/blocks/boundary.js
  • D2 · get (cognitive 87) packages/svelte/src/internal/client/runtime.js
  • D2 · element (cognitive 38) packages/svelte/src/internal/client/dom/blocks/svelte-element.js
  • D2 · animate (cognitive 31) packages/svelte/src/internal/client/dom/elements/transitions.js
  • D2 · #handle_error (cognitive 17) packages/svelte/src/internal/client/dom/blocks/boundary.js
  • D15 · Hotspot: packages/svelte/src/internal/client/proxy.js packages/svelte/src/internal/client/proxy.js
  • D15 · Hotspot: packages/svelte/src/internal/client/dom/blocks/boundary.js packages/svelte/src/internal/client/dom/blocks/boundary.js
  • D15 · Hotspot: packages/svelte/src/internal/client/dom/elements/transitions.js packages/svelte/src/internal/client/dom/elements/transitions.js
  • D29 · REDACTED
  • D29 · REDACTED
  • D29 · REDACTED
  • D29 · REDACTED
  • R4 · This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet-expression/main.svelte
  • R4 · This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet/main.svelte
  • AC2 · <textarea> without a programmatic label packages/svelte/src/compiler/errors.js
  • PF3 · Sync-over-async blocking benchmarking/utils.js
  • PF3 · Sync-over-async blocking packages/svelte/scripts/generate-browser-support.ts
  • PF3 · Sync-over-async blocking packages/svelte/scripts/generate-browser-support.ts
  • PF3 · Sync-over-async blocking packages/svelte/tests/suite.ts
  • PF3 · Sync-over-async blocking packages/svelte/tests/helpers.js
  • PF3 · Sync-over-async blocking packages/svelte/tests/runtime-browser/test-ssr.ts
  • PF3 · Sync-over-async blocking packages/svelte/tests/runtime-browser/test.ts
  • PF3 · Sync-over-async blocking packages/svelte/tests/runtime-legacy/shared.ts
  • PF3 · Sync-over-async blocking REDACTED
  • PF3 · Sync-over-async blocking REDACTED
  • PF3 · Sync-over-async blocking playgrounds/sandbox/ssr-dev.js

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 — €59,000–€300,000
Cost to rebuild€59,000–€300,000 (0.6–1.9 person-years (990–3,140 h), ~1–3 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 58% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

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

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

Top priorities

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

1
Resolve the 2 Documentation finding(s) in Documentation Quality — start with README.md (2).
+3.3 pts · Low effort · Documentation Quality
2
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
+3.9 pts · Medium effort · Documentation (README)
3
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
+3.9 pts · Medium effort · Architecture documentation

Diagnosis — what's actually going on

The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 10.2–61.5 engineer-days every year, paid as drag on the ~49,186 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–4 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 8–19% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 12,128 line(s) changed over a 90-day window ⇒ ~49,186/year · D1/D2/D6 code quality: averaging 4.7/10 ⇒ a 8–19% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 4 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Medium asset (~1.2 person-years to rebuild), and its weakest lens is Maturity at 54%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~1.2 person-years rebuild (57,677 LoC) · weakest lens: Maturity 54%
→ Direct remediation budget at Maturity 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 a build/run (quick start) section to the root README — the first thing a newcomer needs. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 4.7/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 8–19% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D6 code quality: averaging 4.7/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency matrix

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

275 modules, 5 dependencies. Every dependency points down the layering — no cycles.

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

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 benchmarking2 benchmarking.benchmarks.compiler3 benchmarking.benchmarks.reactivity4 benchmarking.benchmarks.reactivity.tests5 benchmarking.benchmarks.ssr.wrapper6 benchmarking.compare7 packages.svelte.scripts.generate-browser-support8 packages.svelte.scripts.process-messages.templates9 packages.svelte.scripts.process-messages.templates.compile-errors10 packages.svelte.src11 packages.svelte.src.compiler12 packages.svelte.src.compiler.errors13 packages.svelte.src.compiler.migrate14 packages.svelte.src.compiler.phases15 packages.svelte.src.compiler.phases.1-parse16 packages.svelte.src.compiler.phases.1-parse.read17 packages.svelte.src.compiler.phases.1-parse.state18 packages.svelte.src.compiler.phases.1-parse.utils19 packages.svelte.src.compiler.phases.2-analyze.css20 packages.svelte.src.compiler.phases.2-analyze.visitors21 packages.svelte.src.compiler.phases.2-analyze.visitors.shared22 packages.svelte.src.compiler.phases.2-analyze.visitors.shared.a11y23 packages.svelte.src.compiler.phases.3-transform24 packages.svelte.src.compiler.phases.3-transform.client25 packages.svelte.src.compiler.phases.3-transform.client.transform-template26 packages.svelte.src.compiler.phases.3-transform.client.transform-template.template27 packages.svelte.src.compiler.phases.3-transform.client.visitors28 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared29 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared.utils30 packages.svelte.src.compiler.phases.3-transform.server31 packages.svelte.src.compiler.phases.3-transform.server.visitors32 packages.svelte.src.compiler.phases.3-transform.server.visitors.shared33 packages.svelte.src.compiler.utils.compile_diagnostic34 packages.svelte.src.reactivity.reactive-value35 packages.svelte.tests.runtime-legacy.shared36 packages.svelte.scripts37 packages.svelte.scripts.process-messages.templates.compile-warnings38 packages.svelte.src.compiler.warnings39 packages.svelte.src.reactivity.media-query40 packages.svelte.tests.runtime-legacy
1 benchmarking
2 benchmarking.benchmarks.compiler
3 benchmarking.benchmarks.reactivity
4 benchmarking.benchmarks.reactivity.tests
5 benchmarking.benchmarks.ssr.wrapper
6 benchmarking.compare
7 packages.svelte.scripts.generate-browser-support
8 packages.svelte.scripts.process-messages.templates
9 packages.svelte.scripts.process-messages.templates.compile-errors
10 packages.svelte.src
11 packages.svelte.src.compiler
12 packages.svelte.src.compiler.errors
13 packages.svelte.src.compiler.migrate
14 packages.svelte.src.compiler.phases
15 packages.svelte.src.compiler.phases.1-parse
16 packages.svelte.src.compiler.phases.1-parse.read
17 packages.svelte.src.compiler.phases.1-parse.state
18 packages.svelte.src.compiler.phases.1-parse.utils
19 packages.svelte.src.compiler.phases.2-analyze.css
20 packages.svelte.src.compiler.phases.2-analyze.visitors
21 packages.svelte.src.compiler.phases.2-analyze.visitors.shared
22 packages.svelte.src.compiler.phases.2-analyze.visitors.shared.a11y
23 packages.svelte.src.compiler.phases.3-transform
24 packages.svelte.src.compiler.phases.3-transform.client
25 packages.svelte.src.compiler.phases.3-transform.client.transform-template
26 packages.svelte.src.compiler.phases.3-transform.client.transform-template.template
27 packages.svelte.src.compiler.phases.3-transform.client.visitors
28 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared
29 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared.utils
30 packages.svelte.src.compiler.phases.3-transform.server
31 packages.svelte.src.compiler.phases.3-transform.server.visitors
32 packages.svelte.src.compiler.phases.3-transform.server.visitors.shared
33 packages.svelte.src.compiler.utils.compile_diagnostic
34 packages.svelte.src.reactivity.reactive-value
35 packages.svelte.tests.runtime-legacy.shared
36 packages.svelte.scripts1
37 packages.svelte.scripts.process-messages.templates.compile-warnings1
38 packages.svelte.src.compiler.warnings1
39 packages.svelte.src.reactivity.media-query1
40 packages.svelte.tests.runtime-legacy1
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
benchmarking…g.benchmarks.compiler…benchmarks.reactivity…arks.reactivity.tests…enchmarks.ssr.wrapperbenchmarking.compare…erate-browser-support…ss-messages.templates…plates.compile-errorspackages.svelte.src…s.svelte.src.compiler…e.src.compiler.errors….src.compiler.migrate…e.src.compiler.phases…mpiler.phases.1-parse…r.phases.1-parse.read….phases.1-parse.state….phases.1-parse.utils….phases.2-analyze.css…es.2-analyze.visitors…alyze.visitors.shared….visitors.shared.a11y…er.phases.3-transform…es.3-transform.client…nt.transform-template…orm-template.template…sform.client.visitors…lient.visitors.shared…visitors.shared.utils…es.3-transform.server…sform.server.visitors…erver.visitors.shared…ls.compile_diagnostic…tivity.reactive-value…runtime-legacy.shared…ckages.svelte.scripts…ates.compile-warnings…src.compiler.warnings…eactivity.media-query….tests.runtime-legacybenchmarking1…g.benchmarks.compiler2…benchmarks.reactivity3…arks.reactivity.tests4…enchmarks.ssr.wrapper5benchmarking.compare6…erate-browser-support7…ss-messages.templates8…plates.compile-errors9packages.svelte.src10…s.svelte.src.compiler11…e.src.compiler.errors12….src.compiler.migrate13…e.src.compiler.phases14…mpiler.phases.1-parse15…r.phases.1-parse.read16….phases.1-parse.state17….phases.1-parse.utils18….phases.2-analyze.css19…es.2-analyze.visitors20…alyze.visitors.shared21….visitors.shared.a11y22…er.phases.3-transform23…es.3-transform.client24…nt.transform-template25…orm-template.template26…sform.client.visitors27…lient.visitors.shared28…visitors.shared.utils29…es.3-transform.server30…sform.server.visitors31…erver.visitors.shared32…ls.compile_diagnostic33…tivity.reactive-value34…runtime-legacy.shared35…ckages.svelte.scripts36…ates.compile-warnings37…src.compiler.warnings38…eactivity.media-query39….tests.runtime-legacy4011111+235 more modules (most-connected shown)

At a glance — Code Health · 62% · Adequate · gated by D1, D2, D3 ·

At a glance — Architecture · 61% · Adequate · gated by D26, R9 ·

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

At a glance — Readiness · 63% · Adequate · gated by P3 ·

At a glance — Security · 66% · Adequate · gated by D30 ·

At a glance — Accessibility · 75% · Strong ·

At a glance — Performance · 60% · Adequate ·

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 Components21High / Critical
A03:2021 — Injection9High / Critical

Roadmap

Begin by adding a build and run quick start to the root README to help newcomers, while simultaneously resolving the two existing documentation quality issues. Next, establish a structured repository for architecture decision records to capture key design choices and their consequences. Address the eighteen code churn and complexity hotspots, prioritizing REDACTED, RegularElement.js, and attributes.js. Finally, improve system responsiveness by replacing synchronous APIs with their asynchronous counterparts throughout the codebase.

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

Do thisHelpsEffortDimension
Resolve the 2 Documentation finding(s) in Documentation Quality — start with README.md (2).+3.3 ptsLowDocumentation Quality
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.+3.9 ptsMediumDocumentation (README)
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).+3.9 ptsMediumArchitecture documentation
Resolve the 18 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (4), RegularElement.js, attributes.js.+2.8 ptsHighChurn × Complexity Hotspots
Resolve the 1 Split packages/svelte finding(s) in Project Cohesion.+0.6 ptsLowProject Cohesion
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.+1.1 ptsMediumAsync & latency hygiene
Resolve the 3 Repeated repair finding(s) in Churn × Complexity Hotspots — start with renderer.js, test.ts, select.js.+0.5 ptsLowChurn × Complexity Hotspots
Break each cycle by extracting the shared piece into a module both sides can import.+0.8 ptsMediumCircular Imports

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED5.4MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js5.9MixedCyclomatic Complexity: EachBlock.EachBlock (cyclomatic 64)
REDACTED6.3MixedCyclomatic Complexity: migrate (cyclomatic 91)
packages/svelte/tests/runtime-legacy/shared.ts6.5MixedExplicit Debt: TodoComment
packages/svelte/tests/store/test.ts6.6MixedExplicit Debt: TodoComment
packages/svelte/tests/signals/test.ts6.7MixedExplicit Debt: TodoComment
packages/svelte/tests/server-side-rendering/test.ts6.9MixedExplicit Debt: TodoComment
packages/svelte/src/compiler/print/index.js7.0MixedCyclomatic Complexity: index.svelte_visitors (cyclomatic 122)
packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js7.0MixedCyclomatic Complexity: relative_selector_might_apply_to_node (cyclomatic 67)
packages/svelte/src/internal/client/reactivity/batch.js7.0MixedCyclomatic Complexity: #commit (cyclomatic 31)
packages/svelte/src/compiler/phases/3-transform/client/visitors/SlotElement.js7.0MixedCognitive Complexity: SlotElement.SlotElement (cognitive 25)
packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitBlock.js7.0MixedCognitive Complexity: AwaitBlock (cognitive 19)
packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js7.0MixedCyclomatic Complexity: check_element (cyclomatic 195)
packages/svelte/src/compiler/phases/2-analyze/index.js7.0MixedCyclomatic Complexity: analyze_component (cyclomatic 181)
packages/svelte/src/compiler/phases/scope.js7.0MixedCyclomatic Complexity: Evaluation.constructor (cyclomatic 107)
packages/svelte/src/compiler/phases/1-parse/state/element.js7.0MixedCyclomatic Complexity: element (cyclomatic 91)
packages/svelte/src/internal/client/runtime.js7.0MixedCyclomatic Complexity: runtime.get (cyclomatic 50)
packages/svelte/src/internal/client/dev/debug.js7.0MixedCyclomatic Complexity: debug.log_reactions (cyclomatic 33)

How the grades work

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

Critical — 22

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

Serious — 574

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 4851

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

Could not be resolved — 33

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

Methodology & how to trust this report

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

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

What we checked — 55 dimensions across the health lenses
D1D2D3D6D9D10D11D12D13D14D15D16D17D19D21D26D27D28D29D30D34D35D36D43AC2AC3AC5AC6AC7AX10AX3AX4M1M2M3M4P1P10P3P4P6PF3R1R10R11R2R3R4R6R7R8R9X24X25X29

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets 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 01a0f80f-788b-798d-98e6-dbce21e889c1.

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.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .js, and our analyzer cannot run the .js test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 91.5% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero. In the meantime, produce a coverage report in a standard format (lcov — `vitest --coverage --coverage.reporter=lcovonly`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures and real coverage will be read. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `vitest --coverage --coverage.reporter=lcovonly`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then both halves are read on the next scan.
  • D11 Test Reliability — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Test reliability for the vitest suite in packages/svelte/ was NOT MEASURED: the vitest run in packages/svelte/ produced no per-test report (⎯⎯⎯⎯⎯⎯⎯ Startup Error ⎯⎯⎯⎯⎯⎯⎯⎯). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (packages/svelte/package.json), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `packages/svelte/elements.d.ts`, `packages/svelte/src/compiler/phases/1-parse/index.js`, `packages/svelte/src/compiler/phases/2-analyze/types.d.ts`, `packages/svelte/src/compiler/phases/3-transform/client/types.d.ts`, `packages/svelte/src/compiler/phases/3-transform/server/types.d.ts`, … (+5 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 67 further occurrence(s) are not listed individually; the score already reflects all 107.
  • R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 39 further occurrence(s) are not listed individually; the score already reflects all 79.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java and Rust source only, and no C# was loaded and no Java or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations: 75 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.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • 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.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • 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 (4): D19, D21, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

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

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

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

266 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was check_element at 195. A further 4 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 scope.should_proxy at 20 — they are counted neither in the figure above nor in this dimension's score. 3 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: packages/svelte/src/compiler/phases/2-analyze/visitors/ConstTag.js (ConstTag at 16), packages/svelte/src/compiler/phases/2-analyze/visitors/ConstTag.js (ConstTag.ConstTag at 16), packages/svelte/src/compiler/phases/nodes.js (nodes.find_descendants at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

check_element (cyclomatic 195)packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:56
analyze_component (cyclomatic 181)packages/svelte/src/compiler/phases/2-analyze/index.js:333
RegularElement (cyclomatic 136)packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:38
index.svelte_visitors (cyclomatic 122)packages/svelte/src/compiler/print/index.js:537
client_component (cyclomatic 108)packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:135

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

What to do

  1. Resolve the 1 check_element (cyclomatic 195) finding(s) in Cyclomatic Complexity — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 analyze_component (cyclomatic 181) finding(s) in Cyclomatic Complexity — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 RegularElement (cyclomatic 136) finding(s) in Cyclomatic Complexity — start with RegularElement.js. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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

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

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

368 method(s) exceeded the cognitive complexity threshold of 15; the worst was analyze_component at 385.

svelte_visitors::Fragment (cognitive 48) · ×2packages/svelte/src/compiler/print/index.js:573
analyze_component (cognitive 385)packages/svelte/src/compiler/phases/2-analyze/index.js:333
VariableDeclaration (cognitive 266)packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16
check_element (cognitive 257)packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:56
migrate (cognitive 179)REDACTED:124

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

What to do

  1. Resolve the 2 svelte_visitors finding(s) in Cognitive Complexity — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 analyze_component (cognitive 385) finding(s) in Cognitive Complexity — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 VariableDeclaration (cognitive 266) finding(s) in Cognitive Complexity — start with VariableDeclaration.js. — One of this dimension's main actionable groups (1 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 Classes0.0 / 10Critical✓ Tool-verified

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

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

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

47 god class(es) detected.

FunctionTooLong: legacy.convert · ×35packages/svelte/src/compiler/legacy.js:42
FileTooLong: REDACTED · ×9REDACTED
MethodTooLong: Evaluation.constructorpackages/svelte/src/compiler/phases/scope.js:262
TooManyMethods: Rendererpackages/svelte/src/internal/server/renderer.js:116
ClassTooLong: Batchpackages/svelte/src/internal/client/reactivity/batch.js:97

What to do

  1. Resolve the 35 FunctionTooLong finding(s) in God Classes — start with REDACTED (7), RegularElement.js (3), component.js (2). — One of this dimension's main actionable groups (35 warning-level).
  2. Resolve the 9 FileTooLong finding(s) in God Classes — start with REDACTED (4), scope.js, css-prune.js. — One of this dimension's main actionable groups (9 warning-level).
  3. Resolve the 1 MethodTooLong finding(s) in God Classes — start with scope.js. — One of this dimension's main actionable groups (1 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.

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

0 of 24 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

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

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

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

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

5072 test methods: 5072 unit, 0 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 5072 `it`/`test` case(s) across 2863 test file(s) declaring at least one; its tier split is read from package names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Stronggated by 2 serious findings✓ Tool-verified

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

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

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

4820 skipped (4820 with a documented reason), 2 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 5072 tests.

No assertions: REGEX_VALID_TAG_NAME no ReDoS · ×2packages/svelte/src/utils.test.ts:43
Skipped (documented): [SKIP] ${cwd} · ×4820packages/svelte/tests/suite.ts:103

What to do

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

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

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

0 flaky across 1 measured tier(s). JavaScript/TypeScript (vitest via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root (7704 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/svelte/): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

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

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

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

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

6 outdated direct production npm dependency(ies) of 15 graded, 0 pinning defect(s), across 3 package.json (2 of them the product) and 1 committed lockfile(s). Development dependencies are deliberately not graded: this dimension grades what SHIPS. Whether any of these packages is DEPRECATED or UNMAINTAINED is not graded — registry.npmjs.org's latest-version answer carries neither, and release age does not stand in for a maintenance status. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.

Outdated (npm): aria-query · ×6

✓ On the Gold path — maintain.

Detailed fixes: d12_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: Documented → Verified → Prevented · 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.

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

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

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

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

0 of 15 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 15 production dependency(ies) this repository's committed lockfile resolves, across 2 product package.json manifest(s). Its 45 `devDependencies` declaration(s) are excluded: a consumer installs none of them. ★ DEPTH: this is the DIRECT production set the lockfile resolves, NOT the transitive closure — only one of the four lock dialects this pass reads states a full graph, so a banned licence pulled in only by a dependency's OWN dependencies is outside this verdict, exactly as the JVM arm's declaration-site verdict is. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. This repository publishes itself under MIT, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots7.8 / 10Strong✓ Tool-verified

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

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

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

Top hotspots: packages/svelte/src/compiler/phases/2-analyze/index.js (8×177=1416); packages/svelte/src/compiler/print/index.js (8×122=976); packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js (7×135=945) Repeated repair below the complexity floor: packages/svelte/src/internal/server/renderer.js (5 of 7 changes were fixes); packages/svelte/tests/signals/test.ts (4 of 4 changes were fixes); packages/svelte/src/internal/client/dom/elements/bindings/select.js (3 of 4 changes were fixes)

Hotspot: packages/svelte/src/compiler/phases/2-analyze/index.js · ×18packages/svelte/src/compiler/phases/2-analyze/index.js:333
Repeated repair: packages/svelte/src/internal/server/renderer.js · ×3packages/svelte/src/internal/server/renderer.js:450

What to do

  1. Resolve the 18 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (4), RegularElement.js, attributes.js. — One of this dimension's main actionable groups (18 warning-level).
  2. Resolve the 3 Repeated repair finding(s) in Churn × Complexity Hotspots — start with renderer.js, test.ts, select.js. — One of this dimension's main actionable groups (3 warning-level).

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

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

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

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

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

4 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is benchmarking/utils.js. Counted over 167 of the 380 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

✓ On the Gold path — maintain.

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

D17 · Explicit Debt8.8 / 10Strong✓ Tool-verified

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

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

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

17 deducted task-comment markers across 798 LoC (0.6/KLoC) → score 8.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×16packages/svelte/tests/suite.ts:56
HackCommentpackages/svelte/tests/runtime-legacy/shared.ts:385

What to do

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

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

D19 · Documentation QualityStrong◐ Sampled · advisory

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

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

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

The repository's root README and two package-level READMEs (one for the packages/svelte directory itself) give an excellent overview of Svelte as a new compiler/runtime project with its Svelte.dev website link, license, roadmap, and contributing guide. The packages/svelte/README is focused on getting started via npx sv create, examples, and SvelteKit docs; it also documents the package's changelog and licensing. The third README (packages/svelte/tests/) is a test repo that migrates tests from the main project to new compiler/runtime code but does not itself document what the tests are for or how to run them — its body is clipped mid-sentence, so any missing usage/usage examples it might have cannot be flagged as an omission. The visible content is clear and complete for a README; the unshown test repo section is clipped and must not be treated as missing.

Documentation: no project overview · ×2README.md

What to do

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

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

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

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

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

1 of 2 build units (npm) flagged as possibly oversized/incoherent.

Split packages/svelte

What to do

  1. Resolve the 1 Split packages/svelte finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

D27 · Navigability10.0 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

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

34 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)5.0 / 10Adequate✓ Tool-verified

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

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

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

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

10 finding(s): 0 critical, 3 high, 2 medium, 5 low. semgrep hit a parse error in 11 file(s) — `packages/svelte/elements.d.ts` (line 91, line 92, line 93, …), `packages/svelte/src/compiler/phases/1-parse/index.js` (lines 15–17), `packages/svelte/src/compiler/phases/2-analyze/types.d.ts` (lines 48–51, lines 53–56), `packages/svelte/src/compiler/phases/3-transform/client/types.d.ts` (line 93, line 94, lines 96–99, …), `packages/svelte/src/compiler/phases/3-transform/server/types.d.ts` (line 38, line 39, lines 41–44, …), … (+6 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 10 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (10). — One of this dimension's main actionable groups (10 issue-level).
  2. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

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

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

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

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

2 of 167 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is packages/svelte/src/store/shared/index.js. Counted over 167 of the 380 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling10.0 / 10Stronggated by 3 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: SlotElement.js↔component.js 91%; REDACTED↔IfBlock.js 50%; EachBlock.js↔IfBlock.js 50%

Change coupling: SlotElement.js ↔ component.js · ×3packages/svelte/src/compiler/phases/3-transform/client/visitors/SlotElement.js

What to do

  1. Resolve the 3 Change coupling finding(s) in Change Coupling — start with SlotElement.js, REDACTED, EachBlock.js. — One of this dimension's main actionable groups (3 warning-level).

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

D36 · Supply-chain Provenance & Signing7.5 / 10Strong✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

Frontend & cross-cutting dimensions

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

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

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

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

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

  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — packages/svelte/src/compiler/errors.js:1670

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

AC6 · Visual & motion safety10.0 / 10Exemplary○ Nothing flagged

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

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

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

AC7 · A11y enforcement6.0 / 10Adequate✓ Tool-verified

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

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

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

  • An a11y linter is configured (Documented) but there's no automated a11y test or CI gate. Add vitest-axe to verify at runtime, then gate it in CI. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Accessibility linting is already configured — assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

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

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

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

What to do

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

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

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

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

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

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

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

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

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

  • 189 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 2 of 3 project(s) that lack one — worth up to 1.3 pts.
  • Review the README against recent changes; refresh the parts that drifted.
M2 · Architecture documentation0.0 / 10Critical✓ Tool-verified

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
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.

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

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

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

P3 · Security & performance tooling0.0 / 10Critical✓ 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.

  • No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 14500 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ 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.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

  • `with_cpu_profile` is async and calls mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — benchmarking/utils.js:306
  • `find_all_conditional_features` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/svelte/scripts/generate-browser-support.ts:602
  • `main` is async and calls rmSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/svelte/scripts/generate-browser-support.ts:806
  • `for_each_dir` is async and calls readdirSync, existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/svelte/tests/suite.ts:78
  • `compile_directory` is async and calls rmSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/svelte/tests/helpers.js:63
  • `run_ssr_test` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/svelte/tests/runtime-browser/test-ssr.ts:15
  • `run_test` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/svelte/tests/runtime-browser/test.ts:63
  • `run_test_variant` is async and calls readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/svelte/tests/runtime-legacy/shared.ts:272
  • `download_stackblitz_project` is async and calls execSync, unlinkSync, readdirSync, statSync, renameSync, rmdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:138
  • `with_tmp_dir` is async and calls existsSync, rmSync, mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:655
  • `polka().use().use()` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — playgrounds/sandbox/ssr-dev.js:22

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified

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

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

R10 · Code Duplication9.2 / 10Exemplary✓ Tool-verified

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

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

  • 17 duplicated blocks under packages/svelte/src/compiler/phases/3-transform/ have copies in at least two of the sibling directories client, server — 16 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 17 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16 · packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js:15 — the two spans are one implementation copied and then locally edited — 935 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:71 · packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/component.js:51 — the two spans are one implementation copied and then locally edited — 835 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:71
  • packages/svelte/src/reactivity/map.js:53 · packages/svelte/src/reactivity/set.js:47 — the two spans are one implementation copied and then locally edited — 335 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/reactivity/map.js:53
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/DeclarationTag.js:27 · packages/svelte/src/compiler/phases/3-transform/server/visitors/DeclarationTag.js:22 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/3-transform/client/visitors/DeclarationTag.js:27
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/ClassBody.js:13 · packages/svelte/src/compiler/phases/3-transform/server/visitors/ClassBody.js:10 — the two spans are one implementation copied and then locally edited — 234 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/compiler/phases/3-transform/client/visitors/ClassBody.js:13
  • packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:106 · packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:65 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:106
  • packages/svelte/src/motion/tweened.js:109 · packages/svelte/src/motion/tweened.js:239 — the two spans are one implementation copied and then locally edited — 116 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/motion/tweened.js:109
  • packages/svelte/src/reactivity/map.js:96 · packages/svelte/src/reactivity/map.js:131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/svelte/src/reactivity/map.js:96
  • packages/svelte/src/compiler/utils/ast.js:300 · packages/svelte/src/compiler/utils/ast.js:357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/svelte/src/compiler/utils/ast.js:300
  • REDACTED:13 · packages/svelte/scripts/generate-browser-support.ts:293 — the two spans are one implementation copied and then locally edited — 92 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:13
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/HtmlTag.js:40 · packages/svelte/src/compiler/phases/3-transform/client/visitors/KeyBlock.js:26 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/3-transform/client/visitors/HtmlTag.js:40
  • packages/svelte/src/index-client.js:157 · packages/svelte/src/legacy/legacy-client.js:250 — the two spans are one implementation copied and then locally edited — 96 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/index-client.js:157
  • packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:446 · packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:283 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:446
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/RenderTag.js:73 · packages/svelte/src/compiler/phases/3-transform/client/visitors/SlotElement.js:76 — the two spans are one implementation copied and then locally edited — 114 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/compiler/phases/3-transform/client/visitors/RenderTag.js:73
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:164 · packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:234 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:164
  • packages/svelte/src/internal/client/proxy.js:170 · packages/svelte/src/internal/client/proxy.js:234 — the two spans are one implementation copied and then locally edited — 91 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/internal/client/proxy.js:170
  • packages/svelte/src/internal/server/renderer.js:288 · packages/svelte/src/internal/server/renderer.js:329 — the two spans are one implementation copied and then locally edited — 93 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/internal/server/renderer.js:288
  • packages/svelte/src/internal/client/context.js:67 · packages/svelte/src/internal/server/context.js:7 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/svelte/src/internal/client/context.js:67
  • packages/svelte/src/compiler/phases/2-analyze/index.js:577 · packages/svelte/src/compiler/phases/2-analyze/visitors/ExportNamedDeclaration.js:52 — the two spans are one implementation copied and then locally edited — 106 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/compiler/phases/2-analyze/index.js:577
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/TransitionDirective.js:20 · packages/svelte/src/compiler/phases/3-transform/client/visitors/UseDirective.js:26 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/3-transform/client/visitors/TransitionDirective.js:20
  • packages/svelte/src/internal/client/dev/assign.js:28 · packages/svelte/src/internal/client/dev/assign.js:52 — the two spans are one implementation copied and then locally edited — 92 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/internal/client/dev/assign.js:28
  • packages/svelte/src/motion/spring.js:112 · packages/svelte/src/motion/spring.js:253 — the two spans are one implementation copied and then locally edited — 66 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/motion/spring.js:112
  • REDACTED:1645 · REDACTED:1665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:1645
  • packages/svelte/src/compiler/phases/2-analyze/css/utils.js:118 · packages/svelte/src/compiler/phases/2-analyze/css/utils.js:163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/svelte/src/compiler/phases/2-analyze/css/utils.js:118
  • packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:667 · packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:403 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:667
  • packages/svelte/src/compiler/print/index.js:982 · packages/svelte/src/compiler/print/index.js:1141 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/print/index.js:982
  • packages/svelte/src/reactivity/window/index.js:68 · packages/svelte/src/reactivity/window/index.js:91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/svelte/src/reactivity/window/index.js:68
  • packages/svelte/src/compiler/legacy.js:479 · packages/svelte/src/compiler/legacy.js:494 · packages/svelte/src/compiler/legacy.js:543 · packages/svelte/src/compiler/legacy.js:557 · +1 more site(s) not listed — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — packages/svelte/src/compiler/legacy.js:479
  • packages/svelte/src/compiler/phases/1-parse/read/style.js:207 · packages/svelte/src/compiler/phases/1-parse/read/style.js:320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/svelte/src/compiler/phases/1-parse/read/style.js:207
  • packages/svelte/src/compiler/phases/1-parse/state/element.js:539 · packages/svelte/src/compiler/phases/1-parse/state/element.js:558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/svelte/src/compiler/phases/1-parse/state/element.js:539
  • packages/svelte/src/compiler/phases/2-analyze/index.js:968 · packages/svelte/src/compiler/phases/2-analyze/index.js:1028 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/2-analyze/index.js:968
  • packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:529 · packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:385 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:529
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js:16 · packages/svelte/src/compiler/phases/3-transform/server/visitors/AssignmentExpression.js:8 — the two spans are one implementation copied and then locally edited — 121 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js:16
  • packages/svelte/src/compiler/print/index.js:706 · packages/svelte/src/compiler/print/index.js:804 · packages/svelte/src/compiler/print/index.js:976 · packages/svelte/src/compiler/print/index.js:1147 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/print/index.js:706
  • packages/svelte/src/internal/client/reactivity/props.js:65 · packages/svelte/src/internal/client/reactivity/props.js:132 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/internal/client/reactivity/props.js:65
  • packages/svelte/src/compiler/legacy.js:433 · packages/svelte/src/compiler/legacy.js:447 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/legacy.js:433
  • packages/svelte/src/compiler/phases/1-parse/read/style.js:236 · packages/svelte/src/compiler/phases/1-parse/read/style.js:253 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/svelte/src/compiler/phases/1-parse/read/style.js:236
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/AttachTag.js:12 · packages/svelte/src/compiler/phases/3-transform/client/visitors/UseDirective.js:35 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/svelte/src/compiler/phases/3-transform/client/visitors/AttachTag.js:12
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/Fragment.js:10 · packages/svelte/src/compiler/phases/3-transform/server/visitors/Fragment.js:5 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/svelte/src/compiler/phases/3-transform/client/visitors/Fragment.js:10

What to do

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

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

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

  • benchmarking/benchmarks/reactivity/tests/kairo_broad_block.bench.js:3 reaches past another workspace package's public entry into its internals with a relative path (../../../../packages/svelte/src/internal/client/reactivity/effects.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — benchmarking/benchmarks/reactivity/tests/kairo_broad_block.bench.js:3
  • benchmarking/benchmarks/reactivity/tests/kairo_deep_block.bench.js:3 reaches past another workspace package's public entry into its internals with a relative path (../../../../packages/svelte/src/internal/client/reactivity/effects.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — benchmarking/benchmarks/reactivity/tests/kairo_deep_block.bench.js:3
  • benchmarking/run.js:3 reaches into another package with a relative path (../packages/svelte/src/internal/client/index.js) — import the package by name instead. — benchmarking/run.js:3
R2 · Cyclomatic Complexity8.0 / 10Strong✓ Tool-verified

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

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

  • check_element has cyclomatic complexity 181 and cognitive complexity 243; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:56
  • analyze_component has cyclomatic complexity 163 and cognitive complexity 360; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/2-analyze/index.js:333
  • RegularElement has cyclomatic complexity 124 and cognitive complexity 167; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:38
  • constructor has cyclomatic complexity 107 and cognitive complexity 131; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/scope.js:262
  • client_component has cyclomatic complexity 90 and cognitive complexity 134; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:135
  • element has cyclomatic complexity 89 and cognitive complexity 150; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/1-parse/state/element.js:65
  • CallExpression has cyclomatic complexity 79 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/2-analyze/visitors/CallExpression.js:16
  • build_component has cyclomatic complexity 78 and cognitive complexity 150; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:19
  • BindDirective has cyclomatic complexity 76 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/3-transform/client/visitors/BindDirective.js:15
  • run_test_variant has cyclomatic complexity 74 and cognitive complexity 119; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/tests/runtime-legacy/shared.ts:272
  • migrate has cyclomatic complexity 73 and cognitive complexity 130; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:124
  • BindDirective has cyclomatic complexity 72 and cognitive complexity 132; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/2-analyze/visitors/BindDirective.js:20
  • build_element_attributes has cyclomatic complexity 71 and cognitive complexity 136; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:36
  • set_attributes has cyclomatic complexity 71 and cognitive complexity 113; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/internal/client/dom/elements/attributes.js:271
  • VariableDeclaration has cyclomatic complexity 68 and cognitive complexity 229; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16
  • clean_nodes has cyclomatic complexity 68 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/3-transform/utils.js:126
  • Identifier has cyclomatic complexity 66 and cognitive complexity 107; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/2-analyze/visitors/Identifier.js:15
  • relative_selector_might_apply_to_node has cyclomatic complexity 64 and cognitive complexity 142; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:447
  • RegularElement has cyclomatic complexity 60 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/2-analyze/visitors/RegularElement.js:26
  • build_assignment has cyclomatic complexity 60 and cognitive complexity 74; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js:47

What to do

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

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

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

  • 33 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: packages/svelte/src/compiler/phases/1-parse/utils/entities.js (2234), REDACTED (1829), packages/svelte/src/compiler/phases/scope.js (1316), packages/svelte/src/internal/client/reactivity/batch.js (1227), packages/svelte/src/compiler/phases/2-analyze/index.js (1205), packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js (1088) (+27 more).

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.4 / 10Exemplary✓ 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.

  • packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression/main.svelte:2 imports './Child.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression/main.svelte
  • packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-2/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-2/main.svelte
  • packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-3/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-3/main.svelte
  • packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-4/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-4/main.svelte
  • packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-5/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-5/main.svelte
  • packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-6/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-6/main.svelte
  • packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error/main.svelte
  • packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-2/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-2/main.svelte
  • packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-3/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-3/main.svelte
  • packages/svelte/tests/compiler-errors/samples/component-slot-nested-error/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/component-slot-nested-error/main.svelte
  • packages/svelte/tests/compiler-errors/samples/dollar-binding-import/main.svelte:2 imports './somewhere', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/dollar-binding-import/main.svelte
  • packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet-expression/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet-expression/main.svelte
  • packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet/main.svelte
  • packages/svelte/tests/compiler-errors/samples/unbalanced-curly-component/main.svelte:3 imports './Component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/compiler-errors/samples/unbalanced-curly-component/main.svelte
  • packages/svelte/tests/migrate/samples/named-slots/input.svelte:2 imports './Component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/migrate/samples/named-slots/input.svelte
  • packages/svelte/tests/migrate/samples/reactive-statements-reorder-not-deleting-additions/input.svelte:5 imports './blah.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/migrate/samples/reactive-statements-reorder-not-deleting-additions/input.svelte
  • packages/svelte/tests/migrate/samples/slot-non-identifier/input.svelte:2 imports './Component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/migrate/samples/slot-non-identifier/input.svelte
  • packages/svelte/tests/migrate/samples/slot-shadow-props/input.svelte:2 imports './Component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/migrate/samples/slot-shadow-props/input.svelte
  • packages/svelte/tests/migrate/samples/slots-below-imports/input.svelte:2 imports './Foo.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/migrate/samples/slots-below-imports/input.svelte
  • packages/svelte/tests/parser-legacy/samples/dynamic-import/input.svelte:5 imports './foo.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/parser-legacy/samples/dynamic-import/input.svelte
  • packages/svelte/tests/print/samples/component/input.svelte:2 imports './C.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/print/samples/component/input.svelte
  • packages/svelte/tests/print/samples/component/output.svelte:2 imports './C.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/print/samples/component/output.svelte
  • packages/svelte/tests/print/samples/svelte-fragment/input.svelte:2 imports './Widget.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/print/samples/svelte-fragment/input.svelte
  • packages/svelte/tests/print/samples/svelte-fragment/output.svelte:2 imports './Widget.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/print/samples/svelte-fragment/output.svelte
  • packages/svelte/tests/snapshot/samples/bind-component-snippet/index.svelte:2 imports './Child.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/snapshot/samples/bind-component-snippet/index.svelte
  • packages/svelte/tests/suite.ts:96 imports './_config.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/suite.ts
  • packages/svelte/tests/types/component.ts:345 imports './doesntexist.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/types/component.ts
  • packages/svelte/tests/validator/samples/a11y-label-has-associated-control-2/input.svelte:2 imports './component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/a11y-label-has-associated-control-2/input.svelte
  • packages/svelte/tests/validator/samples/a11y-label-has-associated-control-3/input.svelte:2 imports './component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/a11y-label-has-associated-control-3/input.svelte
  • packages/svelte/tests/validator/samples/a11y-label-has-associated-control/input.svelte:2 imports './label.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/a11y-label-has-associated-control/input.svelte
  • packages/svelte/tests/validator/samples/a11y-not-on-components/input.svelte:2 imports './Widget.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/a11y-not-on-components/input.svelte
  • packages/svelte/tests/validator/samples/action-on-component/input.svelte:2 imports './Widget.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/action-on-component/input.svelte
  • packages/svelte/tests/validator/samples/animation-on-component/input.svelte:2 imports './Widget.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/animation-on-component/input.svelte
  • packages/svelte/tests/validator/samples/await-component-is-used/input.svelte:2 imports './Component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/await-component-is-used/input.svelte
  • packages/svelte/tests/validator/samples/binding-import-component/input.svelte:2 imports './Input.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/binding-import-component/input.svelte
  • packages/svelte/tests/validator/samples/binding-import-element/input.svelte:2 imports './dummy.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/binding-import-element/input.svelte
  • packages/svelte/tests/validator/samples/component-event-modifiers-invalid/input.svelte:2 imports './Button.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/component-event-modifiers-invalid/input.svelte
  • packages/svelte/tests/validator/samples/component-legacy-instantiation/input.svelte:2 imports './Somewhere.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/component-legacy-instantiation/input.svelte
  • packages/svelte/tests/validator/samples/component-name-lowercase/input.svelte:2 imports './MyComponent.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/component-name-lowercase/input.svelte
  • packages/svelte/tests/validator/samples/component-slot-dynamic-attribute/input.svelte:2 imports './Nested.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/svelte/tests/validator/samples/component-slot-dynamic-attribute/input.svelte

What to do

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

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

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

  • This repository declares test tooling, and the ✓ above records that declaration — but packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression/main.svelte and 56 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression/main.svelte
R7 · Dead Code9.7 / 10Exemplary✓ Tool-verified

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

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

  • Unreachable from the 56 application, 44 tooling and 7491 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (56 application, 44 tooling, 7491 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×4) — packages/svelte/scripts/process-messages/index.js, benchmarking/compare/runner.js, benchmarking/benchmarks/ssr/wrapper/App.svelte, …
  • Nothing imports this binding — it is safe to review for removal. (×3) — packages/svelte/src/internal/client/dev/debug.js:189, packages/svelte/src/internal/client/dev/debug.js:356, packages/svelte/src/internal/client/reactivity/equality.js:24

What to do

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

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

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

R9 · Circular Imports0.0 / 10Critical✓ 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.

  • packages/svelte/src/attachments/index.js → packages/svelte/src/index-client.js → packages/svelte/src/internal/client/index.js → packages/svelte/src/attachments/index.js — packages/svelte/src/attachments/index.js
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js → packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js → packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js — packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
  • packages/svelte/src/compiler/utils/ast.js → packages/svelte/src/compiler/utils/builders.js → packages/svelte/src/compiler/utils/ast.js — packages/svelte/src/compiler/utils/ast.js
  • packages/svelte/src/internal/client/context.js → packages/svelte/src/internal/client/reactivity/effects.js → packages/svelte/src/internal/client/context.js (one verified cycle inside a mutually-dependent group of 18 files) — packages/svelte/src/internal/client/context.js
  • packages/svelte/src/internal/server/dev.js → packages/svelte/src/internal/server/renderer.js → packages/svelte/src/internal/server/index.js → packages/svelte/src/internal/server/dev.js — packages/svelte/src/internal/server/dev.js
  • packages/svelte/src/reactivity/url-search-params.js → packages/svelte/src/reactivity/url.js → packages/svelte/src/reactivity/url-search-params.js — packages/svelte/src/reactivity/url-search-params.js

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

WCAG coverage — what static analysis assessed

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

DimensionWCAG 2.2 A/AA criteriaCoverage
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

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

Reference — by lens

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

LensScoreRatingImpact
Code Health62%Adequate — gated by D1, D2, D3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture61%Adequate — gated by D26, R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity54%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness63%Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security66%Adequate — gated by D30Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility75%StrongStrongest area.
Performance60%AdequateAcceptable, with room to improve.
Unscored — 1 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 72 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 image/media element found in the parsed markup — AC1 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — Not applicable: TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • 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.
  • 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 — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 10 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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.
  • D4 Code Duplication — This repository's production source (.js, .mjs, .ts) is not read by D4's token comparison, which compares .NET source: duplication in it is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream. Not scored here — read the R10 card for this repository's duplication.
  • 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.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D5 Coupling — Not applicable — this npm build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P2 Observability — This repository's JavaScript/TypeScript source (3 module(s), 392 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 363 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X28 Index access outside its own emptiness guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 22 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×4
  • Import cycle (2 files) packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js — packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js → packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js → packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
  • Import cycle (2 files) packages/svelte/src/compiler/utils/ast.js — packages/svelte/src/compiler/utils/ast.js → packages/svelte/src/compiler/utils/builders.js → packages/svelte/src/compiler/utils/ast.js
  • Import cycle (2 files) packages/svelte/src/internal/client/context.js — packages/svelte/src/internal/client/context.js → packages/svelte/src/internal/client/reactivity/effects.js → packages/svelte/src/internal/client/context.js (one verified cycle inside a mutually-dependent group of 18 files)
  • Import cycle (2 files) packages/svelte/src/reactivity/url-search-params.js — packages/svelte/src/reactivity/url-search-params.js → packages/svelte/src/reactivity/url.js → packages/svelte/src/reactivity/url-search-params.js
R9 · Circular Imports · Import cycle (3 files) · ×2
  • Import cycle (3 files) packages/svelte/src/attachments/index.js — packages/svelte/src/attachments/index.js → packages/svelte/src/index-client.js → packages/svelte/src/internal/client/index.js → packages/svelte/src/attachments/index.js
  • Import cycle (3 files) packages/svelte/src/internal/server/dev.js — packages/svelte/src/internal/server/dev.js → packages/svelte/src/internal/server/renderer.js → packages/svelte/src/internal/server/index.js → packages/svelte/src/internal/server/dev.js
AC2 · Forms & labels · <textarea> without a programmatic label · ×1
  • <textarea> without a programmatic label packages/svelte/src/compiler/errors.js:1670 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
Serious — 574 finding(s)
R4 · Test Coverage · This test file cannot be loaded · ×40
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression/main.svelte — packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression/main.svelte:2 imports './Child.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-2/main.svelte — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-2/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-3/main.svelte — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-3/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-4/main.svelte — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-4/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-5/main.svelte — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-5/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-6/main.svelte — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-6/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error/main.svelte — packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-2/main.svelte — packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-2/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-3/main.svelte — packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-3/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/component-slot-nested-error/main.svelte — packages/svelte/tests/compiler-errors/samples/component-slot-nested-error/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/dollar-binding-import/main.svelte — packages/svelte/tests/compiler-errors/samples/dollar-binding-import/main.svelte:2 imports './somewhere', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet-expression/main.svelte — packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet-expression/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet/main.svelte — packages/svelte/tests/compiler-errors/samples/let-directive-children-snippet/main.svelte:2 imports './irrelevant', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/compiler-errors/samples/unbalanced-curly-component/main.svelte — packages/svelte/tests/compiler-errors/samples/unbalanced-curly-component/main.svelte:3 imports './Component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/migrate/samples/named-slots/input.svelte — packages/svelte/tests/migrate/samples/named-slots/input.svelte:2 imports './Component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/migrate/samples/reactive-statements-reorder-not-deleting-additions/input.svelte — packages/svelte/tests/migrate/samples/reactive-statements-reorder-not-deleting-additions/input.svelte:5 imports './blah.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/migrate/samples/slot-non-identifier/input.svelte — packages/svelte/tests/migrate/samples/slot-non-identifier/input.svelte:2 imports './Component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/migrate/samples/slot-shadow-props/input.svelte — packages/svelte/tests/migrate/samples/slot-shadow-props/input.svelte:2 imports './Component.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/migrate/samples/slots-below-imports/input.svelte — packages/svelte/tests/migrate/samples/slots-below-imports/input.svelte:2 imports './Foo.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/parser-legacy/samples/dynamic-import/input.svelte — packages/svelte/tests/parser-legacy/samples/dynamic-import/input.svelte:5 imports './foo.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/print/samples/component/input.svelte — packages/svelte/tests/print/samples/component/input.svelte:2 imports './C.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/print/samples/component/output.svelte — packages/svelte/tests/print/samples/component/output.svelte:2 imports './C.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/print/samples/svelte-fragment/input.svelte — packages/svelte/tests/print/samples/svelte-fragment/input.svelte:2 imports './Widget.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/print/samples/svelte-fragment/output.svelte — packages/svelte/tests/print/samples/svelte-fragment/output.svelte:2 imports './Widget.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded packages/svelte/tests/snapshot/samples/bind-component-snippet/index.svelte — packages/svelte/tests/snapshot/samples/bind-component-snippet/index.svelte:2 imports './Child.svelte', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • + 15 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×35
  • FunctionTooLong: legacy.convert packages/svelte/src/compiler/legacy.js:42 — FunctionTooLong — convert runs 406 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 306 over it, 4.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.svelte_visitors packages/svelte/src/compiler/print/index.js:537 — FunctionTooLong — svelte_visitors runs 391 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 291 over it, 3.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.analyze_component packages/svelte/src/compiler/phases/2-analyze/index.js:333 — FunctionTooLong — analyze_component runs 386 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 286 over it, 3.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.check_element packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:56 — FunctionTooLong — check_element runs 324 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 224 over it, 3.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: transform-client.client_component packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:135 — FunctionTooLong — client_component runs 321 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 221 over it, 3.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: RegularElement.RegularElement packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:38 — FunctionTooLong — RegularElement runs 311 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 211 over it, 3.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: component.build_component packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:19 — FunctionTooLong — build_component runs 290 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 190 over it, 2.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: scope.create_scopes packages/svelte/src/compiler/phases/scope.js:920 — FunctionTooLong — create_scopes runs 279 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 179 over it, 2.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.migrate REDACTED:124 — FunctionTooLong — migrate runs 222 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: VariableDeclaration.VariableDeclaration packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16 — FunctionTooLong — VariableDeclaration runs 215 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: BindDirective.BindDirective packages/svelte/src/compiler/phases/3-transform/client/visitors/BindDirective.js:15 — FunctionTooLong — BindDirective runs 192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 92 over it, 1.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: transform-server.server_component packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:94 — FunctionTooLong — server_component runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: EachBlock.EachBlock packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js:23 — FunctionTooLong — EachBlock runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: component.build_inline_component packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/component.js:21 — FunctionTooLong — build_inline_component runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: proxy.proxy packages/svelte/src/internal/client/proxy.js:40 — FunctionTooLong — proxy runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: element.build_element_attributes packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:36 — FunctionTooLong — build_element_attributes runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.calculate_blockers packages/svelte/src/compiler/phases/2-analyze/index.js:959 — FunctionTooLong — calculate_blockers runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: BindDirective.BindDirective packages/svelte/src/compiler/phases/2-analyze/visitors/BindDirective.js:20 — FunctionTooLong — BindDirective runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.css_visitors packages/svelte/src/compiler/print/index.js:275 — FunctionTooLong — css_visitors runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: style.read_selector packages/svelte/src/compiler/phases/1-parse/read/style.js:167 — FunctionTooLong — read_selector runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: css-prune.relative_selector_might_apply_to_node packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:447 — FunctionTooLong — relative_selector_might_apply_to_node runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: utils.profile_to_markdown benchmarking/utils.js:111 — FunctionTooLong — profile_to_markdown runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: RegularElement.RegularElement packages/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js:17 — FunctionTooLong — RegularElement runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: attributes.set_attributes packages/svelte/src/internal/client/dom/elements/attributes.js:271 — FunctionTooLong — set_attributes runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: options.read_options packages/svelte/src/compiler/phases/1-parse/read/options.js:10 — FunctionTooLong — read_options runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 10 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×18
  • Hotspot: packages/svelte/src/compiler/phases/2-analyze/index.js packages/svelte/src/compiler/phases/2-analyze/index.js:333 — packages/svelte/src/compiler/phases/2-analyze/index.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 177 in index.analyze_component at line 333. 4 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/phases/2-analyze/index.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/compiler/print/index.js packages/svelte/src/compiler/print/index.js:537 — packages/svelte/src/compiler/print/index.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 122 in index.svelte_visitors at line 537. 3 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/print/index.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:38 — packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 135 in RegularElement.RegularElement at line 38. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:56 — packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 194 in index.check_element at line 56. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/internal/client/dom/elements/attributes.js packages/svelte/src/internal/client/dom/elements/attributes.js:271 — packages/svelte/src/internal/client/dom/elements/attributes.js changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in attributes.set_attributes at line 271. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/internal/client/dom/elements/attributes.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:36 — packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in element.build_element_attributes at line 36. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/compiler/phases/scope.js packages/svelte/src/compiler/phases/scope.js:920 — packages/svelte/src/compiler/phases/scope.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in scope.create_scopes at line 920. 2 of those changes were fix/bug commits, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/phases/scope.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16 — packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in VariableDeclaration.VariableDeclaration at line 16. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/compiler/phases/1-parse/read/style.js packages/svelte/src/compiler/phases/1-parse/read/style.js:167 — packages/svelte/src/compiler/phases/1-parse/read/style.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in style.read_selector at line 167. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/phases/1-parse/read/style.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/internal/client/proxy.js packages/svelte/src/internal/client/proxy.js:40 — packages/svelte/src/internal/client/proxy.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in proxy.proxy at line 40. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/internal/client/proxy.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js:23 — packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in EachBlock.EachBlock at line 23. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/internal/client/reactivity/batch.js packages/svelte/src/internal/client/reactivity/batch.js:329 — packages/svelte/src/internal/client/reactivity/batch.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Batch.#process at line 329. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/internal/client/reactivity/batch.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/compiler/phases/3-transform/server/transform-server.js packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:94 — packages/svelte/src/compiler/phases/3-transform/server/transform-server.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in transform-server.server_component at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/compiler/phases/3-transform/server/transform-server.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/internal/client/reactivity/sources.js packages/svelte/src/internal/client/reactivity/sources.js:189 — packages/svelte/src/internal/client/reactivity/sources.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in sources.internal_set at line 189. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/internal/client/reactivity/sources.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/internal/server/index.js packages/svelte/src/internal/server/index.js:130 — packages/svelte/src/internal/server/index.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in index.attributes at line 130. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/internal/server/index.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/internal/client/dom/blocks/boundary.js packages/svelte/src/internal/client/dom/blocks/boundary.js:494 — packages/svelte/src/internal/client/dom/blocks/boundary.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Boundary.#handle_error at line 494. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/internal/client/dom/blocks/boundary.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: packages/svelte/src/internal/client/dom/elements/transitions.js packages/svelte/src/internal/client/dom/elements/transitions.js:338 — packages/svelte/src/internal/client/dom/elements/transitions.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in transitions.animate at line 338. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/internal/client/dom/elements/transitions.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: benchmarking/compare/generate-report.js benchmarking/compare/generate-report.js:15 — benchmarking/compare/generate-report.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in generate-report.generate_report at line 15. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- benchmarking/compare/generate-report.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D17 · Explicit Debt · TodoComment · ×16
  • TodoComment packages/svelte/tests/suite.ts:56 — // TODO unify test interfaces — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/css/test.ts:77 — // TODO enable SSR tests — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/hydration/test.ts:99 — // TODO convert this to structured data, for more robust comparison? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/runtime-legacy/shared.ts:347 — // TODO convert this to structured data, for more robust comparison? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/runtime-legacy/shared.ts:47 — // TODO remove this shim when we can — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/server-side-rendering/test.ts:29 — // TODO remove this shim when we can — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/runtime-legacy/shared.ts:144 — // @ts-expect-error TODO huh? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/runtime-legacy/shared.ts:438 — // @ts-expect-error TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/server-side-rendering/test.ts:4 — // TODO: Isolate the html comparison — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/server-side-rendering/test.ts:5 — // TODO: happy-dom might be faster but currently replaces quotes which fails assertions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/signals/test.ts:220 — // TODO: in an ideal world, the effect wouldn't fire here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/sourcemaps/test.ts:298 — // TODO figure out for which tests we still need this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/store/test.ts:485 — // @ts-expect-error TODO feels like inference should work here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/store/test.ts:519 — // @ts-expect-error TODO feels like inference should work here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/store/test.ts:547 — // @ts-expect-error TODO feels like inference should work here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment packages/svelte/tests/store/test.ts:555 — // @ts-expect-error TODO feels like inference should work here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×11
  • Sync-over-async blocking benchmarking/utils.js:306 — `with_cpu_profile` is async and calls mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking packages/svelte/scripts/generate-browser-support.ts:602 — `find_all_conditional_features` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking packages/svelte/scripts/generate-browser-support.ts:806 — `main` is async and calls rmSync, mkdirSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking packages/svelte/tests/suite.ts:78 — `for_each_dir` is async and calls readdirSync, existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking packages/svelte/tests/helpers.js:63 — `compile_directory` is async and calls rmSync, readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking packages/svelte/tests/runtime-browser/test-ssr.ts:15 — `run_ssr_test` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking packages/svelte/tests/runtime-browser/test.ts:63 — `run_test` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking packages/svelte/tests/runtime-legacy/shared.ts:272 — `run_test_variant` is async and calls readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:138 — `download_stackblitz_project` is async and calls execSync, unlinkSync, readdirSync, statSync, renameSync, rmdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:655 — `with_tmp_dir` is async and calls existsSync, rmSync, mkdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking playgrounds/sandbox/ssr-dev.js:22 — `polka().use().use()` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
D3 · God Classes · FileTooLong · ×9
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1266 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). The bar is 500 significant lines; this is 766 over it, 2.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: 2-analyze/index.js packages/svelte/src/compiler/phases/2-analyze/index.js — FileTooLong — 834 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). The bar is 500 significant lines; this is 334 over it, 1.67× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: phases/scope.js packages/svelte/src/compiler/phases/scope.js — FileTooLong — 819 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). The bar is 500 significant lines; this is 319 over it, 1.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: print/index.js packages/svelte/src/compiler/print/index.js — FileTooLong — 673 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). The bar is 500 significant lines; this is 173 over it, 1.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: css/css-prune.js packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js — FileTooLong — 669 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). The bar is 500 significant lines; this is 169 over it, 1.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: reactivity/batch.js packages/svelte/src/internal/client/reactivity/batch.js — FileTooLong — 656 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), about 61% of them inside a single declaration: Batch (97-1023). The bar is 500 significant lines; this is 156 over it, 1.31× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: state/element.js packages/svelte/src/compiler/phases/1-parse/state/element.js — FileTooLong — 592 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). The bar is 500 significant lines; this is 92 over it, 1.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: a11y/index.js packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js — FileTooLong — 578 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). The bar is 500 significant lines; this is 78 over it, 1.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: state/tag.js packages/svelte/src/compiler/phases/1-parse/state/tag.js — FileTooLong — 531 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). The bar is 500 significant lines; this is 31 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D30 · Dependency Vulnerabilities · Medium CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×5
  • Duplicated block (15 lines × 2 locations) REDACTED:1645 — REDACTED:1645 · REDACTED:1665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2 locations) packages/svelte/src/compiler/phases/2-analyze/css/utils.js:118 — packages/svelte/src/compiler/phases/2-analyze/css/utils.js:118 · packages/svelte/src/compiler/phases/2-analyze/css/utils.js:163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:667 — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:667 · packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:403 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (15 lines × 2 locations) packages/svelte/src/compiler/print/index.js:982 — packages/svelte/src/compiler/print/index.js:982 · packages/svelte/src/compiler/print/index.js:1141 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (15 lines × 2 locations) packages/svelte/src/reactivity/window/index.js:68 — packages/svelte/src/reactivity/window/index.js:68 · packages/svelte/src/reactivity/window/index.js:91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×5
  • Duplicated block (14 lines × 2 locations) packages/svelte/src/compiler/phases/1-parse/read/style.js:207 — packages/svelte/src/compiler/phases/1-parse/read/style.js:207 · packages/svelte/src/compiler/phases/1-parse/read/style.js:320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2 locations) packages/svelte/src/compiler/phases/1-parse/state/element.js:539 — packages/svelte/src/compiler/phases/1-parse/state/element.js:539 · packages/svelte/src/compiler/phases/1-parse/state/element.js:558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2 locations) packages/svelte/src/compiler/phases/2-analyze/index.js:968 — packages/svelte/src/compiler/phases/2-analyze/index.js:968 · packages/svelte/src/compiler/phases/2-analyze/index.js:1028 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (14 lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:529 — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:529 · packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:385 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (14 lines × 2 locations) packages/svelte/src/internal/client/reactivity/props.js:65 — packages/svelte/src/internal/client/reactivity/props.js:65 · packages/svelte/src/internal/client/reactivity/props.js:132 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D15 · Churn × Complexity Hotspots · Repeated repair · ×3
  • Repeated repair: packages/svelte/src/internal/server/renderer.js packages/svelte/src/internal/server/renderer.js:450 — packages/svelte/src/internal/server/renderer.js changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is Renderer.option at line 450), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: reduce SSR render result garbage collection (#18798)”; “fix: throw when `setContext` is called after an `await` during SSR (#18739)”; “fix: render `selected` options for `<select multiple>` with an array `value` on the server (#18720)”; “fix: run `onDestroy` callbacks when a server render throws (#18585)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/internal/server/renderer.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: packages/svelte/tests/signals/test.ts packages/svelte/tests/signals/test.ts:822 — packages/svelte/tests/signals/test.ts changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is (anonymous) at line 822), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: prevent untracked derived reads from retaining dependencies (#18829)”; “fix: in non-async mode, only push variable to current_sources when active_reaction is updating (#18550)”; “fix: commit a reaction's dependencies even when it throws (#18703)”; “fix: prevent derived connection leak in untracked contexts (#18517)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/tests/signals/test.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: packages/svelte/src/internal/client/dom/elements/bindings/select.js packages/svelte/src/internal/client/dom/elements/bindings/select.js:43 — packages/svelte/src/internal/client/dom/elements/bindings/select.js changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is select.apply_default_select_value at line 43), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: keep the current selection of a `<select>` when its `defaultValue` is applied (#18719)”; “fix: prevent `selectedcontent` mutation from changing the selected option (#18495)”; “fix: preserve select selection with spread attributes (#18561)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 23:31:46 +02:00' --until='2026-09-28 23:31:46 +02:00' --full-history --no-merges -- packages/svelte/src/internal/client/dom/elements/bindings/select.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: SlotElement.js ↔ component.js packages/svelte/src/compiler/phases/3-transform/client/visitors/SlotElement.js — `packages/svelte/src/compiler/phases/3-transform/client/visitors/SlotElement.js` and `packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js` change together 91% of the time (10 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `b5e23a6d` chore: tweak memoizer logic (#17042); `9a488d6b` fix: place `let:` declarations before `{@const}` declarations (#16985); `f6a2599e` chore: remove memoize_expression (#16358) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ IfBlock.js packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitBlock.js — `packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitBlock.js` and `packages/svelte/src/compiler/phases/3-transform/client/visitors/IfBlock.js` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `f2648b35` fix: end a restored reaction context at the end of its synchronous se…; `32882a95` feat: add parent hierarchy to `__svelte_meta` objects at dev time (#1…; `18d71fd5` chore: reuse expression nodes (#15513) — run `git show` on any of them.
  • Change coupling: EachBlock.js ↔ IfBlock.js packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js — `packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js` and `packages/svelte/src/compiler/phases/3-transform/client/visitors/IfBlock.js` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `f2648b35` fix: end a restored reaction context at the end of its synchronous se…; `bc4dc1d1` fix: avoid erroneous async derived expressions for blocks (#17604); `32882a95` feat: add parent hierarchy to `__svelte_meta` objects at dev time (#1… — run `git show` on any of them.
R10 · Code Duplication · Duplicated block with local edits (18 matched lines × 2 locations) · ×3
  • Duplicated block with local edits (18 matched lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/RenderTag.js:73 — packages/svelte/src/compiler/phases/3-transform/client/visitors/RenderTag.js:73 · packages/svelte/src/compiler/phases/3-transform/client/visitors/SlotElement.js:76 — the two spans are one implementation copied and then locally edited — 114 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (18 matched lines × 2 locations) packages/svelte/src/internal/client/proxy.js:170 — packages/svelte/src/internal/client/proxy.js:170 · packages/svelte/src/internal/client/proxy.js:234 — the two spans are one implementation copied and then locally edited — 91 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (18 matched lines × 2 locations) packages/svelte/src/internal/server/renderer.js:288 — packages/svelte/src/internal/server/renderer.js:288 · packages/svelte/src/internal/server/renderer.js:329 — the two spans are one implementation copied and then locally edited — 93 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (16 matched lines × 2 locations) · ×3
  • Duplicated block with local edits (16 matched lines × 2 locations) packages/svelte/src/compiler/phases/2-analyze/index.js:577 — packages/svelte/src/compiler/phases/2-analyze/index.js:577 · packages/svelte/src/compiler/phases/2-analyze/visitors/ExportNamedDeclaration.js:52 — the two spans are one implementation copied and then locally edited — 106 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (16 matched lines × 2 locations) packages/svelte/src/internal/client/dev/assign.js:28 — packages/svelte/src/internal/client/dev/assign.js:28 · packages/svelte/src/internal/client/dev/assign.js:52 — the two spans are one implementation copied and then locally edited — 92 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (16 matched lines × 2 locations) packages/svelte/src/motion/spring.js:112 — packages/svelte/src/motion/spring.js:112 · packages/svelte/src/motion/spring.js:253 — the two spans are one implementation copied and then locally edited — 66 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×3
  • Duplicated block (13 lines × 2 locations) packages/svelte/src/compiler/legacy.js:433 — packages/svelte/src/compiler/legacy.js:433 · packages/svelte/src/compiler/legacy.js:447 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (13 lines × 2 locations) packages/svelte/src/compiler/phases/1-parse/read/style.js:236 — packages/svelte/src/compiler/phases/1-parse/read/style.js:236 · packages/svelte/src/compiler/phases/1-parse/read/style.js:253 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (13 lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/AttachTag.js:12 — packages/svelte/src/compiler/phases/3-transform/client/visitors/AttachTag.js:12 · packages/svelte/src/compiler/phases/3-transform/client/visitors/UseDirective.js:35 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R11 · Import Boundaries · Boundary violation [package · ×3
  • Boundary violation [package:test-cross-package-internals] benchmarking/benchmarks/reactivity/tests/kairo_broad_block.bench.js:3 — benchmarking/benchmarks/reactivity/tests/kairo_broad_block.bench.js:3 reaches past another workspace package's public entry into its internals with a relative path (../../../../packages/svelte/src/internal/client/reactivity/effects.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] benchmarking/benchmarks/reactivity/tests/kairo_deep_block.bench.js:3 — benchmarking/benchmarks/reactivity/tests/kairo_deep_block.bench.js:3 reaches past another workspace package's public entry into its internals with a relative path (../../../../packages/svelte/src/internal/client/reactivity/effects.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:relative-cross-package] benchmarking/run.js:3 — benchmarking/run.js:3 reaches into another package with a relative path (../packages/svelte/src/internal/client/index.js) — import the package by name instead.
D10 · Test Quality · No assertions · ×2
  • No assertions: REGEX_VALID_TAG_NAME no ReDoS packages/svelte/src/utils.test.ts:43 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: (unnamed test) packages/svelte/tests/signals/test.ts:42 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D2 · Cognitive Complexity · svelte_visitors · ×2
  • svelte_visitors::Fragment (cognitive 48) packages/svelte/src/compiler/print/index.js:573 — svelte_visitors::Fragment has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • svelte_visitors::AwaitBlock (cognitive 21) packages/svelte/src/compiler/print/index.js:750 — svelte_visitors::AwaitBlock has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (7 pts), ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×2
  • Duplicated block (18 lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:446 — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:446 · packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:283 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (18 lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:164 — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:164 · packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:234 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D1 · Cyclomatic Complexity · check_element (cyclomatic 195) · ×1
  • check_element (cyclomatic 195) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:56 — check_element has cyclomatic complexity 195 (threshold 15). Of this number, 181 points are the body's own statements and 14 belong to 15 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · analyze_component (cyclomatic 181) · ×1
  • analyze_component (cyclomatic 181) packages/svelte/src/compiler/phases/2-analyze/index.js:333 — analyze_component has cyclomatic complexity 181 (threshold 15). Of this number, 163 points are the body's own statements and 18 belong to 10 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RegularElement (cyclomatic 136) · ×1
  • RegularElement (cyclomatic 136) packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:38 — RegularElement has cyclomatic complexity 136 (threshold 15). Of this number, 124 points are the body's own statements and 12 belong to 12 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.svelte_visitors (cyclomatic 122) · ×1
  • index.svelte_visitors (cyclomatic 122) packages/svelte/src/compiler/print/index.js:537 — index.svelte_visitors has cyclomatic complexity 122 (threshold 15). Of this number, 119 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · client_component (cyclomatic 108) · ×1
  • client_component (cyclomatic 108) packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:135 — client_component has cyclomatic complexity 108 (threshold 15). Of this number, 90 points are the body's own statements and 18 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Evaluation.constructor (cyclomatic 107) · ×1
  • Evaluation.constructor (cyclomatic 107) packages/svelte/src/compiler/phases/scope.js:262 — Evaluation.constructor has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent 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 · migrate (cyclomatic 91) · ×1
  • migrate (cyclomatic 91) REDACTED:124 — migrate has cyclomatic complexity 91 (threshold 15). Of this number, 73 points are the body's own statements and 18 belong to 23 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · element (cyclomatic 91) · ×1
  • element (cyclomatic 91) packages/svelte/src/compiler/phases/1-parse/state/element.js:65 — element has cyclomatic complexity 91 (threshold 15). Of this number, 89 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · build_component (cyclomatic 91) · ×1
  • build_component (cyclomatic 91) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:19 — build_component has cyclomatic complexity 91 (threshold 15). Of this number, 78 points are the body's own statements and 13 belong to 14 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BindDirective (cyclomatic 82) · ×1
  • BindDirective (cyclomatic 82) packages/svelte/src/compiler/phases/3-transform/client/visitors/BindDirective.js:15 — BindDirective has cyclomatic complexity 82 (threshold 15). Of this number, 76 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · BindDirective.BindDirective (cyclomatic 79) · ×1
  • BindDirective.BindDirective (cyclomatic 79) packages/svelte/src/compiler/phases/2-analyze/visitors/BindDirective.js:20 — BindDirective.BindDirective has cyclomatic complexity 79 (threshold 15). Of this number, 72 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CallExpression (cyclomatic 79) · ×1
  • CallExpression (cyclomatic 79) packages/svelte/src/compiler/phases/2-analyze/visitors/CallExpression.js:16 — CallExpression has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent 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 · element.build_element_attributes (cyclomatic 78) · ×1
  • element.build_element_attributes (cyclomatic 78) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:36 — element.build_element_attributes has cyclomatic complexity 78 (threshold 15). Of this number, 72 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VariableDeclaration (cyclomatic 78) · ×1
  • VariableDeclaration (cyclomatic 78) packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16 — VariableDeclaration has cyclomatic complexity 78 (threshold 15). Of this number, 68 points are the body's own statements and 10 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VariableDeclaration (cyclomatic 75) · ×1
  • VariableDeclaration (cyclomatic 75) REDACTED:567 — VariableDeclaration has cyclomatic complexity 75 (threshold 15). Of this number, 59 points are the body's own statements and 16 belong to 10 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · create_scopes (cyclomatic 74) · ×1
  • create_scopes (cyclomatic 74) packages/svelte/src/compiler/phases/scope.js:920 — create_scopes has cyclomatic complexity 74 (threshold 15). Most of this is not in the body itself: 10 of the 74 points are its own statements and the rest belongs to 29 function items inside it that branch (EachBlock, AwaitBlock, LabeledStatement, …). 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 · attributes.set_attributes (cyclomatic 71) · ×1
  • attributes.set_attributes (cyclomatic 71) packages/svelte/src/internal/client/dom/elements/attributes.js:271 — attributes.set_attributes has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · utils.clean_nodes (cyclomatic 70) · ×1
  • utils.clean_nodes (cyclomatic 70) packages/svelte/src/compiler/phases/3-transform/utils.js:126 — utils.clean_nodes has cyclomatic complexity 70 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · proxy.proxy (cyclomatic 69) · ×1
  • proxy.proxy (cyclomatic 69) packages/svelte/src/internal/client/proxy.js:40 — proxy.proxy has cyclomatic complexity 69 (threshold 15). Of this number, 61 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · profile_to_markdown (cyclomatic 68) · ×1
  • profile_to_markdown (cyclomatic 68) benchmarking/utils.js:111 — profile_to_markdown has cyclomatic complexity 68 (threshold 15). Of this number, 48 points are the body's own statements and 20 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Identifier.Identifier (cyclomatic 67) · ×1
  • Identifier.Identifier (cyclomatic 67) packages/svelte/src/compiler/phases/2-analyze/visitors/Identifier.js:15 — Identifier.Identifier 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.
D1 · Cyclomatic Complexity · relative_selector_might_apply_to_node (cyclomatic 67) · ×1
  • relative_selector_might_apply_to_node (cyclomatic 67) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:447 — relative_selector_might_apply_to_node has cyclomatic complexity 67 (threshold 15). Of this number, 64 points are the body's own statements and 3 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RegularElement.RegularElement (cyclomatic 66) · ×1
  • RegularElement.RegularElement (cyclomatic 66) packages/svelte/src/compiler/phases/2-analyze/visitors/RegularElement.js:26 — RegularElement.RegularElement has cyclomatic complexity 66 (threshold 15). Of this number, 61 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EachBlock.EachBlock (cyclomatic 64) · ×1
  • EachBlock.EachBlock (cyclomatic 64) packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js:23 — EachBlock.EachBlock has cyclomatic complexity 64 (threshold 15). Of this number, 56 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · build_assignment (cyclomatic 63) · ×1
  • build_assignment (cyclomatic 63) packages/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js:47 — build_assignment has cyclomatic complexity 63 (threshold 15). Of this number, 60 points are the body's own statements and 3 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · build_inline_component (cyclomatic 56) · ×1
  • build_inline_component (cyclomatic 56) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/component.js:21 — build_inline_component has cyclomatic complexity 56 (threshold 15). Of this number, 46 points are the body's own statements and 10 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · options.read_options (cyclomatic 54) · ×1
  • options.read_options (cyclomatic 54) packages/svelte/src/compiler/phases/1-parse/read/options.js:10 — options.read_options has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.calculate_blockers (cyclomatic 51) · ×1
  • index.calculate_blockers (cyclomatic 51) packages/svelte/src/compiler/phases/2-analyze/index.js:959 — index.calculate_blockers has cyclomatic complexity 51 (threshold 15). Of this number, 37 points are the body's own statements and 14 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime.get (cyclomatic 50) · ×1
  • runtime.get (cyclomatic 50) packages/svelte/src/internal/client/runtime.js:540 — runtime.get 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 · VariableDeclarator (cyclomatic 50) · ×1
  • VariableDeclarator (cyclomatic 50) packages/svelte/src/compiler/phases/2-analyze/visitors/VariableDeclarator.js:16 — VariableDeclarator 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 · server_component (cyclomatic 49) · ×1
  • server_component (cyclomatic 49) packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:94 — server_component has cyclomatic complexity 49 (threshold 15). Of this number, 45 points are the body's own statements and 4 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.migrate_slot_usage (cyclomatic 48) · ×1
  • index.migrate_slot_usage (cyclomatic 48) REDACTED:1433 — index.migrate_slot_usage 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.
D1 · Cyclomatic Complexity · each.reconcile (cyclomatic 47) · ×1
  • each.reconcile (cyclomatic 47) packages/svelte/src/internal/client/dom/blocks/each.js:434 — each.reconcile has cyclomatic complexity 47 (threshold 15). Of this number, 45 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassBody.ClassBody (cyclomatic 47) · ×1
  • ClassBody.ClassBody (cyclomatic 47) packages/svelte/src/compiler/phases/2-analyze/visitors/ClassBody.js:15 — ClassBody.ClassBody 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 · open (cyclomatic 47) · ×1
  • open (cyclomatic 47) packages/svelte/src/compiler/phases/1-parse/state/tag.js:151 — open has cyclomatic complexity 47 (threshold 15). Of this number, 46 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SlotElement (cyclomatic 46) · ×1
  • SlotElement (cyclomatic 46) REDACTED:1241 — SlotElement has cyclomatic complexity 46 (threshold 15). Of this number, 30 points are the body's own statements and 16 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · element.validate_element (cyclomatic 45) · ×1
  • element.validate_element (cyclomatic 45) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/element.js:30 — element.validate_element has cyclomatic complexity 45 (threshold 15). Of this number, 43 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.run (cyclomatic 42) · ×1
  • index.run (cyclomatic 42) packages/svelte/scripts/process-messages/index.js:17 — index.run has cyclomatic complexity 42 (threshold 15). Of this number, 31 points are the body's own statements and 11 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ast.is_expression_async (cyclomatic 41) · ×1
  • ast.is_expression_async (cyclomatic 41) packages/svelte/src/compiler/utils/ast.js:484 — ast.is_expression_async has cyclomatic complexity 41 (threshold 15). Of this number, 34 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · svelte_visitors · ×1
  • svelte_visitors::Fragment (cyclomatic 41) packages/svelte/src/compiler/print/index.js:573 — svelte_visitors::Fragment 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 · VariableDeclaration (cyclomatic 41) · ×1
  • VariableDeclaration (cyclomatic 41) packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js:15 — VariableDeclaration has cyclomatic complexity 41 (threshold 15). Of this number, 37 points are the body's own statements and 4 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · each.each (cyclomatic 40) · ×1
  • each.each (cyclomatic 40) packages/svelte/src/internal/client/dom/blocks/each.js:181 — each.each has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 10 of the 40 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 268, 207). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · prop (cyclomatic 40) · ×1
  • prop (cyclomatic 40) packages/svelte/src/internal/client/reactivity/props.js:276 — prop has cyclomatic complexity 40 (threshold 15). Of this number, 19 points are the body's own statements and 21 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · css_visitors (cyclomatic 38) · ×1
  • css_visitors (cyclomatic 38) packages/svelte/src/compiler/print/index.js:275 — css_visitors has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 24 function items inside it that branch (print_selector_list, Atrule, print_children, …). 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 · visit_component (cyclomatic 37) · ×1
  • visit_component (cyclomatic 37) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/component.js:19 — visit_component has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RegularElement (cyclomatic 36) · ×1
  • RegularElement (cyclomatic 36) packages/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js:17 — RegularElement has cyclomatic complexity 36 (threshold 15). Of this number, 32 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · legacy.convert (cyclomatic 34) · ×1
  • legacy.convert (cyclomatic 34) packages/svelte/src/compiler/legacy.js:42 — legacy.convert has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · element.read_attribute (cyclomatic 33) · ×1
  • element.read_attribute (cyclomatic 33) packages/svelte/src/compiler/phases/1-parse/state/element.js:521 — element.read_attribute 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 · debug.log_reactions (cyclomatic 33) · ×1
  • debug.log_reactions (cyclomatic 33) packages/svelte/src/internal/client/dev/debug.js:189 — debug.log_reactions 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 · css-prune.get_possible_element_siblings (cyclomatic 33) · ×1
  • css-prune.get_possible_element_siblings (cyclomatic 33) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:1007 — css-prune.get_possible_element_siblings has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · attributes.to_style (cyclomatic 32) · ×1
  • attributes.to_style (cyclomatic 32) packages/svelte/src/internal/shared/attributes.js:128 — attributes.to_style 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 · handle_identifier (cyclomatic 32) · ×1
  • handle_identifier (cyclomatic 32) REDACTED:1868 — handle_identifier 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 · style.read_selector (cyclomatic 31) · ×1
  • style.read_selector (cyclomatic 31) packages/svelte/src/compiler/phases/1-parse/read/style.js:167 — style.read_selector 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 · css-prune.attribute_matches (cyclomatic 31) · ×1
  • css-prune.attribute_matches (cyclomatic 31) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:724 — css-prune.attribute_matches has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · #commit (cyclomatic 31) · ×1
  • #commit (cyclomatic 31) packages/svelte/src/internal/client/reactivity/batch.js:717 — #commit has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CallExpression.CallExpression (cyclomatic 30) · ×1
  • CallExpression.CallExpression (cyclomatic 30) packages/svelte/src/compiler/phases/3-transform/client/visitors/CallExpression.js:12 — CallExpression.CallExpression 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 · SvelteElement.SvelteElement (cyclomatic 30) · ×1
  • SvelteElement.SvelteElement (cyclomatic 30) packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteElement.js:20 — SvelteElement.SvelteElement 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 · async_derived (cyclomatic 30) · ×1
  • async_derived (cyclomatic 30) packages/svelte/src/internal/client/reactivity/deriveds.js:113 — async_derived has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 5 of the 30 points are its own statements and the rest belongs to 9 function items inside it that branch ((anonymous), (anonymous)::handler, (anonymous)::handler::(anonymous), …). 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 · bind_value (cyclomatic 30) · ×1
  • bind_value (cyclomatic 30) packages/svelte/src/internal/client/dom/elements/bindings/input.js:19 — bind_value has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 81, 22). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ComplexSelector (cyclomatic 29) · ×1
  • ComplexSelector (cyclomatic 29) packages/svelte/src/compiler/phases/3-transform/css/index.js:283 — ComplexSelector 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 · acorn.get_comment_handlers (cyclomatic 28) · ×1
  • acorn.get_comment_handlers (cyclomatic 28) packages/svelte/src/compiler/phases/1-parse/acorn.js:195 — acorn.get_comment_handlers has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to one function literal inside it that branches. 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 · html-tree-validation.is_tag_valid_with_parent (cyclomatic 28) · ×1
  • html-tree-validation.is_tag_valid_with_parent (cyclomatic 28) packages/svelte/src/html-tree-validation.js:184 — html-tree-validation.is_tag_valid_with_parent 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 · debug.log_inconsistent_branches (cyclomatic 28) · ×1
  • debug.log_inconsistent_branches (cyclomatic 28) packages/svelte/src/internal/client/dev/debug.js:356 — debug.log_inconsistent_branches has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · attribute.validate_slot_attribute (cyclomatic 28) · ×1
  • attribute.validate_slot_attribute (cyclomatic 28) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/attribute.js:56 — attribute.validate_slot_attribute has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Fragment (cyclomatic 28) · ×1
  • Fragment (cyclomatic 28) packages/svelte/src/compiler/phases/3-transform/client/visitors/Fragment.js:16 — Fragment has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AwaitExpression.is_last_evaluated_expression (cyclomatic 27) · ×1
  • AwaitExpression.is_last_evaluated_expression (cyclomatic 27) packages/svelte/src/compiler/phases/2-analyze/visitors/AwaitExpression.js:87 — AwaitExpression.is_last_evaluated_expression 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 · LabeledStatement (cyclomatic 27) · ×1
  • LabeledStatement (cyclomatic 27) REDACTED:929 — LabeledStatement has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · validate_aria_attribute_value (cyclomatic 27) · ×1
  • validate_aria_attribute_value (cyclomatic 27) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:878 — validate_aria_attribute_value 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 · ComplexSelector (cyclomatic 27) · ×1
  • ComplexSelector (cyclomatic 27) packages/svelte/src/compiler/phases/2-analyze/css/css-analyze.js:64 — ComplexSelector has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · html (cyclomatic 27) · ×1
  • html (cyclomatic 27) packages/svelte/src/internal/client/dom/blocks/html.js:51 — html has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 72). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · analyze-compiler-profile.analyze_compiler_profiles (cyclomatic 26) · ×1
  • analyze-compiler-profile.analyze_compiler_profiles (cyclomatic 26) benchmarking/analyze-compiler-profile.js:13 — analyze-compiler-profile.analyze_compiler_profiles 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 · svelte-element.element (cyclomatic 26) · ×1
  • svelte-element.element (cyclomatic 26) packages/svelte/src/internal/client/dom/blocks/svelte-element.js:31 — svelte-element.element has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 72, 58, 139). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · utils.gather_possible_values (cyclomatic 26) · ×1
  • utils.gather_possible_values (cyclomatic 26) packages/svelte/src/compiler/phases/2-analyze/css/utils.js:11 — utils.gather_possible_values 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 · Batch.#process (cyclomatic 25) · ×1
  • Batch.#process (cyclomatic 25) packages/svelte/src/internal/client/reactivity/batch.js:329 — Batch.#process 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 · effects.create_effect (cyclomatic 25) · ×1
  • effects.create_effect (cyclomatic 25) packages/svelte/src/internal/client/reactivity/effects.js:88 — effects.create_effect 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 · events.handle_event_propagation (cyclomatic 25) · ×1
  • events.handle_event_propagation (cyclomatic 25) packages/svelte/src/internal/client/dom/elements/events.js:181 — events.handle_event_propagation 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 · css-prune.apply_combinator (cyclomatic 25) · ×1
  • css-prune.apply_combinator (cyclomatic 25) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:302 — css-prune.apply_combinator 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 · infer_namespace (cyclomatic 25) · ×1
  • infer_namespace (cyclomatic 25) packages/svelte/src/compiler/phases/3-transform/utils.js:314 — infer_namespace 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 · SvelteBoundary (cyclomatic 25) · ×1
  • SvelteBoundary (cyclomatic 25) packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteBoundary.js:11 — SvelteBoundary 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 · AssignmentExpression.build_assignment (cyclomatic 24) · ×1
  • AssignmentExpression.build_assignment (cyclomatic 24) packages/svelte/src/compiler/phases/3-transform/server/visitors/AssignmentExpression.js:26 — AssignmentExpression.build_assignment 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 · fragment.process_children (cyclomatic 24) · ×1
  • fragment.process_children (cyclomatic 24) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/fragment.js:19 — fragment.process_children 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 · convert · ×1
  • convert::AwaitBlock (cyclomatic 24) packages/svelte/src/compiler/legacy.js:116 — convert::AwaitBlock 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 · build_template_chunk (cyclomatic 24) · ×1
  • build_template_chunk (cyclomatic 24) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js:105 — build_template_chunk 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 · build_bind_this (cyclomatic 24) · ×1
  • build_bind_this (cyclomatic 24) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js:245 — build_bind_this has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SelectorList (cyclomatic 24) · ×1
  • SelectorList (cyclomatic 24) packages/svelte/src/compiler/phases/3-transform/css/index.js:198 — SelectorList has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · internal_set (cyclomatic 24) · ×1
  • internal_set (cyclomatic 24) packages/svelte/src/internal/client/reactivity/sources.js:189 — internal_set 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 · ExportNamedDeclaration.ExportNamedDeclaration (cyclomatic 23) · ×1
  • ExportNamedDeclaration.ExportNamedDeclaration (cyclomatic 23) packages/svelte/src/compiler/phases/2-analyze/visitors/ExportNamedDeclaration.js:10 — ExportNamedDeclaration.ExportNamedDeclaration has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MappedCode.concat (cyclomatic 23) · ×1
  • MappedCode.concat (cyclomatic 23) packages/svelte/src/compiler/utils/mapped_code.js:121 — MappedCode.concat 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 · log_reactions · ×1
  • log_reactions::log_derived (cyclomatic 23) packages/svelte/src/internal/client/dev/debug.js:216 — log_reactions::log_derived 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 · Rule (cyclomatic 23) · ×1
  • Rule (cyclomatic 23) packages/svelte/src/compiler/phases/2-analyze/css/css-analyze.js:197 — Rule 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 · SvelteBoundary (cyclomatic 23) · ×1
  • SvelteBoundary (cyclomatic 23) packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js:17 — SvelteBoundary has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · style.read_value (cyclomatic 22) · ×1
  • style.read_value (cyclomatic 22) packages/svelte/src/compiler/phases/1-parse/read/style.js:511 — style.read_value 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 · clone.clone (cyclomatic 22) · ×1
  • clone.clone (cyclomatic 22) packages/svelte/src/internal/shared/clone.js:57 — clone.clone 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 · utils.validate_assignment (cyclomatic 22) · ×1
  • utils.validate_assignment (cyclomatic 22) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js:22 — utils.validate_assignment 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 · SnippetBlock.SnippetBlock (cyclomatic 22) · ×1
  • SnippetBlock.SnippetBlock (cyclomatic 22) packages/svelte/src/compiler/phases/2-analyze/visitors/SnippetBlock.js:11 — SnippetBlock.SnippetBlock has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.extract_type_and_comment (cyclomatic 22) · ×1
  • index.extract_type_and_comment (cyclomatic 22) REDACTED:1602 — index.extract_type_and_comment 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 · index.attributes (cyclomatic 22) · ×1
  • index.attributes (cyclomatic 22) packages/svelte/src/internal/server/index.js:130 — index.attributes 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 · connectedCallback (cyclomatic 22) · ×1
  • connectedCallback (cyclomatic 22) packages/svelte/src/internal/client/dom/elements/custom-element.js:93 — connectedCallback has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ast._extract_paths (cyclomatic 21) · ×1
  • ast._extract_paths (cyclomatic 21) packages/svelte/src/compiler/utils/ast.js:269 — ast._extract_paths 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 · browser-support.detector.build_detection_maps (cyclomatic 21) · ×1
  • browser-support.detector.build_detection_maps (cyclomatic 21) packages/svelte/scripts/browser-support.detector.js:67 — browser-support.detector.build_detection_maps has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Attribute.Attribute (cyclomatic 21) · ×1
  • Attribute.Attribute (cyclomatic 21) packages/svelte/src/compiler/phases/2-analyze/visitors/Attribute.js:11 — Attribute.Attribute 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 · EachBlock.EachBlock (cyclomatic 21) · ×1
  • EachBlock.EachBlock (cyclomatic 21) packages/svelte/src/compiler/phases/2-analyze/visitors/EachBlock.js:14 — EachBlock.EachBlock 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 · CallExpression.CallExpression (cyclomatic 21) · ×1
  • CallExpression.CallExpression (cyclomatic 21) packages/svelte/src/compiler/phases/3-transform/server/visitors/CallExpression.js:12 — CallExpression.CallExpression has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Program.Program (cyclomatic 21) · ×1
  • Program.Program (cyclomatic 21) packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js:12 — Program.Program has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · animate (cyclomatic 21) · ×1
  • animate (cyclomatic 21) packages/svelte/src/internal/client/dom/elements/transitions.js:338 — animate has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 17 function items inside it that branch ((anonymous)::onfinish, (anonymous), (anonymous), …). 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 · ClassBody (cyclomatic 21) · ×1
  • ClassBody (cyclomatic 21) packages/svelte/src/compiler/phases/3-transform/client/visitors/ClassBody.js:13 — ClassBody 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 · browser-support.detector.walk_source (cyclomatic 20) · ×1
  • browser-support.detector.walk_source (cyclomatic 20) packages/svelte/scripts/browser-support.detector.js:291 — browser-support.detector.walk_source 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 · css-prune.get_ancestor_elements (cyclomatic 20) · ×1
  • css-prune.get_ancestor_elements (cyclomatic 20) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:848 — css-prune.get_ancestor_elements has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · should_proxy (cyclomatic 20) · ×1
  • should_proxy (cyclomatic 20) packages/svelte/src/compiler/phases/scope.js:1484 — should_proxy has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _mount (cyclomatic 20) · ×1
  • _mount (cyclomatic 20) packages/svelte/src/internal/client/render.js:162 — _mount has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 5 function items inside it that branch ((anonymous)::(anonymous), (anonymous)::event_handle, (anonymous)::(anonymous), …). 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 · runtime.update_reaction (cyclomatic 19) · ×1
  • runtime.update_reaction (cyclomatic 19) packages/svelte/src/internal/client/runtime.js:220 — runtime.update_reaction 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 · custom-element.get_custom_element_value (cyclomatic 19) · ×1
  • custom-element.get_custom_element_value (cyclomatic 19) packages/svelte/src/internal/client/dom/elements/custom-element.js:234 — custom-element.get_custom_element_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.
D1 · Cyclomatic Complexity · LabeledStatement.LabeledStatement (cyclomatic 19) · ×1
  • LabeledStatement.LabeledStatement (cyclomatic 19) packages/svelte/src/compiler/phases/2-analyze/visitors/LabeledStatement.js:12 — LabeledStatement.LabeledStatement 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 · tracing.log_entry (cyclomatic 18) · ×1
  • tracing.log_entry (cyclomatic 18) packages/svelte/src/internal/client/dev/tracing.js:21 — tracing.log_entry has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · await.await_block (cyclomatic 18) · ×1
  • await.await_block (cyclomatic 18) packages/svelte/src/internal/client/dom/blocks/await.js:36 — await.await_block has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 54, 77, 114, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · LetDirective.LetDirective (cyclomatic 18) · ×1
  • LetDirective.LetDirective (cyclomatic 18) packages/svelte/src/compiler/phases/2-analyze/visitors/LetDirective.js:10 — LetDirective.LetDirective has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · RegularElement.build_element_attribute_update (cyclomatic 18) · ×1
  • RegularElement.build_element_attribute_update (cyclomatic 18) packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:626 — RegularElement.build_element_attribute_update has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SvelteComponent (cyclomatic 18) · ×1
  • SvelteComponent (cyclomatic 18) REDACTED:1155 — SvelteComponent 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 · next (cyclomatic 18) · ×1
  • next (cyclomatic 18) packages/svelte/src/compiler/phases/1-parse/state/tag.js:527 — next 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 · RelativeSelector (cyclomatic 18) · ×1
  • RelativeSelector (cyclomatic 18) packages/svelte/src/compiler/phases/2-analyze/css/css-analyze.js:142 — RelativeSelector has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · get_comment_handlers · ×1
  • get_comment_handlers::add_comments::_ (cyclomatic 18) packages/svelte/src/compiler/phases/1-parse/acorn.js:238 — get_comment_handlers::add_comments::_ 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 · find_descendants (cyclomatic 18) · ×1
  • find_descendants (cyclomatic 18) packages/svelte/src/compiler/phases/nodes.js:246 — find_descendants 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 · element.read_attribute_value (cyclomatic 17) · ×1
  • element.read_attribute_value (cyclomatic 17) packages/svelte/src/compiler/phases/1-parse/state/element.js:791 — element.read_attribute_value has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · batch.flush_queued_effects (cyclomatic 17) · ×1
  • batch.flush_queued_effects (cyclomatic 17) packages/svelte/src/internal/client/reactivity/batch.js:1109 — batch.flush_queued_effects 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 · generate-report.generate_report (cyclomatic 17) · ×1
  • generate-report.generate_report (cyclomatic 17) benchmarking/compare/generate-report.js:15 — generate-report.generate_report has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SvelteElement.SvelteElement (cyclomatic 17) · ×1
  • SvelteElement.SvelteElement (cyclomatic 17) packages/svelte/src/compiler/phases/2-analyze/visitors/SvelteElement.js:13 — SvelteElement.SvelteElement has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · utils.get_prop_source (cyclomatic 17) · ×1
  • utils.get_prop_source (cyclomatic 17) packages/svelte/src/compiler/phases/3-transform/client/utils.js:54 — utils.get_prop_source 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 · element.build_set_class (cyclomatic 17) · ×1
  • element.build_set_class (cyclomatic 17) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:157 — element.build_set_class has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · index.handle_events (cyclomatic 17) · ×1
  • index.handle_events (cyclomatic 17) REDACTED:1743 — index.handle_events 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 · transition (cyclomatic 17) · ×1
  • transition (cyclomatic 17) packages/svelte/src/internal/client/dom/elements/transitions.js:193 — transition has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 10 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · build_attribute_value (cyclomatic 17) · ×1
  • build_attribute_value (cyclomatic 17) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.js:222 — build_attribute_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 · proxy · ×1
  • proxy::set (cyclomatic 17) packages/svelte/src/internal/client/proxy.js:270 — proxy::set 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 · visit_assignment_expression (cyclomatic 17) · ×1
  • visit_assignment_expression (cyclomatic 17) packages/svelte/src/compiler/phases/3-transform/shared/assignments.js:14 — visit_assignment_expression has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · html.validate_code (cyclomatic 16) · ×1
  • html.validate_code (cyclomatic 16) packages/svelte/src/compiler/phases/1-parse/utils/html.js:84 — html.validate_code has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · debug.log_effect_tree (cyclomatic 16) · ×1
  • debug.log_effect_tree (cyclomatic 16) packages/svelte/src/internal/client/dev/debug.js:75 — debug.log_effect_tree has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Boundary.#handle_error (cyclomatic 16) · ×1
  • Boundary.#handle_error (cyclomatic 16) packages/svelte/src/internal/client/dom/blocks/boundary.js:494 — Boundary.#handle_error has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 551, 519, 527, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Batch.#traverse (cyclomatic 16) · ×1
  • Batch.#traverse (cyclomatic 16) packages/svelte/src/internal/client/reactivity/batch.js:493 — Batch.#traverse 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 · Batch.apply (cyclomatic 16) · ×1
  • Batch.apply (cyclomatic 16) packages/svelte/src/internal/client/reactivity/batch.js:931 — Batch.apply has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sources.mark_reactions (cyclomatic 16) · ×1
  • sources.mark_reactions (cyclomatic 16) packages/svelte/src/internal/client/reactivity/sources.js:354 — sources.mark_reactions 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 · runtime.deep_read (cyclomatic 16) · ×1
  • runtime.deep_read (cyclomatic 16) packages/svelte/src/internal/client/runtime.js:815 — runtime.deep_read 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 · attributes.to_class (cyclomatic 16) · ×1
  • attributes.to_class (cyclomatic 16) packages/svelte/src/internal/shared/attributes.js:59 — attributes.to_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.
D1 · Cyclomatic Complexity · utils.check_nodes_for_namespace (cyclomatic 16) · ×1
  • utils.check_nodes_for_namespace (cyclomatic 16) packages/svelte/src/compiler/phases/3-transform/utils.js:369 — utils.check_nodes_for_namespace has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassBody.ClassBody (cyclomatic 16) · ×1
  • ClassBody.ClassBody (cyclomatic 16) packages/svelte/src/compiler/phases/3-transform/server/visitors/ClassBody.js:10 — ClassBody.ClassBody 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 · utils.validate_mutation (cyclomatic 16) · ×1
  • utils.validate_mutation (cyclomatic 16) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js:390 — utils.validate_mutation 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 · index.transform_template (cyclomatic 16) · ×1
  • index.transform_template (cyclomatic 16) packages/svelte/src/compiler/phases/3-transform/client/transform-template/index.js:38 — index.transform_template has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · process_children (cyclomatic 16) · ×1
  • process_children (cyclomatic 16) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.js:36 — process_children has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IfBlock (cyclomatic 16) · ×1
  • IfBlock (cyclomatic 16) packages/svelte/src/compiler/phases/3-transform/client/visitors/IfBlock.js:12 — IfBlock 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 · read_profile (cyclomatic 16) · ×1
  • read_profile (cyclomatic 16) benchmarking/compare/profile-diff.mjs:19 — read_profile has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D17 · Explicit Debt · HackComment · ×1
  • HackComment packages/svelte/tests/runtime-legacy/shared.ts:385 — // hack to support transition tests — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D2 · Cognitive Complexity · analyze_component (cognitive 385) · ×1
  • analyze_component (cognitive 385) packages/svelte/src/compiler/phases/2-analyze/index.js:333 — analyze_component has cognitive complexity 385 (threshold 15). Drivers by points: if/else 68 (205 pts), loops 30 (100 pts), boolean chains 56, ternaries 8 (20 pts), other 4 (nesting depth added 219). Of this number, 360 points are the body's own statements and 25 belong to 10 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VariableDeclaration (cognitive 266) · ×1
  • VariableDeclaration (cognitive 266) packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16 — VariableDeclaration has cognitive complexity 266 (threshold 15). Drivers by points: if/else 37 (146 pts), ternaries 11 (70 pts), loops 7 (29 pts), boolean chains 18, other 3 (nesting depth added 190). Of this number, 229 points are the body's own statements and 37 belong to 7 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · check_element (cognitive 257) · ×1
  • check_element (cognitive 257) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:56 — check_element has cognitive complexity 257 (threshold 15). Drivers by points: if/else 72 (182 pts), boolean chains 61, loops 4 (7 pts), match/switch 3 (5 pts), other 1, ternaries 1 (nesting depth added 115). Of this number, 243 points are the body's own statements and 14 belong to 15 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · migrate (cognitive 179) · ×1
  • migrate (cognitive 179) REDACTED:124 — migrate has cognitive complexity 179 (threshold 15). Drivers by points: ternaries 26 (89 pts), if/else 34 (62 pts), boolean chains 20, loops 3 (4 pts), other 3, error handling 1 (nesting depth added 92). Of this number, 130 points are the body's own statements and 49 belong to 23 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RegularElement (cognitive 178) · ×1
  • RegularElement (cognitive 178) packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:38 — RegularElement has cognitive complexity 178 (threshold 15). Drivers by points: if/else 50 (91 pts), boolean chains 52, ternaries 10 (24 pts), loops 5 (8 pts), match/switch 1 (2 pts), other 1 (nesting depth added 59). Of this number, 167 points are the body's own statements and 11 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_component (cognitive 170) · ×1
  • build_component (cognitive 170) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:19 — build_component has cognitive complexity 170 (threshold 15). Drivers by points: if/else 51 (95 pts), ternaries 19 (48 pts), boolean chains 21, loops 4 (5 pts), other 1 (nesting depth added 74). Of this number, 150 points are the body's own statements and 20 belong to 14 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VariableDeclaration (cognitive 157) · ×1
  • VariableDeclaration (cognitive 157) REDACTED:567 — VariableDeclaration has cognitive complexity 157 (threshold 15). Drivers by points: if/else 30 (79 pts), ternaries 5 (24 pts), loops 7 (23 pts), boolean chains 22, other 7, error handling 1 (2 pts) (nesting depth added 85). Of this number, 138 points are the body's own statements and 19 belong to 10 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · index.svelte_visitors (cognitive 156) · ×1
  • index.svelte_visitors (cognitive 156) packages/svelte/src/compiler/print/index.js:537 — index.svelte_visitors has cognitive complexity 156 (threshold 15). Drivers by points: if/else 66 (101 pts), boolean chains 29, loops 15 (19 pts), ternaries 4 (7 pts) (nesting depth added 42). Of this number, 154 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · client_component (cognitive 154) · ×1
  • client_component (cognitive 154) packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:135 — client_component has cognitive complexity 154 (threshold 15). Drivers by points: if/else 57 (85 pts), ternaries 11 (27 pts), boolean chains 16, loops 9 (14 pts), other 12 (nesting depth added 49). Of this number, 134 points are the body's own statements and 20 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · element (cognitive 152) · ×1
  • element (cognitive 152) packages/svelte/src/compiler/phases/1-parse/state/element.js:65 — element has cognitive complexity 152 (threshold 15). Drivers by points: if/else 53 (103 pts), boolean chains 26, ternaries 10 (16 pts), loops 3 (5 pts), other 2 (nesting depth added 58). Of this number, 150 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · relative_selector_might_apply_to_node (cognitive 145) · ×1
  • relative_selector_might_apply_to_node (cognitive 145) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:447 — relative_selector_might_apply_to_node has cognitive complexity 145 (threshold 15). Drivers by points: if/else 24 (77 pts), loops 8 (33 pts), boolean chains 21, ternaries 3 (11 pts), match/switch 1 (2 pts), other 1 (nesting depth added 87). Of this number, 142 points are the body's own statements and 3 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · element.build_element_attributes (cognitive 139) · ×1
  • element.build_element_attributes (cognitive 139) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:36 — element.build_element_attributes has cognitive complexity 139 (threshold 15). Drivers by points: if/else 44 (98 pts), boolean chains 25, ternaries 3 (11 pts), loops 3 (5 pts) (nesting depth added 64). Of this number, 137 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BindDirective.BindDirective (cognitive 138) · ×1
  • BindDirective.BindDirective (cognitive 138) packages/svelte/src/compiler/phases/2-analyze/visitors/BindDirective.js:20 — BindDirective.BindDirective has cognitive complexity 138 (threshold 15). Drivers by points: if/else 37 (95 pts), boolean chains 24, ternaries 3 (10 pts), loops 4 (9 pts) (nesting depth added 70). Of this number, 133 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · profile_to_markdown (cognitive 135) · ×1
  • profile_to_markdown (cognitive 135) benchmarking/utils.js:111 — profile_to_markdown has cognitive complexity 135 (threshold 15). Drivers by points: ternaries 20 (53 pts), if/else 16 (42 pts), loops 8 (19 pts), boolean chains 14, other 7 (nesting depth added 70). Of this number, 107 points are the body's own statements and 28 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · constructor (cognitive 131) · ×1
  • constructor (cognitive 131) packages/svelte/src/compiler/phases/scope.js:262 — constructor has cognitive complexity 131 (threshold 15). Drivers by points: if/else 34 (77 pts), boolean chains 21, loops 8 (20 pts), match/switch 4 (9 pts), ternaries 1 (4 pts) (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VariableDeclarator (cognitive 128) · ×1
  • VariableDeclarator (cognitive 128) packages/svelte/src/compiler/phases/2-analyze/visitors/VariableDeclarator.js:16 — VariableDeclarator has cognitive complexity 128 (threshold 15). Drivers by points: if/else 21 (63 pts), ternaries 8 (37 pts), loops 4 (14 pts), boolean chains 12, other 2 (nesting depth added 81). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · element.validate_element (cognitive 122) · ×1
  • element.validate_element (cognitive 122) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/element.js:30 — element.validate_element has cognitive complexity 122 (threshold 15). Drivers by points: if/else 29 (86 pts), ternaries 4 (18 pts), loops 3 (10 pts), boolean chains 8 (nesting depth added 78). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · each.reconcile (cognitive 121) · ×1
  • each.reconcile (cognitive 121) packages/svelte/src/internal/client/dom/blocks/each.js:434 — each.reconcile has cognitive complexity 121 (threshold 15). Drivers by points: if/else 28 (68 pts), loops 12 (36 pts), ternaries 3 (12 pts), boolean chains 5 (nesting depth added 73). Of this number, 117 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · index.calculate_blockers (cognitive 118) · ×1
  • index.calculate_blockers (cognitive 118) packages/svelte/src/compiler/phases/2-analyze/index.js:959 — index.calculate_blockers has cognitive complexity 118 (threshold 15). Drivers by points: if/else 42 (78 pts), loops 9 (23 pts), ternaries 4 (14 pts), boolean chains 3 (nesting depth added 60). Of this number, 95 points are the body's own statements and 23 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · open (cognitive 116) · ×1
  • open (cognitive 116) packages/svelte/src/compiler/phases/1-parse/state/tag.js:151 — open has cognitive complexity 116 (threshold 15). Drivers by points: if/else 36 (80 pts), error handling 5 (15 pts), loops 5 (14 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 64). Of this number, 113 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · options.read_options (cognitive 115) · ×1
  • options.read_options (cognitive 115) packages/svelte/src/compiler/phases/1-parse/read/options.js:10 — options.read_options has cognitive complexity 115 (threshold 15). Drivers by points: if/else 30 (89 pts), loops 4 (13 pts), boolean chains 8, ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegularElement.RegularElement (cognitive 115) · ×1
  • RegularElement.RegularElement (cognitive 115) packages/svelte/src/compiler/phases/2-analyze/visitors/RegularElement.js:26 — RegularElement.RegularElement has cognitive complexity 115 (threshold 15). Drivers by points: if/else 32 (82 pts), boolean chains 18, loops 6 (15 pts) (nesting depth added 59). Of this number, 107 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · set_attributes (cognitive 113) · ×1
  • set_attributes (cognitive 113) packages/svelte/src/internal/client/dom/elements/attributes.js:271 — set_attributes has cognitive complexity 113 (threshold 15). Drivers by points: if/else 37 (73 pts), boolean chains 26, ternaries 2 (12 pts), loops 2 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VariableDeclaration (cognitive 109) · ×1
  • VariableDeclaration (cognitive 109) packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js:15 — VariableDeclaration has cognitive complexity 109 (threshold 15). Drivers by points: if/else 19 (55 pts), loops 6 (24 pts), ternaries 5 (20 pts), boolean chains 8, other 2 (nesting depth added 69). Of this number, 95 points are the body's own statements and 14 belong to 4 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Identifier (cognitive 108) · ×1
  • Identifier (cognitive 108) packages/svelte/src/compiler/phases/2-analyze/visitors/Identifier.js:15 — Identifier has cognitive complexity 108 (threshold 15). Drivers by points: if/else 26 (70 pts), boolean chains 23, loops 3 (9 pts), ternaries 1 (6 pts) (nesting depth added 55). Of this number, 107 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · scope.create_scopes (cognitive 103) · ×1
  • scope.create_scopes (cognitive 103) packages/svelte/src/compiler/phases/scope.js:920 — scope.create_scopes has cognitive complexity 103 (threshold 15). Drivers by points: if/else 36 (51 pts), loops 21 (33 pts), boolean chains 10, ternaries 4 (9 pts) (nesting depth added 32). Of this number, 93 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EachBlock (cognitive 97) · ×1
  • EachBlock (cognitive 97) packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js:23 — EachBlock has cognitive complexity 97 (threshold 15). Drivers by points: if/else 28 (39 pts), ternaries 17 (33 pts), loops 9 (16 pts), boolean chains 9 (nesting depth added 34). Of this number, 78 points are the body's own statements and 19 belong to 10 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · debug.log_reactions (cognitive 95) · ×1
  • debug.log_reactions (cognitive 95) packages/svelte/src/internal/client/dev/debug.js:189 — debug.log_reactions has cognitive complexity 95 (threshold 15). Drivers by points: if/else 22 (58 pts), ternaries 6 (20 pts), loops 3 (10 pts), error handling 1 (4 pts), boolean chains 3 (nesting depth added 60). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · index.run (cognitive 95) · ×1
  • index.run (cognitive 95) packages/svelte/scripts/process-messages/index.js:17 — index.run has cognitive complexity 95 (threshold 15). Drivers by points: if/else 25 (63 pts), loops 10 (22 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 54). Of this number, 77 points are the body's own statements and 18 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_inline_component (cognitive 91) · ×1
  • build_inline_component (cognitive 91) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/component.js:21 — build_inline_component has cognitive complexity 91 (threshold 15). Drivers by points: if/else 34 (61 pts), ternaries 7 (14 pts), boolean chains 13, loops 3 (nesting depth added 34). Of this number, 74 points are the body's own statements and 17 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassBody (cognitive 91) · ×1
  • ClassBody (cognitive 91) packages/svelte/src/compiler/phases/2-analyze/visitors/ClassBody.js:15 — ClassBody has cognitive complexity 91 (threshold 15). Drivers by points: if/else 25 (62 pts), ternaries 4 (12 pts), boolean chains 10, loops 5 (7 pts) (nesting depth added 47). Of this number, 78 points are the body's own statements and 13 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · proxy.proxy (cognitive 87) · ×1
  • proxy.proxy (cognitive 87) packages/svelte/src/internal/client/proxy.js:40 — proxy.proxy has cognitive complexity 87 (threshold 15). Drivers by points: if/else 39 (60 pts), boolean chains 20, loops 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 23). Of this number, 82 points are the body's own statements and 5 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · #commit (cognitive 87) · ×1
  • #commit (cognitive 87) packages/svelte/src/internal/client/reactivity/batch.js:717 — #commit has cognitive complexity 87 (threshold 15). Drivers by points: if/else 19 (55 pts), loops 7 (21 pts), boolean chains 6, error handling 1 (5 pts) (nesting depth added 54). Of this number, 77 points are the body's own statements and 10 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · get (cognitive 87) · ×1
  • get (cognitive 87) packages/svelte/src/internal/client/runtime.js:540 — get has cognitive complexity 87 (threshold 15). Drivers by points: if/else 29 (69 pts), boolean chains 18 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CallExpression.CallExpression (cognitive 84) · ×1
  • CallExpression.CallExpression (cognitive 84) packages/svelte/src/compiler/phases/2-analyze/visitors/CallExpression.js:16 — CallExpression.CallExpression has cognitive complexity 84 (threshold 15). Drivers by points: if/else 38 (70 pts), boolean chains 11, loops 1 (2 pts), match/switch 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 · css-prune.attribute_matches (cognitive 79) · ×1
  • css-prune.attribute_matches (cognitive 79) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:724 — css-prune.attribute_matches has cognitive complexity 79 (threshold 15). Drivers by points: if/else 27 (69 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 44). Of this number, 64 points are the body's own statements and 15 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · to_style (cognitive 79) · ×1
  • to_style (cognitive 79) packages/svelte/src/internal/shared/attributes.js:128 — to_style has cognitive complexity 79 (threshold 15). Drivers by points: if/else 22 (66 pts), boolean chains 7, loops 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · build_assignment (cognitive 78) · ×1
  • build_assignment (cognitive 78) packages/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js:47 — build_assignment has cognitive complexity 78 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 24, ternaries 7 (19 pts), loops 1, other 1 (nesting depth added 28). Of this number, 74 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · migrate_slot_usage (cognitive 77) · ×1
  • migrate_slot_usage (cognitive 77) REDACTED:1433 — migrate_slot_usage has cognitive complexity 77 (threshold 15). Drivers by points: if/else 22 (48 pts), boolean chains 13, loops 5 (12 pts), ternaries 2 (4 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ComplexSelector (cognitive 74) · ×1
  • ComplexSelector (cognitive 74) packages/svelte/src/compiler/phases/3-transform/css/index.js:283 — ComplexSelector has cognitive complexity 74 (threshold 15). Drivers by points: if/else 17 (58 pts), boolean chains 9, loops 3 (7 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · each (cognitive 72) · ×1
  • each (cognitive 72) packages/svelte/src/internal/client/dom/blocks/each.js:181 — each has cognitive complexity 72 (threshold 15). Drivers by points: if/else 33 (56 pts), ternaries 5 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 29). Most of this is not in the body itself: 6 of the 72 points are its own statements and the rest belongs to 7 function items inside it that branch ((anonymous), commit, (anonymous), …). 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 · SelectorList (cognitive 72) · ×1
  • SelectorList (cognitive 72) packages/svelte/src/compiler/phases/3-transform/css/index.js:198 — SelectorList has cognitive complexity 72 (threshold 15). Drivers by points: if/else 18 (48 pts), ternaries 2 (12 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SlotElement (cognitive 70) · ×1
  • SlotElement (cognitive 70) REDACTED:1241 — SlotElement has cognitive complexity 70 (threshold 15). Drivers by points: if/else 17 (29 pts), ternaries 8 (26 pts), boolean chains 8, loops 2 (6 pts), other 1 (nesting depth added 34). Of this number, 65 points are the body's own statements and 5 belong to 6 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · log_reactions · ×1
  • log_reactions::log_derived (cognitive 70) packages/svelte/src/internal/client/dev/debug.js:216 — log_reactions::log_derived has cognitive complexity 70 (threshold 15). Drivers by points: if/else 12 (36 pts), ternaries 6 (20 pts), loops 2 (6 pts), error handling 1 (4 pts), boolean chains 2, other 2 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · clean_nodes (cognitive 70) · ×1
  • clean_nodes (cognitive 70) packages/svelte/src/compiler/phases/3-transform/utils.js:126 — clean_nodes has cognitive complexity 70 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 22, ternaries 2 (10 pts), loops 4 (7 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · handle_identifier (cognitive 67) · ×1
  • handle_identifier (cognitive 67) REDACTED:1868 — handle_identifier has cognitive complexity 67 (threshold 15). Drivers by points: if/else 19 (43 pts), ternaries 4 (11 pts), boolean chains 7, loops 1 (4 pts), other 2 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · get_possible_element_siblings (cognitive 63) · ×1
  • get_possible_element_siblings (cognitive 63) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:1007 — get_possible_element_siblings has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (40 pts), loops 4 (10 pts), boolean chains 8, ternaries 2 (5 pts) (nesting depth added 34). Of this number, 62 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BindDirective (cognitive 62) · ×1
  • BindDirective (cognitive 62) packages/svelte/src/compiler/phases/3-transform/client/visitors/BindDirective.js:15 — BindDirective has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (29 pts), other 15, boolean chains 9, ternaries 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 17). Of this number, 57 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · attribute.validate_slot_attribute (cognitive 61) · ×1
  • attribute.validate_slot_attribute (cognitive 61) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/attribute.js:56 — attribute.validate_slot_attribute has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (48 pts), boolean chains 7, loops 2 (6 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · read_selector (cognitive 58) · ×1
  • read_selector (cognitive 58) packages/svelte/src/compiler/phases/1-parse/read/style.js:167 — read_selector has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (36 pts), ternaries 4 (15 pts), boolean chains 6, loops 1 (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.
D2 · Cognitive Complexity · LabeledStatement (cognitive 56) · ×1
  • LabeledStatement (cognitive 56) REDACTED:929 — LabeledStatement has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 3 (13 pts), ternaries 2 (10 pts), boolean chains 5 (nesting depth added 32). Of this number, 55 points are the body's own statements and 1 belongs to 5 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · prop (cognitive 56) · ×1
  • prop (cognitive 56) packages/svelte/src/internal/client/reactivity/props.js:276 — prop has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (30 pts), ternaries 7 (15 pts), boolean chains 10, other 1 (nesting depth added 17). Of this number, 24 points are the body's own statements and 32 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server_component (cognitive 55) · ×1
  • server_component (cognitive 55) packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:94 — server_component has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 9, loops 5 (8 pts), other 4, ternaries 2 (3 pts) (nesting depth added 13). Of this number, 51 points are the body's own statements and 4 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · visit_component (cognitive 55) · ×1
  • visit_component (cognitive 55) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/component.js:19 — visit_component has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 6 (7 pts), boolean chains 6, ternaries 2 (3 pts), other 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_visitors (cognitive 54) · ×1
  • css_visitors (cognitive 54) packages/svelte/src/compiler/print/index.js:275 — css_visitors has cognitive complexity 54 (threshold 15). Drivers by points: if/else 24 (35 pts), loops 9 (11 pts), boolean chains 3, ternaries 2 (3 pts), other 2 (nesting depth added 14). Most of this is not in the body itself: 0 of the 54 points are its own statements and the rest belongs to 24 function items inside it that branch (print_selector_list, Atrule, RelativeSelector, …). 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 · analyze-compiler-profile.analyze_compiler_profiles (cognitive 52) · ×1
  • analyze-compiler-profile.analyze_compiler_profiles (cognitive 52) benchmarking/analyze-compiler-profile.js:13 — analyze-compiler-profile.analyze_compiler_profiles has cognitive complexity 52 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 5 (11 pts), ternaries 6 (11 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ast._extract_paths (cognitive 52) · ×1
  • ast._extract_paths (cognitive 52) packages/svelte/src/compiler/utils/ast.js:269 — ast._extract_paths has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (39 pts), loops 3 (8 pts), boolean chains 2, ternaries 1 (2 pts), match/switch 1 (nesting depth added 30). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · element.read_attribute (cognitive 52) · ×1
  • element.read_attribute (cognitive 52) packages/svelte/src/compiler/phases/1-parse/state/element.js:521 — element.read_attribute has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 10, ternaries 2 (5 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LabeledStatement.LabeledStatement (cognitive 52) · ×1
  • LabeledStatement.LabeledStatement (cognitive 52) packages/svelte/src/compiler/phases/2-analyze/visitors/LabeledStatement.js:12 — LabeledStatement.LabeledStatement has cognitive complexity 52 (threshold 15). Drivers by points: if/else 10 (33 pts), loops 4 (16 pts), boolean chains 3 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · async_derived (cognitive 50) · ×1
  • async_derived (cognitive 50) packages/svelte/src/internal/client/reactivity/deriveds.js:113 — async_derived has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 4 (12 pts), boolean chains 3, error handling 1, other 1 (nesting depth added 19). Most of this is not in the body itself: 4 of the 50 points are its own statements and the rest belongs to 9 function items inside it that branch ((anonymous), (anonymous)::handler, (anonymous)::handler::(anonymous), …). 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 · utils.gather_possible_values (cognitive 49) · ×1
  • utils.gather_possible_values (cognitive 49) packages/svelte/src/compiler/phases/2-analyze/css/utils.js:11 — utils.gather_possible_values has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 3 (8 pts), boolean chains 7, ternaries 1 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · internal_set (cognitive 49) · ×1
  • internal_set (cognitive 49) packages/svelte/src/internal/client/reactivity/sources.js:189 — internal_set has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (43 pts), boolean chains 5, other 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · clone (cognitive 49) · ×1
  • clone (cognitive 49) packages/svelte/src/internal/shared/clone.js:57 — clone has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (28 pts), ternaries 3 (12 pts), loops 2 (6 pts), boolean chains 2, error handling 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SvelteBoundary (cognitive 48) · ×1
  • SvelteBoundary (cognitive 48) packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteBoundary.js:11 — SvelteBoundary has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (32 pts), ternaries 3 (7 pts), boolean chains 4, loops 3, other 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · flush_queued_effects (cognitive 46) · ×1
  • flush_queued_effects (cognitive 46) packages/svelte/src/internal/client/reactivity/batch.js:1109 — flush_queued_effects has cognitive complexity 46 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 4 (15 pts), boolean chains 5 (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 · handle_events (cognitive 45) · ×1
  • handle_events (cognitive 45) REDACTED:1743 — handle_events has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (12 pts), ternaries 2 (8 pts), boolean chains 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.
D2 · Cognitive Complexity · Rule (cognitive 45) · ×1
  • Rule (cognitive 45) packages/svelte/src/compiler/phases/2-analyze/css/css-analyze.js:197 — Rule has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 4 (9 pts), boolean chains 7 (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 · connectedCallback (cognitive 45) · ×1
  • connectedCallback (cognitive 45) packages/svelte/src/internal/client/dom/elements/custom-element.js:93 — connectedCallback has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 6 (13 pts), boolean chains 6 (nesting depth added 22). Of this number, 32 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExportNamedDeclaration (cognitive 45) · ×1
  • ExportNamedDeclaration (cognitive 45) packages/svelte/src/compiler/phases/2-analyze/visitors/ExportNamedDeclaration.js:10 — ExportNamedDeclaration has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 4 (14 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 24). Of this number, 43 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MappedCode.concat (cognitive 44) · ×1
  • MappedCode.concat (cognitive 44) packages/svelte/src/compiler/utils/mapped_code.js:121 — MappedCode.concat has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 7 (17 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComplexSelector (cognitive 44) · ×1
  • ComplexSelector (cognitive 44) packages/svelte/src/compiler/phases/2-analyze/css/css-analyze.js:64 — ComplexSelector has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 11, loops 3 (6 pts) (nesting depth added 20). Of this number, 42 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegularElement (cognitive 44) · ×1
  • RegularElement (cognitive 44) packages/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js:17 — RegularElement has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 11, ternaries 2 (3 pts), loops 1 (nesting depth added 9). Of this number, 41 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Program (cognitive 43) · ×1
  • Program (cognitive 43) packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js:12 — Program has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 3 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 22). Of this number, 24 points are the body's own statements and 19 belong to 14 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · attributes (cognitive 42) · ×1
  • attributes (cognitive 42) packages/svelte/src/internal/server/index.js:130 — attributes has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 6, loops 2 (5 pts), ternaries 1 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · next (cognitive 41) · ×1
  • next (cognitive 41) packages/svelte/src/compiler/phases/1-parse/state/tag.js:527 — next has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (28 pts), error handling 3 (10 pts), loops 1 (3 pts) (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 · Batch.#process (cognitive 40) · ×1
  • Batch.#process (cognitive 40) packages/svelte/src/internal/client/reactivity/batch.js:329 — Batch.#process has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 9 (15 pts), error handling 1 (3 pts), 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 · build_template_chunk (cognitive 40) · ×1
  • build_template_chunk (cognitive 40) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js:105 — build_template_chunk has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 6, loops 2, other 2, ternaries 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 · legacy.convert (cognitive 39) · ×1
  • legacy.convert (cognitive 39) packages/svelte/src/compiler/legacy.js:42 — legacy.convert has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 5, loops 3 (5 pts), ternaries 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · css-prune.get_ancestor_elements (cognitive 39) · ×1
  • css-prune.get_ancestor_elements (cognitive 39) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:848 — css-prune.get_ancestor_elements has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (28 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 22). Of this number, 38 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · acorn.get_comment_handlers (cognitive 38) · ×1
  • acorn.get_comment_handlers (cognitive 38) packages/svelte/src/compiler/phases/1-parse/acorn.js:195 — acorn.get_comment_handlers has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 13, loops 4 (9 pts), ternaries 1 (nesting depth added 12). Of this number, 30 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · debug.log_inconsistent_branches (cognitive 38) · ×1
  • debug.log_inconsistent_branches (cognitive 38) packages/svelte/src/internal/client/dev/debug.js:356 — debug.log_inconsistent_branches has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 7 (11 pts), ternaries 5 (9 pts), boolean chains 5 (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 · element (cognitive 38) · ×1
  • element (cognitive 38) packages/svelte/src/internal/client/dom/blocks/svelte-element.js:31 — element has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 5 (8 pts), boolean chains 6 (nesting depth added 13). Most of this is not in the body itself: 6 of the 38 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 72, 58, 139, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · browser-support.detector.build_detection_maps (cognitive 37) · ×1
  • browser-support.detector.build_detection_maps (cognitive 37) packages/svelte/scripts/browser-support.detector.js:67 — browser-support.detector.build_detection_maps has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 19). Of this number, 35 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SvelteElement.SvelteElement (cognitive 36) · ×1
  • SvelteElement.SvelteElement (cognitive 36) packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteElement.js:20 — SvelteElement.SvelteElement has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 8, ternaries 5 (8 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · handle_event_propagation (cognitive 36) · ×1
  • handle_event_propagation (cognitive 36) packages/svelte/src/internal/client/dom/elements/events.js:181 — handle_event_propagation has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 9, loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 11). Of this number, 35 points are the body's own statements and 1 belongs to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · html.html (cognitive 35) · ×1
  • html.html (cognitive 35) packages/svelte/src/internal/client/dom/blocks/html.js:51 — html.html has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 5 (7 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 9). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 72). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · utils.validate_assignment (cognitive 35) · ×1
  • utils.validate_assignment (cognitive 35) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js:22 — utils.validate_assignment has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 7, loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · fragment.process_children (cognitive 35) · ×1
  • fragment.process_children (cognitive 35) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/fragment.js:19 — fragment.process_children has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 8, ternaries 2 (8 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bind_value (cognitive 35) · ×1
  • bind_value (cognitive 35) packages/svelte/src/internal/client/dom/elements/bindings/input.js:19 — bind_value has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 8, ternaries 4 (6 pts), other 2 (nesting depth added 7). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 22, 81). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · to_class (cognitive 35) · ×1
  • to_class (cognitive 35) packages/svelte/src/internal/shared/attributes.js:59 — to_class has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 6 (12 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AwaitExpression.is_last_evaluated_expression (cognitive 34) · ×1
  • AwaitExpression.is_last_evaluated_expression (cognitive 34) packages/svelte/src/compiler/phases/2-analyze/visitors/AwaitExpression.js:87 — AwaitExpression.is_last_evaluated_expression has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (31 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _mount (cognitive 33) · ×1
  • _mount (cognitive 33) packages/svelte/src/internal/client/render.js:162 — _mount has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (6 pts), boolean chains 2, other 1 (nesting depth added 13). Most of this is not in the body itself: 0 of the 33 points are its own statements and the rest belongs to 5 function items inside it that branch ((anonymous)::event_handle, (anonymous)::(anonymous), (anonymous)::(anonymous), …). 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 · generate-report.generate_report (cognitive 32) · ×1
  • generate-report.generate_report (cognitive 32) benchmarking/compare/generate-report.js:15 — generate-report.generate_report has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 6 (10 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 16). Of this number, 27 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SvelteComponent (cognitive 32) · ×1
  • SvelteComponent (cognitive 32) REDACTED:1155 — SvelteComponent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · build_attribute_value (cognitive 32) · ×1
  • build_attribute_value (cognitive 32) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.js:222 — build_attribute_value has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 6 (16 pts), if/else 7 (11 pts), boolean chains 2, loops 2, other 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 · apply (cognitive 31) · ×1
  • apply (cognitive 31) packages/svelte/src/internal/client/reactivity/batch.js:931 — apply has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (8 pts), boolean chains 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 · animate (cognitive 31) · ×1
  • animate (cognitive 31) packages/svelte/src/internal/client/dom/elements/transitions.js:338 — animate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 1 (3 pts), boolean chains 2, other 2, ternaries 1 (2 pts) (nesting depth added 11). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 17 function items inside it that branch ((anonymous)::onfinish, (anonymous), (anonymous), …). 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 · ClassBody (cognitive 31) · ×1
  • ClassBody (cognitive 31) packages/svelte/src/compiler/phases/3-transform/client/visitors/ClassBody.js:13 — ClassBody has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 6, ternaries 1 (3 pts), loops 2, other 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 · apply_combinator (cognitive 30) · ×1
  • apply_combinator (cognitive 30) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:302 — apply_combinator has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 9, loops 2 (4 pts), ternaries 3 (4 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · create_effect (cognitive 30) · ×1
  • create_effect (cognitive 30) packages/svelte/src/internal/client/reactivity/effects.js:88 — create_effect has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 8, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Fragment (cognitive 30) · ×1
  • Fragment (cognitive 30) packages/svelte/src/compiler/phases/3-transform/client/visitors/Fragment.js:16 — Fragment has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 10, ternaries 1 (2 pts), loops 1, other 1 (nesting depth added 4). Of this number, 28 points are the body's own statements and 2 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · index.extract_type_and_comment (cognitive 29) · ×1
  • index.extract_type_and_comment (cognitive 29) REDACTED:1602 — index.extract_type_and_comment has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 6 (10 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer_namespace (cognitive 29) · ×1
  • infer_namespace (cognitive 29) packages/svelte/src/compiler/phases/3-transform/utils.js:314 — infer_namespace has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (8 pts), boolean chains 6, loops 1, other 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 · proxy · ×1
  • proxy::set (cognitive 29) packages/svelte/src/internal/client/proxy.js:270 — proxy::set has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nodes.is_customizable_select_element (cognitive 28) · ×1
  • nodes.is_customizable_select_element (cognitive 28) packages/svelte/src/compiler/phases/nodes.js:208 — nodes.is_customizable_select_element has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update_reaction (cognitive 28) · ×1
  • update_reaction (cognitive 28) packages/svelte/src/internal/client/runtime.js:220 — update_reaction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (8 pts), boolean chains 4, error handling 1, ternaries 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 · extract_svelte_ignore (cognitive 28) · ×1
  • extract_svelte_ignore (cognitive 28) packages/svelte/src/compiler/utils/extract_svelte_ignore.js:28 — extract_svelte_ignore has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (4 pts), other 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 · transitions.transition (cognitive 27) · ×1
  • transitions.transition (cognitive 27) packages/svelte/src/internal/client/dom/elements/transitions.js:193 — transitions.transition has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (7 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EachBlock.EachBlock (cognitive 27) · ×1
  • EachBlock.EachBlock (cognitive 27) packages/svelte/src/compiler/phases/2-analyze/visitors/EachBlock.js:14 — EachBlock.EachBlock has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.sort_const_tags (cognitive 27) · ×1
  • utils.sort_const_tags (cognitive 27) packages/svelte/src/compiler/phases/3-transform/utils.js:21 — utils.sort_const_tags has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 6 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.migrate_css (cognitive 27) · ×1
  • index.migrate_css (cognitive 27) REDACTED:41 — index.migrate_css has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ImportDeclaration (cognitive 27) · ×1
  • ImportDeclaration (cognitive 27) REDACTED:506 — ImportDeclaration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (7 pts), ternaries 1 (5 pts), boolean chains 2, other 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Declaration (cognitive 27) · ×1
  • Declaration (cognitive 27) packages/svelte/src/compiler/phases/3-transform/css/index.js:100 — Declaration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · get_comment_handlers · ×1
  • get_comment_handlers::add_comments::_ (cognitive 27) packages/svelte/src/compiler/phases/1-parse/acorn.js:238 — get_comment_handlers::add_comments::_ has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 10, loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SvelteBoundary (cognitive 27) · ×1
  • SvelteBoundary (cognitive 27) packages/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js:17 — SvelteBoundary has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (11 pts), ternaries 2 (4 pts), other 1 (nesting depth added 5). Of this number, 22 points are the body's own statements and 5 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_assignment (cognitive 27) · ×1
  • build_assignment (cognitive 27) packages/svelte/src/compiler/phases/3-transform/server/visitors/AssignmentExpression.js:26 — build_assignment has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8, ternaries 1 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · await.await_block (cognitive 26) · ×1
  • await.await_block (cognitive 26) packages/svelte/src/internal/client/dom/blocks/await.js:36 — await.await_block has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 4, ternaries 2 (nesting depth added 7). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 54, 77, 114, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · browser-support.detector.walk_source (cognitive 26) · ×1
  • browser-support.detector.walk_source (cognitive 26) packages/svelte/scripts/browser-support.detector.js:291 — browser-support.detector.walk_source has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deep_read (cognitive 26) · ×1
  • deep_read (cognitive 26) packages/svelte/src/internal/client/runtime.js:815 — deep_read has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (8 pts), loops 2 (5 pts), 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.
D2 · Cognitive Complexity · build_bind_this (cognitive 26) · ×1
  • build_bind_this (cognitive 26) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js:245 — build_bind_this has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 7, other 5, boolean chains 3, loops 2 (nesting depth added 3). Of this number, 14 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · IfBlock (cognitive 26) · ×1
  • IfBlock (cognitive 26) packages/svelte/src/compiler/phases/3-transform/client/visitors/IfBlock.js:12 — IfBlock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 3 (5 pts), boolean chains 3, loops 1, other 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 · SnippetBlock (cognitive 26) · ×1
  • SnippetBlock (cognitive 26) packages/svelte/src/compiler/phases/3-transform/client/visitors/SnippetBlock.js:13 — SnippetBlock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 4 (8 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Attribute (cognitive 26) · ×1
  • Attribute (cognitive 26) packages/svelte/src/compiler/phases/2-analyze/visitors/Attribute.js:11 — Attribute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Batch.#traverse (cognitive 25) · ×1
  • Batch.#traverse (cognitive 25) packages/svelte/src/internal/client/reactivity/batch.js:493 — Batch.#traverse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SlotElement.SlotElement (cognitive 25) · ×1
  • SlotElement.SlotElement (cognitive 25) packages/svelte/src/compiler/phases/3-transform/client/visitors/SlotElement.js:12 — SlotElement.SlotElement has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 4 (7 pts), boolean chains 2, loops 1 (nesting depth added 9). Of this number, 21 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validate_aria_attribute_value (cognitive 25) · ×1
  • validate_aria_attribute_value (cognitive 25) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:878 — validate_aria_attribute_value has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, other 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 · process_children (cognitive 25) · ×1
  • process_children (cognitive 25) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.js:36 — process_children has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 3, ternaries 1 (3 pts), other 1 (nesting depth added 8). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to one function item inside it that branches (flush). 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 · visit_assignment_expression (cognitive 25) · ×1
  • visit_assignment_expression (cognitive 25) packages/svelte/src/compiler/phases/3-transform/shared/assignments.js:14 — visit_assignment_expression has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (2 pts), other 1 (nesting depth added 10). Of this number, 22 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bracket.find_matching_bracket (cognitive 24) · ×1
  • bracket.find_matching_bracket (cognitive 24) packages/svelte/src/compiler/phases/1-parse/utils/bracket.js:96 — bracket.find_matching_bracket has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sources.mark_reactions (cognitive 24) · ×1
  • sources.mark_reactions (cognitive 24) packages/svelte/src/internal/client/reactivity/sources.js:354 — sources.mark_reactions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, 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 · template.fragment_from_tree (cognitive 24) · ×1
  • template.fragment_from_tree (cognitive 24) packages/svelte/src/internal/client/dom/template.js:171 — template.fragment_from_tree has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 3 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BranchManager.#commit (cognitive 24) · ×1
  • BranchManager.#commit (cognitive 24) packages/svelte/src/internal/client/dom/blocks/branches.js:76 — BranchManager.#commit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, loops 2 (nesting depth added 8). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.validate_no_const_assignment (cognitive 24) · ×1
  • utils.validate_no_const_assignment (cognitive 24) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js:88 — utils.validate_no_const_assignment has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.is_semantic_role_element (cognitive 24) · ×1
  • index.is_semantic_role_element (cognitive 24) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:663 — index.is_semantic_role_element has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 3 (9 pts), 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.
D2 · Cognitive Complexity · index.has_content (cognitive 24) · ×1
  • index.has_content (cognitive 24) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:803 — index.has_content has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 4, 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 · utils.validate_mutation (cognitive 24) · ×1
  • utils.validate_mutation (cognitive 24) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js:390 — utils.validate_mutation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (8 pts), boolean chains 4, 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 · is_expression_async (cognitive 24) · ×1
  • is_expression_async (cognitive 24) packages/svelte/src/compiler/utils/ast.js:484 — is_expression_async has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (10 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 12 belong to 5 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · (anonymous) (cognitive 24) · ×1
  • (anonymous) (cognitive 24) packages/svelte/src/internal/client/dom/blocks/branches.js:76 — (anonymous) has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, loops 2 (nesting depth added 8). Of this number, 21 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnippetBlock (cognitive 24) · ×1
  • SnippetBlock (cognitive 24) packages/svelte/src/compiler/phases/2-analyze/visitors/SnippetBlock.js:11 — SnippetBlock has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 9, loops 1 (nesting depth added 4). Of this number, 19 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SvelteElement (cognitive 24) · ×1
  • SvelteElement (cognitive 24) packages/svelte/src/compiler/phases/2-analyze/visitors/SvelteElement.js:13 — SvelteElement has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (8 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 11). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css-prune.get_descendant_elements (cognitive 23) · ×1
  • css-prune.get_descendant_elements (cognitive 23) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:918 — css-prune.get_descendant_elements has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · order_reactive_statements (cognitive 23) · ×1
  • order_reactive_statements (cognitive 23) packages/svelte/src/compiler/phases/2-analyze/index.js:1299 — order_reactive_statements has cognitive complexity 23 (threshold 15). Drivers by points: loops 8 (13 pts), if/else 4 (8 pts), other 2 (nesting depth added 9). Of this number, 16 points are the body's own statements and 7 belong to one function item inside it that branches. 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 · get_custom_element_value (cognitive 23) · ×1
  • get_custom_element_value (cognitive 23) packages/svelte/src/internal/client/dom/elements/custom-element.js:234 — get_custom_element_value has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (13 pts), match/switch 2 (4 pts), boolean chains 3, if/else 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 · style.read_value (cognitive 22) · ×1
  • style.read_value (cognitive 22) packages/svelte/src/compiler/phases/1-parse/read/style.js:511 — style.read_value has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CallExpression.CallExpression (cognitive 22) · ×1
  • CallExpression.CallExpression (cognitive 22) packages/svelte/src/compiler/phases/3-transform/server/visitors/CallExpression.js:12 — CallExpression.CallExpression has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 3 (6 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · #merge (cognitive 22) · ×1
  • #merge (cognitive 22) packages/svelte/src/internal/client/reactivity/batch.js:560 — #merge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4, boolean chains 3, error handling 1 (3 pts) (nesting depth added 7). Of this number, 11 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · convert · ×1
  • convert::AwaitBlock (cognitive 22) packages/svelte/src/compiler/legacy.js:116 — convert::AwaitBlock has cognitive complexity 22 (threshold 15). Drivers by points: other 11, error handling 5 (8 pts), if/else 3 (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 · is_pure (cognitive 22) · ×1
  • is_pure (cognitive 22) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js:205 — is_pure has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ensure (cognitive 22) · ×1
  • ensure (cognitive 22) packages/svelte/src/internal/client/dom/blocks/branches.js:186 — ensure has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · get_prop_source (cognitive 22) · ×1
  • get_prop_source (cognitive 22) packages/svelte/src/compiler/phases/3-transform/client/utils.js:54 — get_prop_source has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · log_entry (cognitive 22) · ×1
  • log_entry (cognitive 22) packages/svelte/src/internal/client/dev/tracing.js:21 — log_entry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (6 pts), boolean chains 4, ternaries 4 (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 · init_array_prototype_warnings (cognitive 22) · ×1
  • init_array_prototype_warnings (cognitive 22) packages/svelte/src/internal/client/dev/equality.js:4 — init_array_prototype_warnings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts), other 3 (nesting depth added 9). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 4 function items inside it that branch (lastIndexOf, indexOf, includes, …). 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 · script.read_script (cognitive 21) · ×1
  • script.read_script (cognitive 21) packages/svelte/src/compiler/phases/1-parse/read/script.js:23 — script.read_script has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fragment.is_static_element (cognitive 21) · ×1
  • fragment.is_static_element (cognitive 21) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/fragment.js:141 — fragment.is_static_element has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · element.build_attribute_effect (cognitive 21) · ×1
  • element.build_attribute_effect (cognitive 21) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:22 — element.build_attribute_effect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, ternaries 1 (4 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.attributes (cognitive 21) · ×1
  • index.attributes (cognitive 21) packages/svelte/src/compiler/print/index.js:143 — index.attributes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 159). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · special (cognitive 21) · ×1
  • special (cognitive 21) packages/svelte/src/compiler/phases/1-parse/state/tag.js:712 — special has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · html-tree-validation.is_tag_valid_with_parent (cognitive 20) · ×1
  • html-tree-validation.is_tag_valid_with_parent (cognitive 20) packages/svelte/src/html-tree-validation.js:184 — html-tree-validation.is_tag_valid_with_parent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, ternaries 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 · attributes.attribute_effect (cognitive 20) · ×1
  • attributes.attribute_effect (cognitive 20) packages/svelte/src/internal/client/dom/elements/attributes.js:512 — attributes.attribute_effect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 2 (nesting depth added 7). Most of this is not in the body itself: 0 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 532, 522, 577). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Text.Text (cognitive 20) · ×1
  • Text.Text (cognitive 20) packages/svelte/src/compiler/phases/2-analyze/visitors/Text.js:13 — Text.Text has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · element.build_set_class (cognitive 20) · ×1
  • element.build_set_class (cognitive 20) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:157 — element.build_set_class has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, ternaries 2 (nesting depth added 2). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · create_scopes · ×1
  • create_scopes::AwaitBlock (cognitive 20) packages/svelte/src/compiler/phases/scope.js:1294 — create_scopes::AwaitBlock has cognitive complexity 20 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 5 (7 pts), loops 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · loop_child (cognitive 20) · ×1
  • loop_child (cognitive 20) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:1212 — loop_child has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · element.read_attribute_value (cognitive 19) · ×1
  • element.read_attribute_value (cognitive 19) packages/svelte/src/compiler/phases/1-parse/state/element.js:791 — element.read_attribute_value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 2 (3 pts), error handling 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 · debug.log_effect_tree (cognitive 19) · ×1
  • debug.log_effect_tree (cognitive 19) packages/svelte/src/internal/client/dev/debug.js:75 — debug.log_effect_tree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ImportDeclaration.ImportDeclaration (cognitive 19) · ×1
  • ImportDeclaration.ImportDeclaration (cognitive 19) packages/svelte/src/compiler/phases/2-analyze/visitors/ImportDeclaration.js:9 — ImportDeclaration.ImportDeclaration has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · infinite_loop_guard (cognitive 19) · ×1
  • infinite_loop_guard (cognitive 19) packages/svelte/src/internal/client/reactivity/batch.js:1063 — infinite_loop_guard has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 pts), error handling 1, other 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 · boundary (cognitive 19) · ×1
  • boundary (cognitive 19) packages/svelte/src/internal/server/renderer.js:329 — boundary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3 (6 pts), other 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 · update_dependencies (cognitive 19) · ×1
  • update_dependencies (cognitive 19) packages/svelte/src/internal/client/runtime.js:331 — update_dependencies has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (6 pts), boolean chains 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 · Rule (cognitive 19) · ×1
  • Rule (cognitive 19) packages/svelte/src/compiler/phases/3-transform/css/index.js:138 — Rule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), 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 · AwaitBlock (cognitive 19) · ×1
  • AwaitBlock (cognitive 19) packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitBlock.js:14 — AwaitBlock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 2 (4 pts), boolean chains 3, other 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · read_profile (cognitive 19) · ×1
  • read_profile (cognitive 19) benchmarking/compare/profile-diff.mjs:19 — read_profile has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (6 pts), boolean chains 4, if/else 2 (4 pts), other 3, loops 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 · html-tree-validation.is_tag_valid_with_ancestor (cognitive 18) · ×1
  • html-tree-validation.is_tag_valid_with_ancestor (cognitive 18) packages/svelte/src/html-tree-validation.js:144 — html-tree-validation.is_tag_valid_with_ancestor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · class.set_class (cognitive 18) · ×1
  • class.set_class (cognitive 18) packages/svelte/src/internal/client/dom/elements/class.js:14 — class.set_class has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · input.bind_group (cognitive 18) · ×1
  • input.bind_group (cognitive 18) packages/svelte/src/internal/client/dom/elements/bindings/input.js:135 — input.bind_group has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 168, 206, 154, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SlotElement.SlotElement (cognitive 18) · ×1
  • SlotElement.SlotElement (cognitive 18) packages/svelte/src/compiler/phases/2-analyze/visitors/SlotElement.js:12 — SlotElement.SlotElement has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, 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 · StyleDirective.StyleDirective (cognitive 18) · ×1
  • StyleDirective.StyleDirective (cognitive 18) packages/svelte/src/compiler/phases/2-analyze/visitors/StyleDirective.js:11 — StyleDirective.StyleDirective has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassBody.ClassBody (cognitive 18) · ×1
  • ClassBody.ClassBody (cognitive 18) packages/svelte/src/compiler/phases/3-transform/server/visitors/ClassBody.js:10 — ClassBody.ClassBody has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, 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 · PropertyDefinition.PropertyDefinition (cognitive 18) · ×1
  • PropertyDefinition.PropertyDefinition (cognitive 18) packages/svelte/src/compiler/phases/3-transform/server/visitors/PropertyDefinition.js:10 — PropertyDefinition.PropertyDefinition has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 3 (5 pts), boolean chains 3 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · template.objectify (cognitive 18) · ×1
  • template.objectify (cognitive 18) packages/svelte/src/compiler/phases/3-transform/client/transform-template/template.js:121 — template.objectify has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (6 pts), boolean chains 2, 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 · index.transform_template (cognitive 18) · ×1
  • index.transform_template (cognitive 18) packages/svelte/src/compiler/phases/3-transform/client/transform-template/index.js:38 — index.transform_template has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _ (cognitive 18) · ×1
  • _ (cognitive 18) packages/svelte/src/compiler/phases/2-analyze/index.js:94 — _ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (5 pts), boolean chains 2, ternaries 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 · read_declaration (cognitive 18) · ×1
  • read_declaration (cognitive 18) packages/svelte/src/compiler/phases/1-parse/state/tag.js:71 — read_declaration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, other 2, ternaries 1 (2 pts), error handling 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 · object (cognitive 18) · ×1
  • object (cognitive 18) packages/svelte/src/compiler/validate-options.js:234 — object has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), boolean chains 3, loops 2 (nesting depth added 7). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 235). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · deriveds.update_derived (cognitive 17) · ×1
  • deriveds.update_derived (cognitive 17) packages/svelte/src/internal/client/reactivity/deriveds.js:390 — deriveds.update_derived has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · effects.pause_children (cognitive 17) · ×1
  • effects.pause_children (cognitive 17) packages/svelte/src/internal/client/reactivity/effects.js:644 — effects.pause_children has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.writable (cognitive 17) · ×1
  • index.writable (cognitive 17) packages/svelte/src/store/shared/index.js:34 — index.writable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 8). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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-prune.is_global (cognitive 17) · ×1
  • css-prune.is_global (cognitive 17) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:395 — css-prune.is_global has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnippetBlock.can_hoist_snippet (cognitive 17) · ×1
  • SnippetBlock.can_hoist_snippet (cognitive 17) packages/svelte/src/compiler/phases/2-analyze/visitors/SnippetBlock.js:86 — SnippetBlock.can_hoist_snippet has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.is_empty (cognitive 17) · ×1
  • index.is_empty (cognitive 17) packages/svelte/src/compiler/phases/3-transform/css/index.js:431 — index.is_empty has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · element.build_attr_style (cognitive 17) · ×1
  • element.build_attr_style (cognitive 17) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:540 — element.build_attr_style has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · decode_sourcemap.decoded_sourcemap_from_generator (cognitive 17) · ×1
  • decode_sourcemap.decoded_sourcemap_from_generator (cognitive 17) packages/svelte/src/compiler/preprocess/decode_sourcemap.js:11 — decode_sourcemap.decoded_sourcemap_from_generator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pause_effects (cognitive 17) · ×1
  • pause_effects (cognitive 17) packages/svelte/src/internal/client/dom/blocks/each.js:66 — pause_effects has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 80). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · #handle_error (cognitive 17) · ×1
  • #handle_error (cognitive 17) packages/svelte/src/internal/client/dom/blocks/boundary.js:494 — #handle_error has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 5, error handling 2 (3 pts) (nesting depth added 1). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 7 function items inside it that branch ((anonymous), handle_error_result, handle_error_result::(anonymous), …). 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 · apply_default_select_value (cognitive 17) · ×1
  • apply_default_select_value (cognitive 17) packages/svelte/src/internal/client/dom/elements/bindings/select.js:43 — apply_default_select_value has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (4 pts), loops 2 (3 pts), boolean chains 2, other 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 · CallExpression (cognitive 17) · ×1
  • CallExpression (cognitive 17) packages/svelte/src/compiler/phases/3-transform/client/visitors/CallExpression.js:12 — CallExpression has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (6 pts), ternaries 2 (4 pts), match/switch 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.remove_reaction (cognitive 16) · ×1
  • runtime.remove_reaction (cognitive 16) packages/svelte/src/internal/client/runtime.js:373 — runtime.remove_reaction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuzzySet.__get (cognitive 16) · ×1
  • FuzzySet.__get (cognitive 16) packages/svelte/src/compiler/utils/fuzzymatch.js:213 — FuzzySet.__get has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (7 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AwaitBlock.AwaitBlock (cognitive 16) · ×1
  • AwaitBlock.AwaitBlock (cognitive 16) REDACTED:11 — AwaitBlock.AwaitBlock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.build_template (cognitive 16) · ×1
  • utils.build_template (cognitive 16) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.js:122 — utils.build_template has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenderTag.RenderTag (cognitive 16) · ×1
  • RenderTag.RenderTag (cognitive 16) packages/svelte/src/compiler/phases/3-transform/client/visitors/RenderTag.js:12 — RenderTag.RenderTag has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), 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.
D2 · Cognitive Complexity · generate-browser-support.versions_from_features (cognitive 16) · ×1
  • generate-browser-support.versions_from_features (cognitive 16) packages/svelte/scripts/generate-browser-support.ts:365 — generate-browser-support.versions_from_features has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 1, ternaries 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 · read_identifier (cognitive 16) · ×1
  • read_identifier (cognitive 16) packages/svelte/src/compiler/phases/1-parse/read/style.js:610 — read_identifier has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 1 (4 pts), 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 · #init (cognitive 16) · ×1
  • #init (cognitive 16) packages/svelte/src/reactivity/date.js:62 — #init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 1, loops 1 (nesting depth added 9). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 75, 92, 113). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D3 · God Classes · MethodTooLong · ×1
  • MethodTooLong: Evaluation.constructor packages/svelte/src/compiler/phases/scope.js:262 — MethodTooLong — constructor runs 222 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D3 · God Classes · TooManyMethods · ×1
  • TooManyMethods: Renderer packages/svelte/src/internal/server/renderer.js:116 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D3 · God Classes · ClassTooLong · ×1
  • ClassTooLong: Batch packages/svelte/src/internal/client/reactivity/batch.js:97 — ClassTooLong — 401 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 1 over it, 1.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
M1 · Documentation (README) · README may be stale · ×1
  • README may be stale — 189 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.
R10 · Code Duplication · Duplication concentrated across 2 sibling directories (17 clone groups) · ×1
  • Duplication concentrated across 2 sibling directories (17 clone groups) packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16 — 17 duplicated blocks under packages/svelte/src/compiler/phases/3-transform/ have copies in at least two of the sibling directories client, server — 16 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 17 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (132 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (132 matched lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16 — packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16 · packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js:15 — the two spans are one implementation copied and then locally edited — 935 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (120 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (120 matched lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:71 — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:71 · packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/component.js:51 — the two spans are one implementation copied and then locally edited — 835 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (64 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (64 matched lines × 2 locations) packages/svelte/src/reactivity/map.js:53 — packages/svelte/src/reactivity/map.js:53 · packages/svelte/src/reactivity/set.js:47 — the two spans are one implementation copied and then locally edited — 335 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (44 lines × 2 locations) · ×1
  • Duplicated block (44 lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/DeclarationTag.js:27 — packages/svelte/src/compiler/phases/3-transform/client/visitors/DeclarationTag.js:27 · packages/svelte/src/compiler/phases/3-transform/server/visitors/DeclarationTag.js:22 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (32 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (32 matched lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/ClassBody.js:13 — packages/svelte/src/compiler/phases/3-transform/client/visitors/ClassBody.js:13 · packages/svelte/src/compiler/phases/3-transform/server/visitors/ClassBody.js:10 — the two spans are one implementation copied and then locally edited — 234 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (30 lines × 2 locations) · ×1
  • Duplicated block (30 lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:106 — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:106 · packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:65 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (26 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (26 matched lines × 2 locations) packages/svelte/src/motion/tweened.js:109 — packages/svelte/src/motion/tweened.js:109 · packages/svelte/src/motion/tweened.js:239 — the two spans are one implementation copied and then locally edited — 116 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (24 lines × 2 locations) · ×1
  • Duplicated block (24 lines × 2 locations) packages/svelte/src/reactivity/map.js:96 — packages/svelte/src/reactivity/map.js:96 · packages/svelte/src/reactivity/map.js:131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×1
  • Duplicated block (21 lines × 2 locations) packages/svelte/src/compiler/utils/ast.js:300 — packages/svelte/src/compiler/utils/ast.js:300 · packages/svelte/src/compiler/utils/ast.js:357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (20 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (20 matched lines × 2 locations) REDACTED:13 — REDACTED:13 · packages/svelte/scripts/generate-browser-support.ts:293 — the two spans are one implementation copied and then locally edited — 92 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/HtmlTag.js:40 — packages/svelte/src/compiler/phases/3-transform/client/visitors/HtmlTag.js:40 · packages/svelte/src/compiler/phases/3-transform/client/visitors/KeyBlock.js:26 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (19 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (19 matched lines × 2 locations) packages/svelte/src/index-client.js:157 — packages/svelte/src/index-client.js:157 · packages/svelte/src/legacy/legacy-client.js:250 — the two spans are one implementation copied and then locally edited — 96 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) packages/svelte/src/internal/client/context.js:67 — packages/svelte/src/internal/client/context.js:67 · packages/svelte/src/internal/server/context.js:7 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×1
  • Duplicated block (16 lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/TransitionDirective.js:20 — packages/svelte/src/compiler/phases/3-transform/client/visitors/TransitionDirective.js:20 · packages/svelte/src/compiler/phases/3-transform/client/visitors/UseDirective.js:26 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (14 lines × 5 locations) · ×1
  • Duplicated block (14 lines × 5 locations) packages/svelte/src/compiler/legacy.js:479 — packages/svelte/src/compiler/legacy.js:479 · packages/svelte/src/compiler/legacy.js:494 · packages/svelte/src/compiler/legacy.js:543 · packages/svelte/src/compiler/legacy.js:557 · +1 more site(s) not listed — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block with local edits (14 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (14 matched lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js:16 — packages/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js:16 · packages/svelte/src/compiler/phases/3-transform/server/visitors/AssignmentExpression.js:8 — the two spans are one implementation copied and then locally edited — 121 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (14 lines × 4 locations) · ×1
  • Duplicated block (14 lines × 4 locations) packages/svelte/src/compiler/print/index.js:706 — packages/svelte/src/compiler/print/index.js:706 · packages/svelte/src/compiler/print/index.js:804 · packages/svelte/src/compiler/print/index.js:976 · packages/svelte/src/compiler/print/index.js:1147 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (13 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (13 matched lines × 2 locations) packages/svelte/src/compiler/phases/3-transform/client/visitors/Fragment.js:10 — packages/svelte/src/compiler/phases/3-transform/client/visitors/Fragment.js:10 · packages/svelte/src/compiler/phases/3-transform/server/visitors/Fragment.js:5 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity · Complex function check_element (cyclomatic 181, cognitive 243) · ×1
  • Complex function check_element (cyclomatic 181, cognitive 243) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:56 — check_element has cyclomatic complexity 181 and cognitive complexity 243; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function analyze_component (cyclomatic 163, cognitive 360) · ×1
  • Complex function analyze_component (cyclomatic 163, cognitive 360) packages/svelte/src/compiler/phases/2-analyze/index.js:333 — analyze_component has cyclomatic complexity 163 and cognitive complexity 360; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function RegularElement (cyclomatic 124, cognitive 167) · ×1
  • Complex function RegularElement (cyclomatic 124, cognitive 167) packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:38 — RegularElement has cyclomatic complexity 124 and cognitive complexity 167; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function constructor (cyclomatic 107, cognitive 131) · ×1
  • Complex function constructor (cyclomatic 107, cognitive 131) packages/svelte/src/compiler/phases/scope.js:262 — constructor has cyclomatic complexity 107 and cognitive complexity 131; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function client_component (cyclomatic 90, cognitive 134) · ×1
  • Complex function client_component (cyclomatic 90, cognitive 134) packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:135 — client_component has cyclomatic complexity 90 and cognitive complexity 134; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function element (cyclomatic 89, cognitive 150) · ×1
  • Complex function element (cyclomatic 89, cognitive 150) packages/svelte/src/compiler/phases/1-parse/state/element.js:65 — element has cyclomatic complexity 89 and cognitive complexity 150; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function CallExpression (cyclomatic 79, cognitive 84) · ×1
  • Complex function CallExpression (cyclomatic 79, cognitive 84) packages/svelte/src/compiler/phases/2-analyze/visitors/CallExpression.js:16 — CallExpression has cyclomatic complexity 79 and cognitive complexity 84; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function build_component (cyclomatic 78, cognitive 150) · ×1
  • Complex function build_component (cyclomatic 78, cognitive 150) packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:19 — build_component has cyclomatic complexity 78 and cognitive complexity 150; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function BindDirective (cyclomatic 76, cognitive 57) · ×1
  • Complex function BindDirective (cyclomatic 76, cognitive 57) packages/svelte/src/compiler/phases/3-transform/client/visitors/BindDirective.js:15 — BindDirective has cyclomatic complexity 76 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function run_test_variant (cyclomatic 74, cognitive 119) · ×1
  • Complex function run_test_variant (cyclomatic 74, cognitive 119) packages/svelte/tests/runtime-legacy/shared.ts:272 — run_test_variant has cyclomatic complexity 74 and cognitive complexity 119; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function migrate (cyclomatic 73, cognitive 130) · ×1
  • Complex function migrate (cyclomatic 73, cognitive 130) REDACTED:124 — migrate has cyclomatic complexity 73 and cognitive complexity 130; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function BindDirective (cyclomatic 72, cognitive 132) · ×1
  • Complex function BindDirective (cyclomatic 72, cognitive 132) packages/svelte/src/compiler/phases/2-analyze/visitors/BindDirective.js:20 — BindDirective has cyclomatic complexity 72 and cognitive complexity 132; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function build_element_attributes (cyclomatic 71, cognitive 136) · ×1
  • Complex function build_element_attributes (cyclomatic 71, cognitive 136) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:36 — build_element_attributes has cyclomatic complexity 71 and cognitive complexity 136; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function set_attributes (cyclomatic 71, cognitive 113) · ×1
  • Complex function set_attributes (cyclomatic 71, cognitive 113) packages/svelte/src/internal/client/dom/elements/attributes.js:271 — set_attributes has cyclomatic complexity 71 and cognitive complexity 113; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function VariableDeclaration (cyclomatic 68, cognitive 229) · ×1
  • Complex function VariableDeclaration (cyclomatic 68, cognitive 229) packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js:16 — VariableDeclaration has cyclomatic complexity 68 and cognitive complexity 229; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function clean_nodes (cyclomatic 68, cognitive 70) · ×1
  • Complex function clean_nodes (cyclomatic 68, cognitive 70) packages/svelte/src/compiler/phases/3-transform/utils.js:126 — clean_nodes has cyclomatic complexity 68 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function Identifier (cyclomatic 66, cognitive 107) · ×1
  • Complex function Identifier (cyclomatic 66, cognitive 107) packages/svelte/src/compiler/phases/2-analyze/visitors/Identifier.js:15 — Identifier has cyclomatic complexity 66 and cognitive complexity 107; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function relative_selector_might_apply_to_node (cyclomatic 64, cognitive 142) · ×1
  • Complex function relative_selector_might_apply_to_node (cyclomatic 64, cognitive 142) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:447 — relative_selector_might_apply_to_node has cyclomatic complexity 64 and cognitive complexity 142; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function RegularElement (cyclomatic 60, cognitive 106) · ×1
  • Complex function RegularElement (cyclomatic 60, cognitive 106) packages/svelte/src/compiler/phases/2-analyze/visitors/RegularElement.js:26 — RegularElement has cyclomatic complexity 60 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function build_assignment (cyclomatic 60, cognitive 74) · ×1
  • Complex function build_assignment (cyclomatic 60, cognitive 74) packages/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js:47 — build_assignment has cyclomatic complexity 60 and cognitive complexity 74; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · Large Files · ×1
  • Large Files — 33 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: packages/svelte/src/compiler/phases/1-parse/utils/entities.js (2234), REDACTED (1829), packages/svelte/src/compiler/phases/scope.js (1316), packages/svelte/src/internal/client/reactivity/batch.js (1227), packages/svelte/src/compiler/phases/2-analyze/index.js (1205), packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js (1088) (+27 more).
R6 · Tooling · The declared test suite includes a file that cannot be loaded · ×1
  • The declared test suite includes a file that cannot be loaded packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression/main.svelte — This repository declares test tooling, and the ✓ above records that declaration — but packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression/main.svelte and 56 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
R7 · Dead Code · Dead file (~429 LoC) · ×1
  • Dead file (~429 LoC) packages/svelte/scripts/process-messages/index.js — no import path from any entry point (56 application, 44 tooling, 7491 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~67 LoC) · ×1
  • Dead file (~67 LoC) benchmarking/compare/runner.js — no import path from any entry point (56 application, 44 tooling, 7491 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~24 LoC) · ×1
  • Dead file (~24 LoC) benchmarking/benchmarks/ssr/wrapper/App.svelte — no import path from any entry point (56 application, 44 tooling, 7491 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~19 LoC) · ×1
  • Dead file (~19 LoC) vitest-xhtml-environment.ts — no import path from any entry point (56 application, 44 tooling, 7491 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Minor — 25 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X10 · Duplicated predicate · Duplicated predicate · ×3
  • Duplicated predicate packages/svelte/src/compiler/phases/2-analyze/visitors/SvelteBody.js:15 — `attribute.type === 'Attribute' && is_event_attribute(attribute)` appears character-identically in 3 files — packages/svelte/src/compiler/phases/2-analyze/visitors/SvelteBody.js, packages/svelte/src/compiler/phases/2-analyze/visitors/SvelteDocument.js, packages/svelte/src/compiler/phases/2-analyze/visitors/SvelteWindow.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:677 — `is_ignored(element, 'hydration_attribute_changed') && b.true` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js, packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/svelte/src/compiler/phases/3-transform/client/visitors/CallExpression.js:62 — `is_ignored(node, 'state_snapshot_uncloneable') && b.true` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/visitors/CallExpression.js, packages/svelte/src/compiler/phases/3-transform/server/visitors/CallExpression.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D19 · Documentation Quality · Documentation · ×2
  • Documentation: no project overview README.md — The overview begins with 'What is Svelte?' and links to the Svelte website, but it never states what the repository's purpose is or how readers can use the codebase (e.g. whether it compiles SvelteKit apps). Add a one-line description of what the repository does under the heading 'What this project provides' so an outsider can read it without leaving the README.
  • Documentation: no installation or build instructions README.md — There are no installation, build, or setup instructions in any document. Add a one-line install/dependencies line and a short 'how to get started' note under the overview so readers can run the repo without leaving the README.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — An a11y linter is configured (Documented) but there's no automated a11y test or CI gate. Add vitest-axe to verify at runtime, then gate it in CI. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 2 significant file(s) lose their only recent owner: benchmarking/utils.js, benchmarking/compare/profile-diff.mjs. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (4 single-owned of 167 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 167 of the 380 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D26 · Project Cohesion · Split packages/svelte · ×1
  • Split packages/svelte — A Svelte compiler and dev tool project whose namespaces are all named phases/visitors/shared/client/reactivity/server/dom/elements with no cohesive name. Suggested:
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 2 of 167 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 167 of the 380 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: packages/svelte/src/store/shared/index.js, packages/svelte/src/compiler/preprocess/decode_sourcemap.js. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 14500 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
R7 · Dead Code · Unused export 'log_reactions' · ×1
  • Unused export 'log_reactions' packages/svelte/src/internal/client/dev/debug.js:189 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'log_inconsistent_branches' · ×1
  • Unused export 'log_inconsistent_branches' packages/svelte/src/internal/client/dev/debug.js:356 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'not_equal' · ×1
  • Unused export 'not_equal' packages/svelte/src/internal/client/reactivity/equality.js:24 — Nothing imports this binding — it is safe to review for removal.
Minor — 4826 finding(s)
D10 · Test Quality · Skipped (documented) · ×4820
  • Skipped (documented): [SKIP] ${cwd} packages/svelte/tests/suite.ts:103 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skip
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/attribute-empty/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression-2/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/attribute-sequence-expression/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/attribute-unique-binding/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/attribute-unique-class/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/attribute-unique-shorthand/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/attribute-unique-style/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/attribute-unique/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/catch-before-closing/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/catch-without-await/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/class-state-field-static/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/comment-unclosed/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-invalid-name/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-2/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-3/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-4/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-5/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error-6/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-slot-duplicate-error/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-2/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-slot-nested-error-3/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/component-slot-nested-error/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/const-tag-cyclical/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/svelte/tests/compiler-errors/samples/const-tag-sequence/_config.js:3 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • + 4795 more in this group — see findings.md.
D12 · Dependency Hygiene · Outdated (npm) · ×6
  • Outdated (npm): aria-query — aria-query is pinned at 5.3.1; registry.npmjs.org publishes 5.3.2 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): devalue — devalue is pinned at 5.9.2; registry.npmjs.org publishes 6.0.2 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): esm-env — esm-env is pinned at 1.2.1; registry.npmjs.org publishes 1.2.2 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): esrap — esrap is pinned at 2.3.6; registry.npmjs.org publishes 2.4.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): magic-string — magic-string is pinned at 0.30.21; registry.npmjs.org publishes 1.4.2 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): zimmerframe — zimmerframe is pinned at 1.1.2; registry.npmjs.org publishes 1.1.5 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-fffb365f68a84975bf41f7c49ea3eb02/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-fffb365f68a84975bf41f7c49ea3eb02/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .10artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update21artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 10 file(s) — `packages/svelte/elements.d.ts`, `packages/svelte/src/compiler/phases/1-parse/index.js`, `packages/svelte/src/compiler/phases/2-analyze/types.d.ts`, `packages/svelte/src/compiler/phases/3-transform/client/types.d.ts`, `packages/svelte/src/compiler/phases/3-transform/server/types.d.ts`, … (+5 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a0f80f-788b-798d-98e6-dbce21e889c1 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md