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

sveltejs/svelte

Measured 15 November 2026, 04:37 UTC, at code version e129e22

First survey, so nothing to compare with yet
CAI score 61out of 100 At risk

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

A medium codebase: 57,714 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 1.3 person-years · Weakest lens: Performance, 60

Findings by how serious they are

29 critical 644 serious 5030 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
15 November 2026, 04:37 UTC

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

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

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

65of 65 dimensions measured by tools.
5685of 5703 findings point to an exact file and line, so you can open each one in the code. The other 18 concern the repository as a whole, such as missing documentation.
65dimensions across 7 lenses, read from 57,714 lines of product code in 2 projects.
Chapters

Executive summary

sveltejs/svelte is rated At risk because critical security findings are open, most of them in the packages it uses. It scores 61 out of 100, which the At risk rating leaves unchanged.

Performance, at 60, is the weakest lens by a small margin, and the weakest lens counts most in the score. The best first step is removing the blocking calls, worth about 2 points. Simplifying the hardest methods comes next, worth about 1.0 points.

Fifteen known security holes in the packages the code depends on can be used by attackers. Five pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and one automatic update takes new releases before a bad one can be spotted. Updating the vulnerable packages, pinning each tool to an exact version and setting a waiting period for automatic updates would close these risks. Fixing the weaknesses the scanner points to would fix the security weakness in the code. The six loops of files that import each other need breaking.

The product code is 57,714 lines, about €190,000 to rebuild.

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

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

The weakest lenses score close to each other, so improving any of them moves the score.

Code composition: what the lines of code are
Product code 33%Tests 67%
Rebuild cost: about €190,000 · Estimate
Cost to rebuild€64,000 to €320,000, for 1,062 to 3,369 hours of work, about 1.3 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 61. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 57,714 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
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.
Raises the score by about 2 points · Medium effort · Async & latency hygiene
2
Bring the 209 bodies over 15 down to 15 or less in Cognitive Complexity — start with analyze_component (cognitive 385), VariableDeclaration (cognitive 266), check_element (cognitive 257).
Raises the score by about 1.0 points · High effort · Cognitive Complexity
3
Bring the 52 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with check_element (cyclomatic 195), analyze_component (cyclomatic 181), RegularElement (cyclomatic 136).
Raises the score by about 0.8 points · High effort · Cyclomatic Complexity

Diagnosis: what the measurements show together

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

Files that change often carry extra risk · Combined risk
One file is changed often and is hard to read, which makes it the likeliest place for a mistake. It also has under half its code tested, or was written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to this file therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (11 files) · Code Coverage (11 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: REDACTED
What to do: Add tests to these files and have a second person review every change to them, starting with REDACTED.
Where the investment is most exposed · Value at risk
This code would cost about €190,000 to build again, about 1.3 person-years of work. Its weakest lens is Performance, at 60 (Adequate). Performance is about whether the code is written and measured with speed in mind. Because the weakest lens counts most in the score, work on Performance also moves the score most.
Based on: the rebuild estimate · the Performance grade · how much each lens counts
What to do: Start with the Performance actions in Top priorities.
If you do one thing first · First action
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. Of all the actions in this report, it raises the score most for the work it takes: about 2 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 4.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 8% to 19% on every change. The history of the code shows how much it changes: about 13,451 lines over the last 90 days, which is about 54,551 lines a year. At that pace, the extra work comes to an estimated 11.4 to 68.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

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

75 modules, with 4 dependencies between them. Every module uses only modules listed above it, so there are no loops.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 benchmarking2 benchmarking.compare3 packages.svelte.scripts.generate-browser-support4 packages.svelte.scripts.process-messages.templates5 packages.svelte.scripts.process-messages.templates.compile-errors6 packages.svelte.src7 packages.svelte.src.compiler8 packages.svelte.src.compiler.errors9 packages.svelte.src.compiler.migrate10 packages.svelte.src.compiler.phases11 packages.svelte.src.compiler.phases.1-parse12 packages.svelte.src.compiler.phases.1-parse.read13 packages.svelte.src.compiler.phases.1-parse.state14 packages.svelte.src.compiler.phases.1-parse.utils15 packages.svelte.src.compiler.phases.2-analyze.css16 packages.svelte.src.compiler.phases.2-analyze.visitors17 packages.svelte.src.compiler.phases.2-analyze.visitors.shared18 packages.svelte.src.compiler.phases.2-analyze.visitors.shared.a11y19 packages.svelte.src.compiler.phases.3-transform20 packages.svelte.src.compiler.phases.3-transform.client21 packages.svelte.src.compiler.phases.3-transform.client.transform-template22 packages.svelte.src.compiler.phases.3-transform.client.transform-template.template23 packages.svelte.src.compiler.phases.3-transform.client.visitors24 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared25 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared.utils26 packages.svelte.src.compiler.phases.3-transform.server27 packages.svelte.src.compiler.phases.3-transform.server.visitors28 packages.svelte.src.compiler.phases.3-transform.server.visitors.shared29 packages.svelte.src.compiler.phases.3-transform.server.visitors.shared.utils30 packages.svelte.src.compiler.phases.3-transform.shared31 packages.svelte.src.compiler.phases.nodes32 packages.svelte.src.compiler.phases.scope33 packages.svelte.src.compiler.preprocess34 packages.svelte.src.compiler.utils35 packages.svelte.src.compiler.utils.compile_diagnostic36 packages.svelte.src.reactivity.reactive-value37 packages.svelte.scripts38 packages.svelte.scripts.process-messages.templates.compile-warnings39 packages.svelte.src.compiler.warnings40 packages.svelte.src.reactivity.media-query
1 benchmarking
2 benchmarking.compare
3 packages.svelte.scripts.generate-browser-support
4 packages.svelte.scripts.process-messages.templates
5 packages.svelte.scripts.process-messages.templates.compile-errors
6 packages.svelte.src
7 packages.svelte.src.compiler
8 packages.svelte.src.compiler.errors
9 packages.svelte.src.compiler.migrate
10 packages.svelte.src.compiler.phases
11 packages.svelte.src.compiler.phases.1-parse
12 packages.svelte.src.compiler.phases.1-parse.read
13 packages.svelte.src.compiler.phases.1-parse.state
14 packages.svelte.src.compiler.phases.1-parse.utils
15 packages.svelte.src.compiler.phases.2-analyze.css
16 packages.svelte.src.compiler.phases.2-analyze.visitors
17 packages.svelte.src.compiler.phases.2-analyze.visitors.shared
18 packages.svelte.src.compiler.phases.2-analyze.visitors.shared.a11y
19 packages.svelte.src.compiler.phases.3-transform
20 packages.svelte.src.compiler.phases.3-transform.client
21 packages.svelte.src.compiler.phases.3-transform.client.transform-template
22 packages.svelte.src.compiler.phases.3-transform.client.transform-template.template
23 packages.svelte.src.compiler.phases.3-transform.client.visitors
24 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared
25 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared.utils
26 packages.svelte.src.compiler.phases.3-transform.server
27 packages.svelte.src.compiler.phases.3-transform.server.visitors
28 packages.svelte.src.compiler.phases.3-transform.server.visitors.shared
29 packages.svelte.src.compiler.phases.3-transform.server.visitors.shared.utils
30 packages.svelte.src.compiler.phases.3-transform.shared
31 packages.svelte.src.compiler.phases.nodes
32 packages.svelte.src.compiler.phases.scope
33 packages.svelte.src.compiler.preprocess
34 packages.svelte.src.compiler.utils
35 packages.svelte.src.compiler.utils.compile_diagnostic
36 packages.svelte.src.reactivity.reactive-value
37 packages.svelte.scripts1
38 packages.svelte.scripts.process-messages.templates.compile-warnings1
39 packages.svelte.src.compiler.warnings1
40 packages.svelte.src.reactivity.media-query1
Uses a module listed above itPart of a loopThe module itself
1 benchmarking2 benchmarking.compare3 packages.svelte.scripts.generate-browser-support4 packages.svelte.scripts.process-messages.templates5 packages.svelte.scripts.process-messages.templates.compile-errors6 packages.svelte.src7 packages.svelte.src.compiler8 packages.svelte.src.compiler.errors9 packages.svelte.src.compiler.migrate10 packages.svelte.src.compiler.phases11 packages.svelte.src.compiler.phases.1-parse12 packages.svelte.src.compiler.phases.1-parse.read13 packages.svelte.src.compiler.phases.1-parse.state14 packages.svelte.src.compiler.phases.1-parse.utils15 packages.svelte.src.compiler.phases.2-analyze.css16 packages.svelte.src.compiler.phases.2-analyze.visitors17 packages.svelte.src.compiler.phases.2-analyze.visitors.shared18 packages.svelte.src.compiler.phases.2-analyze.visitors.shared.a11y19 packages.svelte.src.compiler.phases.3-transform20 packages.svelte.src.compiler.phases.3-transform.client21 packages.svelte.src.compiler.phases.3-transform.client.transform-template22 packages.svelte.src.compiler.phases.3-transform.client.transform-template.template23 packages.svelte.src.compiler.phases.3-transform.client.visitors24 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared25 packages.svelte.src.compiler.phases.3-transform.client.visitors.shared.utils26 packages.svelte.src.compiler.phases.3-transform.server27 packages.svelte.src.compiler.phases.3-transform.server.visitors28 packages.svelte.src.compiler.phases.3-transform.server.visitors.shared29 packages.svelte.src.compiler.phases.3-transform.server.visitors.shared.utils30 packages.svelte.src.compiler.phases.3-transform.shared31 packages.svelte.src.compiler.phases.nodes32 packages.svelte.src.compiler.phases.scope33 packages.svelte.src.compiler.preprocess34 packages.svelte.src.compiler.utils35 packages.svelte.src.compiler.utils.compile_diagnostic36 packages.svelte.src.reactivity.reactive-value37 packages.svelte.scripts38 packages.svelte.scripts.process-messages.templates.compile-warnings39 packages.svelte.src.compiler.warnings40 packages.svelte.src.reactivity.media-querybenchmarking1benchmarking.compare2packages.svelte.scripts.generate-browser-support3packages.svelte.scripts.process-messages.templates4packages.svelte.scripts.process-messages.templates.compile-errors5packages.svelte.src6packages.svelte.src.compiler7packages.svelte.src.compiler.errors8packages.svelte.src.compiler.migrate9packages.svelte.src.compiler.phases10packages.svelte.src.compiler.phases.1-parse11packages.svelte.src.compiler.phases.1-parse.read12packages.svelte.src.compiler.phases.1-parse.state13packages.svelte.src.compiler.phases.1-parse.utils14packages.svelte.src.compiler.phases.2-analyze.css15packages.svelte.src.compiler.phases.2-analyze.visitors16packages.svelte.src.compiler.phases.2-analyze.visitors.shared17packages.svelte.src.compiler.phases.2-analyze.visitors.shared.a11y18packages.svelte.src.compiler.phases.3-transform19packages.svelte.src.compiler.phases.3-transform.client20packages.svelte.src.compiler.phases.3-transform.client.transform-template21packages.svelte.src.compiler.phases.3-transform.client.transform-template.template22packages.svelte.src.compiler.phases.3-transform.client.visitors23packages.svelte.src.compiler.phases.3-transform.client.visitors.shared24packages.svelte.src.compiler.phases.3-transform.client.visitors.shared.utils25packages.svelte.src.compiler.phases.3-transform.server26packages.svelte.src.compiler.phases.3-transform.server.visitors27packages.svelte.src.compiler.phases.3-transform.server.visitors.shared28packages.svelte.src.compiler.phases.3-transform.server.visitors.shared.utils29packages.svelte.src.compiler.phases.3-transform.shared30packages.svelte.src.compiler.phases.nodes31packages.svelte.src.compiler.phases.scope32packages.svelte.src.compiler.preprocess33packages.svelte.src.compiler.utils34packages.svelte.src.compiler.utils.compile_diagnostic35packages.svelte.src.reactivity.reactive-value36packages.svelte.scripts37packages.svelte.scripts.process-messages.templates.compile-warnings38packages.svelte.src.compiler.warnings39packages.svelte.src.reactivity.media-query401111+35 more modules (most-connected shown)

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

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

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

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

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

At a glance — Accessibility · 70% · 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
A03:2025 — Software Supply Chain Failures27High / Critical
A05:2025 — Injection12High / Critical

Roadmap

Top priorities: 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; Bring the 209 bodies over 15 down to 15 or less in Cognitive Complexity — start with analyze_component (cognitive 385), VariableDeclaration (cognitive 266), check_element (cognitive 257); Bring the 52 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with check_element (cyclomatic 195), analyze_component (cyclomatic 181), RegularElement (cyclomatic 136).

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

Do thisHelpsEffortDimension
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.6 ptsMediumAsync & latency hygiene
Bring the 209 bodies over 15 down to 15 or less in Cognitive Complexity — start with analyze_component (cognitive 385), VariableDeclaration (cognitive 266), check_element (cognitive 257).+1.0 ptsHighCognitive Complexity
Bring the 52 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with check_element (cyclomatic 195), analyze_component (cyclomatic 181), RegularElement (cyclomatic 136).+0.8 ptsHighCyclomatic Complexity
Resolve the 16 TodoComment finding(s) in Explicit Debt — start with test.ts (11), shared.ts (4), suite.ts.+0.8 ptsMediumExplicit Debt
Resolve the 35 FunctionTooLong finding(s) in God Classes — start with REDACTED (7), RegularElement.js (3), component.js (2).+0.7 ptsHighGod Classes
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion.+0.3 ptsLowProject Cohesion
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+0.7 ptsMediumArchitecture documentation
Swallowed exception (empty catch)+0.6 ptsMediumException handling

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
packages/svelte/src/internal/client/dev/debug.js5.5MixedCyclomatic Complexity: debug.log_inconsistent_branches (cyclomatic 28)
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js5.9MixedCyclomatic Complexity: EachBlock.EachBlock (cyclomatic 64)
packages/svelte/tests/signals/test.ts6.0MixedExplicit Debt: TodoComment
REDACTED6.3MixedCyclomatic Complexity: migrate (cyclomatic 91)
packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js6.5MixedCyclomatic Complexity: check_element (cyclomatic 195)
packages/svelte/tests/runtime-legacy/shared.ts6.5MixedExplicit Debt: TodoComment
packages/svelte/tests/store/test.ts6.6MixedExplicit Debt: TodoComment
packages/svelte/tests/suite.ts6.7MixedExplicit Debt: TodoComment
packages/svelte/tests/server-side-rendering/test.ts6.9MixedExplicit Debt: TodoComment
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/index.js7.0MixedCyclomatic Complexity: analyze_component (cyclomatic 181)
packages/svelte/src/compiler/print/index.js7.0MixedCyclomatic Complexity: index.svelte_visitors (cyclomatic 116)
packages/svelte/src/compiler/phases/scope.js7.0MixedCyclomatic Complexity: Evaluation.constructor (cyclomatic 107)

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

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

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

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

Could not be resolved — 7

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

Methodology & how to trust this report

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

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

What we checked — 65 dimensions across the health lenses
D1D2D3D6D8D10D11D12D13D14D15D16D17D19D23D24D26D27D28D29D30D34D35D36D43AC2AC3AC5AC6AX10AX3AX4AX6GD1IC1M1M2M3M4P1P10P3P4P6PF3R1R10R11R2R3R4R6R7R8R9X1X12X16X21X24X28X29X3X30X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1dd7f-60b3-703d-b683-fdc10d88f8a7.

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.

  • D11 Test Reliability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `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`, … (+4 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This 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.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (the repository): package.json has no "dev" script, so `npm run dev` could not start the app. Last output: "npm error Missing script: "dev" / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 68 further occurrence(s) are not listed individually; the score already reflects all 108.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 183 further occurrence(s) are not listed individually; the score already reflects all 223.
  • R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 39 further occurrence(s) are not listed individually; the score already reflects all 79.
  • R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 25 further occurrence(s) are not listed individually; the score already reflects all 65.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 382 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled certificate validation, obsolete TLS versions, plaintext password storage and session cookies set without HttpOnly, Secure or SameSite, and none was found. The server controls this dimension also scores were not assessed, so no score is given.
  • X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, 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.

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

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • 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.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • 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 — we run 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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • 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.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic 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:57
analyze_component (cyclomatic 181)packages/svelte/src/compiler/phases/2-analyze/index.js:334
RegularElement (cyclomatic 136)packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:38
index.svelte_visitors (cyclomatic 116)packages/svelte/src/compiler/print/index.js:537
client_component (cyclomatic 108)packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:135

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

What to do

  1. Bring the 52 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with check_element (cyclomatic 195), analyze_component (cyclomatic 181), RegularElement (cyclomatic 136). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 52 together lifts Cyclomatic Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.

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

369 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:334
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:57
migrate (cognitive 179)REDACTED:124

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

What to do

  1. Bring the 209 bodies over 15 down to 15 or less in Cognitive Complexity — start with analyze_component (cognitive 385), VariableDeclaration (cognitive 266), check_element (cognitive 257). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 209 together lifts Cognitive Complexity from 2.0 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

D3 · God Classes6.7 / 10Adequate✓ 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 6.7 / 10 · rule-coverage 100% · ceiling Prevented

45 over-large unit(s) detected — types, modules or files that carry too much.

FunctionTooLong: legacy.convert · ×35packages/svelte/src/compiler/legacy.js:42
FileTooLong: REDACTED · ×9REDACTED
MethodTooLong: Evaluation.constructorpackages/svelte/src/compiler/phases/scope.js:262

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).

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 25 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D8 · Code Coverage10.0 / 10Stronggated by 14 serious findings✓ Tool-verified

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

Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

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

Line coverage 92.5% — 14 file(s) below 50%. Measured from the JavaScript/TypeScript suite (vitest + @vitest/coverage-v8 via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root; vitest in packages/svelte/: not run).

Low coverage: packages/svelte/src/index-server.js · ×14packages/svelte/src/index-server.js:1

What to do

  1. Resolve the 14 Low coverage finding(s) in Code Coverage — start with REDACTED (4), index-server.js, ExportNamedDeclaration.js. — One of this dimension's main actionable groups (14 warning-level).

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

D10 · Test Quality10.0 / 10Stronggated by 9 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

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

Skipped test: [SKIP] ${cwd} · ×7packages/svelte/tests/suite.ts:128
No assertions: (unnamed test) · ×2packages/svelte/tests/signals/test.ts:52
Skipped (documented): (unnamed test) · ×4911packages/svelte/tests/validator/samples/tag-hyphen/_config.js:3

What to do

  1. Resolve the 7 Skipped test finding(s) in Test Quality — start with test.ts (6), suite.ts. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 2 No assertions finding(s) in Test Quality — start with test.ts, utils.test.ts. — One of this dimension's main actionable groups (2 warning-level).

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 (7820 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.6 / 10Exemplary✓ Tool-verified

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

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

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

8 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 for currency: that grade is about what SHIPS. 0 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, 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.

Deprecated: whatwg-encodingREDACTED:2423
Outdated (npm): @types/estree · ×8

✓ 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 20 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 20 package(s) this repository's committed lockfile installs for a consumer — its 15 production, optional and peer dependency(ies), across 2 product package.json manifest(s), and everything those install in turn. Its 45 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ 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 Hotspots8.0 / 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 8.0 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: packages/svelte/src/compiler/phases/2-analyze/index.js (8×177=1416); packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js (7×135=945); packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js (4×194=776) Repeated repair below the complexity floor: packages/svelte/src/internal/server/renderer.js (6 of 9 changes were fixes)

Hotspot: packages/svelte/src/compiler/phases/2-analyze/index.js · ×13packages/svelte/src/compiler/phases/2-analyze/index.js:334
Repeated repair: packages/svelte/src/internal/server/renderer.jspackages/svelte/src/internal/server/renderer.js:620

What to do

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

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

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

5 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is benchmarking/analyze-compiler-profile.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:70
HackCommentpackages/svelte/tests/runtime-legacy/shared.ts:402

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).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D23 · Boundary Type-Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.

Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.

Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.

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

No domain types leak across context boundaries (2 contexts). Contexts: sandbox, svelte.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D24 · Comment Value9.8 9.6 / 10Exemplary✓ Tool-verified

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

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

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

3 of 1292 judged comments only repeat the code they sit on (0.2 %). 24 comment(s) in another language or script were not judged.

redundant comment · ×3packages/svelte/src/compiler/phases/2-analyze/visitors/StyleDirective.js:19
doc comments repeat the namespackages/svelte/src/compiler/phases/1-parse/utils/bracket.js:17

✓ On the Gold path — maintain.

Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.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.

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

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

Projects may be oversized for their cohesion

What to do

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

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

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. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

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

33 % 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)2.6 / 10Weak✓ 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 2.6 / 10 · rule-coverage 100% · ceiling Documented

13 finding(s): 0 critical, 7 high, 1 medium, 5 low. semgrep hit a parse error in 10 file(s) — `packages/svelte/elements.d.ts` (line 91, line 92, line 93, …), `packages/svelte/src/compiler/phases/1-parse/index.js` (lines 16–18), `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, …), … (+5 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 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5). — One of this dimension's main actionable groups (5 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.0 / 10Critical✓ Tool-verified

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

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

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

25 finding(s): 1 critical, 14 high, 8 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 13 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (13). — One of this dimension's main actionable groups (13 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.8 / 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.8 / 10 · rule-coverage 100% · ceiling Documented

4 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/internal/client/dom/elements/custom-element.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 file · ×4packages/svelte/src/internal/client/dom/elements/custom-element.js:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change 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%; AwaitBlock.js↔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:1

What to do

  1. Resolve the 3 Change coupling finding(s) in Change Coupling — start with SlotElement.js, AwaitBlock.js, 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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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 safety5.3 / 10Adequate✓ Tool-verified

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

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

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

  • `.missing` sets color: #6e7781 on background-color: #f6f8fa — 4.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — benchmarking/compare/results.template.html:309

What to do

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

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.

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

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

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

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead. — packages/svelte/src/compiler/validate-options.js:16
  • `tick` has an empty body — confirm it's an intentional no-op and not an unfinished method. — packages/svelte/src/index-server.js:40
  • `settled` has an empty body — confirm it's an intentional no-op and not an unfinished method. — packages/svelte/src/index-server.js:42
  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×7) — packages/svelte/tests/signals/test.ts:63, packages/svelte/tests/signals/test.ts:64, packages/svelte/tests/signals/test.ts:759, …

What to do

  • Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
M1 · Documentation (README)8.7 / 10Strong✓ Tool-verified

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

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

M2 · Architecture 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 your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
  • 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 repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

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

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

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

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

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

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

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

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 4 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. — REDACTED:5
  • `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — package.json:29

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 each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `fs.mkdirSync` in `with_cpu_profile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — benchmarking/utils.js:311
  • `fs.writeFileSync` in `with_cpu_profile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — benchmarking/utils.js:326, benchmarking/utils.js:327
  • `fs.readFileSync` in `callback to use` blocks the event loop until it finishes — 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:23

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 Duplication7.2 / 10Strong✓ Tool-verified

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

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

  • 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:291 · packages/svelte/src/internal/server/renderer.js:332 — 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:291
  • 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:578 · 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:578
  • 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:802 · packages/svelte/src/compiler/print/index.js:974 — 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:802
  • 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:969 · packages/svelte/src/compiler/phases/2-analyze/index.js:1029 — 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:969
  • 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/internal/client/reactivity/props.js:64 · packages/svelte/src/internal/client/reactivity/props.js:131 — 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:64
  • 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
  • packages/svelte/src/compiler/print/index.js:1068 · packages/svelte/src/compiler/print/index.js:1088 — 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:1068

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:57
  • 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:334
  • 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:289
  • 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:37
  • 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:279
  • 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:439
  • 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
  • VariableDeclaration has cyclomatic complexity 59 and cognitive complexity 138; 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:567
  • EachBlock has cyclomatic complexity 55 and cognitive complexity 78; 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/EachBlock.js:23
  • read_options has cyclomatic complexity 54 and cognitive complexity 115; 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/read/options.js:10
  • VariableDeclarator has cyclomatic complexity 50 and cognitive complexity 128; 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/VariableDeclarator.js:16
  • get has cyclomatic complexity 50 and cognitive complexity 87; 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/runtime.js:540
  • profile_to_markdown has cyclomatic complexity 48 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. — benchmarking/utils.js:111
  • migrate_slot_usage has cyclomatic complexity 47 and cognitive complexity 77; 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:1433
  • open has cyclomatic complexity 46 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/compiler/phases/1-parse/state/tag.js:151
  • build_inline_component has cyclomatic complexity 46 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/server/visitors/shared/component.js:21
  • reconcile has cyclomatic complexity 45 and cognitive complexity 117; 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/blocks/each.js:434
  • server_component has cyclomatic complexity 45 and cognitive complexity 51; 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/transform-server.js:94
  • validate_element has cyclomatic complexity 41 and cognitive complexity 118; 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/element.js:30
  • Fragment has cyclomatic complexity 41 and cognitive complexity 48; 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/print/index.js:573
  • (anonymous) has cyclomatic complexity 38 and cognitive complexity 36; 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/tests/runtime-legacy/shared.ts:178
  • VariableDeclaration has cyclomatic complexity 37 and cognitive complexity 95; 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/VariableDeclaration.js:15
  • ClassBody has cyclomatic complexity 37 and cognitive complexity 78; 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/ClassBody.js:15
  • visit_component has cyclomatic complexity 37 and cognitive complexity 55; 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/component.js:19
  • calculate_blockers has cyclomatic complexity 36 and cognitive complexity 94; 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:960
  • is_expression_async has cyclomatic complexity 34 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/utils/ast.js:484
  • read_attribute has cyclomatic complexity 33 and cognitive complexity 51; 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:521
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.

  • REDACTED has 1829 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • packages/svelte/src/compiler/phases/scope.js has 1316 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/scope.js:1
  • packages/svelte/src/compiler/phases/2-analyze/index.js has 1206 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/2-analyze/index.js:1
  • packages/svelte/src/internal/client/reactivity/batch.js has 1192 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/client/reactivity/batch.js:1
  • packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js has 1082 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:1
  • packages/svelte/src/compiler/print/index.js has 950 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/print/index.js:1
  • packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js has 920 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:1
  • packages/svelte/src/internal/server/renderer.js has 875 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/server/renderer.js:1
  • packages/svelte/src/compiler/phases/1-parse/state/element.js has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/1-parse/state/element.js:1
  • packages/svelte/scripts/generate-browser-support.ts has 781 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/scripts/generate-browser-support.ts:1
  • packages/svelte/src/internal/client/runtime.js has 743 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/client/runtime.js:1
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js has 705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:1
  • packages/svelte/src/compiler/phases/1-parse/state/tag.js has 698 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/1-parse/state/tag.js:1
  • packages/svelte/src/internal/client/reactivity/effects.js has 657 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/client/reactivity/effects.js:1
  • packages/svelte/src/internal/client/dom/blocks/each.js has 640 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/client/dom/blocks/each.js:1
  • packages/svelte/src/compiler/utils/builders.js has 627 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/utils/builders.js:1
  • packages/svelte/src/compiler/phases/3-transform/client/transform-client.js has 619 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:1
  • packages/svelte/src/internal/client/dom/elements/attributes.js has 615 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/client/dom/elements/attributes.js:1
  • packages/svelte/src/compiler/legacy.js has 598 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/legacy.js:1
  • packages/svelte/src/compiler/phases/1-parse/read/style.js has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/1-parse/read/style.js:1
  • packages/svelte/src/compiler/utils/ast.js has 570 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/utils/ast.js:1
  • packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js has 517 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:1
  • packages/svelte/src/internal/client/dom/blocks/boundary.js has 492 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/client/dom/blocks/boundary.js:1
  • packages/svelte/src/internal/server/index.js has 486 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/server/index.js:1
  • packages/svelte/src/utils.js has 467 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/utils.js:1
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js has 452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:1
  • packages/svelte/src/internal/client/dev/debug.js has 452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/client/dev/debug.js:1
  • packages/svelte/src/compiler/utils/mapped_code.js has 444 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/utils/mapped_code.js:1
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js has 435 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js:1
  • packages/svelte/src/internal/client/dom/elements/transitions.js has 429 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/client/dom/elements/transitions.js:1
  • packages/svelte/src/compiler/phases/3-transform/css/index.js has 419 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/compiler/phases/3-transform/css/index.js:1
  • packages/svelte/src/internal/client/reactivity/deriveds.js has 414 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/svelte/src/internal/client/reactivity/deriveds.js:1

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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:3
  • 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:2
  • 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:5
  • 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:2
  • 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:2
  • 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:2
  • 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:5
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • packages/svelte/tests/suite.ts:121 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:121
  • 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:345
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2
  • 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:2

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:2
R7 · Dead Code7.9 / 10Strong✓ 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 59 application, 44 tooling and 7606 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 (59 application, 44 tooling, 7606 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. (×2) — packages/svelte/src/internal/client/dev/debug.js:189, packages/svelte/src/internal/client/dev/debug.js:356
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×26) — packages/svelte/tests/compiler-errors/samples/class-state-field-static/main.svelte:2, packages/svelte/tests/compiler-errors/samples/dollar-binding-declaration-legacy/main.svelte:4, packages/svelte/tests/compiler-errors/samples/dollar-binding-declaration-legacy/main.svelte:5, …
  • Nothing in its class calls or references this private method — no member access, no string key, no decorator, and no test reaches it by name. A private member cannot be called from outside its class, so this is the whole search: remove it, or call it where it was meant to be used. — packages/svelte/tests/runtime-runes/samples/class-disabinguate-private-method-definition/main.svelte:4
  • This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments. (×3) — packages/svelte/tests/runtime-runes/samples/class-state-init-conflict/main.svelte:4, packages/svelte/tests/runtime-runes/samples/class-state-init-conflict/main.svelte:5, packages/svelte/tests/runtime-runes/samples/each-updates-9/main.svelte:10
  • Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect. (×3) — packages/svelte/tests/runtime-runes/samples/class-state-init-eager-2/main.svelte:8, packages/svelte/tests/runtime-runes/samples/class-state-init-eager-3/main.svelte:4, packages/svelte/tests/runtime-runes/samples/class-state-init-eager/main.svelte:4

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:5
  • 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:20
  • 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:4
  • 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:5
  • 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:10
  • 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:5

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

X24 · Document value interpolated into markup unescaped5.2 / 10Adequate✓ Tool-verified

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.

  • `create_trusted_html('<option><span>t</span></option>')` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/svelte/src/internal/client/dom/elements/customizable-select.js:18
  • `create_trusted_html(html.replaceAll('<!>','<!---->'))` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/svelte/src/internal/client/dom/reconciler.js:23

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X3 · Exception handling5.3 / 10Adequate✓ Tool-verified

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

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

  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×2) — packages/svelte/src/internal/server/hydratable.js:27, packages/svelte/src/internal/server/hydratable.js:84
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×7) — packages/svelte/src/internal/client/proxy.js:385, packages/svelte/src/internal/client/runtime.js:838, packages/svelte/src/internal/client/runtime.js:856, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. (×2) — packages/svelte/scripts/generate-browser-support.ts:619, packages/svelte/scripts/generate-browser-support.ts:640

What to do

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

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

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

X5 · Nullable reference types7.3 / 10Strong✓ Tool-verified

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

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

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

What to do

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

WCAG coverage — what static analysis assessed

Statically assessed 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

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 Health61%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture65%Adequate — gated by D26, R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity62%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.
Security67%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility70%StrongStrongest area.
Performance60%AdequateLargest drag on the score — prioritise here.
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 — 39 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 62 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
  • 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 (`npm run dev`) exited before it served a page. Likely cause (the repository): package.json has no "dev" script, so `npm run dev` could not start the app. Last output: "npm error Missing script: "dev" / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — 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 — No access-control surface detected in the analyzed source — this repository stands up no server (no Express, Fastify, Koa, Hono, NestJS or similar app, no Next.js/SvelteKit/Nuxt server route, no edge function), creates no Supabase tables and talks to no hosted backend. Access control is therefore N/A here — a browser application or library is authorized by the server it calls, not by itself; a client-side route guard hides a page and authorizes nothing. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — 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 sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, 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 personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
  • C5 Data-Subject Rights — 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 personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
  • 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.
  • D21 Naming Consistency — Naming consistency does not read html yet; not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed JavaScript surface was not measured.
  • 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) — 9 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.
  • 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. The rest — .html (295 lines, 0.5% of production source) — is compared by neither card, so duplication there is unmeasured; it is a corner of this repository, not its product.
  • 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
  • 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 — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • 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), 386 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 scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • 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: 382 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled TLS certificate validation, obsolete TLS versions, passwords stored or checked as plaintext and session cookies set without HttpOnly, Secure or SameSite, and none was found. That half of the dimension is clean, but it is not scored on its own: a C# repository with the same clean reading is scored on its server controls as well, or is N/A for having no web surface, and neither can be decided here. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is 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.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — Not 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 applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • 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
  • 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 — 29 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · 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:20 — 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:4 — 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:5 — 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:5 — 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:5 — 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:10 — 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
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
Serious — 644 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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:3 — 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:2 — 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:5 — 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:2 — 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:2 — 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:2 — 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:5 — 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:2 — 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:2 — 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:2 — 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:2 — 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:2 — 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.analyze_component packages/svelte/src/compiler/phases/2-analyze/index.js:334 — 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.svelte_visitors packages/svelte/src/compiler/print/index.js:537 — FunctionTooLong — svelte_visitors runs 384 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 284 over it, 3.84× 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:57 — 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 175 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: element.build_element_attributes packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:37 — 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:960 — 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:439 — 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:279 — 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.
D17 · Explicit Debt · TodoComment · ×16
  • TodoComment packages/svelte/tests/suite.ts:70 — // 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/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.
  • 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/signals/test.ts:310 — // 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/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/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: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/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:364 — // 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/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:455 — // @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/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.
D8 · Code Coverage · Low coverage · ×14
  • Low coverage: packages/svelte/src/index-server.js packages/svelte/src/index-server.js:1 — 33.3% line coverage (2/6).
  • Low coverage: packages/svelte/src/compiler/phases/3-transform/client/visitors/ExportNamedDeclaration.js packages/svelte/src/compiler/phases/3-transform/client/visitors/ExportNamedDeclaration.js:1 — 40.0% line coverage (2/5).
  • Low coverage: packages/svelte/src/easing/index.js packages/svelte/src/easing/index.js:1 — 6.0% line coverage (3/50).
  • Low coverage: packages/svelte/src/internal/index.js packages/svelte/src/internal/index.js:1 — 0.0% line coverage (0/1).
  • Low coverage: packages/svelte/src/internal/client/dev/debug.js packages/svelte/src/internal/client/dev/debug.js:1 — 0.5% line coverage (1/197).
  • Low coverage: packages/svelte/src/internal/client/dev/legacy.js packages/svelte/src/internal/client/dev/legacy.js:1 — 37.5% line coverage (3/8).
  • Low coverage: packages/svelte/src/internal/client/dom/elements/bindings/media.js packages/svelte/src/internal/client/dom/elements/bindings/media.js:1 — 22.1% line coverage (15/68).
  • Low coverage: packages/svelte/src/internal/client/dom/elements/bindings/navigator.js packages/svelte/src/internal/client/dom/elements/bindings/navigator.js:1 — 0.0% line coverage (0/2).
  • Low coverage: packages/svelte/src/internal/client/dom/elements/bindings/size.js packages/svelte/src/internal/client/dom/elements/bindings/size.js:1 — 21.4% line coverage (6/28).
  • Low coverage: packages/svelte/src/legacy/legacy-server.js packages/svelte/src/legacy/legacy-server.js:1 — 12.5% line coverage (2/16).
  • Low coverage: packages/svelte/src/motion/spring.js packages/svelte/src/motion/spring.js:1 — 45.0% line coverage (59/131).
  • Low coverage: packages/svelte/src/motion/utils.js packages/svelte/src/motion/utils.js:1 — 0.0% line coverage (0/1).
  • Low coverage: packages/svelte/src/reactivity/window/index.js packages/svelte/src/reactivity/window/index.js:1 — 45.5% line coverage (25/55).
  • Low coverage: packages/svelte/src/transition/index.js packages/svelte/src/transition/index.js:1 — 43.5% line coverage (40/92).
D15 · Churn × Complexity Hotspots · Hotspot · ×13
  • Hotspot: packages/svelte/src/compiler/phases/2-analyze/index.js packages/svelte/src/compiler/phases/2-analyze/index.js:334 — 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 334. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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:57 — packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 194 in index.check_element at line 57. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/compiler/print/index.js packages/svelte/src/compiler/print/index.js:537 — packages/svelte/src/compiler/print/index.js changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 116 in index.svelte_visitors at line 537. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/internal/client/dom/elements/attributes.js packages/svelte/src/internal/client/dom/elements/attributes.js:279 — packages/svelte/src/internal/client/dom/elements/attributes.js changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in attributes.set_attributes at line 279. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/internal/client/reactivity/batch.js packages/svelte/src/internal/client/reactivity/batch.js:687 — packages/svelte/src/internal/client/reactivity/batch.js changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Batch.#commit at line 687. 4 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/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 4 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, 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/internal/client/proxy.js packages/svelte/src/internal/client/proxy.js:40 — packages/svelte/src/internal/client/proxy.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in proxy.proxy at line 40. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/internal/client/reactivity/sources.js packages/svelte/src/internal/client/reactivity/sources.js:190 — packages/svelte/src/internal/client/reactivity/sources.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in sources.internal_set at line 190. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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/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 17 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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.
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: css/css-prune.js packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js — FileTooLong — 667 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 167 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: print/index.js packages/svelte/src/compiler/print/index.js — FileTooLong — 666 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 166 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: reactivity/batch.js packages/svelte/src/internal/client/reactivity/batch.js — FileTooLong — 633 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 60% of them inside a single declaration: Batch (96-980). The bar is 500 significant lines; this is 133 over it, 1.27× 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 — 586 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 86 over it, 1.17× 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 — 533 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 33 over it, 1.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
X3 · Exception handling · Swallowed exception (empty catch) · ×9
  • Swallowed exception (empty catch) packages/svelte/src/internal/server/hydratable.js:27 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) packages/svelte/src/internal/server/hydratable.js:84 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) packages/svelte/src/internal/client/proxy.js:385 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/svelte/src/internal/client/runtime.js:838 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/svelte/src/internal/client/runtime.js:856 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/svelte/src/internal/client/dev/console-log.js:31 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/svelte/src/internal/client/dev/equality.js:84 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/svelte/src/internal/client/dev/inspect.js:64 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/svelte/scripts/generate-browser-support.ts:867 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D10 · Test Quality · Skipped test · ×7
  • Skipped test: [SKIP] ${cwd} packages/svelte/tests/suite.ts:128 — Skipped — switched off by it.skip
  • Skipped test: errors if options.name is illegal packages/svelte/tests/validator/test.ts:88 — Skipped — switched off by it.skip
  • Skipped test: check warning position packages/svelte/tests/validator/test.ts:97 — Skipped — switched off by it.skip
  • Skipped test: warns if options.name is not capitalised packages/svelte/tests/validator/test.ts:112 — Skipped — switched off by it.skip
  • Skipped test: ${text} (legacy mode) packages/svelte/tests/signals/test.ts:63 — Skipped — switched off by it.skip
  • Skipped test: ${text} (runes mode) packages/svelte/tests/signals/test.ts:64 — Skipped — switched off by it.skip
  • Skipped test: schedules rerun when writing to signal before reading it packages/svelte/tests/signals/test.ts:759 — Skipped — switched off by test.skip
D30 · Dependency Vulnerabilities · Medium CVE · ×7
  • REDACTED
  • 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:802 — packages/svelte/src/compiler/print/index.js:802 · packages/svelte/src/compiler/print/index.js:974 — 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:969 — packages/svelte/src/compiler/phases/2-analyze/index.js:969 · packages/svelte/src/compiler/phases/2-analyze/index.js:1029 — 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:64 — packages/svelte/src/internal/client/reactivity/props.js:64 · packages/svelte/src/internal/client/reactivity/props.js:131 — 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×4
  • Sync-over-async blocking benchmarking/utils.js:311 — `fs.mkdirSync` in `with_cpu_profile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking benchmarking/utils.js:326 — `fs.writeFileSync` in `with_cpu_profile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking benchmarking/utils.js:327 — `fs.writeFileSync` in `with_cpu_profile` blocks the event loop until it finishes — 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:23 — `fs.readFileSync` in `callback to use` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×4
  • 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.
  • Duplicated block (13 lines × 2 locations) packages/svelte/src/compiler/print/index.js:1068 — packages/svelte/src/compiler/print/index.js:1068 · packages/svelte/src/compiler/print/index.js:1088 — 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.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: SlotElement.js ↔ component.js packages/svelte/src/compiler/phases/3-transform/client/visitors/SlotElement.js:1 — `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: AwaitBlock.js ↔ IfBlock.js packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitBlock.js:1 — `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:1 — `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:291 — packages/svelte/src/internal/server/renderer.js:291 · packages/svelte/src/internal/server/renderer.js:332 — 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:578 — packages/svelte/src/compiler/phases/2-analyze/index.js:578 · 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.
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: (unnamed test) packages/svelte/tests/signals/test.ts:52 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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 27) packages/svelte/src/compiler/print/index.js:747 — svelte_visitors::AwaitBlock has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 4 (10 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×2
  • Untrusted text written into markup unescaped packages/svelte/src/internal/client/dom/elements/customizable-select.js:18 — `create_trusted_html('<option><span>t</span></option>')` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped packages/svelte/src/internal/client/dom/reconciler.js:23 — `create_trusted_html(html.replaceAll('<!>','<!---->'))` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×2
  • Swallowed exception (caught, then discarded) packages/svelte/scripts/generate-browser-support.ts:619 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) packages/svelte/scripts/generate-browser-support.ts:640 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (4.3 · ×1
  • Low contrast colour pair in CSS (4.3:1) benchmarking/compare/results.template.html:309 — `.missing` sets color: #6e7781 on background-color: #f6f8fa — 4.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · check_element (cyclomatic 195) · ×1
  • check_element (cyclomatic 195) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:57 — 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:334 — 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 116) · ×1
  • index.svelte_visitors (cyclomatic 116) packages/svelte/src/compiler/print/index.js:537 — index.svelte_visitors has cyclomatic complexity 116 (threshold 15). Of this number, 113 points are the body's own statements and 3 belong to 2 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 · 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:37 — 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, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so 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:279 — 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 · proxy.proxy (cyclomatic 70) · ×1
  • proxy.proxy (cyclomatic 70) packages/svelte/src/internal/client/proxy.js:40 — proxy.proxy has cyclomatic complexity 70 (threshold 15). Of this number, 60 points are the body's own statements and 10 belong to 6 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 · 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 · 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:439 — 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 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 · 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:960 — index.calculate_blockers has cyclomatic complexity 51 (threshold 15). Of this number, 36 points are the body's own statements and 15 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 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). Of this number, 37 points are the body's own statements and 10 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 · 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 · 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: 6 of the 40 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 268, commit, a function literal at line 207). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · prop (cyclomatic 40) · ×1
  • prop (cyclomatic 40) packages/svelte/src/internal/client/reactivity/props.js:275 — 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 · 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 · 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:999 — 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:716 — 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:687 — #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:114 — 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 (a function literal at line 132, (anonymous)::handler, a function literal at line 237, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so 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 · 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). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to 3 function items inside it that branch (log_branch, collect_branches, has_inconsistency). 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 · 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:89 — 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:903 — 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). Of this number, 23 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · 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:294 — 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). Of this number, 16 points are the body's own statements and 8 belong to 3 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 · 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:190 — 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:110 — 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 · index.run · ×1
  • index.run::transform (cyclomatic 23) packages/svelte/scripts/process-messages/index.js:100 — index.run::transform 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 · acorn.get_comment_handlers.add_comments (cyclomatic 22) · ×1
  • acorn.get_comment_handlers.add_comments (cyclomatic 22) REDACTED:223 — acorn.get_comment_handlers.add_comments 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 · 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 · Batch.#process (cyclomatic 22) · ×1
  • Batch.#process (cyclomatic 22) packages/svelte/src/internal/client/reactivity/batch.js:322 — Batch.#process 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 · SvelteElement.connectedCallback (cyclomatic 22) · ×1
  • SvelteElement.connectedCallback (cyclomatic 22) packages/svelte/src/internal/client/dom/elements/custom-element.js:93 — SvelteElement.connectedCallback has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 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 · 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 · 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 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 · 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 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 · 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 · ×1
  • browser-support.detector.walk_source::visit (cyclomatic 20) packages/svelte/scripts/browser-support.detector.js:293 — browser-support.detector.walk_source::visit 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:840 — 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 · next (cyclomatic 20) · ×1
  • next (cyclomatic 20) packages/svelte/src/compiler/phases/1-parse/state/tag.js:527 — next 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 · _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 (a function literal at line 180, (anonymous)::event_handle, a function literal at line 260, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so 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 · animate (cyclomatic 19) · ×1
  • animate (cyclomatic 19) packages/svelte/src/internal/client/dom/elements/transitions.js:338 — animate has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 13 function items inside it that branch ((anonymous)::onfinish, a function literal at line 393, a function literal at line 349, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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:35 — 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 53, 76, 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.
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 · 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.add_comments · ×1
  • get_comment_handlers.add_comments::_ (cyclomatic 18) REDACTED:231 — 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:1066 — 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 · set_attribute (cyclomatic 17) · ×1
  • set_attribute (cyclomatic 17) packages/svelte/src/internal/client/dom/elements/attributes.js:158 — set_attribute 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:271 — 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 items inside it that branch (a function literal at line 551, handle_error_result, a function literal at line 527, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one 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:466 — 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 · sources.mark_reactions (cyclomatic 16) · ×1
  • sources.mark_reactions (cyclomatic 16) packages/svelte/src/internal/client/reactivity/sources.js:356 — 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:821 — 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 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 · 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×1
  • Repeated repair: packages/svelte/src/internal/server/renderer.js packages/svelte/src/internal/server/renderer.js:620 — packages/svelte/src/internal/server/renderer.js changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is Renderer.#run_on_destroy at line 620), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: render the same `<title>` on the server as on the client and ignore titles inside failed boundaries (#19176)”; “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 21:10:50 -05:00' --until='2026-11-13 21:10:50 -05: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.
D17 · Explicit Debt · HackComment · ×1
  • HackComment packages/svelte/tests/runtime-legacy/shared.ts:402 — // 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:334 — 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:57 — 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 · 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 · index.svelte_visitors (cognitive 151) · ×1
  • index.svelte_visitors (cognitive 151) packages/svelte/src/compiler/print/index.js:537 — index.svelte_visitors has cognitive complexity 151 (threshold 15). Drivers by points: if/else 67 (103 pts), boolean chains 22, loops 15 (19 pts), ternaries 4 (7 pts) (nesting depth added 43). Of this number, 149 points are the body's own statements and 2 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 · 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:439 — 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:37 — 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:960 — 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, 94 points are the body's own statements and 24 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 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 · set_attributes (cognitive 113) · ×1
  • set_attributes (cognitive 113) packages/svelte/src/internal/client/dom/elements/attributes.js:279 — 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, 87 points are the body's own statements and 16 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 · 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 · 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 88) · ×1
  • proxy.proxy (cognitive 88) packages/svelte/src/internal/client/proxy.js:40 — proxy.proxy has cognitive complexity 88 (threshold 15). Drivers by points: if/else 39 (60 pts), boolean chains 21, loops 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 23). Of this number, 81 points are the body's own statements and 7 belong to 6 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 · #commit (cognitive 87) · ×1
  • #commit (cognitive 87) packages/svelte/src/internal/client/reactivity/batch.js:687 — #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:716 — 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 (a function literal at line 268, commit, a function literal at line 207, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so 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:999 — 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:275 — 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 · index.run · ×1
  • index.run::transform (cognitive 54) packages/svelte/scripts/process-messages/index.js:100 — index.run::transform has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (index.run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · 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). Of this number, 49 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 · 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:114 — 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 (a function literal at line 132, (anonymous)::handler, a function literal at line 237, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so 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:190 — 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:1066 — 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 · next (cognitive 45) · ×1
  • next (cognitive 45) packages/svelte/src/compiler/phases/1-parse/state/tag.js:527 — next has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (32 pts), error handling 3 (10 pts), loops 1 (3 pts) (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:110 — 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 · 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:840 — 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 · 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 · Batch.#process (cognitive 37) · ×1
  • Batch.#process (cognitive 37) packages/svelte/src/internal/client/reactivity/batch.js:322 — Batch.#process has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 8 (15 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 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 · 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 · log_inconsistent_branches (cognitive 36) · ×1
  • log_inconsistent_branches (cognitive 36) packages/svelte/src/internal/client/dev/debug.js:356 — log_inconsistent_branches has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 7 (11 pts), ternaries 5 (7 pts), boolean chains 5 (nesting depth added 8). Most of this is not in the body itself: 5 of the 36 points are its own statements and the rest belongs to 3 function items inside it that branch (log_branch, collect_branches, has_inconsistency). 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 · 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). Of this number, 26 points are the body's own statements and 9 belong 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 · 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:89 — 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). None of this is in the body itself: all 33 points belong to 5 function items inside it that branch ((anonymous)::event_handle, a function literal at line 260, a function literal at line 180, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so 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 · 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 · acorn.get_comment_handlers.add_comments (cognitive 30) · ×1
  • acorn.get_comment_handlers.add_comments (cognitive 30) REDACTED:223 — acorn.get_comment_handlers.add_comments has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 11, 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 · apply_combinator (cognitive 30) · ×1
  • apply_combinator (cognitive 30) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:294 — 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 · animate (cognitive 29) · ×1
  • animate (cognitive 29) packages/svelte/src/internal/client/dom/elements/transitions.js:338 — animate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 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 29 points are its own statements and the rest belongs to 13 function items inside it that branch ((anonymous)::onfinish, a function literal at line 393, a function literal at line 349, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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:271 — 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). Of this number, 23 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.add_comments · ×1
  • get_comment_handlers.add_comments::_ (cognitive 27) REDACTED:231 — 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:35 — 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 53, 76, 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.
D2 · Cognitive Complexity · browser-support.detector.walk_source · ×1
  • browser-support.detector.walk_source::visit (cognitive 26) packages/svelte/scripts/browser-support.detector.js:293 — browser-support.detector.walk_source::visit 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:821 — 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:466 — 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:903 — 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:356 — 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:170 — 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:77 — 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 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 · 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:664 — 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:828 — 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:77 — (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:910 — 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). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (walk_children, a function literal at line 947). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · index.run (cognitive 23) · ×1
  • index.run (cognitive 23) packages/svelte/scripts/process-messages/index.js:17 — index.run has cognitive complexity 23 (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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (index.run::transform) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · order_reactive_statements (cognitive 23) · ×1
  • order_reactive_statements (cognitive 23) packages/svelte/src/compiler/phases/2-analyze/index.js:1300 — 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:532 — #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:187 — 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:714 — 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:520 — 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). None of this is in the body itself: all 20 points belong to 3 function literals inside it that branch (lines 540, 530, 585). 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:1204 — 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 · apply (cognitive 19) · ×1
  • apply (cognitive 19) packages/svelte/src/internal/client/reactivity/batch.js:905 — apply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, loops 3 (5 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 · infinite_loop_guard (cognitive 19) · ×1
  • infinite_loop_guard (cognitive 19) packages/svelte/src/internal/client/reactivity/batch.js:1020 — 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:332 — 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:95 — _ 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 · set_attribute (cognitive 18) · ×1
  • set_attribute (cognitive 18) packages/svelte/src/internal/client/dom/elements/attributes.js:158 — set_attribute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, other 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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). None of this is in the body itself: all 18 points belong 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 · bracket.match_bracket (cognitive 17) · ×1
  • bracket.match_bracket (cognitive 17) packages/svelte/src/compiler/phases/1-parse/utils/bracket.js:162 — bracket.match_bracket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1, ternaries 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 · deriveds.update_derived (cognitive 17) · ×1
  • deriveds.update_derived (cognitive 17) packages/svelte/src/internal/client/reactivity/deriveds.js:391 — 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 · results.template.html.benchmark_order (cognitive 17) · ×1
  • results.template.html.benchmark_order (cognitive 17) benchmarking/compare/results.template.html:642 — results.template.html.benchmark_order has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 4, boolean chains 3 (nesting depth added 4). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 644). 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 · css-prune.is_global (cognitive 17) · ×1
  • css-prune.is_global (cognitive 17) packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:387 — 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:541 — 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 (a function literal at line 551, handle_error_result, a function literal at line 527, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so 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:44 — 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 · debug.log_inconsistent_branches · ×1
  • debug.log_inconsistent_branches::log_branch (cognitive 16) packages/svelte/src/internal/client/dev/debug.js:434 — debug.log_inconsistent_branches::log_branch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5, loops 2 (4 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · 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) packages/svelte/src/compiler/phases/2-analyze/visitors/AwaitBlock.js: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 · validate-options.object.<returned closure> (cognitive 16) · ×1
  • validate-options.object.<returned closure> (cognitive 16) packages/svelte/src/compiler/validate-options.js:235 — validate-options.object.<returned closure> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
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 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:57 — 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:334 — 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:289 — 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:37 — 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:279 — 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:439 — 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.
R2 · Cyclomatic Complexity · Complex function VariableDeclaration (cyclomatic 59, cognitive 138) · ×1
  • Complex function VariableDeclaration (cyclomatic 59, cognitive 138) REDACTED:567 — VariableDeclaration has cyclomatic complexity 59 and cognitive complexity 138; 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 EachBlock (cyclomatic 55, cognitive 78) · ×1
  • Complex function EachBlock (cyclomatic 55, cognitive 78) packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js:23 — EachBlock has cyclomatic complexity 55 and cognitive complexity 78; 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 read_options (cyclomatic 54, cognitive 115) · ×1
  • Complex function read_options (cyclomatic 54, cognitive 115) packages/svelte/src/compiler/phases/1-parse/read/options.js:10 — read_options has cyclomatic complexity 54 and cognitive complexity 115; 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 VariableDeclarator (cyclomatic 50, cognitive 128) · ×1
  • Complex function VariableDeclarator (cyclomatic 50, cognitive 128) packages/svelte/src/compiler/phases/2-analyze/visitors/VariableDeclarator.js:16 — VariableDeclarator has cyclomatic complexity 50 and cognitive complexity 128; 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 get (cyclomatic 50, cognitive 87) · ×1
  • Complex function get (cyclomatic 50, cognitive 87) packages/svelte/src/internal/client/runtime.js:540 — get has cyclomatic complexity 50 and cognitive complexity 87; 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 profile_to_markdown (cyclomatic 48, cognitive 107) · ×1
  • Complex function profile_to_markdown (cyclomatic 48, cognitive 107) benchmarking/utils.js:111 — profile_to_markdown has cyclomatic complexity 48 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 migrate_slot_usage (cyclomatic 47, cognitive 77) · ×1
  • Complex function migrate_slot_usage (cyclomatic 47, cognitive 77) REDACTED:1433 — migrate_slot_usage has cyclomatic complexity 47 and cognitive complexity 77; 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 open (cyclomatic 46, cognitive 113) · ×1
  • Complex function open (cyclomatic 46, cognitive 113) packages/svelte/src/compiler/phases/1-parse/state/tag.js:151 — open has cyclomatic complexity 46 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 build_inline_component (cyclomatic 46, cognitive 74) · ×1
  • Complex function build_inline_component (cyclomatic 46, cognitive 74) packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/component.js:21 — build_inline_component has cyclomatic complexity 46 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.
R2 · Cyclomatic Complexity · Complex function reconcile (cyclomatic 45, cognitive 117) · ×1
  • Complex function reconcile (cyclomatic 45, cognitive 117) packages/svelte/src/internal/client/dom/blocks/each.js:434 — reconcile has cyclomatic complexity 45 and cognitive complexity 117; 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 server_component (cyclomatic 45, cognitive 51) · ×1
  • Complex function server_component (cyclomatic 45, cognitive 51) packages/svelte/src/compiler/phases/3-transform/server/transform-server.js:94 — server_component has cyclomatic complexity 45 and cognitive complexity 51; 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 validate_element (cyclomatic 41, cognitive 118) · ×1
  • Complex function validate_element (cyclomatic 41, cognitive 118) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/element.js:30 — validate_element has cyclomatic complexity 41 and cognitive complexity 118; 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 Fragment (cyclomatic 41, cognitive 48) · ×1
  • Complex function Fragment (cyclomatic 41, cognitive 48) packages/svelte/src/compiler/print/index.js:573 — Fragment has cyclomatic complexity 41 and cognitive complexity 48; 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 (anonymous) (cyclomatic 38, cognitive 36) · ×1
  • Complex function (anonymous) (cyclomatic 38, cognitive 36) packages/svelte/tests/runtime-legacy/shared.ts:178 — (anonymous) has cyclomatic complexity 38 and cognitive complexity 36; 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 VariableDeclaration (cyclomatic 37, cognitive 95) · ×1
  • Complex function VariableDeclaration (cyclomatic 37, cognitive 95) packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js:15 — VariableDeclaration has cyclomatic complexity 37 and cognitive complexity 95; 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 ClassBody (cyclomatic 37, cognitive 78) · ×1
  • Complex function ClassBody (cyclomatic 37, cognitive 78) packages/svelte/src/compiler/phases/2-analyze/visitors/ClassBody.js:15 — ClassBody has cyclomatic complexity 37 and cognitive complexity 78; 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 visit_component (cyclomatic 37, cognitive 55) · ×1
  • Complex function visit_component (cyclomatic 37, cognitive 55) packages/svelte/src/compiler/phases/2-analyze/visitors/shared/component.js:19 — visit_component has cyclomatic complexity 37 and cognitive complexity 55; 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 calculate_blockers (cyclomatic 36, cognitive 94) · ×1
  • Complex function calculate_blockers (cyclomatic 36, cognitive 94) packages/svelte/src/compiler/phases/2-analyze/index.js:960 — calculate_blockers has cyclomatic complexity 36 and cognitive complexity 94; 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 is_expression_async (cyclomatic 34, cognitive 12) · ×1
  • Complex function is_expression_async (cyclomatic 34, cognitive 12) packages/svelte/src/compiler/utils/ast.js:484 — is_expression_async has cyclomatic complexity 34 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 read_attribute (cyclomatic 33, cognitive 51) · ×1
  • Complex function read_attribute (cyclomatic 33, cognitive 51) packages/svelte/src/compiler/phases/1-parse/state/element.js:521 — read_attribute has cyclomatic complexity 33 and cognitive complexity 51; 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 · REDACTED · ×1
  • REDACTED: 1829 lines of code REDACTED:1 — REDACTED has 1829 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/scope.js · ×1
  • packages/svelte/src/compiler/phases/scope.js: 1316 lines of code packages/svelte/src/compiler/phases/scope.js:1 — packages/svelte/src/compiler/phases/scope.js has 1316 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/2-analyze/index.js · ×1
  • packages/svelte/src/compiler/phases/2-analyze/index.js: 1206 lines of code packages/svelte/src/compiler/phases/2-analyze/index.js:1 — packages/svelte/src/compiler/phases/2-analyze/index.js has 1206 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/client/reactivity/batch.js · ×1
  • packages/svelte/src/internal/client/reactivity/batch.js: 1192 lines of code packages/svelte/src/internal/client/reactivity/batch.js:1 — packages/svelte/src/internal/client/reactivity/batch.js has 1192 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js · ×1
  • packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js: 1082 lines of code packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js:1 — packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js has 1082 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/print/index.js · ×1
  • packages/svelte/src/compiler/print/index.js: 950 lines of code packages/svelte/src/compiler/print/index.js:1 — packages/svelte/src/compiler/print/index.js has 950 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js · ×1
  • packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js: 920 lines of code packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:1 — packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js has 920 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/server/renderer.js · ×1
  • packages/svelte/src/internal/server/renderer.js: 875 lines of code packages/svelte/src/internal/server/renderer.js:1 — packages/svelte/src/internal/server/renderer.js has 875 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/1-parse/state/element.js · ×1
  • packages/svelte/src/compiler/phases/1-parse/state/element.js: 847 lines of code packages/svelte/src/compiler/phases/1-parse/state/element.js:1 — packages/svelte/src/compiler/phases/1-parse/state/element.js has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/scripts/generate-browser-support.ts · ×1
  • packages/svelte/scripts/generate-browser-support.ts: 781 lines of code packages/svelte/scripts/generate-browser-support.ts:1 — packages/svelte/scripts/generate-browser-support.ts has 781 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/client/runtime.js · ×1
  • packages/svelte/src/internal/client/runtime.js: 743 lines of code packages/svelte/src/internal/client/runtime.js:1 — packages/svelte/src/internal/client/runtime.js has 743 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js · ×1
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js: 705 lines of code packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js:1 — packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js has 705 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/1-parse/state/tag.js · ×1
  • packages/svelte/src/compiler/phases/1-parse/state/tag.js: 698 lines of code packages/svelte/src/compiler/phases/1-parse/state/tag.js:1 — packages/svelte/src/compiler/phases/1-parse/state/tag.js has 698 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/client/reactivity/effects.js · ×1
  • packages/svelte/src/internal/client/reactivity/effects.js: 657 lines of code packages/svelte/src/internal/client/reactivity/effects.js:1 — packages/svelte/src/internal/client/reactivity/effects.js has 657 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/client/dom/blocks/each.js · ×1
  • packages/svelte/src/internal/client/dom/blocks/each.js: 640 lines of code packages/svelte/src/internal/client/dom/blocks/each.js:1 — packages/svelte/src/internal/client/dom/blocks/each.js has 640 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/utils/builders.js · ×1
  • packages/svelte/src/compiler/utils/builders.js: 627 lines of code packages/svelte/src/compiler/utils/builders.js:1 — packages/svelte/src/compiler/utils/builders.js has 627 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/3-transform/client/transform-client.js · ×1
  • packages/svelte/src/compiler/phases/3-transform/client/transform-client.js: 619 lines of code packages/svelte/src/compiler/phases/3-transform/client/transform-client.js:1 — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js has 619 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/client/dom/elements/attributes.js · ×1
  • packages/svelte/src/internal/client/dom/elements/attributes.js: 615 lines of code packages/svelte/src/internal/client/dom/elements/attributes.js:1 — packages/svelte/src/internal/client/dom/elements/attributes.js has 615 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/legacy.js · ×1
  • packages/svelte/src/compiler/legacy.js: 598 lines of code packages/svelte/src/compiler/legacy.js:1 — packages/svelte/src/compiler/legacy.js has 598 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/1-parse/read/style.js · ×1
  • packages/svelte/src/compiler/phases/1-parse/read/style.js: 593 lines of code packages/svelte/src/compiler/phases/1-parse/read/style.js:1 — packages/svelte/src/compiler/phases/1-parse/read/style.js has 593 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/utils/ast.js · ×1
  • packages/svelte/src/compiler/utils/ast.js: 570 lines of code packages/svelte/src/compiler/utils/ast.js:1 — packages/svelte/src/compiler/utils/ast.js has 570 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js · ×1
  • packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js: 517 lines of code packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js:1 — packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js has 517 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/client/dom/blocks/boundary.js · ×1
  • packages/svelte/src/internal/client/dom/blocks/boundary.js: 492 lines of code packages/svelte/src/internal/client/dom/blocks/boundary.js:1 — packages/svelte/src/internal/client/dom/blocks/boundary.js has 492 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/server/index.js · ×1
  • packages/svelte/src/internal/server/index.js: 486 lines of code packages/svelte/src/internal/server/index.js:1 — packages/svelte/src/internal/server/index.js has 486 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/utils.js · ×1
  • packages/svelte/src/utils.js: 467 lines of code packages/svelte/src/utils.js:1 — packages/svelte/src/utils.js has 467 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js · ×1
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js: 452 lines of code packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js:1 — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js has 452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/client/dev/debug.js · ×1
  • packages/svelte/src/internal/client/dev/debug.js: 452 lines of code packages/svelte/src/internal/client/dev/debug.js:1 — packages/svelte/src/internal/client/dev/debug.js has 452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/utils/mapped_code.js · ×1
  • packages/svelte/src/compiler/utils/mapped_code.js: 444 lines of code packages/svelte/src/compiler/utils/mapped_code.js:1 — packages/svelte/src/compiler/utils/mapped_code.js has 444 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js · ×1
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js: 435 lines of code packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js:1 — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js has 435 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/client/dom/elements/transitions.js · ×1
  • packages/svelte/src/internal/client/dom/elements/transitions.js: 429 lines of code packages/svelte/src/internal/client/dom/elements/transitions.js:1 — packages/svelte/src/internal/client/dom/elements/transitions.js has 429 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/compiler/phases/3-transform/css/index.js · ×1
  • packages/svelte/src/compiler/phases/3-transform/css/index.js: 419 lines of code packages/svelte/src/compiler/phases/3-transform/css/index.js:1 — packages/svelte/src/compiler/phases/3-transform/css/index.js has 419 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/svelte/src/internal/client/reactivity/deriveds.js · ×1
  • packages/svelte/src/internal/client/reactivity/deriveds.js: 414 lines of code packages/svelte/src/internal/client/reactivity/deriveds.js:1 — packages/svelte/src/internal/client/reactivity/deriveds.js has 414 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
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:2 — 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 (59 application, 44 tooling, 7606 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 (59 application, 44 tooling, 7606 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 (59 application, 44 tooling, 7606 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 (59 application, 44 tooling, 7606 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 — 110 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×39
  • Duplicated predicate packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js:119 — `!Array.isArray(value) || value.length === 1` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js, packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.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/shared/element.js:142 — `!element.metadata.svg && !element.metadata.mathml` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js, packages/svelte/src/compiler/phases/3-transform/server/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/2-analyze/visitors/ExportNamedDeclaration.js:35 — `(binding.kind === 'state' || binding.kind === 'raw_state') && binding.reassigned` appears character-identically in 2 files — packages/svelte/src/compiler/phases/2-analyze/visitors/ExportNamedDeclaration.js, packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.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/internal/client/dev/ownership.js:75 — `STATE_SYMBOL in props || LEGACY_PROPS in props` appears character-identically in 2 files — packages/svelte/src/internal/client/dev/ownership.js, packages/svelte/src/internal/client/reactivity/props.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/2-analyze/visitors/ConstTag.js:31 — `a.type === 'Attribute' && a.name === 'slot'` appears character-identically in 2 files — packages/svelte/src/compiler/phases/2-analyze/visitors/ConstTag.js, packages/svelte/src/compiler/phases/2-analyze/visitors/shared/attribute.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 REDACTED:330 — `analysis.uses_props || analysis.uses_rest_props` appears character-identically in 3 files — REDACTED, packages/svelte/src/compiler/phases/3-transform/client/transform-client.js, packages/svelte/src/compiler/phases/3-transform/server/transform-server.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/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/2-analyze/visitors/SvelteBody.js:17 — `attribute.type === 'SpreadAttribute' || attribute.type === '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/2-analyze/visitors/DeclarationTag.js:49 — `b !== null && b.object !== context.state.async_consts?.id` appears character-identically in 3 files — packages/svelte/src/compiler/phases/2-analyze/visitors/DeclarationTag.js, packages/svelte/src/compiler/phases/3-transform/client/visitors/DeclarationTag.js, packages/svelte/src/compiler/phases/3-transform/server/visitors/DeclarationTag.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/LabeledStatement.js:37 — `binding.kind === 'normal' && binding.declaration_kind !== 'import'` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/visitors/LabeledStatement.js, packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.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/transform-client.js:291 — `binding?.kind === 'state' || binding?.kind === 'raw_state'` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/transform-client.js, packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.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/2-analyze/visitors/DeclarationTag.js:16 — `context.path.length === 1 && context.path[0].type === 'Fragment'` appears character-identically in 3 files — packages/svelte/src/compiler/phases/2-analyze/visitors/DeclarationTag.js, packages/svelte/src/compiler/phases/2-analyze/visitors/SnippetBlock.js, packages/svelte/src/compiler/phases/3-transform/client/visitors/SnippetBlock.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/2-analyze/visitors/ClassDeclaration.js:11 — `context.state.analysis.runes && node.id !== null` appears character-identically in 2 files — packages/svelte/src/compiler/phases/2-analyze/visitors/ClassDeclaration.js, packages/svelte/src/compiler/phases/2-analyze/visitors/FunctionDeclaration.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/LabeledStatement.js:12 — `context.state.analysis.runes || context.path.length > 1 || node.label.name !== '$'` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/visitors/LabeledStatement.js, packages/svelte/src/compiler/phases/3-transform/server/visitors/LabeledStatement.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/VariableDeclaration.js:371 — `declarator.init && context.visit(declarator.init)` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js, packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.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/EachBlock.js:141 — `each_node_meta.contains_group_binding || !node.index` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js, packages/svelte/src/compiler/phases/3-transform/server/visitors/EachBlock.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/shared/element.js:193 — `element.metadata.scoped && context.state.analysis.css.hash` appears character-identically in 2 files — packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js, packages/svelte/src/compiler/phases/3-transform/server/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/2-analyze/css/css-prune.js:948 — `element.type === 'RegularElement' && element.name === 'select'` appears character-identically in 3 files — packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js, packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js, packages/svelte/src/compiler/phases/3-transform/server/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/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.
  • Duplicated predicate packages/svelte/src/compiler/phases/2-analyze/visitors/PropertyDefinition.js:12 — `name && context.state.state_fields.get(name)` appears character-identically in 3 files — packages/svelte/src/compiler/phases/2-analyze/visitors/PropertyDefinition.js, packages/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js, packages/svelte/src/compiler/phases/3-transform/server/visitors/AssignmentExpression.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 REDACTED:378 — `node.body.type === 'ExpressionStatement' && node.body.expression.type === 'AssignmentExpression'` appears character-identically in 4 files — REDACTED, packages/svelte/src/compiler/phases/2-analyze/visitors/LabeledStatement.js, packages/svelte/src/compiler/phases/3-transform/server/transform-server.js, packages/svelte/src/compiler/phases/scope.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/2-analyze/index.js:580 — `node.declaration.type === 'FunctionDeclaration' || node.declaration.type === 'ClassDeclaration'` appears character-identically in 2 files — packages/svelte/src/compiler/phases/2-analyze/index.js, packages/svelte/src/compiler/phases/2-analyze/visitors/ExportNamedDeclaration.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/2-analyze/css/css-prune.js:920 — `node.type === 'RegularElement' || node.type === 'SvelteElement'` appears character-identically in 2 files — packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js, packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.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/2-analyze/css/css-analyze.js:47 — `node.type === 'Rule' && node.metadata.is_global_block` appears character-identically in 2 files — packages/svelte/src/compiler/phases/2-analyze/css/css-analyze.js, packages/svelte/src/compiler/phases/3-transform/css/index.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.
  • + 14 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Disabled test · ×7
  • Disabled test packages/svelte/tests/signals/test.ts:63 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/svelte/tests/signals/test.ts:64 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/svelte/tests/signals/test.ts:759 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/svelte/tests/suite.ts:128 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/svelte/tests/validator/test.ts:88 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/svelte/tests/validator/test.ts:97 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/svelte/tests/validator/test.ts:112 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned file · ×4
  • Orphaned file packages/svelte/src/internal/client/dom/elements/custom-element.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file packages/svelte/src/store/shared/index.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file packages/svelte/src/reactivity/set.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file packages/svelte/src/compiler/preprocess/decode_sourcemap.js:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
R7 · Dead Code · Unused module-local declaration 'a' · ×4
  • Unused module-local declaration 'a' packages/svelte/tests/compiler-errors/samples/runes-wrong-effect-placement/main.svelte:2 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
  • Unused module-local declaration 'a' packages/svelte/tests/runtime-legacy/samples/empty-dom/main.svelte:2 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
  • Unused module-local declaration 'a' packages/svelte/tests/runtime-legacy/samples/reactive-assignment-in-declaration/main.svelte:4 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
  • Unused module-local declaration 'a' packages/svelte/tests/runtime-legacy/samples/reactive-assignment-in-for-loop-head/main.svelte:7 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
D24 · Comment Value · redundant comment · ×3
  • redundant comment packages/svelte/src/compiler/phases/2-analyze/visitors/StyleDirective.js:19 — "get the binding for node.name and change the binding to state" repeats the code it sits on: 5 of its 6 words (get, binding, node, name, state) are already in `let binding = context.state.scope.get(node.name);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js:138 — "aria-activedescendant-has-tabindex" repeats the code it sits on: 3 of its 3 words (aria, activedescendant, tabindex) are already in `if (`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/svelte/src/compiler/utils/mapped_code.js:342 — "parse attached sourcemap in processed.code" repeats the code it sits on: 4 of its 5 words (parse, attached, sourcemap, processed) are already in `export function parse_attached_sourcemap(processed, tag_name)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
R7 · Dead Code · Unused module-local declaration 'foo' · ×3
  • Unused module-local declaration 'foo' packages/svelte/tests/compiler-errors/samples/store-autosub-context-module/main.svelte:5 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
  • Unused module-local declaration 'foo' packages/svelte/tests/compiler-errors/samples/store-shadow-scope/main.svelte:5 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
  • Unused module-local declaration 'foo' packages/svelte/tests/runtime-legacy/samples/async-generator-object-methods/main.svelte:2 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused private field '#count' · ×3
  • Unused private field '#count' packages/svelte/tests/runtime-runes/samples/class-state-init-eager-2/main.svelte:8 — Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
  • Unused private field '#count' packages/svelte/tests/runtime-runes/samples/class-state-init-eager-3/main.svelte:4 — Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
  • Unused private field '#count' packages/svelte/tests/runtime-runes/samples/class-state-init-eager/main.svelte:4 — Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
IC1 · Incompleteness & stubs · Empty method body · ×2
  • Empty method body packages/svelte/src/index-server.js:40 — `tick` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body packages/svelte/src/index-server.js:42 — `settled` has an empty body — confirm it's an intentional no-op and not an unfinished method.
R7 · Dead Code · Unused module-local declaration 'ok' · ×2
  • Unused module-local declaration 'ok' packages/svelte/tests/compiler-errors/samples/dollar-binding-declaration-legacy/main.svelte:4 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
  • Unused module-local declaration 'ok' packages/svelte/tests/compiler-errors/samples/dollar-binding-declaration-runes-2/main.svelte:4 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'Test' · ×2
  • Unused module-local declaration 'Test' packages/svelte/tests/runtime-runes/samples/class-state-conflicting-get-name/main.svelte:2 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
  • Unused module-local declaration 'Test' packages/svelte/tests/runtime-runes/samples/class-state-constructor-conflicting-get-name/main.svelte:2 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
D12 · Dependency Hygiene · Deprecated · ×1
  • Deprecated: whatwg-encoding REDACTED:2423 — whatwg-encoding 3.1.1 is resolved in REDACTED and is marked deprecated by its publisher: "Use @exodus/bytes instead for a more spec-conformant and faster implementation". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
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/analyze-compiler-profile.js, benchmarking/profile-compiler.js. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 3 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 (5 single-owned of 167 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 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)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: benchmarking/utils.js, packages/svelte/src/easing/index.js, packages/svelte/src/compiler/phases/3-transform/client/transform-template/index.js.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `packages/svelte` (54914 LoC, 378 module-visible types across 50 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D30 · Dependency Vulnerabilities · 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 — 4 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, example/demo and scaffolding-template 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/internal/client/dom/elements/custom-element.js, packages/svelte/src/store/shared/index.js, packages/svelte/src/reactivity/set.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
IC1 · Incompleteness & stubs · Blanket warning suppression · ×1
  • Blanket warning suppression packages/svelte/src/compiler/validate-options.js:16 — A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
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 REDACTED:5 — 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 4 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.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation package.json:29 — `package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
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 module-local declaration 'X' · ×1
  • Unused module-local declaration 'X' packages/svelte/tests/compiler-errors/samples/class-state-field-static/main.svelte:2 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'ok2' · ×1
  • Unused module-local declaration 'ok2' packages/svelte/tests/compiler-errors/samples/dollar-binding-declaration-legacy/main.svelte:5 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'error' · ×1
  • Unused module-local declaration 'error' packages/svelte/tests/compiler-errors/samples/dollar-binding-declaration-runes-2/main.svelte:5 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'x' · ×1
  • Unused module-local declaration 'x' packages/svelte/tests/compiler-errors/samples/runes-wrong-props-placement-instance/main.svelte:2 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'strip_link' · ×1
  • Unused module-local declaration 'strip_link' packages/svelte/tests/css/test.ts:43 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'func' · ×1
  • Unused module-local declaration 'func' packages/svelte/tests/runtime-legacy/samples/const-tag-func-function/main.svelte:2 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'obj' · ×1
  • Unused module-local declaration 'obj' packages/svelte/tests/runtime-legacy/samples/each-blocks-assignment/main.svelte:2 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'yes' · ×1
  • Unused module-local declaration 'yes' packages/svelte/tests/runtime-legacy/samples/ondestroy-deep/C.svelte:5 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'employees' · ×1
  • Unused module-local declaration 'employees' packages/svelte/tests/runtime-legacy/samples/reactive-assignment-in-complex-declaration/main.svelte:4 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'onClick' · ×1
  • Unused module-local declaration 'onClick' packages/svelte/tests/runtime-legacy/samples/reactive-update-expression/main.svelte:6 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'timeZone' · ×1
  • Unused module-local declaration 'timeZone' packages/svelte/tests/runtime-legacy/samples/semicolon-hoisting/main.svelte:3 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused private method '#tree' · ×1
  • Unused private method '#tree' packages/svelte/tests/runtime-runes/samples/class-disabinguate-private-method-definition/main.svelte:4 — Nothing in its class calls or references this private method — no member access, no string key, no decorator, and no test reaches it by name. A private member cannot be called from outside its class, so this is the whole search: remove it, or call it where it was meant to be used.
R7 · Dead Code · Write-only private field '#count' · ×1
  • Write-only private field '#count' packages/svelte/tests/runtime-runes/samples/class-state-init-conflict/main.svelte:4 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Write-only private field '#_count' · ×1
  • Write-only private field '#_count' packages/svelte/tests/runtime-runes/samples/class-state-init-conflict/main.svelte:5 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Write-only private field '#id' · ×1
  • Write-only private field '#id' packages/svelte/tests/runtime-runes/samples/each-updates-9/main.svelte:10 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Unused module-local declaration 'init' · ×1
  • Unused module-local declaration 'init' packages/svelte/tests/runtime-runes/samples/reassigned-store-not-state/main.svelte:10 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'store2' · ×1
  • Unused module-local declaration 'store2' packages/svelte/tests/runtime-runes/samples/store-no-mutation-validation/main.svelte:5 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'this_fn' · ×1
  • Unused module-local declaration 'this_fn' packages/svelte/tests/runtime-runes/samples/typescript/main.svelte:7 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'MyClass' · ×1
  • Unused module-local declaration 'MyClass' packages/svelte/tests/runtime-runes/samples/typescript/main.svelte:24 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 4/6 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Minor — 4920 finding(s)
D10 · Test Quality · Skipped (documented) · ×4911
  • Skipped (documented): (unnamed test) packages/svelte/tests/validator/samples/tag-hyphen/_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/validator/samples/tag-emoji/_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/validator/samples/tag-custom-element-options-true/_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/validator/samples/siblings-combinator-in-custom-element-selects-slot-fallback/_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/validator/samples/runes-referenced-nonstate-bind-this/_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/validator/samples/runes-referenced-nonstate-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/validator/samples/runes-referenced-nonstate/_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/validator/samples/runes-conflicting-store-in-module/_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/validator/samples/reactive-statement-non-reactive-self-declaration/_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/validator/samples/non-empty-block-dev/_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/validator/samples/no-runes-mode/_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/validator/samples/ignore-warning-compiler-option/_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/validator/samples/global-event-reference-special-elements/_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/validator/samples/global-event-reference/_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/validator/samples/general-siblings-combinator-in-custom-element-selects-slot-fallback/_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/validator/samples/error-mode-warn/_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/validator/samples/each-block-multiple-children/_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/validator/samples/css-mismatched-quotes/_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/sourcemaps/samples/typescript/_config.js:4 — 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/sourcemaps/samples/two-scripts/_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/sourcemaps/samples/static-no-script/_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/sourcemaps/samples/static-no-script/_config.js:4 — 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/sourcemaps/samples/sourcemap-sources/_config.js:40 — 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/sourcemaps/samples/sourcemap-offsets/_config.js:6 — 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/sourcemaps/samples/sourcemap-names/_config.js:5 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • + 4886 more in this group — see findings.md.
D12 · Dependency Hygiene · Outdated (npm) · ×8
  • Outdated (npm): @types/estree — @types/estree is pinned at 1.0.9; registry.npmjs.org publishes 1.0.10 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): acorn — acorn is pinned at 8.18.0; registry.npmjs.org publishes 8.19.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): 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.3 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.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.
  • 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.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names packages/svelte/src/compiler/phases/1-parse/utils/bracket.js:17 — 2 of 68 documented parameters and 2 of 577 summaries in `svelte` only repeat the member or parameter name (e.g. "The index to start searching at." for `search_start_index`). Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-1d9499eb05bf4d3dab99c6829485513c/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/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-1d9499eb05bf4d3dab99c6829485513c/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/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude .changeset --exclude documentation --exclude packages/svelte/tests/snapshot/samples/async-const/_expected --exclude packages/svelte/tests/snapshot/samples/async-each-fallback-hoisting/_expected --exclude packages/svelte/tests/snapshot/samples/async-each-hoisting/_expected --exclude packages/svelte/tests/snapshot/samples/async-if-alternate-hoisting/_expected --exclude packages/svelte/tests/snapshot/samples/async-if-chain/_expected --exclude packages/svelte/tests/snapshot/samples/async-if-hoisting/_expected --exclude packages/svelte/tests/snapshot/samples/async-in-derived/_expected --exclude packages/svelte/tests/snapshot/samples/async-top-level-group-sync-run/_expected --exclude packages/svelte/tests/snapshot/samples/async-top-level-inspect-server/_expected --exclude packages/svelte/tests/snapshot/samples/await-block-scope/_expected --exclude packages/svelte/tests/snapshot/samples/bind-component-snippet/_expected --exclude packages/svelte/tests/snapshot/samples/bind-this/_expected --exclude packages/svelte/tests/snapshot/samples/class-state-field-constructor-assignment/_expected --exclude packages/svelte/tests/snapshot/samples/dedupe-templates/_expected --exclude packages/svelte/tests/snapshot/samples/delegated-locally-declared-shadowed/_expected --exclude packages/svelte/tests/snapshot/samples/destructured-assignments/_expected --exclude packages/svelte/tests/snapshot/samples/dynamic-attributes-casing/_expected --exclude packages/svelte/tests/snapshot/samples/each-index-non-null/_expected --exclude packages/svelte/tests/snapshot/samples/each-string-template/_expected --exclude packages/svelte/tests/snapshot/samples/export-state/_expected --exclude packages/svelte/tests/snapshot/samples/function-prop-no-getter/_expected --exclude packages/svelte/tests/snapshot/samples/functional-templating/_expected --exclude packages/svelte/tests/snapshot/samples/hello-world/_expected --exclude packages/svelte/tests/snapshot/samples/hmr/_expected --exclude packages/svelte/tests/snapshot/samples/imports-in-modules/_expected --exclude packages/svelte/tests/snapshot/samples/nullish-coallescence-omittance/_expected --exclude packages/svelte/tests/snapshot/samples/props-identifier/_expected --exclude packages/svelte/tests/snapshot/samples/purity/_expected --exclude packages/svelte/tests/snapshot/samples/select-with-rich-content/_expected --exclude packages/svelte/tests/snapshot/samples/skip-static-subtree/_expected --exclude packages/svelte/tests/snapshot/samples/state-proxy-literal/_expected --exclude packages/svelte/tests/snapshot/samples/svelte-element/_expected --exclude packages/svelte/tests/snapshot/samples/text-nodes-deriveds/_expected --exclude packages/svelte/tests/snapshot/samples/typescript-optional-parameter/_expected --exclude packages/svelte/types .13artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .25artifacts/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 9 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`, … (+4 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/** .0artifacts/raw/trivy-fs.json

Run 01a1dd7f-60b3-703d-b683-fdc10d88f8a7 · 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