Public report — esbuild, published 6 Aug 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 06-08-2026 @ 06:49 UTC Public
Code Health Audit

Evanw/esbuild

40% At Risk

Medium · 91,003 LoC · rebuild ~1.0 person-years · weakest lens: Readiness (35%)

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

38/40dimensions tool-verifieddeterministic · confidence 1.0 · 2 LLM-assisted, advisory
813findings with an exact file:lineof 823 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
40/105dimensions across the health lenses91003 LoC — wide & deep

Executive summary

Read through the Preview lens: this repo is pre-1.0 / in development, so the colour bands are relaxed to what a preview needs — *green* means good enough for a preview, not yet production-stable. Code correctness and security stay near-strict even here; the score itself is absolute and comparable across repos.

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

Most urgent: a critical security exposure was detected (see the Security & Compliance lens). Treat it as a priority regardless of the overall grade.

The area that most needs attention is Readiness (35%) — releases are harder to depend on — versioning, release notes and dependency hygiene are thin, so consumers can't easily tell what changed or trust an upgrade. Accessibility (39%) is the next concern — it raises ongoing delivery and operational cost.

Leadership focus, highest impact first: SAST step to CI running what this repository's stack ships (Security & performance tooling); tests that import the unreached modules (directly or through… (Test Coverage); Nothing pauses a release for a human (Deployment & Rollback).

For scale: Medium (~91,003 production lines); rebuilding it from scratch would take roughly ~1.0 person-years (~1–2 engineers). Approximate, ±~30%.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Readiness 35% · 46% weightAccessibility 39% · 25% weightSecurity 40% · 14% weightCode Health 54% · 8% weightMaturity 57% · 4% weightArchitecture 65% · 2% weight

Raise Readiness 35 → 70 (the Healthy floor) ⇒ headline 40 → ~45.

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

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

  • D3 · TooManyMethods: parser internal/js_parser/js_parser.go
  • D4 · Duplicated block (23 lines × 2) internal/js_ast/js_ast_helpers.go
  • D4 · Duplicated block (19 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (18 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (16 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (16 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (16 lines × 2) internal/linker/linker.go
  • D4 · Duplicated block (15 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (15 lines × 2) internal/js_ast/js_ident.go
  • D4 · Duplicated block (14 lines × 4) internal/js_parser/js_parser.go
  • D4 · Duplicated block (14 lines × 2) cmd/esbuild/service.go
  • D4 · Duplicated block (14 lines × 2) internal/css_parser/css_nesting.go
  • D4 · Duplicated block (14 lines × 2) internal/css_printer/css_printer.go
  • D4 · Duplicated block (14 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (13 lines × 2) cmd/esbuild/service.go
  • D4 · Duplicated block (13 lines × 2) internal/bundler/bundler.go
  • D4 · Duplicated block (13 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (13 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (13 lines × 2) internal/resolver/package_json.go
  • D4 · Duplicated block (12 lines × 3) internal/js_parser/js_parser_lower_class.go
  • D4 · Duplicated block (12 lines × 2) internal/css_printer/css_printer.go
  • D4 · Duplicated block (12 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (12 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (12 lines × 2) internal/js_parser/ts_parser.go
  • D4 · Duplicated block (12 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (12 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (12 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (12 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (11 lines × 4) internal/css_parser/css_decls_color.go
  • D4 · Duplicated block (11 lines × 2) cmd/esbuild/service.go
  • D4 · Duplicated block (11 lines × 2) internal/css_parser/css_reduce_calc.go
  • D4 · Duplicated block (11 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (11 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (11 lines × 2) internal/js_parser/ts_parser.go
  • D4 · Duplicated block (11 lines × 2) internal/js_parser/ts_parser.go
  • D4 · Duplicated block (11 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (11 lines × 2) internal/linker/linker.go
  • D4 · Duplicated block (11 lines × 2) pkg/cli/cli_impl.go
  • D4 · Duplicated block (10 lines × 4) internal/js_printer/js_printer.go
  • D4 · Duplicated block (10 lines × 2) cmd/esbuild/service.go
  • D4 · Duplicated block (10 lines × 2) internal/bundler/bundler.go
  • D4 · Duplicated block (10 lines × 2) internal/cache/cache_ast.go
  • D4 · Duplicated block (10 lines × 2) internal/js_ast/js_ast_helpers.go
  • D4 · Duplicated block (10 lines × 2) internal/js_lexer/js_lexer.go
  • D4 · Duplicated block (10 lines × 2) internal/js_lexer/js_lexer.go
  • D4 · Duplicated block (10 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (10 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (10 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (10 lines × 2) internal/linker/linker.go
  • D4 · Duplicated block (10 lines × 2) internal/linker/linker.go
  • D4 · Duplicated block (10 lines × 2) pkg/api/api_impl.go
  • D4 · Duplicated block (10 lines × 2) internal/js_ast/js_ident.go
  • D4 · Duplicated block (9 lines × 3) internal/bundler/bundler.go
  • D4 · Duplicated block (9 lines × 2) cmd/esbuild/service.go
  • D4 · Duplicated block (9 lines × 2) internal/js_lexer/js_lexer.go
  • D4 · Duplicated block (9 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (9 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (9 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (9 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (9 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (9 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (9 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (9 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (9 lines × 2) internal/linker/linker.go
  • D4 · Duplicated block (9 lines × 2) internal/linker/linker.go
  • D4 · Duplicated block (9 lines × 2) internal/linker/linker.go
  • D4 · Duplicated block (9 lines × 2) internal/linker/linker.go
  • D4 · Duplicated block (9 lines × 2) internal/resolver/package_json.go
  • D4 · Duplicated block (9 lines × 2) internal/resolver/yarnpnp.go
  • D4 · Duplicated block (9 lines × 2) internal/js_ast/js_ident.go
  • D4 · Duplicated block (8 lines × 2) cmd/esbuild/service.go
  • D4 · Duplicated block (8 lines × 2) internal/bundler/bundler.go
  • D4 · Duplicated block (8 lines × 2) internal/css_parser/css_decls_color.go
  • D4 · Duplicated block (8 lines × 2) internal/js_lexer/js_lexer.go
  • D4 · Duplicated block (8 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (8 lines × 2) internal/js_parser/ts_parser.go
  • D4 · Duplicated block (8 lines × 2) internal/linker/linker.go
  • D4 · Duplicated block (8 lines × 2) internal/resolver/resolver.go
  • D4 · Duplicated block (8 lines × 2) pkg/api/api_impl.go
  • D4 · Duplicated block (7 lines × 4) internal/bundler/bundler.go
  • D4 · Duplicated block (7 lines × 4) internal/css_parser/css_color_spaces.go
  • D4 · Duplicated block (7 lines × 2) cmd/esbuild/service.go
  • D4 · Duplicated block (7 lines × 2) internal/css_parser/css_nesting.go
  • D4 · Duplicated block (7 lines × 2) internal/css_parser/css_parser.go
  • D4 · Duplicated block (7 lines × 2) internal/js_ast/js_ast_helpers.go
  • D4 · Duplicated block (7 lines × 2) internal/js_ast/js_ast_helpers.go
  • D4 · Duplicated block (7 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (7 lines × 2) internal/js_printer/js_printer.go
  • D4 · Duplicated block (7 lines × 2) pkg/api/serve_other.go
  • D4 · Duplicated block (7 lines × 2) internal/helpers/utf.go
  • D4 · Duplicated block (6 lines × 2) internal/bundler/bundler.go
  • D4 · Duplicated block (6 lines × 2) internal/css_parser/css_decls_color.go
  • D4 · Duplicated block (6 lines × 2) internal/css_parser/css_reduce_calc.go
  • D4 · Duplicated block (6 lines × 2) internal/js_lexer/js_lexer.go
  • D4 · Duplicated block (6 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (6 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (6 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (6 lines × 2) internal/js_parser/js_parser.go
  • D4 · Duplicated block (6 lines × 2) internal/js_parser/js_parser_lower_class.go
  • D4 · Duplicated block (6 lines × 2) internal/js_parser/js_parser_lower_class.go

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

Rebuild cost & value ~ Modeled — €49,000–€250,000
Cost to rebuild€49,000–€250,000 (0.5–1.5 person-years (817–2,591 h), ~1–2 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 40% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
Dead frontend code~26 LoC unreachable (1 file(s)) — that slice of this estimate buys code with zero runtime value; deleting it is the cheapest win in this report (the R7 card lists every file)

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

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

Top priorities

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

1
Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
+5.7 pts · Medium effort · Security & performance tooling
2
Add tests that import the unreached modules (directly or through their public entry).
+5.7 pts · Medium effort · Test Coverage
3
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.
+5.3 pts · Medium effort · Deployment & Rollback

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Medium asset (~1.0 person-years to rebuild), and its weakest lens is Readiness at 35%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~1.0 person-years rebuild (91,003 LoC) · weakest lens: Readiness 35%
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
A velocity tax on every change · High · Economics
The code-quality signals (complexity, duplication, cohesion) average 3.8/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 11–24% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 3.8/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
The top fix pays for itself · Medium · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 0.7–3.9 engineer-days every year, paid as drag on the ~2,462 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 9–184 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 11–24% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 607 line(s) changed over a 90-day window ⇒ ~2,462/year · D1/D2/D4 code quality: averaging 3.8/10 ⇒ a 11–24% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 184 months.

Architecture — module dependency matrix

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

…e470385c72ac8f52a9aa9…/internal/api_helpers…w/esbuild/internal/fs…build/internal/logger…build/internal/xxhash…ld/internal/css_lexer…uild/internal/helpers…/esbuild/internal/ast…uild/internal/css_ast…ld/internal/sourcemap…build/internal/compat…build/internal/js_ast…uild/internal/runtime…build/internal/config…uild/internal/renamer…d/internal/css_parser…/internal/css_printer…ild/internal/js_lexer…d/internal/js_printer…ld/internal/js_parser…sbuild/internal/cache…ild/internal/resolver…sbuild/internal/graph…uild/internal/bundler…build/internal/linker…evanw/esbuild/pkg/api…w/esbuild/cmd/esbuild…/internal/cli_helpers…evanw/esbuild/pkg/cli…e470385c72ac8f52a9aa91…/internal/api_helpers2…w/esbuild/internal/fs3…build/internal/logger4…build/internal/xxhash5…ld/internal/css_lexer6…uild/internal/helpers7…/esbuild/internal/ast8…uild/internal/css_ast9…ld/internal/sourcemap10…build/internal/compat11…build/internal/js_ast12…uild/internal/runtime13…build/internal/config14…uild/internal/renamer15…d/internal/css_parser16…/internal/css_printer17…ild/internal/js_lexer18…d/internal/js_printer19…ld/internal/js_parser20…sbuild/internal/cache21…ild/internal/resolver22…sbuild/internal/graph23…uild/internal/bundler24…build/internal/linker25…evanw/esbuild/pkg/api26…w/esbuild/cmd/esbuild27…/internal/cli_helpers28…evanw/esbuild/pkg/cli29141161222121113115436211142143133143495222151041312222942254235126149411721724244311241134214115114243712113587285124664112918121251421216117

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

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

At a glance — Maturity · 57% · Adequate · gated by D15, M2

At a glance — Readiness · 35% · Weak · gated by R4, P3

At a glance — Security · 40% · Weak · gated by D29, D36, D38

At a glance — Accessibility · 39% · Weak · gated by AC1

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:2021 — Injection31High / Critical
A06:2021 — Vulnerable & Outdated Components24High / Critical

Roadmap

First, integrate static security scanning into the CI pipeline to fail the build on vulnerabilities, ensuring security regressions are caught early. Next, expand test coverage to include all unreached production modules to improve code reliability. Then, implement a release gate or draft mode to prevent bad builds from reaching users. Finally, enforce release hygiene by stamping versions in build manifests and removing unused dependencies to maintain a clean, traceable, and efficient codebase.

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

Do thisHelpsEffortDimension
Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+5.7 ptsMediumSecurity & performance tooling
Add tests that import the unreached modules (directly or through their public entry).+5.7 ptsMediumTest Coverage
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.+5.3 ptsMediumDeployment & Rollback
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.+5.3 ptsMediumRelease Hygiene
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+5.3 ptsMediumDependency Hygiene
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+3.6 ptsMediumText alternatives
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with your test runner's axe binding (jest-axe, vitest-axe, cypress-axe or @axe-core/playwright) in tests, then gate axe/pa11y/Lighthouse in CI.+3.6 ptsMediumA11y enforcement
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+3.5 ptsMediumPage structure

File quality

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

FileScoreBandWorst signal
require/parcel2/package-lock.json1.3SlopOSV Dependency Vulnerabilities: High CVE: [GHSA redacted]
require/webpack5/package-lock.json1.4SlopOSV Dependency Vulnerabilities: High CVE: [GHSA redacted]
.github/workflows/ci.yml4.4MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/publish.yml4.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
scripts/browser/package-lock.json4.8MixedOSV Dependency Vulnerabilities: Critical CVE: [GHSA redacted]
internal/bundler/bundler.go4.9MixedStatic Analysis (SAST): Medium: math-random-used
.github/workflows/validate.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
require/rollup/package-lock.json5.8MixedOSV Dependency Vulnerabilities: High CVE: [GHSA redacted]
pkg/api/watcher.go6.4MixedStatic Analysis (SAST): Medium: math-random-used
go.mod6.9MixedOSV Dependency Vulnerabilities: Medium CVE: GO-2026-5024
internal/js_parser/js_parser.go7.0Near-cleanCyclomatic Complexity: parser.visitExprInOut (cyclomatic 618)
internal/js_printer/js_printer.go7.0Near-cleanCyclomatic Complexity: printer.printExpr (cyclomatic 377)
internal/js_lexer/js_lexer.go7.0Near-cleanCyclomatic Complexity: Lexer.Next (cyclomatic 147)
internal/linker/linker.go7.0Near-cleanCyclomatic Complexity: linkerContext.scanImportsAndExports (cyclomatic 141)
internal/css_parser/css_parser.go7.0Near-cleanCyclomatic Complexity: parser.parseAtRule (cyclomatic 122)
internal/js_parser/ts_parser.go7.0Near-cleanCyclomatic Complexity: parser.skipTypeScriptTypeWithFlags (cyclomatic 94)
internal/css_printer/css_printer.go7.0Near-cleanCyclomatic Complexity: printer.printRule (cyclomatic 92)
internal/js_ast/js_ast_helpers.go7.0Near-cleanCyclomatic Complexity: HelperContext.SimplifyUnusedExpr (cyclomatic 91)
internal/css_parser/css_decls_color.go7.0Near-cleanCyclomatic Complexity: css_parser.parseColor (cyclomatic 88)
internal/resolver/resolver.go7.0Near-cleanCyclomatic Complexity: resolverQuery.parseTSConfigFromSource (cyclomatic 71)

Methodology & how to trust this report

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

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

What we checked — 40 dimensions across the health lenses
D1D2D3D4D13D15D16D19D21D28D29D33D34D35D36D38AC1AC2AC3AC6AC7AX5M1M2M3M4P1P3P4P6R1R10R2R3R4R5R6R7R8R9

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 019fd5d5-e83a-7fa8-a4f7-884711eca6d3.

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.

  • D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity (jscpd) — it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D33 JS/npm Dependency Vulnerabilities: JS/npm CVE matching reads package manifests and lockfiles — risk from how a dependency is used, and advisories not yet published, fall outside this scan.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A clean result is "no unlabelled native 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.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

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

Dimensions

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

245 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was parser.visitExprInOut at 618. 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 logger.StringToMsgIDs at 58 — they are counted neither in the figure above nor in this dimension's score.

parser.visitExprInOut (cyclomatic 618)internal/js_parser/js_parser.go:13504
printer.printExpr (cyclomatic 377)internal/js_printer/js_printer.go:2005
parser.visitAndAppendStmt (cyclomatic 281)internal/js_parser/js_parser.go:10350
parser.parseStmt (cyclomatic 257)internal/js_parser/js_parser.go:7061
cli.parseOptionsImpl (cyclomatic 246)pkg/cli/cli_impl.go:85

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

What to do

  1. Resolve the 1 parser.visitExprInOut (cyclomatic 618) finding(s) in Cyclomatic Complexity — start with js_parser.go. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 printer.printExpr (cyclomatic 377) finding(s) in Cyclomatic Complexity — start with js_printer.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 parser.visitAndAppendStmt (cyclomatic 281) finding(s) in Cyclomatic Complexity — start with js_parser.go. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

348 method(s) exceeded the cognitive complexity threshold of 15; the worst was parser.visitExprInOut at 1654.

parser.visitExprInOut (cognitive 1654)internal/js_parser/js_parser.go:13504
printer.printExpr (cognitive 745)internal/js_printer/js_printer.go:2005
parser.visitAndAppendStmt (cognitive 628)internal/js_parser/js_parser.go:10350
parser.parseStmt (cognitive 517)internal/js_parser/js_parser.go:7061
linkerContext.scanImportsAndExports (cognitive 424)internal/linker/linker.go:1289

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

What to do

  1. Resolve the 1 parser.visitExprInOut (cognitive 1654) finding(s) in Cognitive Complexity — start with js_parser.go. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 printer.printExpr (cognitive 745) finding(s) in Cognitive Complexity — start with js_printer.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 parser.visitAndAppendStmt (cognitive 628) finding(s) in Cognitive Complexity — start with js_parser.go. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

30 god class(es) detected.

FileTooLong: js_parser/js_parser.go · ×24internal/js_parser/js_parser.go:0
TooManyMethods: parser · ×6internal/js_parser/js_parser.go:36

What to do

  1. Resolve the 24 FileTooLong finding(s) in God Classes — start with js_parser.go, linker.go, js_printer.go. — One of this dimension's main actionable groups (24 warning-level).
  2. Resolve the 6 TooManyMethods finding(s) in God Classes — start with js_parser.go, css_parser.go, js_printer.go. — One of this dimension's main actionable groups (6 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.3 / 10Exemplary✓ Tool-verified

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

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

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

131 duplicated block group(s) detected.

Duplicated block (9 lines × 2) · ×18cmd/esbuild/service.go:1057
Duplicated block (6 lines × 2) · ×15internal/bundler/bundler.go:1760
Duplicated block (10 lines × 2) · ×14cmd/esbuild/service.go:988
Duplicated block (7 lines × 2) · ×14cmd/esbuild/service.go:1359
Duplicated block (5 lines × 2) · ×11internal/css_parser/css_decls_color.go:528

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

✓ On the Gold path — maintain.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots2.3 / 10Critical✓ Tool-verified

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

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

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

Top hotspots: internal/js_parser/js_parser.go (5×618=3090); internal/js_printer/js_printer.go (3×377=1131); internal/linker/linker.go (2×141=282)

Hotspot: internal/js_parser/js_parser.go · ×4internal/js_parser/js_parser.go

What to do

  1. Resolve the 4 Hotspot finding(s) in Churn × Complexity Hotspots — start with js_parser.go, js_printer.go, linker.go. — One of this dimension's main actionable groups (4 warning-level).

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

D16 · Bus Factor6.7 / 10Adequate✓ Tool-verified

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

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

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

30 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is internal/js_parser/js_parser.go.

Off-boarding risk: anonymized user #1

What to do

  1. Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D19 · Documentation Quality / 10Strong◐ Sampled · advisory

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

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

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

The documentation is strong: an impressive landing page with the project logo, a benchmarking rationale, a feature list (speed without cache, built-in JS/CSS/TS JSX, API for CLI/JS/Go, ESM/CommonJS modules, CSS modules, minification/source maps, local server/watch plugins), and a detailed README for each platform binary (Linux x64, NetBSD arm64, WASI preview 1, etc.) with a helpful note about unsupported platforms. The body is clipped mid-README.md, so the full feature list and getting-started docs are present in the outline but not shown.

What to do

  1. Improve Documentation Quality — currently 7.0/10. — The documentation is strong: an impressive landing page with the project logo, a benchmarking rationale, a feature list (speed without cache, built-in JS/CSS/TS JSX, API for CLI/JS/Go, ESM/CommonJS modules, CSS modules, minification/source maps, local server/watch plugins), and a detailed README for each platform binary (Linux x64, NetBSD arm64, WASI preview 1, etc.) with a helpful note about unsupported platforms. The body is clipped mid-README.md, so the full feature list and getting-started docs are present in the outline but not shown.

Detailed fixes: d19_recommendation.md.

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.1 / 10Critical✓ Tool-verified

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

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

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

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

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

High: github-actions-mutable-action-tag · ×24.github/workflows/ci.yml:21detected by semgrep finding
Medium: math-random-used · ×2internal/bundler/bundler.go:14detected by semgrep finding
Low: use-of-unsafe-block · ×5internal/logger/logger_windows.go:39detected by semgrep finding

What to do

  1. Resolve the 24 High finding(s) in Static Analysis (SAST) — start with ci.yml (16), publish.yml (4), validate.yml (2). — One of this dimension's main actionable groups (24 issue-level).
  2. Resolve the 5 Low finding(s) in Static Analysis (SAST) — start with logger_windows.go (2), js-api-tests.js (2), gradient-tests.html. — One of this dimension's main actionable groups (5 recommendation-level).
  3. Resolve the 2 Medium finding(s) in Static Analysis (SAST) — start with bundler.go, watcher.go. — One of this dimension's main actionable groups (2 warning-level).

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

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

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

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

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

No known-vulnerable JS/npm dependencies.

✓ On the Gold path — maintain.

Detailed fixes: d33_recommendation.md.

D34 · Knowledge Freshness9.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: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

2 of 92 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is internal/css_parser/css_decls_font_family.go.

Further orphaned files (smaller)

✓ On the Gold path — maintain.

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

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

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

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

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

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

Unpinned build actions
No build provenance
No artifact signing
No SBOM

What to do

  1. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 No artifact signing 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.

D38 · OSV Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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

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

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

24 finding(s): 1 critical, 16 high, 7 medium, 0 low.

High CVE: [GHSA redacted] · ×13require/parcel2/package-lock.jsondetected by osv-scanner finding
High vulnerability: [GHSA redacted] · ×3require/rollup/package-lock.jsondetected by osv-scanner finding
Critical CVE: [GHSA redacted]scripts/browser/package-lock.jsondetected by osv-scanner finding
Medium CVE: [GHSA redacted] · ×7require/parcel2/package-lock.jsondetected by osv-scanner finding

What to do

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

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

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives1.0 / 10Critical✓ Tool-verified

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

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

  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. — graph-debugger.html:47

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels5.7 / 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, 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.

  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — try.html:247

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 structure4.2 / 10Weak✓ Tool-verified

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

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

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×3) — gradient-tests.html:2, graph-debugger.html:2, try.html:3
  • A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. — gradient-tests.html:2
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×3) — gradient-tests.html:2, graph-debugger.html:2, try.html:3

What to do

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

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

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

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

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

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

  • No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time.

What to do

  • Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with your test runner's axe binding (jest-axe, vitest-axe, cypress-axe or @axe-core/playwright) in tests, then gate axe/pa11y/Lighthouse in CI.
AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 7 of 39 project(s) that lack one — worth up to 0.4 pts.
  • Review the README against recent changes; refresh the parts that drifted.
M2 · Architecture documentation2.0 / 10Weak✓ 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 `NNNN-title.md` documents and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

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

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

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

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

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

P3 · Security & performance 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 gosec / govulncheck (or golangci-lint) (or `semgrep --config=auto`, which runs on any language) as a CI step.

What to do

  • Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — 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.

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 Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

What to do

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

  • 19 typed · 21 plain JS — the untyped files are require/yarnpnp/bar/index.js, require/yarnpnp/foo/index.js, require/yarnpnp/in.mjs, scripts/browser/browser-tests.js, scripts/decorator-tests.js, scripts/deno-tests.js (+15 more). 0 production file(s) opt out entirely with @ts-nocheck · 2 @ts-ignore suppression(s).

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication3.9 / 10Weak✓ Tool-verified

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

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

  • scripts/decorator-tests.ts:3139 · scripts/decorator-tests.ts:3368 · scripts/decorator-tests.ts:3597 · scripts/decorator-tests.ts:3826 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — decorator-tests.ts:3139
  • scripts/js-api-tests.js:7602 · scripts/js-api-tests.js:7832 — 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. — js-api-tests.js:7602
  • scripts/decorator-tests.js:3813 · scripts/decorator-tests.js:3901 · scripts/decorator-tests.js:3989 — all 3 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same names written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — decorator-tests.js:3813
  • scripts/decorator-tests.js:4082 · scripts/decorator-tests.js:4188 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same names written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — decorator-tests.js:4082
  • scripts/decorator-tests.js:3868 · scripts/decorator-tests.js:3951 · scripts/decorator-tests.js:4044 · scripts/decorator-tests.js:4151 · +1 more site(s) not listed — all 5 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same names written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — decorator-tests.js:3868
  • scripts/decorator-tests.js:4282 · scripts/decorator-tests.js:4432 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same names written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — decorator-tests.js:4282
  • scripts/decorator-tests.js:4685 · scripts/decorator-tests.js:4894 — all 2 copies are in the same file, and what repeats is a LIST OF ENTRIES rather than behaviour — the same names written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — decorator-tests.js:4685
  • scripts/plugin-tests.js:1347 · scripts/plugin-tests.js:1405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — plugin-tests.js:1347

What to do

  • Extract the duplicated blocks into shared functions/components.
R2 · Cyclomatic Complexity9.2 / 10Exemplary✓ Tool-verified

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

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

  • Branch-heavy code is where defects cluster — extract decisions into smaller functions. (×8) — uint8array_json_parser.ts:77, common.ts:235, common.ts:145, …

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files5.0 / 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.

  • 5 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: scripts/decorator-tests.ts (3741), lib/shared/common.ts (1700), lib/shared/types.ts (636), lib/npm/node.ts (552), compat-table/src/index.ts (505).

What to do

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

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

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

  • 0% of 23 production file(s) reachable from 0 test file(s) via the import graph

What to do

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

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

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

What to do

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

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

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

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

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

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

  • 1 file(s) (~140 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — browser
  • Unreachable from the 15 application, 19 tooling and 0 test entry point(s) detected in this repo. Gate removals on your build/type-check — an undetected custom entry would make these reachable.
  • no import path from any entry point (15 application, 19 tooling, 0 test roots considered) — in.mjs
R8 · Dependency Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×2) — node-platform.ts:261, index.js:1
  • Declared in scripts/package.json but never imported anywhere in that package or its workspace members — dead weight and attack surface. Verify against build tooling before removing. (×2)

What to do

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

  • compat-table/src/index.ts → compat-table/src/js_table.ts → compat-table/src/index.ts — index.ts
  • lib/deno/mod.ts → lib/deno/mod.ts — mod.ts
  • lib/deno/wasm.ts → lib/deno/wasm.ts — wasm.ts
  • lib/npm/browser.ts → lib/npm/browser.ts — browser.ts
  • lib/npm/node.ts → lib/npm/node.ts — node.ts

What to do

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

WCAG coverage — what static analysis assessed

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

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

Not statically assessed — these 42 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.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 Health54%Adequate — gated by D1, D2, R10Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture65%Adequate — gated by R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity57%Adequate — gated by D15, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness35%Weak — gated by R4, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security40%Weak — gated by D29, D36, D38Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility39%Weak — gated by AC1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 65 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.

  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AX1 Captive dependencies — no DI registrations detected
  • AX10 Code composition — not assessed — code composition is computed by ROLE over a document set 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
  • AX2 Stateful singletons — no singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) 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
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~53396 lines of test source are present (.go) but the test-quality collector reads C# only, so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Go module (go.mod/go.sum) and package.json), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
  • D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Production source is present (.go, .ts) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Go module (go.mod/go.sum) and package.json — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is mostly .go, .ts, which this pass does not read, so cohesion was not assessed for this repository. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is present (.go) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Domain Modelling — applicable but not scored (1 of 2 signals for this style — below the bar we score at): 11 value object(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this check looks for (1 CQRS handler(s))
  • 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 check looks for
  • GD1 Unfinished & placeholder code — no source files
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, 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 — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • P8 Schema migrations — not assessed — schema-migration practice is read from 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
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

Appendix A — Findings (grouped)

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

Issue — 41 finding(s)
D29 · Static Analysis (SAST) · High · ×24
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:21 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:28 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:34 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-node@<40-character SHA>`. This step references `actions/setup-node@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-node/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:49 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:56 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:62 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-node@<40-character SHA>`. This step references `actions/setup-node@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-node/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:95 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:108 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:114 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-node@<40-character SHA>`. This step references `actions/setup-node@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-node/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:119 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: denoland/setup-deno@<40-character SHA>`. This step references `denoland/setup-deno@main`; resolve the SHA it points at today with `gh api repos/denoland/setup-deno/commits/main --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:233 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:236 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:294 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:307 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:315 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: denoland/setup-deno@<40-character SHA>`. This step references `denoland/setup-deno@main`; resolve the SHA it points at today with `gh api repos/denoland/setup-deno/commits/main --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:320 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-node@<40-character SHA>`. This step references `actions/setup-node@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-node/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/publish.yml:19 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/publish.yml:45 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/publish.yml:50 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-node@<40-character SHA>`. This step references `actions/setup-node@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-node/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/publish.yml:80 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/create-release@<40-character SHA>`. This step references `actions/create-release@v1`; resolve the SHA it points at today with `gh api repos/actions/create-release/commits/v1 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/validate.yml:16 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v3`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/validate.yml:23 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v3`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v3 --jq .sha`.
  • High: detect-child-process lib/npm/node-install.ts:124 — Detected calls to child_process from a function argument `pkg`. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
  • High: detect-child-process scripts/test-yarnpnp.js:11 — Detected calls to child_process from a function argument `command`. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
D38 · OSV Dependency Vulnerabilities · High CVE · ×13
  • High CVE: [GHSA redacted] require/parcel2/package-lock.json — base-x 3.0.9: [GHSA redacted] — base-x is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin base-x to 3.0.11 with an `overrides` entry (`resolutions` if you use Yarn)).
  • High CVE: [GHSA redacted] require/parcel2/package-lock.json — braces 3.0.2: [GHSA redacted] — braces is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin braces to 3.0.3 with an `overrides` entry (`resolutions` if you use Yarn)). (in 2 dependency files: require/parcel2/package-lock.json, require/webpack5/package-lock.json)
  • High CVE: [GHSA redacted] require/webpack5/package-lock.json — cross-spawn 7.0.3: [GHSA redacted] — cross-spawn is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin cross-spawn to 7.0.5 with an `overrides` entry (`resolutions` if you use Yarn)).
  • High CVE: [GHSA redacted] scripts/browser/package-lock.json — ip-address 9.0.5: [GHSA redacted] — ip-address is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 10.3.1 is a MAJOR ahead of the resolved 9.0.5, so an `overrides` pin would force a breaking version under a dependent written against 9.0.5; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead). This is 1 of 2 advisories with a published fix this scan raises against ip-address 9.0.5, and their fixed versions do not agree — anything below 10.3.1 still leaves at least one of them open. Take this package to 10.3.1 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against ip-address 9.0.5: [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] scripts/package-lock.json — js-yaml 3.14.0: [GHSA redacted] — upgrade to 3.15.0. This is 1 of 3 advisories with a published fix this scan raises against js-yaml 3.14.0, and their fixed versions do not agree — anything below 3.15.0 still leaves at least one of them open. Take this package to 3.15.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 3 advisories this scan raises against js-yaml 3.14.0: [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] require/parcel2/package-lock.json — js-yaml 4.1.0: [GHSA redacted] — js-yaml is not declared by the manifests that govern this lockfile: it is pulled in transitively here (the 3.14.0 this repo declares for it belongs to a separate install root and does not reach this one), so upgrade the dependency that requires it (or pin js-yaml to 4.3.0 with an `overrides` entry (`resolutions` if you use Yarn)). This is 1 of 3 advisories with a published fix this scan raises against js-yaml 4.1.0, and their fixed versions do not agree — anything below 4.3.0 still leaves at least one of them open. Take this package to 4.3.0 or later: that is the floor for the package, not this row's target alone. (in 2 dependency files: require/parcel2/package-lock.json, scripts/browser/package-lock.json) This one row stands for the 3 advisories this scan raises against js-yaml 4.1.0: [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] require/parcel2/package-lock.json — msgpackr 1.9.9: [GHSA redacted] — msgpackr is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin msgpackr to 1.10.1 with an `overrides` entry (`resolutions` if you use Yarn)).
  • High CVE: [GHSA redacted] require/webpack5/package-lock.json — picomatch 2.3.0: [GHSA redacted] — picomatch is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin picomatch to 2.3.2 with an `overrides` entry (`resolutions` if you use Yarn)). This one row stands for the 2 advisories this scan raises against picomatch 2.3.0: [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] require/parcel2/package-lock.json — picomatch 2.3.1: [GHSA redacted] — picomatch is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin picomatch to 2.3.2 with an `overrides` entry (`resolutions` if you use Yarn)). This one row stands for the 2 advisories this scan raises against picomatch 2.3.1: [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] require/rollup/package-lock.json — rollup 4.0.2: [GHSA redacted] — upgrade to 4.22.4. This is 1 of 2 advisories with a published fix this scan raises against rollup 4.0.2, and their fixed versions do not agree — anything below 4.59.0 still leaves at least one of them open. Take this package to 4.59.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against rollup 4.0.2: [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] require/webpack5/package-lock.json — semver 7.3.5: [GHSA redacted] — semver is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin semver to 7.5.2 with an `overrides` entry (`resolutions` if you use Yarn)).
  • High CVE: [GHSA redacted] scripts/browser/package-lock.json — tar-fs 3.0.6: [GHSA redacted] — tar-fs is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin tar-fs to 3.0.9 with an `overrides` entry (`resolutions` if you use Yarn)). This is 1 of 3 advisories with a published fix this scan raises against tar-fs 3.0.6, and their fixed versions do not agree — anything below 3.1.1 still leaves at least one of them open. Take this package to 3.1.1 or later: that is the floor for the package, not this row's target alone. This one row stands for the 3 advisories this scan raises against tar-fs 3.0.6: [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] scripts/browser/package-lock.json — ws 8.18.0: [GHSA redacted] — ws is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin ws to 8.21.0 with an `overrides` entry (`resolutions` if you use Yarn)). This is 1 of 2 advisories with a published fix this scan raises against ws 8.18.0, and their fixed versions do not agree — anything below 8.21.0 still leaves at least one of them open. Take this package to 8.21.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against ws 8.18.0: [GHSA redacted], [GHSA redacted].
D38 · OSV Dependency Vulnerabilities · High vulnerability · ×3
  • High vulnerability: [GHSA redacted] require/rollup/package-lock.json — serialize-javascript 6.0.1: [GHSA redacted] — serialize-javascript is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (— 7.0.3 is a MAJOR ahead of the resolved 6.0.1, so an `overrides` pin would force a breaking version under a dependent written against 6.0.1; upgrading the declaring package is the remedy, and where no patched release exists in your major line, record the exposure instead). (in 2 dependency files: require/rollup/package-lock.json, require/webpack5/package-lock.json) This one row stands for the 3 advisories this scan raises against serialize-javascript 6.0.1: [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High vulnerability: [GHSA redacted] require/parcel2/package-lock.json — svgo 2.8.0: [GHSA redacted] — svgo is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin svgo to 2.8.3 with an `overrides` entry (`resolutions` if you use Yarn)). This is 1 of 2 advisories with a published fix this scan raises against svgo 2.8.0, and their fixed versions do not agree — anything below 2.8.3 still leaves at least one of them open. Take this package to 2.8.3 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against svgo 2.8.0: [GHSA redacted], [GHSA redacted].
  • High vulnerability: [GHSA redacted] require/parcel2/package-lock.json — svgo 3.0.2: [GHSA redacted] — svgo is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin svgo to 3.3.4 with an `overrides` entry (`resolutions` if you use Yarn)). This is 1 of 2 advisories with a published fix this scan raises against svgo 3.0.2, and their fixed versions do not agree — anything below 3.3.4 still leaves at least one of them open. Take this package to 3.3.4 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against svgo 3.0.2: [GHSA redacted], [GHSA redacted].
D38 · OSV Dependency Vulnerabilities · Critical CVE · ×1
  • Critical CVE: [GHSA redacted] scripts/browser/package-lock.json — basic-ftp 5.0.5: [GHSA redacted] — basic-ftp is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin basic-ftp to 5.2.0 with an `overrides` entry (`resolutions` if you use Yarn)). This is 1 of 4 advisories with a published fix this scan raises against basic-ftp 5.0.5, and their fixed versions do not agree — anything below 5.3.1 still leaves at least one of them open. Take this package to 5.3.1 or later: that is the floor for the package, not this row's target alone. This one row stands for the 4 advisories this scan raises against basic-ftp 5.0.5: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
Warning — 768 finding(s)
D3 · God Classes · FileTooLong · ×24
  • FileTooLong: js_parser/js_parser.go internal/js_parser/js_parser.go:0 — FileTooLong — 10524 significant lines (blank, comment-only and punctuation-only lines excluded). 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: linker/linker.go internal/linker/linker.go:0 — FileTooLong — 3827 significant lines (blank, comment-only and punctuation-only lines excluded). 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: js_printer/js_printer.go internal/js_printer/js_printer.go:0 — FileTooLong — 3352 significant lines (blank, comment-only and punctuation-only lines excluded). 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: bundler/bundler.go internal/bundler/bundler.go:0 — FileTooLong — 2158 significant lines (blank, comment-only and punctuation-only lines excluded). 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: js_lexer/js_lexer.go internal/js_lexer/js_lexer.go:0 — FileTooLong — 1719 significant lines (blank, comment-only and punctuation-only lines excluded). 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: api/api_impl.go pkg/api/api_impl.go:0 — FileTooLong — 1663 significant lines (blank, comment-only and punctuation-only lines excluded). 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: js_ast/js_ast_helpers.go internal/js_ast/js_ast_helpers.go:0 — FileTooLong — 1605 significant lines (blank, comment-only and punctuation-only lines excluded). 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: resolver/resolver.go internal/resolver/resolver.go:0 — FileTooLong — 1576 significant lines (blank, comment-only and punctuation-only lines excluded). 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_parser/css_parser.go internal/css_parser/css_parser.go:0 — FileTooLong — 1483 significant lines (blank, comment-only and punctuation-only lines excluded). 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: js_parser/js_parser_lower_class.go internal/js_parser/js_parser_lower_class.go:0 — FileTooLong — 1390 significant lines (blank, comment-only and punctuation-only lines excluded). 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: js_parser/js_parser_lower.go internal/js_parser/js_parser_lower.go:0 — FileTooLong — 1205 significant lines (blank, comment-only and punctuation-only lines excluded). 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: js_parser/ts_parser.go internal/js_parser/ts_parser.go:0 — FileTooLong — 1118 significant lines (blank, comment-only and punctuation-only lines excluded). 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: cli/cli_impl.go pkg/cli/cli_impl.go:0 — FileTooLong — 1113 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: parseOptionsImpl (85-1010). 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: css_ast/css_ast.go internal/css_ast/css_ast.go:0 — FileTooLong — 929 significant lines (blank, comment-only and punctuation-only lines excluded). 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: js_ast/js_ast.go internal/js_ast/js_ast.go:0 — FileTooLong — 928 significant lines (blank, comment-only and punctuation-only lines excluded). 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: esbuild/service.go cmd/esbuild/service.go:0 — FileTooLong — 909 significant lines (blank, comment-only and punctuation-only lines excluded). 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_printer/css_printer.go internal/css_printer/css_printer.go:0 — FileTooLong — 848 significant lines (blank, comment-only and punctuation-only lines excluded). 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: resolver/package_json.go internal/resolver/package_json.go:0 — FileTooLong — 835 significant lines (blank, comment-only and punctuation-only lines excluded). 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_lexer/css_lexer.go internal/css_lexer/css_lexer.go:0 — FileTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded). 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_parser/css_decls_gradient.go internal/css_parser/css_decls_gradient.go:0 — FileTooLong — 671 significant lines (blank, comment-only and punctuation-only lines excluded). 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_parser/css_decls_color.go internal/css_parser/css_decls_color.go:0 — FileTooLong — 667 significant lines (blank, comment-only and punctuation-only lines excluded). 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: api/serve_other.go pkg/api/serve_other.go:0 — FileTooLong — 644 significant lines (blank, comment-only and punctuation-only lines excluded). 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_parser/css_parser_selector.go internal/css_parser/css_parser_selector.go:0 — FileTooLong — 605 significant lines (blank, comment-only and punctuation-only lines excluded). 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: config/config.go internal/config/config.go:0 — FileTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded). 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×18
  • Duplicated block (9 lines × 2) cmd/esbuild/service.go:1057 — cmd/esbuild/service.go:1057-1065 | cmd/esbuild/service.go:1141-1149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/esbuild/service.go:1057` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/bundler/bundler.go:2470 — internal/bundler/bundler.go:2470-2478 | internal/bundler/bundler.go:2508-2516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/bundler/bundler.go:2470` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/js_lexer/js_lexer.go:2124 — internal/js_lexer/js_lexer.go:2124-2132 | internal/js_lexer/js_lexer.go:2423-2431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_lexer/js_lexer.go:2124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) internal/js_parser/js_parser.go:2345 — internal/js_parser/js_parser.go:2345-2353 | internal/js_parser/js_parser.go:2360-2388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:2345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) internal/js_parser/js_parser.go:5037 — internal/js_parser/js_parser.go:5037-5045 | internal/js_parser/js_parser.go:5064-5072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:5037` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/js_parser/js_parser.go:12310 — internal/js_parser/js_parser.go:12310-12319 | internal/js_parser/js_parser.go:14874-14882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:12310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) internal/js_parser/js_parser.go:15107 — internal/js_parser/js_parser.go:15107-15115 | internal/js_parser/js_parser.go:15699-15707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:15107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) internal/js_parser/js_parser.go:16129 — internal/js_parser/js_parser.go:16129-16137 | internal/js_parser/js_parser.go:16173-16181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:16129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/js_printer/js_printer.go:671 — internal/js_printer/js_printer.go:671-679 | internal/js_printer/js_printer.go:1165-1173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) internal/js_printer/js_printer.go:1688 — internal/js_printer/js_printer.go:1688-1696 | internal/js_printer/js_printer.go:2307-2315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:1688` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/js_printer/js_printer.go:4833 — internal/js_printer/js_printer.go:4833-4841 | internal/js_printer/js_printer.go:4846-4854 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) internal/linker/linker.go:822 — internal/linker/linker.go:822-830 | internal/linker/linker.go:859-867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:822` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/linker/linker.go:1324 — internal/linker/linker.go:1324-1332 | internal/linker/linker.go:1381-1389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:1324` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/linker/linker.go:2274 — internal/linker/linker.go:2274-2282 | internal/linker/linker.go:5185-5193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:2274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/linker/linker.go:2443 — internal/linker/linker.go:2443-2451 | internal/linker/linker.go:2479-2487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:2443` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/resolver/package_json.go:263 — internal/resolver/package_json.go:263-271 | internal/resolver/resolver.go:1226-1234 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/resolver/package_json.go:263` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/resolver/yarnpnp.go:638 — internal/resolver/yarnpnp.go:638-646 | internal/resolver/yarnpnp.go:664-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/resolver/yarnpnp.go:638` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/js_ast/js_ident.go:78 — internal/js_ast/js_ident.go:78-86 | internal/js_ast/js_ident.go:106-114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_ast/js_ident.go:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×15
  • Duplicated block (6 lines × 2) internal/bundler/bundler.go:1760 — internal/bundler/bundler.go:1760-1765 | internal/bundler/bundler.go:1880-1885 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/bundler/bundler.go:1760` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/css_parser/css_decls_color.go:342 — internal/css_parser/css_decls_color.go:342-347 | internal/css_parser/css_decls_color.go:369-374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_decls_color.go:342` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) internal/css_parser/css_reduce_calc.go:539 — internal/css_parser/css_reduce_calc.go:539-544 | internal/css_parser/css_reduce_calc.go:579-584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_reduce_calc.go:539` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/js_lexer/js_lexer.go:2303 — internal/js_lexer/js_lexer.go:2303-2308 | internal/js_lexer/js_lexer.go:2337-2343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_lexer/js_lexer.go:2303` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser.go:2793 — internal/js_parser/js_parser.go:2793-2798 | internal/js_parser/js_parser.go:6937-6942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser.go:4270 — internal/js_parser/js_parser.go:4270-4275 | internal/js_parser/js_parser.go:4580-4585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:4270` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser.go:5714 — internal/js_parser/js_parser.go:5714-5725 | internal/js_parser/js_parser.go:5849-5854 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:5714` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser.go:7490 — internal/js_parser/js_parser.go:7490-7495 | internal/js_parser/js_parser.go:7521-7526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser.go:9275 — internal/js_parser/js_parser.go:9275-9280 | internal/js_parser/js_parser.go:9285-9290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:9275` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser.go:9563 — internal/js_parser/js_parser.go:9563-9568 | internal/js_parser/js_parser.go:9619-9624 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser.go:15490 — internal/js_parser/js_parser.go:15490-15495 | internal/js_parser/js_parser.go:15708-15713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser_lower_class.go:2319 — internal/js_parser/js_parser_lower_class.go:2319-2324 | internal/js_parser/js_parser_lower_class.go:2365-2370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser_lower_class.go:2319` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser_lower_class.go:2496 — internal/js_parser/js_parser_lower_class.go:2496-2501 | internal/js_parser/js_parser_lower_class.go:2503-2508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser_lower_class.go:2496` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/js_printer/js_printer.go:2801 — internal/js_printer/js_printer.go:2801-2806 | internal/js_printer/js_printer.go:4233-4238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:2801` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/linker/linker.go:2383 — internal/linker/linker.go:2383-2389 | internal/linker/linker.go:5047-5052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:2383` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×14
  • Duplicated block (10 lines × 2) cmd/esbuild/service.go:988 — cmd/esbuild/service.go:988-997 | cmd/esbuild/service.go:1079-1088 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/esbuild/service.go:988` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/bundler/bundler.go:1665 — internal/bundler/bundler.go:1665-1674 | internal/bundler/bundler.go:1685-1694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/bundler/bundler.go:1665` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/cache/cache_ast.go:45 — internal/cache/cache_ast.go:45-54 | internal/cache/cache_ast.go:156-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/cache/cache_ast.go:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) internal/js_ast/js_ast_helpers.go:2941 — internal/js_ast/js_ast_helpers.go:2941-2950 | internal/js_ast/js_ast_helpers.go:2954-2963 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_ast/js_ast_helpers.go:2941` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/js_lexer/js_lexer.go:1861 — internal/js_lexer/js_lexer.go:1861-1871 | internal/js_lexer/js_lexer.go:1980-1989 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_lexer/js_lexer.go:1861` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) internal/js_lexer/js_lexer.go:2602 — internal/js_lexer/js_lexer.go:2602-2611 | internal/js_lexer/js_lexer.go:2620-2629 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_lexer/js_lexer.go:2602` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/js_parser/js_parser.go:4365 — internal/js_parser/js_parser.go:4365-4375 | internal/js_parser/js_parser.go:4505-4514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:4365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/js_parser/js_parser.go:4907 — internal/js_parser/js_parser.go:4907-4916 | internal/js_parser/js_parser.go:4932-4942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:4907` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/js_parser/js_parser.go:5752 — internal/js_parser/js_parser.go:5752-5761 | internal/js_parser/js_parser.go:5794-5803 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:5752` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/js_printer/js_printer.go:1191 — internal/js_printer/js_printer.go:1191-1200 | internal/js_printer/js_printer.go:1326-1335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:1191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/linker/linker.go:4399 — internal/linker/linker.go:4399-4408 | internal/linker/linker.go:4444-4453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:4399` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/linker/linker.go:5986 — internal/linker/linker.go:5986-5995 | internal/linker/linker.go:6461-6470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:5986` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) pkg/api/api_impl.go:1261 — pkg/api/api_impl.go:1261-1270 | pkg/api/api_impl.go:1725-1734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/api_impl.go:1261` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/js_ast/js_ident.go:138 — internal/js_ast/js_ident.go:138-147 | internal/js_ast/js_ident.go:179-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_ast/js_ident.go:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×14
  • Duplicated block (7 lines × 2) cmd/esbuild/service.go:1359 — cmd/esbuild/service.go:1359-1365 | cmd/esbuild/service.go:1403-1409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/esbuild/service.go:1359` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/css_parser/css_nesting.go:419 — internal/css_parser/css_nesting.go:419-425 | internal/css_parser/css_parser_selector.go:135-141 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_nesting.go:419` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/css_parser/css_parser.go:1727 — internal/css_parser/css_parser.go:1727-1733 | internal/css_parser/css_parser.go:1759-1765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_parser.go:1727` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/css_printer/css_printer.go:95 — internal/css_printer/css_printer.go:95-101 | internal/js_printer/js_printer.go:3937-3943 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_printer/css_printer.go:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/js_ast/js_ast_helpers.go:815 — internal/js_ast/js_ast_helpers.go:815-821 | internal/js_ast/js_ast_helpers.go:876-882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_ast/js_ast_helpers.go:815` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/js_ast/js_ast_helpers.go:1182 — internal/js_ast/js_ast_helpers.go:1182-1188 | internal/js_ast/js_ast_helpers.go:1191-1197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) internal/js_parser/js_parser.go:2191 — internal/js_parser/js_parser.go:2191-2197 | internal/js_parser/js_parser.go:2758-2764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:2191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/js_parser/js_parser.go:7665 — internal/js_parser/js_parser.go:7665-7671 | internal/js_parser/js_parser.go:7710-7718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) internal/js_parser/js_parser.go:7935 — internal/js_parser/js_parser.go:7935-7941 | internal/js_parser/js_parser.go:7973-7979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) internal/js_parser/js_parser.go:9548 — internal/js_parser/js_parser.go:9548-9554 | internal/js_parser/js_parser.go:9605-9612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:9548` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/js_parser/js_parser.go:11008 — internal/js_parser/js_parser.go:11008-11014 | internal/js_parser/js_parser.go:11051-11058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:11008` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) internal/js_printer/js_printer.go:3846 — internal/js_printer/js_printer.go:3846-3853 | internal/js_printer/js_printer.go:4588-4594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:3846` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) pkg/api/serve_other.go:244 — pkg/api/serve_other.go:244-250 | pkg/api/serve_other.go:297-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/serve_other.go:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 2) internal/helpers/utf.go:52 — internal/helpers/utf.go:52-58 | internal/helpers/utf.go:101-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×11
  • Duplicated block (5 lines × 2) internal/css_parser/css_decls_color.go:528 — internal/css_parser/css_decls_color.go:528-532 | internal/css_parser/css_decls_color.go:566-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_decls_color.go:528` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) internal/js_parser/js_parser.go:2319 — internal/js_parser/js_parser.go:2319-2323 | internal/js_parser/js_parser.go:2356-2360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:2319` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/js_parser/js_parser.go:3407 — internal/js_parser/js_parser.go:3407-3411 | internal/js_parser/js_parser.go:3438-3442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) internal/js_parser/js_parser.go:7523 — internal/js_parser/js_parser.go:7523-7527 | internal/js_parser/js_parser.go:7855-7859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) internal/js_parser/js_parser.go:12067 — internal/js_parser/js_parser.go:12067-12071 | internal/js_parser/js_parser.go:12092-12096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:12067` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) internal/js_parser/js_parser.go:14790 — internal/js_parser/js_parser.go:14790-14794 | internal/js_parser/js_parser.go:14829-14833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:14790` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/js_parser/js_parser.go:16254 — internal/js_parser/js_parser.go:16254-16258 | internal/js_parser/js_parser.go:16301-16305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:16254` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) internal/js_parser/ts_parser.go:1927 — internal/js_parser/ts_parser.go:1927-1931 | internal/js_parser/ts_parser.go:2037-2041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/ts_parser.go:1927` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/linker/linker.go:4253 — internal/linker/linker.go:4253-4257 | internal/linker/linker.go:4279-4283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:4253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/linker/linker.go:5021 — internal/linker/linker.go:5021-5025 | internal/linker/linker.go:5059-5063 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:5021` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) internal/xxhash/xxhash_other.go:22 — internal/xxhash/xxhash_other.go:22-26 | internal/xxhash/xxhash_other.go:68-72 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/xxhash/xxhash_other.go:22` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×10
  • Duplicated block (11 lines × 2) cmd/esbuild/service.go:326 — cmd/esbuild/service.go:326-336 | cmd/esbuild/service.go:363-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/esbuild/service.go:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) internal/css_parser/css_reduce_calc.go:123 — internal/css_parser/css_reduce_calc.go:123-133 | internal/css_parser/css_reduce_calc.go:140-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_reduce_calc.go:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) internal/js_parser/js_parser.go:3093 — internal/js_parser/js_parser.go:3093-3103 | internal/js_parser/js_parser.go:6727-6737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) internal/js_parser/js_parser.go:4311 — internal/js_parser/js_parser.go:4311-4322 | internal/js_parser/js_parser.go:4422-4432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:4311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/js_parser/js_parser.go:14242 — internal/js_parser/js_parser.go:14242-14252 | internal/js_parser/js_parser.go:14375-14385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:14242` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) internal/js_parser/ts_parser.go:315 — internal/js_parser/ts_parser.go:315-328 | internal/js_parser/ts_parser.go:333-343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/ts_parser.go:315` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) internal/js_parser/ts_parser.go:1710 — internal/js_parser/ts_parser.go:1710-1720 | internal/js_parser/ts_parser.go:1726-1736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/ts_parser.go:1710` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/js_printer/js_printer.go:2772 — internal/js_printer/js_printer.go:2772-2782 | internal/js_printer/js_printer.go:4214-4224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:2772` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/linker/linker.go:5952 — internal/linker/linker.go:5952-5962 | internal/linker/linker.go:6430-6440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:5952` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) pkg/cli/cli_impl.go:1275 — pkg/cli/cli_impl.go:1275-1285 | pkg/cli/cli_impl.go:1321-1331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/cli/cli_impl.go:1275` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×10
  • Duplicated block (8 lines × 2) cmd/esbuild/service.go:980 — cmd/esbuild/service.go:980-987 | cmd/esbuild/service.go:1071-1078 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) internal/bundler/bundler.go:392 — internal/bundler/bundler.go:392-399 | internal/bundler/bundler.go:409-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) internal/css_parser/css_decls_color.go:566 — internal/css_parser/css_decls_color.go:566-573 | internal/css_parser/css_decls_color.go:594-601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_decls_color.go:566` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/js_lexer/js_lexer.go:1657 — internal/js_lexer/js_lexer.go:1657-1664 | internal/js_lexer/js_lexer.go:1670-1677 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_lexer/js_lexer.go:1657` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/js_parser/js_parser.go:3554 — internal/js_parser/js_parser.go:3554-3561 | internal/js_parser/json_parser.go:42-49 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/js_parser/ts_parser.go:1498 — internal/js_parser/ts_parser.go:1498-1505 | internal/js_parser/ts_parser.go:1780-1804 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/ts_parser.go:1498` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/linker/linker.go:4820 — internal/linker/linker.go:4820-4827 | internal/linker/linker.go:4892-4899 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:4820` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/resolver/resolver.go:1876 — internal/resolver/resolver.go:1876-1883 | internal/resolver/resolver.go:2005-2012 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/resolver/resolver.go:1876` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) internal/resolver/resolver.go:2804 — internal/resolver/resolver.go:2804-2811 | internal/resolver/resolver.go:2821-2828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/resolver/resolver.go:2804` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) pkg/api/api_impl.go:1274 — pkg/api/api_impl.go:1274-1281 | pkg/api/api_impl.go:1740-1747 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×9
  • Duplicated block (12 lines × 2) internal/css_printer/css_printer.go:109 — internal/css_printer/css_printer.go:109-120 | internal/js_printer/js_printer.go:4111-4122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_printer/css_printer.go:109` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) internal/js_parser/js_parser.go:10540 — internal/js_parser/js_parser.go:10540-10551 | internal/js_parser/js_parser.go:11347-11358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) internal/js_parser/js_parser.go:14253 — internal/js_parser/js_parser.go:14253-14264 | internal/js_parser/js_parser.go:14390-14401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:14253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/js_parser/js_parser.go:16259 — internal/js_parser/js_parser.go:16259-16270 | internal/js_parser/js_parser.go:16306-16317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:16259` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/js_parser/ts_parser.go:117 — internal/js_parser/ts_parser.go:117-133 | internal/js_parser/ts_parser.go:440-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/ts_parser.go:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/js_printer/js_printer.go:583 — internal/js_printer/js_printer.go:583-594 | internal/js_printer/js_printer.go:2815-2826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:583` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/js_printer/js_printer.go:643 — internal/js_printer/js_printer.go:643-654 | internal/js_printer/js_printer.go:2870-2881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:643` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/js_printer/js_printer.go:1223 — internal/js_printer/js_printer.go:1223-1234 | internal/js_printer/js_printer.go:1265-1276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:1223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/js_printer/js_printer.go:2424 — internal/js_printer/js_printer.go:2424-2435 | internal/js_printer/js_printer.go:2823-2834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D38 · OSV Dependency Vulnerabilities · Medium CVE · ×7
  • Medium CVE: [GHSA redacted] require/parcel2/package-lock.json — @parcel/reporter-dev-server 2.10.0: [GHSA redacted] — @parcel/reporter-dev-server is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin @parcel/reporter-dev-server to 2.16.4 with an `overrides` entry (`resolutions` if you use Yarn)).
  • Medium CVE: [GHSA redacted] require/webpack5/package-lock.json — ajv 6.12.6: [GHSA redacted] — ajv is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin ajv to 6.14.0 with an `overrides` entry (`resolutions` if you use Yarn)).
  • Medium CVE: GO-2026-5024 go.mod — golang.org/x/sys 0.0.0-20220715151400-c0bba94af5f8 (golang.org/x/sys/windows): GO-2026-5024 — upgrade to 0.44.0
  • Medium CVE: [GHSA redacted] require/webpack5/package-lock.json — micromatch 4.0.4: [GHSA redacted] — micromatch is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin micromatch to 4.0.8 with an `overrides` entry (`resolutions` if you use Yarn)).
  • Medium CVE: [GHSA redacted] require/parcel2/package-lock.json — micromatch 4.0.5: [GHSA redacted] — micromatch is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin micromatch to 4.0.8 with an `overrides` entry (`resolutions` if you use Yarn)).
  • Medium CVE: GO-2021-0226 go.mod — stdlib 1.13.99 (net/http/cgi, net/http/fcgi): GO-2021-0226 — fixed in Go 1.14.8; pin a build toolchain at or above it (go.mod `toolchain` directive, or your CI's Go version) — the `go` directive is a minimum language version, not the compiler that builds your binaries. This one row stands for the 124 advisories this scan raises against stdlib 1.13.99: GO-2021-0226, GO-2021-0234, GO-2021-0235, GO-2021-0239, GO-2021-0240, GO-2021-0241, GO-2021-0242, GO-2021-0243, GO-2021-0245, GO-2021-0263, GO-2021-0264, GO-2021-0317, GO-2021-0319, GO-2021-0347, GO-2022-0236, GO-2022-0273, GO-2022-0288, GO-2022-0289, GO-2022-0433, GO-2022-0435, GO-2022-0477, GO-2022-0493, GO-2022-0515, GO-2022-0520, GO-2022-0521, GO-2022-0522, GO-2022-0523, GO-2022-0524, GO-2022-0525, GO-2022-0526, GO-2022-0527, GO-2022-0531, GO-2022-0532, GO-2022-0533, GO-2022-0537, GO-2022-0969, GO-2022-1037, GO-2022-1038, GO-2022-1039, GO-2022-1095, GO-2022-1143, GO-2022-1144, GO-2023-1568, GO-2023-1569, GO-2023-1570, GO-2023-1571, GO-2023-1621, GO-2023-1702, GO-2023-1703, GO-2023-1704, GO-2023-1705, GO-2023-1751, GO-2023-1752, GO-2023-1753, GO-2023-1840, GO-2023-1878, GO-2023-1987, GO-2023-2041, GO-2023-2043, GO-2023-2102, GO-2023-2185, GO-2023-2186, GO-2023-2375, GO-2023-2382, GO-2024-2598, GO-2024-2599, GO-2024-2600, GO-2024-2609, GO-2024-2610, GO-2024-2687, GO-2024-2887, GO-2024-2888, GO-2024-2963, GO-2024-3105, GO-2024-3106, GO-2024-3107, GO-2025-3373, GO-2025-3420, GO-2025-3447, GO-2025-3503, GO-2025-3563, GO-2025-3750, GO-2025-3751, GO-2025-3849, GO-2025-3956, GO-2025-4006, GO-2025-4007, GO-2025-4008, GO-2025-4009, GO-2025-4010, GO-2025-4011, GO-2025-4012, GO-2025-4013, GO-2025-4014, GO-2025-4015, GO-2025-4155, GO-2025-4175, GO-2026-4337, GO-2026-4340, GO-2026-4341, GO-2026-4342, GO-2026-4403, GO-2026-4601, GO-2026-4602, GO-2026-4603, GO-2026-4864, GO-2026-4865, GO-2026-4869, GO-2026-4870, GO-2026-4918, GO-2026-4946, GO-2026-4947, GO-2026-4970, GO-2026-4971, GO-2026-4976, GO-2026-4977, GO-2026-4980, GO-2026-4981, GO-2026-4982, GO-2026-4986, GO-2026-5037, GO-2026-5038, GO-2026-5039, GO-2026-5856.
  • Medium CVE: [GHSA redacted] require/webpack5/package-lock.json — webpack 5.88.2: [GHSA redacted] — upgrade to 5.94.0. This is 1 of 3 advisories with a published fix this scan raises against webpack 5.88.2, and their fixed versions do not agree — anything below 5.104.1 still leaves at least one of them open. Take this package to 5.104.1 or later: that is the floor for the package, not this row's target alone. This one row stands for the 3 advisories this scan raises against webpack 5.88.2: [GHSA redacted], [GHSA redacted], [GHSA redacted].
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×7
  • Duplicated block (13 lines × 2) cmd/esbuild/service.go:490 — cmd/esbuild/service.go:490-502 | cmd/esbuild/service.go:535-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/esbuild/service.go:490` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/bundler/bundler.go:1085 — internal/bundler/bundler.go:1085-1097 | internal/bundler/bundler.go:1203-1215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/bundler/bundler.go:1085` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/css_parser/css_parser.go:1630 — internal/css_parser/css_parser.go:1630-1642 | internal/css_parser/css_parser.go:1739-1751 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_parser.go:1630` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/js_parser/js_parser.go:4346 — internal/js_parser/js_parser.go:4346-4358 | internal/js_parser/js_parser.go:4485-4497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:4346` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/js_parser/js_parser.go:14315 — internal/js_parser/js_parser.go:14315-14327 | internal/js_parser/js_parser.go:14488-14500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:14315` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/js_printer/js_printer.go:2439 — internal/js_printer/js_printer.go:2439-2452 | internal/js_printer/js_printer.go:2475-2487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:2439` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/resolver/package_json.go:125 — internal/resolver/package_json.go:125-137 | internal/resolver/package_json.go:156-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/resolver/package_json.go:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D3 · God Classes · TooManyMethods · ×6
  • TooManyMethods: parser internal/js_parser/js_parser.go:36 — TooManyMethods — 232 methods, declared across 4 files: js_parser/js_parser.go (151), js_parser/js_parser_lower.go (31), js_parser/ts_parser.go (31), js_parser/js_parser_lower_class.go (19). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: parser internal/css_parser/css_parser.go:18 — TooManyMethods — 78 methods, declared across 17 files: css_parser/css_parser.go (29), css_parser/css_parser_selector.go (10), css_parser/css_nesting.go (7), css_parser/css_parser_media.go (7), +13 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: printer internal/js_printer/js_printer.go:276 — TooManyMethods — 63 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: linkerContext internal/linker/linker.go:45 — TooManyMethods — 52 methods, declared across 2 files: linker/linker.go (51), linker/debug.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: resolverQuery internal/resolver/resolver.go:235 — TooManyMethods — 38 methods, declared across 3 files: resolver/resolver.go (22), resolver/package_json.go (10), resolver/yarnpnp.go (6). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Lexer internal/js_lexer/js_lexer.go:241 — TooManyMethods — 33 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×5
  • Duplicated block (14 lines × 2) cmd/esbuild/service.go:1009 — cmd/esbuild/service.go:1009-1022 | cmd/esbuild/service.go:1098-1111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/esbuild/service.go:1009` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/css_parser/css_nesting.go:301 — internal/css_parser/css_nesting.go:301-314 | internal/css_parser/css_nesting.go:324-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_nesting.go:301` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) internal/css_printer/css_printer.go:983 — internal/css_printer/css_printer.go:983-996 | internal/js_printer/js_printer.go:792-805 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) internal/js_printer/js_printer.go:4298 — internal/js_printer/js_printer.go:4298-4311 | internal/js_printer/js_printer.go:4345-4358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:4298` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/js_printer/js_printer.go:4327 — internal/js_printer/js_printer.go:4327-4340 | internal/js_printer/js_printer.go:4746-4759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D15 · Churn × Complexity Hotspots · Hotspot · ×4
  • Hotspot: internal/js_parser/js_parser.go internal/js_parser/js_parser.go — internal/js_parser/js_parser.go changed 5 times in last 90 days, max complexity 618. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: internal/js_printer/js_printer.go internal/js_printer/js_printer.go — internal/js_printer/js_printer.go changed 3 times in last 90 days, max complexity 377. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: internal/linker/linker.go internal/linker/linker.go — internal/linker/linker.go changed 2 times in last 90 days, max complexity 141. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: pkg/api/serve_other.go pkg/api/serve_other.go — pkg/api/serve_other.go changed 2 times in last 90 days, max complexity 71. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) internal/js_parser/js_parser.go:3880 — internal/js_parser/js_parser.go:3880-3895 | internal/js_parser/js_parser.go:3949-3964 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:3880` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) internal/js_parser/js_parser.go:16883 — internal/js_parser/js_parser.go:16883-16898 | internal/js_parser/js_parser.go:16959-16974 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:16883` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) internal/linker/linker.go:5757 — internal/linker/linker.go:5757-5772 | internal/linker/linker.go:6321-6336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:5757` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D29 · Static Analysis (SAST) · Medium · ×2
  • Medium: math-random-used internal/bundler/bundler.go:14 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: math-random-used pkg/api/watcher.go:27 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) internal/js_printer/js_printer.go:4270 — internal/js_printer/js_printer.go:4270-4284 | internal/js_printer/js_printer.go:4317-4331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_printer/js_printer.go:4270` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) internal/js_ast/js_ident.go:156 — internal/js_ast/js_ident.go:156-170 | internal/js_ast/js_ident.go:197-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_ast/js_ident.go:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) internal/bundler/bundler.go:269 — internal/bundler/bundler.go:269-275 | internal/bundler/bundler.go:278-284 | internal/bundler/bundler.go:288-294 | internal/bundler/bundler.go:298-304 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 4) internal/css_parser/css_color_spaces.go:83 — internal/css_parser/css_color_spaces.go:83-89 | internal/css_parser/css_color_spaces.go:109-115 | internal/css_parser/css_color_spaces.go:183-189 | internal/css_parser/css_color_spaces.go:227-233 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_color_spaces.go:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D1 · Cyclomatic Complexity · parser.visitExprInOut (cyclomatic 618) · ×1
  • parser.visitExprInOut (cyclomatic 618) internal/js_parser/js_parser.go:13504 — parser.visitExprInOut has cyclomatic complexity 618 (threshold 15). Of this number, 598 points are the body's own statements and 20 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 · printer.printExpr (cyclomatic 377) · ×1
  • printer.printExpr (cyclomatic 377) internal/js_printer/js_printer.go:2005 — printer.printExpr has cyclomatic complexity 377 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.visitAndAppendStmt (cyclomatic 281) · ×1
  • parser.visitAndAppendStmt (cyclomatic 281) internal/js_parser/js_parser.go:10350 — parser.visitAndAppendStmt has cyclomatic complexity 281 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.parseStmt (cyclomatic 257) · ×1
  • parser.parseStmt (cyclomatic 257) internal/js_parser/js_parser.go:7061 — parser.parseStmt has cyclomatic complexity 257 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.parseOptionsImpl (cyclomatic 246) · ×1
  • cli.parseOptionsImpl (cyclomatic 246) pkg/cli/cli_impl.go:85 — cli.parseOptionsImpl has cyclomatic complexity 246 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.parseSuffix (cyclomatic 162) · ×1
  • parser.parseSuffix (cyclomatic 162) internal/js_parser/js_parser.go:4263 — parser.parseSuffix has cyclomatic complexity 162 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.parseProperty (cyclomatic 161) · ×1
  • parser.parseProperty (cyclomatic 161) internal/js_parser/js_parser.go:2184 — parser.parseProperty has cyclomatic complexity 161 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · binaryExprVisitor.visitRightAndFinish (cyclomatic 153) · ×1
  • binaryExprVisitor.visitRightAndFinish (cyclomatic 153) internal/js_parser/js_parser.go:16019 — binaryExprVisitor.visitRightAndFinish has cyclomatic complexity 153 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · printer.printStmt (cyclomatic 150) · ×1
  • printer.printStmt (cyclomatic 150) internal/js_printer/js_printer.go:4101 — printer.printStmt has cyclomatic complexity 150 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Lexer.Next (cyclomatic 147) · ×1
  • Lexer.Next (cyclomatic 147) internal/js_lexer/js_lexer.go:999 — Lexer.Next has cyclomatic complexity 147 (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 · linkerContext.scanImportsAndExports (cyclomatic 141) · ×1
  • linkerContext.scanImportsAndExports (cyclomatic 141) internal/linker/linker.go:1289 — linkerContext.scanImportsAndExports has cyclomatic complexity 141 (threshold 15). Of this number, 108 points are the body's own statements and 33 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 · parser.mangleStmts (cyclomatic 127) · ×1
  • parser.mangleStmts (cyclomatic 127) internal/js_parser/js_parser.go:9113 — parser.mangleStmts has cyclomatic complexity 127 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.parseAtRule (cyclomatic 122) · ×1
  • parser.parseAtRule (cyclomatic 122) internal/css_parser/css_parser.go:1196 — parser.parseAtRule has cyclomatic complexity 122 (threshold 15). Of this number, 119 points are the body's own statements and 3 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 · parser.parsePrefix (cyclomatic 116) · ×1
  • parser.parsePrefix (cyclomatic 116) internal/js_parser/js_parser.go:3498 — parser.parsePrefix has cyclomatic complexity 116 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bundler.parseFile (cyclomatic 109) · ×1
  • bundler.parseFile (cyclomatic 109) internal/bundler/bundler.go:123 — bundler.parseFile has cyclomatic complexity 109 (threshold 15). Of this number, 108 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 · parser.processDeclarations (cyclomatic 104) · ×1
  • parser.processDeclarations (cyclomatic 104) internal/css_parser/css_decls.go:84 — parser.processDeclarations has cyclomatic complexity 104 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Lexer.parseNumericLiteralOrDot (cyclomatic 96) · ×1
  • Lexer.parseNumericLiteralOrDot (cyclomatic 96) internal/js_lexer/js_lexer.go:1726 — Lexer.parseNumericLiteralOrDot has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.skipTypeScriptTypeWithFlags (cyclomatic 94) · ×1
  • parser.skipTypeScriptTypeWithFlags (cyclomatic 94) internal/js_parser/ts_parser.go:216 — parser.skipTypeScriptTypeWithFlags has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · printer.printRule (cyclomatic 92) · ×1
  • printer.printRule (cyclomatic 92) internal/css_printer/css_printer.go:107 — printer.printRule has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperContext.SimplifyUnusedExpr (cyclomatic 91) · ×1
  • HelperContext.SimplifyUnusedExpr (cyclomatic 91) internal/js_ast/js_ast_helpers.go:534 — HelperContext.SimplifyUnusedExpr has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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_parser.parseColor (cyclomatic 88) · ×1
  • css_parser.parseColor (cyclomatic 88) internal/css_parser/css_decls_color.go:465 — css_parser.parseColor has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.scanForImportsAndExports (cyclomatic 87) · ×1
  • parser.scanForImportsAndExports (cyclomatic 87) internal/js_parser/js_parser.go:17281 — parser.scanForImportsAndExports has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · scanner.processScannedFiles (cyclomatic 82) · ×1
  • scanner.processScannedFiles (cyclomatic 82) internal/bundler/bundler.go:2360 — scanner.processScannedFiles has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · js_parser.ParseSourceMap (cyclomatic 81) · ×1
  • js_parser.ParseSourceMap (cyclomatic 81) internal/js_parser/sourcemap_parser.go:18 — js_parser.ParseSourceMap has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.mangleTransforms (cyclomatic 79) · ×1
  • parser.mangleTransforms (cyclomatic 79) internal/css_parser/css_decls_transform.go:21 — parser.mangleTransforms 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 · resolverQuery.parseTSConfigFromSource (cyclomatic 71) · ×1
  • resolverQuery.parseTSConfigFromSource (cyclomatic 71) internal/resolver/resolver.go:1252 — resolverQuery.parseTSConfigFromSource has cyclomatic complexity 71 (threshold 15). Most of this is not in the body itself: 9 of the 71 points are its own statements and the rest belongs to one function literal inside it that branches (line 1257). 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 · apiHandler.ServeHTTP (cyclomatic 71) · ×1
  • apiHandler.ServeHTTP (cyclomatic 71) pkg/api/serve_other.go:105 — apiHandler.ServeHTTP 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 · parser.substituteSingleUseSymbolInExpr (cyclomatic 69) · ×1
  • parser.substituteSingleUseSymbolInExpr (cyclomatic 69) internal/js_parser/js_parser.go:9692 — parser.substituteSingleUseSymbolInExpr has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.visitClass (cyclomatic 69) · ×1
  • parser.visitClass (cyclomatic 69) internal/js_parser/js_parser.go:12132 — parser.visitClass has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lowerClassContext.processProperties (cyclomatic 69) · ×1
  • lowerClassContext.processProperties (cyclomatic 69) internal/js_parser/js_parser_lower_class.go:1471 — lowerClassContext.processProperties has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · printer.printProperty (cyclomatic 69) · ×1
  • printer.printProperty (cyclomatic 69) internal/js_printer/js_printer.go:1077 — printer.printProperty has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · linkerContext.generateChunkJS (cyclomatic 68) · ×1
  • linkerContext.generateChunkJS (cyclomatic 68) internal/linker/linker.go:5563 — linkerContext.generateChunkJS has cyclomatic complexity 68 (threshold 15). Of this number, 64 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 · resolver.ParseTSConfigJSON (cyclomatic 68) · ×1
  • resolver.ParseTSConfigJSON (cyclomatic 68) internal/resolver/tsconfig_json.go:95 — resolver.ParseTSConfigJSON has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperContext.ExprCanBeRemovedIfUnused (cyclomatic 66) · ×1
  • HelperContext.ExprCanBeRemovedIfUnused (cyclomatic 66) internal/js_ast/js_ast_helpers.go:2432 — HelperContext.ExprCanBeRemovedIfUnused has cyclomatic complexity 66 (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 · parser.convertTokensHelper (cyclomatic 65) · ×1
  • parser.convertTokensHelper (cyclomatic 65) internal/css_parser/css_parser.go:1814 — parser.convertTokensHelper has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperContext.MangleIfExpr (cyclomatic 65) · ×1
  • HelperContext.MangleIfExpr (cyclomatic 65) internal/js_ast/js_ast_helpers.go:2788 — HelperContext.MangleIfExpr has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolverQuery.finalizeImportsExportsResult (cyclomatic 65) · ×1
  • resolverQuery.finalizeImportsExportsResult (cyclomatic 65) internal/resolver/resolver.go:2605 — resolverQuery.finalizeImportsExportsResult has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · printer.printBinding (cyclomatic 63) · ×1
  • printer.printBinding (cyclomatic 63) internal/js_printer/js_printer.go:562 — printer.printBinding has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · linkerContext.generateChunkCSS (cyclomatic 62) · ×1
  • linkerContext.generateChunkCSS (cyclomatic 62) internal/linker/linker.go:6093 — linkerContext.generateChunkCSS has cyclomatic complexity 62 (threshold 15). Of this number, 55 points are the body's own statements and 7 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 · linkerContext.findImportedFilesInCSSOrder (cyclomatic 60) · ×1
  • linkerContext.findImportedFilesInCSSOrder (cyclomatic 60) internal/linker/linker.go:3406 — linkerContext.findImportedFilesInCSSOrder has cyclomatic complexity 60 (threshold 15). Of this number, 48 points are the body's own statements and 12 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 · serviceType.convertPlugins (cyclomatic 59) · ×1
  • serviceType.convertPlugins (cyclomatic 59) cmd/esbuild/service.go:848 — serviceType.convertPlugins has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 5 of the 59 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 903, 860). 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 · scanner.addEntryPoints (cyclomatic 59) · ×1
  • scanner.addEntryPoints (cyclomatic 59) internal/bundler/bundler.go:1841 — scanner.addEntryPoints has cyclomatic complexity 59 (threshold 15). Of this number, 47 points are the body's own statements and 12 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 · linkerContext.convertStmtsForChunk (cyclomatic 59) · ×1
  • linkerContext.convertStmtsForChunk (cyclomatic 59) internal/linker/linker.go:4311 — linkerContext.convertStmtsForChunk has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lexer.next (cyclomatic 56) · ×1
  • lexer.next (cyclomatic 56) internal/css_lexer/css_lexer.go:279 — lexer.next has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · js_ast.FoldBinaryOperator (cyclomatic 56) · ×1
  • js_ast.FoldBinaryOperator (cyclomatic 56) internal/js_ast/js_ast_helpers.go:1235 — js_ast.FoldBinaryOperator has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · printer.printUnquotedUTF16 (cyclomatic 56) · ×1
  • printer.printUnquotedUTF16 (cyclomatic 56) internal/js_printer/js_printer.go:65 — printer.printUnquotedUTF16 has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Lexer.tryToDecodeEscapeSequences (cyclomatic 55) · ×1
  • Lexer.tryToDecodeEscapeSequences (cyclomatic 55) internal/js_lexer/js_lexer.go:2192 — Lexer.tryToDecodeEscapeSequences has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.lowerAndMinifyColor (cyclomatic 54) · ×1
  • parser.lowerAndMinifyColor (cyclomatic 54) internal/css_parser/css_decls_color.go:280 — parser.lowerAndMinifyColor 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 · lowerClassContext.finishAndGenerateCode (cyclomatic 54) · ×1
  • lowerClassContext.finishAndGenerateCode (cyclomatic 54) internal/js_parser/js_parser_lower_class.go:2054 — lowerClassContext.finishAndGenerateCode 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 · linkerContext.computeCrossChunkDependencies (cyclomatic 54) · ×1
  • linkerContext.computeCrossChunkDependencies (cyclomatic 54) internal/linker/linker.go:908 — linkerContext.computeCrossChunkDependencies has cyclomatic complexity 54 (threshold 15). Of this number, 28 points are the body's own statements and 26 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 · serviceType.handleIncomingPacket (cyclomatic 53) · ×1
  • serviceType.handleIncomingPacket (cyclomatic 53) cmd/esbuild/service.go:203 — serviceType.handleIncomingPacket has cyclomatic complexity 53 (threshold 15). Of this number, 34 points are the body's own statements and 19 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 · parser.maybeRewritePropertyAccess (cyclomatic 53) · ×1
  • parser.maybeRewritePropertyAccess (cyclomatic 53) internal/js_parser/js_parser.go:12894 — parser.maybeRewritePropertyAccess has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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_parser.tryToParseCalcTerm (cyclomatic 52) · ×1
  • css_parser.tryToParseCalcTerm (cyclomatic 52) internal/css_parser/css_reduce_calc.go:469 — css_parser.tryToParseCalcTerm has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolverQuery.esmPackageTargetResolve (cyclomatic 52) · ×1
  • resolverQuery.esmPackageTargetResolve (cyclomatic 52) internal/resolver/package_json.go:1096 — resolverQuery.esmPackageTargetResolve has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolverQuery.loadNodeModules (cyclomatic 50) · ×1
  • resolverQuery.loadNodeModules (cyclomatic 50) internal/resolver/resolver.go:2358 — resolverQuery.loadNodeModules has cyclomatic complexity 50 (threshold 15). Of this number, 41 points are the body's own statements and 9 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 · internalContext.Serve (cyclomatic 50) · ×1
  • internalContext.Serve (cyclomatic 50) pkg/api/serve_other.go:730 — internalContext.Serve has cyclomatic complexity 50 (threshold 15). Of this number, 45 points are the body's own statements and 5 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 · parser.lowerOptionalChain (cyclomatic 49) · ×1
  • parser.lowerOptionalChain (cyclomatic 49) internal/js_parser/js_parser_lower.go:495 — parser.lowerOptionalChain has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolverQuery.parsePackageJSON (cyclomatic 49) · ×1
  • resolverQuery.parsePackageJSON (cyclomatic 49) internal/resolver/package_json.go:251 — resolverQuery.parsePackageJSON has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · printer.printTokens (cyclomatic 48) · ×1
  • printer.printTokens (cyclomatic 48) internal/css_printer/css_printer.go:1162 — printer.printTokens 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 · linkerContext.generateCodeForFileInChunkJS (cyclomatic 48) · ×1
  • linkerContext.generateCodeForFileInChunkJS (cyclomatic 48) internal/linker/linker.go:4657 — linkerContext.generateCodeForFileInChunkJS 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 · parser.parseJSXElement (cyclomatic 47) · ×1
  • parser.parseJSXElement (cyclomatic 47) internal/js_parser/js_parser.go:5219 — parser.parseJSXElement has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resolver.compileYarnPnPData (cyclomatic 47) · ×1
  • resolver.compileYarnPnPData (cyclomatic 47) internal/resolver/yarnpnp.go:426 — resolver.compileYarnPnPData has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Resolver.Resolve (cyclomatic 47) · ×1
  • Resolver.Resolve (cyclomatic 47) internal/resolver/resolver.go:368 — Resolver.Resolve has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · js_ast.KnownPrimitiveType (cyclomatic 46) · ×1
  • js_ast.KnownPrimitiveType (cyclomatic 46) internal/js_ast/js_ast_helpers.go:245 — js_ast.KnownPrimitiveType has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.main (cyclomatic 44) · ×1
  • main.main (cyclomatic 44) cmd/esbuild/main.go:159 — main.main has cyclomatic complexity 44 (threshold 15). Of this number, 21 points are the body's own statements and 23 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 · parser.handleIdentifier (cyclomatic 44) · ×1
  • parser.handleIdentifier (cyclomatic 44) internal/js_parser/js_parser.go:17007 — parser.handleIdentifier has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.runImpl (cyclomatic 44) · ×1
  • cli.runImpl (cyclomatic 44) pkg/cli/cli_impl.go:1184 — cli.runImpl has cyclomatic complexity 44 (threshold 15). Of this number, 32 points are the body's own statements and 12 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 · js_ast.ValuesLookTheSame (cyclomatic 43) · ×1
  • js_ast.ValuesLookTheSame (cyclomatic 43) internal/js_ast/js_ast_helpers.go:1593 — js_ast.ValuesLookTheSame has cyclomatic complexity 43 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · js_parser.Parse (cyclomatic 43) · ×1
  • js_parser.Parse (cyclomatic 43) internal/js_parser/js_parser.go:17772 — js_parser.Parse has cyclomatic complexity 43 (threshold 15). Of this number, 41 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 · parser.minifySwitchStmt (cyclomatic 43) · ×1
  • parser.minifySwitchStmt (cyclomatic 43) internal/js_parser/js_parser.go:11569 — parser.minifySwitchStmt has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.toAST (cyclomatic 43) · ×1
  • parser.toAST (cyclomatic 43) internal/js_parser/js_parser.go:18563 — parser.toAST has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · api.validateBuildOptions (cyclomatic 43) · ×1
  • api.validateBuildOptions (cyclomatic 43) pkg/api/api_impl.go:1233 — api.validateBuildOptions has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · printer.printRequireOrImportExpr (cyclomatic 42) · ×1
  • printer.printRequireOrImportExpr (cyclomatic 42) internal/js_printer/js_printer.go:1399 — printer.printRequireOrImportExpr has cyclomatic complexity 42 (threshold 15). Of this number, 41 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 · resolverQuery.dirInfoUncached (cyclomatic 42) · ×1
  • resolverQuery.dirInfoUncached (cyclomatic 42) internal/resolver/resolver.go:1533 — resolverQuery.dirInfoUncached has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperContext.StmtsCanBeRemovedIfUnused (cyclomatic 41) · ×1
  • HelperContext.StmtsCanBeRemovedIfUnused (cyclomatic 41) internal/js_ast/js_ast_helpers.go:2200 — HelperContext.StmtsCanBeRemovedIfUnused 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 · linkerContext.renameSymbolsInChunk (cyclomatic 41) · ×1
  • linkerContext.renameSymbolsInChunk (cyclomatic 41) internal/linker/linker.go:5315 — linkerContext.renameSymbolsInChunk has cyclomatic complexity 41 (threshold 15). Of this number, 36 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.computeClassLoweringInfo (cyclomatic 40) · ×1
  • parser.computeClassLoweringInfo (cyclomatic 40) internal/js_parser/js_parser_lower_class.go:387 — parser.computeClassLoweringInfo has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · api.analyzeMetafileImpl (cyclomatic 39) · ×1
  • api.analyzeMetafileImpl (cyclomatic 39) pkg/api/api_impl.go:2265 — api.analyzeMetafileImpl has cyclomatic complexity 39 (threshold 15). Of this number, 33 points are the body's own statements and 6 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 · css_parser.tryToParseColorStops (cyclomatic 38) · ×1
  • css_parser.tryToParseColorStops (cyclomatic 38) internal/css_parser/css_decls_gradient.go:467 — css_parser.tryToParseColorStops has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Resolver.ResolveGlob (cyclomatic 38) · ×1
  • Resolver.ResolveGlob (cyclomatic 38) internal/resolver/resolver.go:580 — Resolver.ResolveGlob has cyclomatic complexity 38 (threshold 15). Of this number, 27 points are the body's own statements and 11 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 · js_ast.CheckEqualityIfNoSideEffects (cyclomatic 37) · ×1
  • js_ast.CheckEqualityIfNoSideEffects (cyclomatic 37) internal/js_ast/js_ast_helpers.go:1442 — js_ast.CheckEqualityIfNoSideEffects 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 · Lexer.NextInsideJSXElement (cyclomatic 37) · ×1
  • Lexer.NextInsideJSXElement (cyclomatic 37) internal/js_lexer/js_lexer.go:819 — Lexer.NextInsideJSXElement has cyclomatic complexity 37 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · parser.hoistSymbols (cyclomatic 37) · ×1
  • parser.hoistSymbols (cyclomatic 37) internal/js_parser/js_parser.go:1540 — parser.hoistSymbols 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 · parser.insertPrefixedDeclaration (cyclomatic 36) · ×1
  • parser.insertPrefixedDeclaration (cyclomatic 36) internal/css_parser/css_decls.go:424 — parser.insertPrefixedDeclaration has cyclomatic complexity 36 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · parser.parseFn (cyclomatic 36) · ×1
  • parser.parseFn (cyclomatic 36) internal/js_parser/js_parser.go:6120 — parser.parseFn has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.visitStmts (cyclomatic 36) · ×1
  • parser.visitStmts (cyclomatic 36) internal/js_parser/js_parser.go:8917 — parser.visitStmts has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.parseListOfRules (cyclomatic 35) · ×1
  • parser.parseListOfRules (cyclomatic 35) internal/css_parser/css_parser.go:366 — parser.parseListOfRules has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · printer.printCompoundSelector (cyclomatic 35) · ×1
  • printer.printCompoundSelector (cyclomatic 35) internal/css_printer/css_printer.go:609 — printer.printCompoundSelector has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.parseParenExpr (cyclomatic 35) · ×1
  • parser.parseParenExpr (cyclomatic 35) internal/js_parser/js_parser.go:3152 — parser.parseParenExpr has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lowerClassContext.analyzeProperty (cyclomatic 35) · ×1
  • lowerClassContext.analyzeProperty (cyclomatic 35) internal/js_parser/js_parser_lower_class.go:1124 — lowerClassContext.analyzeProperty has cyclomatic complexity 35 (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 · resolverQuery.checkBrowserMap (cyclomatic 35) · ×1
  • resolverQuery.checkBrowserMap (cyclomatic 35) internal/resolver/package_json.go:94 — resolverQuery.checkBrowserMap has cyclomatic complexity 35 (threshold 15). Of this number, 20 points are the body's own statements and 15 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 · parser.parsePseudoClassSelector (cyclomatic 34) · ×1
  • parser.parsePseudoClassSelector (cyclomatic 34) internal/css_parser/css_parser_selector.go:620 — parser.parsePseudoClassSelector has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · printer.printIdent (cyclomatic 34) · ×1
  • printer.printIdent (cyclomatic 34) internal/css_printer/css_printer.go:1027 — printer.printIdent has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HelperContext.SimplifyBooleanExpr (cyclomatic 34) · ×1
  • HelperContext.SimplifyBooleanExpr (cyclomatic 34) internal/js_ast/js_ast_helpers.go:2096 — HelperContext.SimplifyBooleanExpr has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.lowerFunction (cyclomatic 34) · ×1
  • parser.lowerFunction (cyclomatic 34) internal/js_parser/js_parser_lower.go:276 — parser.lowerFunction has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · api.rebuildImpl (cyclomatic 34) · ×1
  • api.rebuildImpl (cyclomatic 34) pkg/api/api_impl.go:1467 — api.rebuildImpl has cyclomatic complexity 34 (threshold 15). Of this number, 27 points are the body's own statements and 7 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 · printer.printMediaQuery (cyclomatic 33) · ×1
  • printer.printMediaQuery (cyclomatic 33) internal/css_printer/css_printer.go:423 — printer.printMediaQuery 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 · parser.parseExprOrLetOrUsingStmt (cyclomatic 33) · ×1
  • parser.parseExprOrLetOrUsingStmt (cyclomatic 33) internal/js_parser/js_parser.go:4987 — parser.parseExprOrLetOrUsingStmt 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 · parser.isUnsupportedRegularExpression (cyclomatic 33) · ×1
  • parser.isUnsupportedRegularExpression (cyclomatic 33) internal/js_parser/js_parser.go:13367 — parser.isUnsupportedRegularExpression 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 · parser.lowerObjectRestHelper (cyclomatic 33) · ×1
  • parser.lowerObjectRestHelper (cyclomatic 33) internal/js_parser/js_parser_lower.go:1432 — parser.lowerObjectRestHelper has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 5 of the 33 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1453, 1627, 1523, …). 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 · linkerContext.computeChunks (cyclomatic 33) · ×1
  • linkerContext.computeChunks (cyclomatic 33) internal/linker/linker.go:3870 — linkerContext.computeChunks 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 · parser.parseFnStmt (cyclomatic 32) · ×1
  • parser.parseFnStmt (cyclomatic 32) internal/js_parser/js_parser.go:6726 — parser.parseFnStmt 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 · parser.mangleIf (cyclomatic 32) · ×1
  • parser.mangleIf (cyclomatic 32) internal/js_parser/js_parser.go:10203 — parser.mangleIf 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 · parser.handleGlobPattern (cyclomatic 32) · ×1
  • parser.handleGlobPattern (cyclomatic 32) internal/js_parser/js_parser.go:16569 — parser.handleGlobPattern 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 · binaryExprVisitor.checkAndPrepare (cyclomatic 32) · ×1
  • binaryExprVisitor.checkAndPrepare (cyclomatic 32) internal/js_printer/js_printer.go:3374 — binaryExprVisitor.checkAndPrepare 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 · resolverQuery.resolveWithoutSymlinks (cyclomatic 32) · ×1
  • resolverQuery.resolveWithoutSymlinks (cyclomatic 32) internal/resolver/resolver.go:954 — resolverQuery.resolveWithoutSymlinks 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 · parser.lowerAndMinifyGradient (cyclomatic 31) · ×1
  • parser.lowerAndMinifyGradient (cyclomatic 31) internal/css_parser/css_decls_gradient.go:170 — parser.lowerAndMinifyGradient 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 · parser.mangleRules (cyclomatic 31) · ×1
  • parser.mangleRules (cyclomatic 31) internal/css_parser/css_parser.go:588 — parser.mangleRules 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 · parser.parseNthIndex (cyclomatic 31) · ×1
  • parser.parseNthIndex (cyclomatic 31) internal/css_parser/css_parser_selector.go:850 — parser.parseNthIndex 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 · parser.canMergeSymbols (cyclomatic 31) · ×1
  • parser.canMergeSymbols (cyclomatic 31) internal/js_parser/js_parser.go:1396 — parser.canMergeSymbols has cyclomatic complexity 31 (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 · parser.parseClass (cyclomatic 31) · ×1
  • parser.parseClass (cyclomatic 31) internal/js_parser/js_parser.go:6457 — parser.parseClass 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 · printer.printNonNegativeFloat (cyclomatic 31) · ×1
  • printer.printNonNegativeFloat (cyclomatic 31) internal/js_printer/js_printer.go:3564 — printer.printNonNegativeFloat 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 · linkerContext.generateSourceMapForChunk (cyclomatic 31) · ×1
  • linkerContext.generateSourceMapForChunk (cyclomatic 31) internal/linker/linker.go:6996 — linkerContext.generateSourceMapForChunk 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_parser.parseGradient (cyclomatic 30) · ×1
  • css_parser.parseGradient (cyclomatic 30) internal/css_parser/css_decls_gradient.go:37 — css_parser.parseGradient 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 · css_parser.removeColorInterpolation (cyclomatic 30) · ×1
  • css_parser.removeColorInterpolation (cyclomatic 30) internal/css_parser/css_decls_gradient.go:362 — css_parser.removeColorInterpolation 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 · parser.parseCompoundSelector (cyclomatic 30) · ×1
  • parser.parseCompoundSelector (cyclomatic 30) internal/css_parser/css_parser_selector.go:343 — parser.parseCompoundSelector 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 · js_ast.ShouldFoldBinaryOperatorWhenMinifying (cyclomatic 30) · ×1
  • js_ast.ShouldFoldBinaryOperatorWhenMinifying (cyclomatic 30) internal/js_ast/js_ast_helpers.go:1140 — js_ast.ShouldFoldBinaryOperatorWhenMinifying 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 · Lexer.scanCommentText (cyclomatic 30) · ×1
  • Lexer.scanCommentText (cyclomatic 30) internal/js_lexer/js_lexer.go:2584 — Lexer.scanCommentText 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 · parser.parseTypeScriptNamespaceStmt (cyclomatic 30) · ×1
  • parser.parseTypeScriptNamespaceStmt (cyclomatic 30) internal/js_parser/ts_parser.go:1623 — parser.parseTypeScriptNamespaceStmt 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 · linkerContext.generateEntryPointTailJS (cyclomatic 30) · ×1
  • linkerContext.generateEntryPointTailJS (cyclomatic 30) internal/linker/linker.go:4992 — linkerContext.generateEntryPointTailJS 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 · logger.detailStruct (cyclomatic 30) · ×1
  • logger.detailStruct (cyclomatic 30) internal/logger/logger.go:1642 — logger.detailStruct 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 · parser.parseBinding (cyclomatic 29) · ×1
  • parser.parseBinding (cyclomatic 29) internal/js_parser/js_parser.go:5967 — parser.parseBinding 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 · parser.prepareForVisitPass (cyclomatic 29) · ×1
  • parser.prepareForVisitPass (cyclomatic 29) internal/js_parser/js_parser.go:18276 — parser.prepareForVisitPass 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 · parser.markSyntaxFeature (cyclomatic 29) · ×1
  • parser.markSyntaxFeature (cyclomatic 29) internal/js_parser/js_parser_lower.go:18 — parser.markSyntaxFeature has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · parser.insertStmtsAfterSuperCall (cyclomatic 29) · ×1
  • parser.insertStmtsAfterSuperCall (cyclomatic 29) internal/js_parser/js_parser_lower_class.go:2451 — parser.insertStmtsAfterSuperCall 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 · linkerContext.matchImportWithExport (cyclomatic 29) · ×1
  • linkerContext.matchImportWithExport (cyclomatic 29) internal/linker/linker.go:2628 — linkerContext.matchImportWithExport 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 · resolverQuery.finalizeResolve (cyclomatic 29) · ×1
  • resolverQuery.finalizeResolve (cyclomatic 29) internal/resolver/resolver.go:831 — resolverQuery.finalizeResolve 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 · resolverQuery.loadAsMainField (cyclomatic 29) · ×1
  • resolverQuery.loadAsMainField (cyclomatic 29) internal/resolver/resolver.go:1972 — resolverQuery.loadAsMainField has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 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 · resolverQuery.resolveToUnqualified (cyclomatic 29) · ×1
  • resolverQuery.resolveToUnqualified (cyclomatic 29) internal/resolver/yarnpnp.go:148 — resolverQuery.resolveToUnqualified 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 · bundler.runOnLoadPlugins (cyclomatic 28) · ×1
  • bundler.runOnLoadPlugins (cyclomatic 28) internal/bundler/bundler.go:1181 — bundler.runOnLoadPlugins 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 · parser.skipTypeScriptTypeParameters (cyclomatic 28) · ×1
  • parser.skipTypeScriptTypeParameters (cyclomatic 28) internal/js_parser/ts_parser.go:678 — parser.skipTypeScriptTypeParameters 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 · Options.Equal (cyclomatic 28) · ×1
  • Options.Equal (cyclomatic 28) internal/js_parser/js_parser.go:544 — Options.Equal has cyclomatic complexity 28 (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 · linkerContext.maybeAppendLegalComments (cyclomatic 28) · ×1
  • linkerContext.maybeAppendLegalComments (cyclomatic 28) internal/linker/linker.go:6544 — linkerContext.maybeAppendLegalComments 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 · resolver.parseImportsExportsMap (cyclomatic 28) · ×1
  • resolver.parseImportsExportsMap (cyclomatic 28) internal/resolver/package_json.go:640 — resolver.parseImportsExportsMap has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs 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.
D1 · Cyclomatic Complexity · serviceType.handleBuildRequest (cyclomatic 27) · ×1
  • serviceType.handleBuildRequest (cyclomatic 27) cmd/esbuild/service.go:597 — serviceType.handleBuildRequest has cyclomatic complexity 27 (threshold 15). Of this number, 14 points are the body's own statements and 13 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 · parser.lowerNestingInRuleWithContext (cyclomatic 27) · ×1
  • parser.lowerNestingInRuleWithContext (cyclomatic 27) internal/css_parser/css_nesting.go:153 — parser.lowerNestingInRuleWithContext has cyclomatic complexity 27 (threshold 15). Of this number, 26 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 · parser.parseAttributeSelector (cyclomatic 27) · ×1
  • parser.parseAttributeSelector (cyclomatic 27) internal/css_parser/css_parser_selector.go:523 — parser.parseAttributeSelector 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 · printer.printQuotedWithQuote (cyclomatic 27) · ×1
  • printer.printQuotedWithQuote (cyclomatic 27) internal/css_printer/css_printer.go:903 — printer.printQuotedWithQuote 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 · js_ast.ToBooleanWithSideEffects (cyclomatic 27) · ×1
  • js_ast.ToBooleanWithSideEffects (cyclomatic 27) internal/js_ast/js_ast_helpers.go:2014 — js_ast.ToBooleanWithSideEffects has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · jsonParser.parseExpr (cyclomatic 27) · ×1
  • jsonParser.parseExpr (cyclomatic 27) internal/js_parser/json_parser.go:36 — jsonParser.parseExpr 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 · logger.NewStderrLog (cyclomatic 27) · ×1
  • logger.NewStderrLog (cyclomatic 27) internal/logger/logger.go:685 — logger.NewStderrLog has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 730, 700). 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 · logger.PrintSummary (cyclomatic 27) · ×1
  • logger.PrintSummary (cyclomatic 27) internal/logger/logger.go:998 — logger.PrintSummary has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to one function literal inside it that branches (line 999). 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 · resolver.NewResolver (cyclomatic 27) · ×1
  • resolver.NewResolver (cyclomatic 27) internal/resolver/resolver.go:242 — resolver.NewResolver 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 · lowerClassContext.lowerField (cyclomatic 26) · ×1
  • lowerClassContext.lowerField (cyclomatic 26) internal/js_parser/js_parser_lower_class.go:819 — lowerClassContext.lowerField 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 · resolverQuery.matchTSConfigPaths (cyclomatic 26) · ×1
  • resolverQuery.matchTSConfigPaths (cyclomatic 26) internal/resolver/resolver.go:2134 — resolverQuery.matchTSConfigPaths 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 · parser.mangleFont (cyclomatic 25) · ×1
  • parser.mangleFont (cyclomatic 25) internal/css_parser/css_decls_font.go:13 — parser.mangleFont 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 · realFS.WatchData (cyclomatic 25) · ×1
  • realFS.WatchData (cyclomatic 25) internal/fs/fs_real.go:449 — realFS.WatchData has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 481, 515, 523, …). 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 · graph.CloneLinkerGraph (cyclomatic 25) · ×1
  • graph.CloneLinkerGraph (cyclomatic 25) internal/graph/graph.go:126 — graph.CloneLinkerGraph has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to one function literal 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.
D1 · Cyclomatic Complexity · HelperContext.isSideEffectFreeUnboundIdentifierRef (cyclomatic 25) · ×1
  • HelperContext.isSideEffectFreeUnboundIdentifierRef (cyclomatic 25) internal/js_ast/js_ast_helpers.go:2637 — HelperContext.isSideEffectFreeUnboundIdentifierRef 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 · js_parser.shouldKeepStmtInDeadControlFlow (cyclomatic 25) · ×1
  • js_parser.shouldKeepStmtInDeadControlFlow (cyclomatic 25) internal/js_parser/js_parser.go:8777 — js_parser.shouldKeepStmtInDeadControlFlow has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · parser.instantiateDefineExpr (cyclomatic 25) · ×1
  • parser.instantiateDefineExpr (cyclomatic 25) internal/js_parser/js_parser.go:12633 — parser.instantiateDefineExpr 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 · parser.maybeMarkKnownGlobalConstructorAsPure (cyclomatic 25) · ×1
  • parser.maybeMarkKnownGlobalConstructorAsPure (cyclomatic 25) internal/js_parser/js_parser.go:16878 — parser.maybeMarkKnownGlobalConstructorAsPure 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 · parser.lowerAndMangleBoxShadow (cyclomatic 24) · ×1
  • parser.lowerAndMangleBoxShadow (cyclomatic 24) internal/css_parser/css_decls_box_shadow.go:10 — parser.lowerAndMangleBoxShadow 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 · helpers.internalQuote (cyclomatic 24) · ×1
  • helpers.internalQuote (cyclomatic 24) internal/helpers/quote.go:28 — helpers.internalQuote 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 · js_parser.duplicateCaseEquals (cyclomatic 24) · ×1
  • js_parser.duplicateCaseEquals (cyclomatic 24) internal/js_parser/js_parser.go:984 — js_parser.duplicateCaseEquals 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 · parser.parseAndDeclareDecls (cyclomatic 24) · ×1
  • parser.parseAndDeclareDecls (cyclomatic 24) internal/js_parser/js_parser.go:5569 — parser.parseAndDeclareDecls 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 · parser.parseExportClause (cyclomatic 24) · ×1
  • parser.parseExportClause (cyclomatic 24) internal/js_parser/js_parser.go:5824 — parser.parseExportClause 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 · parser.skipTypeScriptObjectType (cyclomatic 24) · ×1
  • parser.skipTypeScriptObjectType (cyclomatic 24) internal/js_parser/ts_parser.go:557 — parser.skipTypeScriptObjectType 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 · css_lexer.decodeEscapesInToken (cyclomatic 23) · ×1
  • css_lexer.decodeEscapesInToken (cyclomatic 23) internal/css_lexer/css_lexer.go:997 — css_lexer.decodeEscapesInToken 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 · css_parser.removeImpliedPositions (cyclomatic 23) · ×1
  • css_parser.removeImpliedPositions (cyclomatic 23) internal/css_parser/css_decls_gradient.go:259 — css_parser.removeImpliedPositions 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 · parser.processListStyleShorthand (cyclomatic 23) · ×1
  • parser.processListStyleShorthand (cyclomatic 23) internal/css_parser/css_decls_list_style.go:20 — parser.processListStyleShorthand 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 · parser.parseSelectorList (cyclomatic 23) · ×1
  • parser.parseSelectorList (cyclomatic 23) internal/css_parser/css_parser_selector.go:22 — parser.parseSelectorList 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 · js_ast.FoldStringAddition (cyclomatic 23) · ×1
  • js_ast.FoldStringAddition (cyclomatic 23) internal/js_ast/js_ast_helpers.go:1779 — js_ast.FoldStringAddition 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 · parser.parseAsyncPrefixExpr (cyclomatic 23) · ×1
  • parser.parseAsyncPrefixExpr (cyclomatic 23) internal/js_parser/js_parser.go:2991 — parser.parseAsyncPrefixExpr 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 · printer.lateConstantFoldUnaryOrBinaryOrIfExpr (cyclomatic 23) · ×1
  • printer.lateConstantFoldUnaryOrBinaryOrIfExpr (cyclomatic 23) internal/js_printer/js_printer.go:1765 — printer.lateConstantFoldUnaryOrBinaryOrIfExpr 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 · linkerContext.generateCodeForLazyExport (cyclomatic 23) · ×1
  • linkerContext.generateCodeForLazyExport (cyclomatic 23) internal/linker/linker.go:2105 — linkerContext.generateCodeForLazyExport has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 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 · api.validateFeatures (cyclomatic 23) · ×1
  • api.validateFeatures (cyclomatic 23) pkg/api/api_impl.go:300 — api.validateFeatures 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 · apiHandler.broadcastBuildResult (cyclomatic 23) · ×1
  • apiHandler.broadcastBuildResult (cyclomatic 23) pkg/api/serve_other.go:474 — apiHandler.broadcastBuildResult has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 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 · scanner.maybeParseFile (cyclomatic 22) · ×1
  • scanner.maybeParseFile (cyclomatic 22) internal/bundler/bundler.go:1539 — scanner.maybeParseFile 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 · lexer.consumeNumeric (cyclomatic 22) · ×1
  • lexer.consumeNumeric (cyclomatic 22) internal/css_lexer/css_lexer.go:900 — lexer.consumeNumeric 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 · printer.printWithEscape (cyclomatic 22) · ×1
  • printer.printWithEscape (cyclomatic 22) internal/css_printer/css_printer.go:863 — printer.printWithEscape has cyclomatic complexity 22 (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 · HelperContext.ClassCanBeRemovedIfUnused (cyclomatic 22) · ×1
  • HelperContext.ClassCanBeRemovedIfUnused (cyclomatic 22) internal/js_ast/js_ast_helpers.go:2335 — HelperContext.ClassCanBeRemovedIfUnused 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 · parser.parseStmtsUpTo (cyclomatic 22) · ×1
  • parser.parseStmtsUpTo (cyclomatic 22) internal/js_parser/js_parser.go:8464 — parser.parseStmtsUpTo 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 · linkerContext.generateChunksInParallel (cyclomatic 22) · ×1
  • linkerContext.generateChunksInParallel (cyclomatic 22) internal/linker/linker.go:603 — linkerContext.generateChunksInParallel has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 659). 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 · linkerContext.findImportedPartsInJSOrder (cyclomatic 22) · ×1
  • linkerContext.findImportedPartsInJSOrder (cyclomatic 22) internal/linker/linker.go:4139 — linkerContext.findImportedPartsInJSOrder has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 4163). 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 · logger.GenerateStringInJSTable (cyclomatic 22) · ×1
  • logger.GenerateStringInJSTable (cyclomatic 22) internal/logger/logger.go:1904 — logger.GenerateStringInJSTable 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 · api.validateDefines (cyclomatic 22) · ×1
  • api.validateDefines (cyclomatic 22) pkg/api/api_impl.go:549 — api.validateDefines 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 · api.transformImpl (cyclomatic 22) · ×1
  • api.transformImpl (cyclomatic 22) pkg/api/api_impl.go:1687 — api.transformImpl has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.decodePacket (cyclomatic 21) · ×1
  • main.decodePacket (cyclomatic 21) cmd/esbuild/stdio_protocol.go:110 — main.decodePacket has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 113). 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 · Bundle.Compile (cyclomatic 21) · ×1
  • Bundle.Compile (cyclomatic 21) internal/bundler/bundler.go:3012 — Bundle.Compile 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 · parser.parseDeclaration (cyclomatic 21) · ×1
  • parser.parseDeclaration (cyclomatic 21) internal/css_parser/css_parser.go:2348 — parser.parseDeclaration 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 · js_ast.MaybeSimplifyNot (cyclomatic 21) · ×1
  • js_ast.MaybeSimplifyNot (cyclomatic 21) internal/js_ast/js_ast_helpers.go:73 — js_ast.MaybeSimplifyNot has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · lowerClassContext.hoistComputedProperties (cyclomatic 21) · ×1
  • lowerClassContext.hoistComputedProperties (cyclomatic 21) internal/js_parser/js_parser_lower_class.go:1219 — lowerClassContext.hoistComputedProperties 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 · printer.printDecorators (cyclomatic 21) · ×1
  • printer.printDecorators (cyclomatic 21) internal/js_printer/js_printer.go:919 — printer.printDecorators 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 · linkerContext.generateExtraDataForFileJS (cyclomatic 21) · ×1
  • linkerContext.generateExtraDataForFileJS (cyclomatic 21) internal/linker/debug.go:21 — linkerContext.generateExtraDataForFileJS 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 · bundler.RunOnResolvePlugins (cyclomatic 20) · ×1
  • bundler.RunOnResolvePlugins (cyclomatic 20) internal/bundler/bundler.go:1051 — bundler.RunOnResolvePlugins 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_parser.mangleNumber (cyclomatic 20) · ×1
  • css_parser.mangleNumber (cyclomatic 20) internal/css_parser/css_parser.go:2123 — css_parser.mangleNumber 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 · parser.parseListOfDeclarations (cyclomatic 20) · ×1
  • parser.parseListOfDeclarations (cyclomatic 20) internal/css_parser/css_parser.go:508 — parser.parseListOfDeclarations 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 · parser.parseSelectorRule (cyclomatic 20) · ×1
  • parser.parseSelectorRule (cyclomatic 20) internal/css_parser/css_parser.go:2151 — parser.parseSelectorRule 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 · calcProduct.partiallySimplify (cyclomatic 20) · ×1
  • calcProduct.partiallySimplify (cyclomatic 20) internal/css_parser/css_reduce_calc.go:342 — calcProduct.partiallySimplify 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 · helpers.EncodeStringAsPercentEscapedDataURL (cyclomatic 20) · ×1
  • helpers.EncodeStringAsPercentEscapedDataURL (cyclomatic 20) internal/helpers/dataurl.go:21 — helpers.EncodeStringAsPercentEscapedDataURL 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 · parser.parseImportClause (cyclomatic 20) · ×1
  • parser.parseImportClause (cyclomatic 20) internal/js_parser/js_parser.go:5703 — parser.parseImportClause 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 · parser.parseDecorator (cyclomatic 20) · ×1
  • parser.parseDecorator (cyclomatic 20) internal/js_parser/js_parser.go:6924 — parser.parseDecorator 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 · parser.parseTypeScriptEnumStmt (cyclomatic 20) · ×1
  • parser.parseTypeScriptEnumStmt (cyclomatic 20) internal/js_parser/ts_parser.go:1360 — parser.parseTypeScriptEnumStmt 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 · printer.printNumber (cyclomatic 20) · ×1
  • printer.printNumber (cyclomatic 20) internal/js_printer/js_printer.go:484 — printer.printNumber 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 · linkerContext.generateGlobalNamePrefix (cyclomatic 20) · ×1
  • linkerContext.generateGlobalNamePrefix (cyclomatic 20) internal/linker/linker.go:5999 — linkerContext.generateGlobalNamePrefix 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 · logger.PlatformIndependentPathDirBaseExt (cyclomatic 20) · ×1
  • logger.PlatformIndependentPathDirBaseExt (cyclomatic 20) internal/logger/logger.go:353 — logger.PlatformIndependentPathDirBaseExt 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 · resolver.isValidTSConfigPathNoBaseURLPattern (cyclomatic 20) · ×1
  • resolver.isValidTSConfigPathNoBaseURLPattern (cyclomatic 20) internal/resolver/tsconfig_json.go:437 — resolver.isValidTSConfigPathNoBaseURLPattern 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 · resolverQuery.esmPackageTargetReverseResolve (cyclomatic 20) · ×1
  • resolverQuery.esmPackageTargetReverseResolve (cyclomatic 20) internal/resolver/package_json.go:1401 — resolverQuery.esmPackageTargetReverseResolve 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 · resolverQuery.checkForBuiltInNodeModules (cyclomatic 20) · ×1
  • resolverQuery.checkForBuiltInNodeModules (cyclomatic 20) internal/resolver/resolver.go:2539 — resolverQuery.checkForBuiltInNodeModules 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 · bundler.ResolveFailureErrorTextSuggestionNotes (cyclomatic 19) · ×1
  • bundler.ResolveFailureErrorTextSuggestionNotes (cyclomatic 19) internal/bundler/bundler.go:802 — bundler.ResolveFailureErrorTextSuggestionNotes 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 · scanner.validateTLA (cyclomatic 19) · ×1
  • scanner.validateTLA (cyclomatic 19) internal/bundler/bundler.go:2827 — scanner.validateTLA 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 · parser.processAnimationShorthand (cyclomatic 19) · ×1
  • parser.processAnimationShorthand (cyclomatic 19) internal/css_parser/css_decls_animation.go:11 — parser.processAnimationShorthand 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 · parser.parseMediaInParens (cyclomatic 19) · ×1
  • parser.parseMediaInParens (cyclomatic 19) internal/css_parser/css_parser_media.go:170 — parser.parseMediaInParens 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 · parser.warnAboutDuplicateProperties (cyclomatic 19) · ×1
  • parser.warnAboutDuplicateProperties (cyclomatic 19) internal/js_parser/js_parser.go:1048 — parser.warnAboutDuplicateProperties 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 · logger.msgString (cyclomatic 19) · ×1
  • logger.msgString (cyclomatic 19) internal/logger/logger.go:1247 — logger.msgString 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 · Source.CommentTextWithoutIndent (cyclomatic 19) · ×1
  • Source.CommentTextWithoutIndent (cyclomatic 19) internal/logger/logger.go:570 — Source.CommentTextWithoutIndent 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 · resolverQuery.esmPackageExportsResolve (cyclomatic 19) · ×1
  • resolverQuery.esmPackageExportsResolve (cyclomatic 19) internal/resolver/package_json.go:948 — resolverQuery.esmPackageExportsResolve 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 · resolverQuery.esmPackageImportsExportsResolve (cyclomatic 19) · ×1
  • resolverQuery.esmPackageImportsExportsResolve (cyclomatic 19) internal/resolver/package_json.go:997 — resolverQuery.esmPackageImportsExportsResolve 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 · bundler.lowestCommonAncestorDirectory (cyclomatic 18) · ×1
  • bundler.lowestCommonAncestorDirectory (cyclomatic 18) internal/bundler/bundler.go:2118 — bundler.lowestCommonAncestorDirectory 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 · parser.captureValueWithPossibleSideEffects (cyclomatic 18) · ×1
  • parser.captureValueWithPossibleSideEffects (cyclomatic 18) internal/js_parser/js_parser.go:11984 — parser.captureValueWithPossibleSideEffects has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 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 · parser.isDotOrIndexDefineMatch (cyclomatic 18) · ×1
  • parser.isDotOrIndexDefineMatch (cyclomatic 18) internal/js_parser/js_parser.go:12574 — parser.isDotOrIndexDefineMatch 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 · printer.printSpaceBeforeOperator (cyclomatic 18) · ×1
  • printer.printSpaceBeforeOperator (cyclomatic 18) internal/js_printer/js_printer.go:817 — printer.printSpaceBeforeOperator 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 · linkerContext.mangleLocalCSS (cyclomatic 18) · ×1
  • linkerContext.mangleLocalCSS (cyclomatic 18) internal/linker/linker.go:450 — linkerContext.mangleLocalCSS 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 · linkerContext.markFileLiveForTreeShaking (cyclomatic 18) · ×1
  • linkerContext.markFileLiveForTreeShaking (cyclomatic 18) internal/linker/linker.go:3215 — linkerContext.markFileLiveForTreeShaking 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 · resolverQuery.loadAsFile (cyclomatic 18) · ×1
  • resolverQuery.loadAsFile (cyclomatic 18) internal/resolver/resolver.go:1732 — resolverQuery.loadAsFile has cyclomatic complexity 18 (threshold 15). Of this number, 14 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 · scanner.preprocessInjectedFiles (cyclomatic 17) · ×1
  • scanner.preprocessInjectedFiles (cyclomatic 17) internal/bundler/bundler.go:1696 — scanner.preprocessInjectedFiles has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 1755). 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 · Token.Equal (cyclomatic 17) · ×1
  • Token.Equal (cyclomatic 17) internal/css_ast/css_ast.go:163 — Token.Equal 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 · css_parser.isSafeSelectors (cyclomatic 17) · ×1
  • css_parser.isSafeSelectors (cyclomatic 17) internal/css_parser/css_parser.go:928 — css_parser.isSafeSelectors 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 · parser.expectWithMatchingLoc (cyclomatic 17) · ×1
  • parser.expectWithMatchingLoc (cyclomatic 17) internal/css_parser/css_parser.go:245 — parser.expectWithMatchingLoc has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · fs.ParseYarnPnPVirtualPath (cyclomatic 17) · ×1
  • fs.ParseYarnPnPVirtualPath (cyclomatic 17) internal/fs/fs_zip.go:337 — fs.ParseYarnPnPVirtualPath 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 · mockFS.Rel (cyclomatic 17) · ×1
  • mockFS.Rel (cyclomatic 17) internal/fs/fs_mock.go:240 — mockFS.Rel 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 · Lexer.NextJSXElementChild (cyclomatic 17) · ×1
  • Lexer.NextJSXElementChild (cyclomatic 17) internal/js_lexer/js_lexer.go:702 — Lexer.NextJSXElementChild has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · js_parser.duplicateCaseHash (cyclomatic 17) · ×1
  • js_parser.duplicateCaseHash (cyclomatic 17) internal/js_parser/js_parser.go:930 — js_parser.duplicateCaseHash has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case's concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases — they stay explicit and reviewable.
D1 · Cyclomatic Complexity · parser.globPatternFromExpr (cyclomatic 17) · ×1
  • parser.globPatternFromExpr (cyclomatic 17) internal/js_parser/js_parser.go:16710 — parser.globPatternFromExpr 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 · parser.lowerSuperPropertyOrPrivateInAssign (cyclomatic 17) · ×1
  • parser.lowerSuperPropertyOrPrivateInAssign (cyclomatic 17) internal/js_parser/js_parser_lower_class.go:174 — parser.lowerSuperPropertyOrPrivateInAssign 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 · parser.skipTypeScriptBinding (cyclomatic 17) · ×1
  • parser.skipTypeScriptBinding (cyclomatic 17) internal/js_parser/ts_parser.go:19 — parser.skipTypeScriptBinding 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 · linker.Link (cyclomatic 17) · ×1
  • linker.Link (cyclomatic 17) internal/linker/linker.go:227 — linker.Link 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 · linkerContext.mangleProps (cyclomatic 17) · ×1
  • linkerContext.mangleProps (cyclomatic 17) internal/linker/linker.go:352 — linkerContext.mangleProps 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 · scanner.scanAllDependencies (cyclomatic 16) · ×1
  • scanner.scanAllDependencies (cyclomatic 16) internal/bundler/bundler.go:2175 — scanner.scanAllDependencies 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 · lexer.consumeURL (cyclomatic 16) · ×1
  • lexer.consumeURL (cyclomatic 16) internal/css_lexer/css_lexer.go:795 — lexer.consumeURL 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 · parser.handleComposesPragma (cyclomatic 16) · ×1
  • parser.handleComposesPragma (cyclomatic 16) internal/css_parser/css_decls_composes.go:19 — parser.handleComposesPragma 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 · parser.flattenLocalAndGlobalSelectors (cyclomatic 16) · ×1
  • parser.flattenLocalAndGlobalSelectors (cyclomatic 16) internal/css_parser/css_parser_selector.go:168 — parser.flattenLocalAndGlobalSelectors 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 · helpers.DecodeWTF8Rune (cyclomatic 16) · ×1
  • helpers.DecodeWTF8Rune (cyclomatic 16) internal/helpers/utf.go:168 — helpers.DecodeWTF8Rune 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 · js_ast.ToNullOrUndefinedWithSideEffects (cyclomatic 16) · ×1
  • js_ast.ToNullOrUndefinedWithSideEffects (cyclomatic 16) internal/js_ast/js_ast_helpers.go:1939 — js_ast.ToNullOrUndefinedWithSideEffects has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · js_parser.analyzeSwitchCasesForLiveness (cyclomatic 16) · ×1
  • js_parser.analyzeSwitchCasesForLiveness (cyclomatic 16) internal/js_parser/js_parser.go:771 — js_parser.analyzeSwitchCasesForLiveness 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 · parser.parsePropertyBinding (cyclomatic 16) · ×1
  • parser.parsePropertyBinding (cyclomatic 16) internal/js_parser/js_parser.go:2740 — parser.parsePropertyBinding 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 · parser.parsePath (cyclomatic 16) · ×1
  • parser.parsePath (cyclomatic 16) internal/js_parser/js_parser.go:6616 — parser.parsePath 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 · parser.generateClosureForTypeScriptNamespaceOrEnum (cyclomatic 16) · ×1
  • parser.generateClosureForTypeScriptNamespaceOrEnum (cyclomatic 16) internal/js_parser/ts_parser.go:1822 — parser.generateClosureForTypeScriptNamespaceOrEnum 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 · lowerClassContext.insertInitializersIntoConstructor (cyclomatic 16) · ×1
  • lowerClassContext.insertInitializersIntoConstructor (cyclomatic 16) internal/js_parser/js_parser_lower_class.go:1974 — lowerClassContext.insertInitializersIntoConstructor 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 · printer.printQuotedUTF16 (cyclomatic 16) · ×1
  • printer.printQuotedUTF16 (cyclomatic 16) internal/js_printer/js_printer.go:1353 — printer.printQuotedUTF16 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 · linkerContext.markFileReachableForCodeSplitting (cyclomatic 16) · ×1
  • linkerContext.markFileReachableForCodeSplitting (cyclomatic 16) internal/linker/linker.go:3162 — linkerContext.markFileReachableForCodeSplitting 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 · linkerContext.preventExportsFromBeingRenamed (cyclomatic 16) · ×1
  • linkerContext.preventExportsFromBeingRenamed (cyclomatic 16) internal/linker/linker.go:6922 — linkerContext.preventExportsFromBeingRenamed 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 · pluginImpl.onResolve (cyclomatic 16) · ×1
  • pluginImpl.onResolve (cyclomatic 16) pkg/api/api_impl.go:1927 — pluginImpl.onResolve has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1938). 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 · cli.parseServeOptionsImpl (cyclomatic 16) · ×1
  • cli.parseServeOptionsImpl (cyclomatic 16) pkg/cli/cli_impl.go:1413 — cli.parseServeOptionsImpl has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · parser.visitExprInOut (cognitive 1654) · ×1
  • parser.visitExprInOut (cognitive 1654) internal/js_parser/js_parser.go:13504 — parser.visitExprInOut has cognitive complexity 1654 (threshold 15). Drivers by points: if/else 1334, boolean chains 130, match/switch 117, loops 73 (nesting depth added 1094). Of this number, 1569 points are the body's own statements and 85 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 · printer.printExpr (cognitive 745) · ×1
  • printer.printExpr (cognitive 745) internal/js_printer/js_printer.go:2005 — printer.printExpr has cognitive complexity 745 (threshold 15). Drivers by points: if/else 610, boolean chains 83, loops 31, match/switch 21 (nesting depth added 403). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.visitAndAppendStmt (cognitive 628) · ×1
  • parser.visitAndAppendStmt (cognitive 628) internal/js_parser/js_parser.go:10350 — parser.visitAndAppendStmt has cognitive complexity 628 (threshold 15). Drivers by points: if/else 515, boolean chains 56, loops 48, match/switch 9 (nesting depth added 373). 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 · parser.parseStmt (cognitive 517) · ×1
  • parser.parseStmt (cognitive 517) internal/js_parser/js_parser.go:7061 — parser.parseStmt has cognitive complexity 517 (threshold 15). Drivers by points: if/else 392, boolean chains 63, match/switch 45, loops 15, jumps 2 (nesting depth added 307). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.scanImportsAndExports (cognitive 424) · ×1
  • linkerContext.scanImportsAndExports (cognitive 424) internal/linker/linker.go:1289 — linkerContext.scanImportsAndExports has cognitive complexity 424 (threshold 15). Drivers by points: if/else 315, loops 80, boolean chains 22, match/switch 6, jumps 1 (nesting depth added 289). Of this number, 293 points are the body's own statements and 131 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 · cli.parseOptionsImpl (cognitive 406) · ×1
  • cli.parseOptionsImpl (cognitive 406) pkg/cli/cli_impl.go:85 — cli.parseOptionsImpl has cognitive complexity 406 (threshold 15). Drivers by points: if/else 328, boolean chains 41, match/switch 33, loops 4 (nesting depth added 202). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.mangleStmts (cognitive 380) · ×1
  • parser.mangleStmts (cognitive 380) internal/js_parser/js_parser.go:9113 — parser.mangleStmts has cognitive complexity 380 (threshold 15). Drivers by points: if/else 313, boolean chains 23, loops 22, match/switch 15, jumps 7 (nesting depth added 258). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bundler.parseFile (cognitive 325) · ×1
  • bundler.parseFile (cognitive 325) internal/bundler/bundler.go:123 — bundler.parseFile has cognitive complexity 325 (threshold 15). Drivers by points: if/else 258, loops 39, match/switch 16, boolean chains 12 (nesting depth added 218). Of this number, 324 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 · Lexer.Next (cognitive 320) · ×1
  • Lexer.Next (cognitive 320) internal/js_lexer/js_lexer.go:999 — Lexer.Next has cognitive complexity 320 (threshold 15). Drivers by points: if/else 140, match/switch 109, loops 46, boolean chains 13, jumps 12 (nesting depth added 214). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseSuffix (cognitive 305) · ×1
  • parser.parseSuffix (cognitive 305) internal/js_parser/js_parser.go:4263 — parser.parseSuffix has cognitive complexity 305 (threshold 15). Drivers by points: if/else 276, match/switch 13, boolean chains 12, loops 4 (nesting depth added 199). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · binaryExprVisitor.visitRightAndFinish (cognitive 302) · ×1
  • binaryExprVisitor.visitRightAndFinish (cognitive 302) internal/js_parser/js_parser.go:16019 — binaryExprVisitor.visitRightAndFinish has cognitive complexity 302 (threshold 15). Drivers by points: if/else 276, boolean chains 17, match/switch 9 (nesting depth added 177). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolver.compileYarnPnPData (cognitive 285) · ×1
  • resolver.compileYarnPnPData (cognitive 285) internal/resolver/yarnpnp.go:426 — resolver.compileYarnPnPData has cognitive complexity 285 (threshold 15). Drivers by points: if/else 242, loops 37, boolean chains 6 (nesting depth added 237). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseAtRule (cognitive 280) · ×1
  • parser.parseAtRule (cognitive 280) internal/css_parser/css_parser.go:1196 — parser.parseAtRule has cognitive complexity 280 (threshold 15). Drivers by points: if/else 207, match/switch 23, boolean chains 20, loops 19, jumps 11 (nesting depth added 169). Of this number, 279 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 · parser.parseProperty (cognitive 262) · ×1
  • parser.parseProperty (cognitive 262) internal/js_parser/js_parser.go:2184 — parser.parseProperty has cognitive complexity 262 (threshold 15). Drivers by points: if/else 201, boolean chains 42, match/switch 19 (nesting depth added 138). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printStmt (cognitive 259) · ×1
  • printer.printStmt (cognitive 259) internal/js_printer/js_printer.go:4101 — printer.printStmt has cognitive complexity 259 (threshold 15). Drivers by points: if/else 220, boolean chains 17, loops 12, match/switch 10 (nesting depth added 133). To reduce it, split the body into named stages: move each independent step or branch 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_parser.parseColor (cognitive 257) · ×1
  • css_parser.parseColor (cognitive 257) internal/css_parser/css_decls_color.go:465 — css_parser.parseColor has cognitive complexity 257 (threshold 15). Drivers by points: if/else 220, match/switch 33, boolean chains 4 (nesting depth added 198). 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 · scanner.processScannedFiles (cognitive 253) · ×1
  • scanner.processScannedFiles (cognitive 253) internal/bundler/bundler.go:2360 — scanner.processScannedFiles has cognitive complexity 253 (threshold 15). Drivers by points: if/else 210, loops 23, boolean chains 11, match/switch 9 (nesting depth added 173). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_parser.ParseSourceMap (cognitive 229) · ×1
  • js_parser.ParseSourceMap (cognitive 229) internal/js_parser/sourcemap_parser.go:18 — js_parser.ParseSourceMap has cognitive complexity 229 (threshold 15). Drivers by points: if/else 170, loops 29, match/switch 21, boolean chains 9 (nesting depth added 150). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.scanForImportsAndExports (cognitive 216) · ×1
  • parser.scanForImportsAndExports (cognitive 216) internal/js_parser/js_parser.go:17281 — parser.scanForImportsAndExports has cognitive complexity 216 (threshold 15). Drivers by points: if/else 150, loops 41, boolean chains 23, match/switch 2 (nesting depth added 142). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.parseTSConfigFromSource (cognitive 216) · ×1
  • resolverQuery.parseTSConfigFromSource (cognitive 216) internal/resolver/resolver.go:1252 — resolverQuery.parseTSConfigFromSource has cognitive complexity 216 (threshold 15). Drivers by points: if/else 187, loops 14, boolean chains 13, jumps 2 (nesting depth added 144). Most of this is not in the body itself: 15 of the 216 points are its own statements and the rest belongs to one function literal inside it that branches (line 1257). 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 · parser.mangleTransforms (cognitive 212) · ×1
  • parser.mangleTransforms (cognitive 212) internal/css_parser/css_decls_transform.go:21 — parser.mangleTransforms has cognitive complexity 212 (threshold 15). Drivers by points: if/else 195, loops 7, boolean chains 6, match/switch 4 (nesting depth added 156). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.processDeclarations (cognitive 206) · ×1
  • parser.processDeclarations (cognitive 206) internal/css_parser/css_decls.go:84 — parser.processDeclarations has cognitive complexity 206 (threshold 15). Drivers by points: if/else 174, loops 27, boolean chains 3, match/switch 2 (nesting depth added 135). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperContext.SimplifyUnusedExpr (cognitive 204) · ×1
  • HelperContext.SimplifyUnusedExpr (cognitive 204) internal/js_ast/js_ast_helpers.go:534 — HelperContext.SimplifyUnusedExpr has cognitive complexity 204 (threshold 15). Drivers by points: if/else 154, loops 28, match/switch 13, boolean chains 9 (nesting depth added 132). 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 · resolver.ParseTSConfigJSON (cognitive 201) · ×1
  • resolver.ParseTSConfigJSON (cognitive 201) internal/resolver/tsconfig_json.go:95 — resolver.ParseTSConfigJSON has cognitive complexity 201 (threshold 15). Drivers by points: if/else 166, loops 17, match/switch 16, boolean chains 1, jumps 1 (nesting depth added 135). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parsePrefix (cognitive 197) · ×1
  • parser.parsePrefix (cognitive 197) internal/js_parser/js_parser.go:3498 — parser.parsePrefix has cognitive complexity 197 (threshold 15). Drivers by points: if/else 163, match/switch 22, boolean chains 8, loops 4 (nesting depth added 116). 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 · Lexer.parseNumericLiteralOrDot (cognitive 189) · ×1
  • Lexer.parseNumericLiteralOrDot (cognitive 189) internal/js_lexer/js_lexer.go:1726 — Lexer.parseNumericLiteralOrDot has cognitive complexity 189 (threshold 15). Drivers by points: if/else 134, boolean chains 29, loops 20, match/switch 5, jumps 1 (nesting depth added 102). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printBinding (cognitive 185) · ×1
  • printer.printBinding (cognitive 185) internal/js_printer/js_printer.go:562 — printer.printBinding has cognitive complexity 185 (threshold 15). Drivers by points: if/else 156, boolean chains 16, loops 12, match/switch 1 (nesting depth added 124). 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 · printer.printRule (cognitive 184) · ×1
  • printer.printRule (cognitive 184) internal/css_printer/css_printer.go:107 — printer.printRule has cognitive complexity 184 (threshold 15). Drivers by points: if/else 154, loops 13, boolean chains 11, match/switch 6 (nesting depth added 96). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.finalizeImportsExportsResult (cognitive 184) · ×1
  • resolverQuery.finalizeImportsExportsResult (cognitive 184) internal/resolver/resolver.go:2605 — resolverQuery.finalizeImportsExportsResult has cognitive complexity 184 (threshold 15). Drivers by points: if/else 136, loops 30, match/switch 11, boolean chains 7 (nesting depth added 130). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.computeCrossChunkDependencies (cognitive 182) · ×1
  • linkerContext.computeCrossChunkDependencies (cognitive 182) internal/linker/linker.go:908 — linkerContext.computeCrossChunkDependencies has cognitive complexity 182 (threshold 15). Drivers by points: if/else 121, loops 50, match/switch 8, boolean chains 3 (nesting depth added 128). Of this number, 65 points are the body's own statements and 117 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 · parser.skipTypeScriptTypeWithFlags (cognitive 173) · ×1
  • parser.skipTypeScriptTypeWithFlags (cognitive 173) internal/js_parser/ts_parser.go:216 — parser.skipTypeScriptTypeWithFlags has cognitive complexity 173 (threshold 15). Drivers by points: if/else 129, boolean chains 22, loops 12, match/switch 7, jumps 3 (nesting depth added 102). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lowerClassContext.processProperties (cognitive 166) · ×1
  • lowerClassContext.processProperties (cognitive 166) internal/js_parser/js_parser_lower_class.go:1471 — lowerClassContext.processProperties has cognitive complexity 166 (threshold 15). Drivers by points: if/else 130, loops 20, boolean chains 9, match/switch 7 (nesting depth added 97). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.convertStmtsForChunk (cognitive 157) · ×1
  • linkerContext.convertStmtsForChunk (cognitive 157) internal/linker/linker.go:4311 — linkerContext.convertStmtsForChunk has cognitive complexity 157 (threshold 15). Drivers by points: if/else 123, loops 21, boolean chains 7, match/switch 6 (nesting depth added 107). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.analyzeMetafileImpl (cognitive 157) · ×1
  • api.analyzeMetafileImpl (cognitive 157) pkg/api/api_impl.go:2265 — api.analyzeMetafileImpl has cognitive complexity 157 (threshold 15). Drivers by points: if/else 106, loops 49, boolean chains 2 (nesting depth added 119). Of this number, 134 points are the body's own statements and 23 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 · apiHandler.ServeHTTP (cognitive 156) · ×1
  • apiHandler.ServeHTTP (cognitive 156) pkg/api/serve_other.go:105 — apiHandler.ServeHTTP has cognitive complexity 156 (threshold 15). Drivers by points: if/else 124, boolean chains 14, loops 13, match/switch 5 (nesting depth added 86). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.visitClass (cognitive 151) · ×1
  • parser.visitClass (cognitive 151) internal/js_parser/js_parser.go:12132 — parser.visitClass has cognitive complexity 151 (threshold 15). Drivers by points: if/else 122, boolean chains 13, match/switch 9, loops 7 (nesting depth added 81). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.generateChunkJS (cognitive 142) · ×1
  • linkerContext.generateChunkJS (cognitive 142) internal/linker/linker.go:5563 — linkerContext.generateChunkJS has cognitive complexity 142 (threshold 15). Drivers by points: if/else 104, loops 33, boolean chains 5 (nesting depth added 69). Of this number, 132 points are the body's own statements and 10 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 · serviceType.handleIncomingPacket (cognitive 139) · ×1
  • serviceType.handleIncomingPacket (cognitive 139) cmd/esbuild/service.go:203 — serviceType.handleIncomingPacket has cognitive complexity 139 (threshold 15). Drivers by points: if/else 127, loops 10, boolean chains 1, match/switch 1 (nesting depth added 94). Of this number, 55 points are the body's own statements and 84 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.findImportedFilesInCSSOrder (cognitive 137) · ×1
  • linkerContext.findImportedFilesInCSSOrder (cognitive 137) internal/linker/linker.go:3406 — linkerContext.findImportedFilesInCSSOrder has cognitive complexity 137 (threshold 15). Drivers by points: if/else 93, loops 28, boolean chains 11, jumps 3, match/switch 2 (nesting depth added 77). Of this number, 112 points are the body's own statements and 25 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 · scanner.addEntryPoints (cognitive 136) · ×1
  • scanner.addEntryPoints (cognitive 136) internal/bundler/bundler.go:1841 — scanner.addEntryPoints has cognitive complexity 136 (threshold 15). Drivers by points: if/else 108, loops 18, boolean chains 10 (nesting depth added 74). Of this number, 95 points are the body's own statements and 41 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 · linkerContext.generateChunkCSS (cognitive 136) · ×1
  • linkerContext.generateChunkCSS (cognitive 136) internal/linker/linker.go:6093 — linkerContext.generateChunkCSS has cognitive complexity 136 (threshold 15). Drivers by points: if/else 95, loops 29, boolean chains 6, match/switch 6 (nesting depth added 75). Of this number, 119 points are the body's own statements and 17 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 · Lexer.tryToDecodeEscapeSequences (cognitive 134) · ×1
  • Lexer.tryToDecodeEscapeSequences (cognitive 134) internal/js_lexer/js_lexer.go:2192 — Lexer.tryToDecodeEscapeSequences has cognitive complexity 134 (threshold 15). Drivers by points: if/else 78, match/switch 36, loops 15, boolean chains 4, jumps 1 (nesting depth added 98). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printProperty (cognitive 133) · ×1
  • printer.printProperty (cognitive 133) internal/js_printer/js_printer.go:1077 — printer.printProperty has cognitive complexity 133 (threshold 15). Drivers by points: if/else 107, boolean chains 14, match/switch 12 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.renameSymbolsInChunk (cognitive 132) · ×1
  • linkerContext.renameSymbolsInChunk (cognitive 132) internal/linker/linker.go:5315 — linkerContext.renameSymbolsInChunk has cognitive complexity 132 (threshold 15). Drivers by points: if/else 70, loops 55, match/switch 6, boolean chains 1 (nesting depth added 93). Of this number, 115 points are the body's own statements and 17 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 · parser.convertTokensHelper (cognitive 131) · ×1
  • parser.convertTokensHelper (cognitive 131) internal/css_parser/css_parser.go:1814 — parser.convertTokensHelper has cognitive complexity 131 (threshold 15). Drivers by points: if/else 106, boolean chains 10, loops 9, match/switch 5, jumps 1 (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.substituteSingleUseSymbolInExpr (cognitive 121) · ×1
  • parser.substituteSingleUseSymbolInExpr (cognitive 121) internal/js_parser/js_parser.go:9692 — parser.substituteSingleUseSymbolInExpr has cognitive complexity 121 (threshold 15). Drivers by points: if/else 100, boolean chains 9, loops 9, match/switch 3 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.maybeRewritePropertyAccess (cognitive 120) · ×1
  • parser.maybeRewritePropertyAccess (cognitive 120) internal/js_parser/js_parser.go:12894 — parser.maybeRewritePropertyAccess has cognitive complexity 120 (threshold 15). Drivers by points: if/else 101, boolean chains 10, match/switch 6, loops 3 (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serviceType.convertPlugins (cognitive 117) · ×1
  • serviceType.convertPlugins (cognitive 117) cmd/esbuild/service.go:848 — serviceType.convertPlugins has cognitive complexity 117 (threshold 15). Drivers by points: if/else 99, loops 18 (nesting depth added 56). Most of this is not in the body itself: 9 of the 117 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 903, 860). 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 · linkerContext.generateCodeForFileInChunkJS (cognitive 117) · ×1
  • linkerContext.generateCodeForFileInChunkJS (cognitive 117) internal/linker/linker.go:4657 — linkerContext.generateCodeForFileInChunkJS has cognitive complexity 117 (threshold 15). Drivers by points: if/else 90, loops 15, boolean chains 6, match/switch 6 (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.esmPackageTargetResolve (cognitive 107) · ×1
  • resolverQuery.esmPackageTargetResolve (cognitive 107) internal/resolver/package_json.go:1096 — resolverQuery.esmPackageTargetResolve has cognitive complexity 107 (threshold 15). Drivers by points: if/else 89, loops 10, boolean chains 7, match/switch 1 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.finalizeResolve (cognitive 106) · ×1
  • resolverQuery.finalizeResolve (cognitive 106) internal/resolver/resolver.go:831 — resolverQuery.finalizeResolve has cognitive complexity 106 (threshold 15). Drivers by points: if/else 97, loops 8, boolean chains 1 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseJSXElement (cognitive 104) · ×1
  • parser.parseJSXElement (cognitive 104) internal/js_parser/js_parser.go:5219 — parser.parseJSXElement has cognitive complexity 104 (threshold 15). Drivers by points: if/else 88, loops 6, match/switch 5, boolean chains 4, jumps 1 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_parser.tryToParseColorStops (cognitive 102) · ×1
  • css_parser.tryToParseColorStops (cognitive 102) internal/css_parser/css_decls_gradient.go:467 — css_parser.tryToParseColorStops has cognitive complexity 102 (threshold 15). Drivers by points: if/else 80, loops 20, boolean chains 2 (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 · parser.computeClassLoweringInfo (cognitive 102) · ×1
  • parser.computeClassLoweringInfo (cognitive 102) internal/js_parser/js_parser_lower_class.go:387 — parser.computeClassLoweringInfo has cognitive complexity 102 (threshold 15). Drivers by points: if/else 83, loops 13, boolean chains 6 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.parsePackageJSON (cognitive 102) · ×1
  • resolverQuery.parsePackageJSON (cognitive 102) internal/resolver/package_json.go:251 — resolverQuery.parsePackageJSON has cognitive complexity 102 (threshold 15). Drivers by points: if/else 83, loops 8, boolean chains 6, match/switch 5 (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.
D2 · Cognitive Complexity · parser.lowerOptionalChain (cognitive 100) · ×1
  • parser.lowerOptionalChain (cognitive 100) internal/js_parser/js_parser_lower.go:495 — parser.lowerOptionalChain has cognitive complexity 100 (threshold 15). Drivers by points: if/else 79, match/switch 9, boolean chains 7, jumps 3, loops 2 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runImpl (cognitive 99) · ×1
  • cli.runImpl (cognitive 99) pkg/cli/cli_impl.go:1184 — cli.runImpl has cognitive complexity 99 (threshold 15). Drivers by points: if/else 93, boolean chains 4, loops 1, match/switch 1 (nesting depth added 55). Of this number, 65 points are the body's own statements and 34 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 · HelperContext.MangleIfExpr (cognitive 98) · ×1
  • HelperContext.MangleIfExpr (cognitive 98) internal/js_ast/js_ast_helpers.go:2788 — HelperContext.MangleIfExpr has cognitive complexity 98 (threshold 15). Drivers by points: if/else 72, boolean chains 20, loops 4, match/switch 2 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_parser.Parse (cognitive 97) · ×1
  • js_parser.Parse (cognitive 97) internal/js_parser/js_parser.go:17772 — js_parser.Parse has cognitive complexity 97 (threshold 15). Drivers by points: if/else 66, loops 21, match/switch 5, boolean chains 4, jumps 1 (nesting depth added 53). Of this number, 95 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 · resolverQuery.loadNodeModules (cognitive 96) · ×1
  • resolverQuery.loadNodeModules (cognitive 96) internal/resolver/resolver.go:2358 — resolverQuery.loadNodeModules has cognitive complexity 96 (threshold 15). Drivers by points: if/else 83, boolean chains 7, loops 3, match/switch 3 (nesting depth added 50). Of this number, 76 points are the body's own statements and 20 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 · parser.lowerAndMinifyColor (cognitive 95) · ×1
  • parser.lowerAndMinifyColor (cognitive 95) internal/css_parser/css_decls_color.go:280 — parser.lowerAndMinifyColor has cognitive complexity 95 (threshold 15). Drivers by points: if/else 78, match/switch 10, boolean chains 7 (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperContext.StmtsCanBeRemovedIfUnused (cognitive 95) · ×1
  • HelperContext.StmtsCanBeRemovedIfUnused (cognitive 95) internal/js_ast/js_ast_helpers.go:2200 — HelperContext.StmtsCanBeRemovedIfUnused has cognitive complexity 95 (threshold 15). Drivers by points: if/else 63, match/switch 16, loops 10, boolean chains 6 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.hoistSymbols (cognitive 95) · ×1
  • parser.hoistSymbols (cognitive 95) internal/js_parser/js_parser.go:1540 — parser.hoistSymbols has cognitive complexity 95 (threshold 15). Drivers by points: if/else 72, boolean chains 11, loops 10, jumps 2 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.minifySwitchStmt (cognitive 94) · ×1
  • parser.minifySwitchStmt (cognitive 94) internal/js_parser/js_parser.go:11569 — parser.minifySwitchStmt has cognitive complexity 94 (threshold 15). Drivers by points: if/else 75, loops 12, boolean chains 7 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch 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_parser.tryToParseCalcTerm (cognitive 92) · ×1
  • css_parser.tryToParseCalcTerm (cognitive 92) internal/css_parser/css_reduce_calc.go:469 — css_parser.tryToParseCalcTerm has cognitive complexity 92 (threshold 15). Drivers by points: if/else 58, boolean chains 19, loops 15 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printUnquotedUTF16 (cognitive 86) · ×1
  • printer.printUnquotedUTF16 (cognitive 86) internal/js_printer/js_printer.go:65 — printer.printUnquotedUTF16 has cognitive complexity 86 (threshold 15). Drivers by points: if/else 65, boolean chains 11, loops 5, match/switch 5 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Resolver.Resolve (cognitive 86) · ×1
  • Resolver.Resolve (cognitive 86) internal/resolver/resolver.go:368 — Resolver.Resolve has cognitive complexity 86 (threshold 15). Drivers by points: if/else 76, boolean chains 6, loops 4 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperContext.ExprCanBeRemovedIfUnused (cognitive 85) · ×1
  • HelperContext.ExprCanBeRemovedIfUnused (cognitive 85) internal/js_ast/js_ast_helpers.go:2432 — HelperContext.ExprCanBeRemovedIfUnused has cognitive complexity 85 (threshold 15). Drivers by points: if/else 47, boolean chains 17, loops 13, match/switch 8 (nesting depth added 43). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · parser.maybeMarkKnownGlobalConstructorAsPure (cognitive 84) · ×1
  • parser.maybeMarkKnownGlobalConstructorAsPure (cognitive 84) internal/js_parser/js_parser.go:16878 — parser.maybeMarkKnownGlobalConstructorAsPure has cognitive complexity 84 (threshold 15). Drivers by points: if/else 55, match/switch 23, loops 6 (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.mangleIf (cognitive 82) · ×1
  • parser.mangleIf (cognitive 82) internal/js_parser/js_parser.go:10203 — parser.mangleIf has cognitive complexity 82 (threshold 15). Drivers by points: if/else 76, boolean chains 6 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · internalContext.Serve (cognitive 82) · ×1
  • internalContext.Serve (cognitive 82) pkg/api/serve_other.go:730 — internalContext.Serve has cognitive complexity 82 (threshold 15). Drivers by points: if/else 67, boolean chains 8, loops 7 (nesting depth added 28). Of this number, 74 points are the body's own statements and 8 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 · linkerContext.generateEntryPointTailJS (cognitive 81) · ×1
  • linkerContext.generateEntryPointTailJS (cognitive 81) internal/linker/linker.go:4992 — linkerContext.generateEntryPointTailJS has cognitive complexity 81 (threshold 15). Drivers by points: if/else 69, loops 10, boolean chains 1, match/switch 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.rebuildImpl (cognitive 78) · ×1
  • api.rebuildImpl (cognitive 78) pkg/api/api_impl.go:1467 — api.rebuildImpl has cognitive complexity 78 (threshold 15). Drivers by points: if/else 58, loops 18, boolean chains 2 (nesting depth added 42). Of this number, 52 points are the body's own statements and 26 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 · parser.parsePseudoClassSelector (cognitive 76) · ×1
  • parser.parsePseudoClassSelector (cognitive 76) internal/css_parser/css_parser_selector.go:620 — parser.parsePseudoClassSelector has cognitive complexity 76 (threshold 15). Drivers by points: if/else 66, match/switch 6, boolean chains 4 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.main (cognitive 74) · ×1
  • main.main (cognitive 74) cmd/esbuild/main.go:159 — main.main has cognitive complexity 74 (threshold 15). Drivers by points: if/else 57, loops 9, boolean chains 6, match/switch 2 (nesting depth added 35). Of this number, 16 points are the body's own statements and 58 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 · printer.printRequireOrImportExpr (cognitive 74) · ×1
  • printer.printRequireOrImportExpr (cognitive 74) internal/js_printer/js_printer.go:1399 — printer.printRequireOrImportExpr has cognitive complexity 74 (threshold 15). Drivers by points: if/else 64, boolean chains 7, match/switch 3 (nesting depth added 34). Of this number, 70 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 · parser.handleGlobPattern (cognitive 73) · ×1
  • parser.handleGlobPattern (cognitive 73) internal/js_parser/js_parser.go:16569 — parser.handleGlobPattern has cognitive complexity 73 (threshold 15). Drivers by points: if/else 54, loops 12, boolean chains 5, jumps 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.computeChunks (cognitive 73) · ×1
  • linkerContext.computeChunks (cognitive 73) internal/linker/linker.go:3870 — linkerContext.computeChunks has cognitive complexity 73 (threshold 15). Drivers by points: if/else 52, loops 16, match/switch 4, boolean chains 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.isUnsupportedRegularExpression (cognitive 72) · ×1
  • parser.isUnsupportedRegularExpression (cognitive 72) internal/js_parser/js_parser.go:13367 — parser.isUnsupportedRegularExpression has cognitive complexity 72 (threshold 15). Drivers by points: if/else 50, match/switch 9, loops 6, jumps 4, boolean chains 3 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseListOfRules (cognitive 71) · ×1
  • parser.parseListOfRules (cognitive 71) internal/css_parser/css_parser.go:366 — parser.parseListOfRules has cognitive complexity 71 (threshold 15). Drivers by points: if/else 56, match/switch 6, boolean chains 4, loops 3, jumps 2 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.visitStmts (cognitive 71) · ×1
  • parser.visitStmts (cognitive 71) internal/js_parser/js_parser.go:8917 — parser.visitStmts has cognitive complexity 71 (threshold 15). Drivers by points: if/else 57, loops 9, boolean chains 3, match/switch 2 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.maybeAppendLegalComments (cognitive 71) · ×1
  • linkerContext.maybeAppendLegalComments (cognitive 71) internal/linker/linker.go:6544 — linkerContext.maybeAppendLegalComments has cognitive complexity 71 (threshold 15). Drivers by points: if/else 34, loops 34, match/switch 2, boolean chains 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.dirInfoUncached (cognitive 71) · ×1
  • resolverQuery.dirInfoUncached (cognitive 71) internal/resolver/resolver.go:1533 — resolverQuery.dirInfoUncached has cognitive complexity 71 (threshold 15). Drivers by points: if/else 61, boolean chains 10 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.mangleRules (cognitive 70) · ×1
  • parser.mangleRules (cognitive 70) internal/css_parser/css_parser.go:588 — parser.mangleRules has cognitive complexity 70 (threshold 15). Drivers by points: if/else 44, loops 17, boolean chains 5, jumps 2, match/switch 2 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printTokens (cognitive 70) · ×1
  • printer.printTokens (cognitive 70) internal/css_printer/css_printer.go:1162 — printer.printTokens has cognitive complexity 70 (threshold 15). Drivers by points: if/else 51, boolean chains 11, match/switch 5, loops 3 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lexer.NextInsideJSXElement (cognitive 70) · ×1
  • Lexer.NextInsideJSXElement (cognitive 70) internal/js_lexer/js_lexer.go:819 — Lexer.NextInsideJSXElement has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26, loops 20, match/switch 19, jumps 4, boolean chains 1 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.insertStmtsAfterSuperCall (cognitive 70) · ×1
  • parser.insertStmtsAfterSuperCall (cognitive 70) internal/js_parser/js_parser_lower_class.go:2451 — parser.insertStmtsAfterSuperCall has cognitive complexity 70 (threshold 15). Drivers by points: if/else 60, boolean chains 5, match/switch 3, loops 2 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printCompoundSelector (cognitive 69) · ×1
  • printer.printCompoundSelector (cognitive 69) internal/css_printer/css_printer.go:609 — printer.printCompoundSelector has cognitive complexity 69 (threshold 15). Drivers by points: if/else 53, boolean chains 7, loops 7, match/switch 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.FoldBinaryOperator (cognitive 69) · ×1
  • js_ast.FoldBinaryOperator (cognitive 69) internal/js_ast/js_ast_helpers.go:1235 — js_ast.FoldBinaryOperator has cognitive complexity 69 (threshold 15). Drivers by points: if/else 68, match/switch 1 (nesting depth added 34). 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 · parser.handleIdentifier (cognitive 68) · ×1
  • parser.handleIdentifier (cognitive 68) internal/js_parser/js_parser.go:17007 — parser.handleIdentifier has cognitive complexity 68 (threshold 15). Drivers by points: if/else 46, boolean chains 14, match/switch 8 (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 · lowerClassContext.finishAndGenerateCode (cognitive 68) · ×1
  • lowerClassContext.finishAndGenerateCode (cognitive 68) internal/js_parser/js_parser_lower_class.go:2054 — lowerClassContext.finishAndGenerateCode has cognitive complexity 68 (threshold 15). Drivers by points: if/else 53, boolean chains 9, loops 4, match/switch 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.resolveWithoutSymlinks (cognitive 68) · ×1
  • resolverQuery.resolveWithoutSymlinks (cognitive 68) internal/resolver/resolver.go:954 — resolverQuery.resolveWithoutSymlinks has cognitive complexity 68 (threshold 15). Drivers by points: if/else 64, boolean chains 4 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lexer.next (cognitive 67) · ×1
  • lexer.next (cognitive 67) internal/css_lexer/css_lexer.go:279 — lexer.next has cognitive complexity 67 (threshold 15). Drivers by points: if/else 48, loops 9, boolean chains 5, match/switch 5 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseCompoundSelector (cognitive 67) · ×1
  • parser.parseCompoundSelector (cognitive 67) internal/css_parser/css_parser_selector.go:343 — parser.parseCompoundSelector has cognitive complexity 67 (threshold 15). Drivers by points: if/else 44, match/switch 11, loops 5, boolean chains 4, jumps 3 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseFn (cognitive 67) · ×1
  • parser.parseFn (cognitive 67) internal/js_parser/js_parser.go:6120 — parser.parseFn has cognitive complexity 67 (threshold 15). Drivers by points: if/else 54, boolean chains 8, loops 5 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.toAST (cognitive 67) · ×1
  • parser.toAST (cognitive 67) internal/js_parser/js_parser.go:18563 — parser.toAST has cognitive complexity 67 (threshold 15). Drivers by points: if/else 33, loops 19, boolean chains 13, match/switch 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.generateSourceMapForChunk (cognitive 67) · ×1
  • linkerContext.generateSourceMapForChunk (cognitive 67) internal/linker/linker.go:6996 — linkerContext.generateSourceMapForChunk has cognitive complexity 67 (threshold 15). Drivers by points: if/else 56, loops 10, boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bundler.runOnLoadPlugins (cognitive 66) · ×1
  • bundler.runOnLoadPlugins (cognitive 66) internal/bundler/bundler.go:1181 — bundler.runOnLoadPlugins has cognitive complexity 66 (threshold 15). Drivers by points: if/else 49, loops 9, match/switch 5, boolean chains 3 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperContext.isSideEffectFreeUnboundIdentifierRef (cognitive 66) · ×1
  • HelperContext.isSideEffectFreeUnboundIdentifierRef (cognitive 66) internal/js_ast/js_ast_helpers.go:2637 — HelperContext.isSideEffectFreeUnboundIdentifierRef has cognitive complexity 66 (threshold 15). Drivers by points: if/else 55, boolean chains 8, match/switch 3 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.matchImportWithExport (cognitive 66) · ×1
  • linkerContext.matchImportWithExport (cognitive 66) internal/linker/linker.go:2628 — linkerContext.matchImportWithExport has cognitive complexity 66 (threshold 15). Drivers by points: if/else 51, loops 10, boolean chains 2, match/switch 2, jumps 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.loadAsMainField (cognitive 66) · ×1
  • resolverQuery.loadAsMainField (cognitive 66) internal/resolver/resolver.go:1972 — resolverQuery.loadAsMainField has cognitive complexity 66 (threshold 15). Drivers by points: if/else 61, loops 3, boolean chains 2 (nesting depth added 35). Of this number, 58 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.lowerFunction (cognitive 65) · ×1
  • parser.lowerFunction (cognitive 65) internal/js_parser/js_parser_lower.go:276 — parser.lowerFunction has cognitive complexity 65 (threshold 15). Drivers by points: if/else 42, boolean chains 12, loops 11 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.generateCodeForLazyExport (cognitive 65) · ×1
  • linkerContext.generateCodeForLazyExport (cognitive 65) internal/linker/linker.go:2105 — linkerContext.generateCodeForLazyExport has cognitive complexity 65 (threshold 15). Drivers by points: if/else 47, loops 15, boolean chains 3 (nesting depth added 44). Of this number, 26 points are the body's own statements and 39 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 · logger.PrintSummary (cognitive 65) · ×1
  • logger.PrintSummary (cognitive 65) internal/logger/logger.go:998 — logger.PrintSummary has cognitive complexity 65 (threshold 15). Drivers by points: if/else 59, loops 4, boolean chains 2 (nesting depth added 39). Most of this is not in the body itself: 0 of the 65 points are its own statements and the rest belongs to one function literal inside it that branches (line 999). 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 · Resolver.ResolveGlob (cognitive 64) · ×1
  • Resolver.ResolveGlob (cognitive 64) internal/resolver/resolver.go:580 — Resolver.ResolveGlob has cognitive complexity 64 (threshold 15). Drivers by points: if/else 52, boolean chains 5, match/switch 4, loops 3 (nesting depth added 29). Of this number, 36 points are the body's own statements and 28 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 · scanner.validateTLA (cognitive 63) · ×1
  • scanner.validateTLA (cognitive 63) internal/bundler/bundler.go:2827 — scanner.validateTLA has cognitive complexity 63 (threshold 15). Drivers by points: if/else 49, loops 9, boolean chains 5 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseListOfDeclarations (cognitive 63) · ×1
  • parser.parseListOfDeclarations (cognitive 63) internal/css_parser/css_parser.go:508 — parser.parseListOfDeclarations has cognitive complexity 63 (threshold 15). Drivers by points: if/else 50, loops 7, boolean chains 4, match/switch 2 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseBinding (cognitive 63) · ×1
  • parser.parseBinding (cognitive 63) internal/js_parser/js_parser.go:5967 — parser.parseBinding has cognitive complexity 63 (threshold 15). Drivers by points: if/else 52, boolean chains 6, loops 4, match/switch 1 (nesting depth added 36). 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 · parser.lowerNestingInRuleWithContext (cognitive 62) · ×1
  • parser.lowerNestingInRuleWithContext (cognitive 62) internal/css_parser/css_nesting.go:153 — parser.lowerNestingInRuleWithContext has cognitive complexity 62 (threshold 15). Drivers by points: if/else 33, loops 25, boolean chains 3, match/switch 1 (nesting depth added 38). Of this number, 58 points are the body's own statements and 4 belong to one function literal inside it that branches. 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 · parser.parseParenExpr (cognitive 61) · ×1
  • parser.parseParenExpr (cognitive 61) internal/js_parser/js_parser.go:3152 — parser.parseParenExpr has cognitive complexity 61 (threshold 15). Drivers by points: if/else 45, loops 10, boolean chains 6 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseAndDeclareDecls (cognitive 61) · ×1
  • parser.parseAndDeclareDecls (cognitive 61) internal/js_parser/js_parser.go:5569 — parser.parseAndDeclareDecls has cognitive complexity 61 (threshold 15). Drivers by points: if/else 49, boolean chains 7, match/switch 4, loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.checkBrowserMap (cognitive 61) · ×1
  • resolverQuery.checkBrowserMap (cognitive 61) internal/resolver/package_json.go:94 — resolverQuery.checkBrowserMap has cognitive complexity 61 (threshold 15). Drivers by points: if/else 48, loops 7, boolean chains 4, match/switch 2 (nesting depth added 26). Of this number, 36 points are the body's own statements and 25 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 · lowerClassContext.lowerField (cognitive 59) · ×1
  • lowerClassContext.lowerField (cognitive 59) internal/js_parser/js_parser_lower_class.go:819 — lowerClassContext.lowerField has cognitive complexity 59 (threshold 15). Drivers by points: if/else 54, boolean chains 5 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · realFS.WatchData (cognitive 58) · ×1
  • realFS.WatchData (cognitive 58) internal/fs/fs_real.go:449 — realFS.WatchData has cognitive complexity 58 (threshold 15). Drivers by points: if/else 40, loops 13, boolean chains 3, match/switch 2 (nesting depth added 36). Most of this is not in the body itself: 10 of the 58 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 481, 515, 523, …). 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 · parser.parseSelectorRule (cognitive 57) · ×1
  • parser.parseSelectorRule (cognitive 57) internal/css_parser/css_parser.go:2151 — parser.parseSelectorRule has cognitive complexity 57 (threshold 15). Drivers by points: if/else 43, loops 12, boolean chains 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.lowerAndMinifyGradient (cognitive 56) · ×1
  • parser.lowerAndMinifyGradient (cognitive 56) internal/css_parser/css_decls_gradient.go:170 — parser.lowerAndMinifyGradient has cognitive complexity 56 (threshold 15). Drivers by points: if/else 40, boolean chains 8, loops 8 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printMediaQuery (cognitive 56) · ×1
  • printer.printMediaQuery (cognitive 56) internal/css_printer/css_printer.go:423 — printer.printMediaQuery has cognitive complexity 56 (threshold 15). Drivers by points: if/else 46, match/switch 7, loops 2, boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printNonNegativeFloat (cognitive 56) · ×1
  • printer.printNonNegativeFloat (cognitive 56) internal/js_printer/js_printer.go:3564 — printer.printNonNegativeFloat has cognitive complexity 56 (threshold 15). Drivers by points: if/else 37, loops 12, boolean chains 5, match/switch 2 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.matchTSConfigPaths (cognitive 56) · ×1
  • resolverQuery.matchTSConfigPaths (cognitive 56) internal/resolver/resolver.go:2134 — resolverQuery.matchTSConfigPaths has cognitive complexity 56 (threshold 15). Drivers by points: if/else 46, loops 7, boolean chains 3 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scanner.scanAllDependencies (cognitive 55) · ×1
  • scanner.scanAllDependencies (cognitive 55) internal/bundler/bundler.go:2175 — scanner.scanAllDependencies has cognitive complexity 55 (threshold 15). Drivers by points: if/else 49, loops 4, boolean chains 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.CheckEqualityIfNoSideEffects (cognitive 54) · ×1
  • js_ast.CheckEqualityIfNoSideEffects (cognitive 54) internal/js_ast/js_ast_helpers.go:1442 — js_ast.CheckEqualityIfNoSideEffects has cognitive complexity 54 (threshold 15). Drivers by points: if/else 37, match/switch 13, boolean chains 4 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseTypeScriptNamespaceStmt (cognitive 54) · ×1
  • parser.parseTypeScriptNamespaceStmt (cognitive 54) internal/js_parser/ts_parser.go:1623 — parser.parseTypeScriptNamespaceStmt has cognitive complexity 54 (threshold 15). Drivers by points: if/else 46, boolean chains 4, loops 2, match/switch 2 (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 · graph.CloneLinkerGraph (cognitive 53) · ×1
  • graph.CloneLinkerGraph (cognitive 53) internal/graph/graph.go:126 — graph.CloneLinkerGraph has cognitive complexity 53 (threshold 15). Drivers by points: loops 28, if/else 20, boolean chains 3, match/switch 2 (nesting depth added 30). Of this number, 25 points are the body's own statements and 28 belong to one function literal 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 · jsonParser.parseExpr (cognitive 53) · ×1
  • jsonParser.parseExpr (cognitive 53) internal/js_parser/json_parser.go:36 — jsonParser.parseExpr has cognitive complexity 53 (threshold 15). Drivers by points: if/else 47, loops 4, boolean chains 1, match/switch 1 (nesting depth added 34). 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 · parser.parseStmtsUpTo (cognitive 52) · ×1
  • parser.parseStmtsUpTo (cognitive 52) internal/js_parser/js_parser.go:8464 — parser.parseStmtsUpTo has cognitive complexity 52 (threshold 15). Drivers by points: if/else 45, loops 4, boolean chains 3 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lowerClassContext.hoistComputedProperties (cognitive 52) · ×1
  • lowerClassContext.hoistComputedProperties (cognitive 52) internal/js_parser/js_parser_lower_class.go:1219 — lowerClassContext.hoistComputedProperties has cognitive complexity 52 (threshold 15). Drivers by points: if/else 43, loops 4, boolean chains 3, match/switch 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.generateExtraDataForFileJS (cognitive 52) · ×1
  • linkerContext.generateExtraDataForFileJS (cognitive 52) internal/linker/debug.go:21 — linkerContext.generateExtraDataForFileJS has cognitive complexity 52 (threshold 15). Drivers by points: if/else 43, loops 9 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperContext.SimplifyBooleanExpr (cognitive 51) · ×1
  • HelperContext.SimplifyBooleanExpr (cognitive 51) internal/js_ast/js_ast_helpers.go:2096 — HelperContext.SimplifyBooleanExpr has cognitive complexity 51 (threshold 15). Drivers by points: if/else 37, boolean chains 11, match/switch 3 (nesting depth added 22). 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 · Lexer.scanCommentText (cognitive 51) · ×1
  • Lexer.scanCommentText (cognitive 51) internal/js_lexer/js_lexer.go:2584 — Lexer.scanCommentText has cognitive complexity 51 (threshold 15). Drivers by points: if/else 44, boolean chains 4, match/switch 2, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lowerClassContext.lowerMethod (cognitive 51) · ×1
  • lowerClassContext.lowerMethod (cognitive 51) internal/js_parser/js_parser_lower_class.go:1048 — lowerClassContext.lowerMethod has cognitive complexity 51 (threshold 15). Drivers by points: if/else 44, loops 4, boolean chains 3 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.validateBuildOptions (cognitive 51) · ×1
  • api.validateBuildOptions (cognitive 51) pkg/api/api_impl.go:1233 — api.validateBuildOptions has cognitive complexity 51 (threshold 15). Drivers by points: if/else 34, boolean chains 10, loops 5, match/switch 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseExprOrLetOrUsingStmt (cognitive 50) · ×1
  • parser.parseExprOrLetOrUsingStmt (cognitive 50) internal/js_parser/js_parser.go:4987 — parser.parseExprOrLetOrUsingStmt has cognitive complexity 50 (threshold 15). Drivers by points: if/else 41, boolean chains 7, match/switch 2 (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 · parser.skipTypeScriptTypeParameters (cognitive 50) · ×1
  • parser.skipTypeScriptTypeParameters (cognitive 50) internal/js_parser/ts_parser.go:678 — parser.skipTypeScriptTypeParameters has cognitive complexity 50 (threshold 15). Drivers by points: if/else 39, boolean chains 8, loops 3 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolver.parseImportsExportsMap (cognitive 50) · ×1
  • resolver.parseImportsExportsMap (cognitive 50) internal/resolver/package_json.go:640 — resolver.parseImportsExportsMap has cognitive complexity 50 (threshold 15). Drivers by points: if/else 34, loops 7, match/switch 5, boolean chains 4 (nesting depth added 28). Most of this is not in the body itself: 1 of the 50 points is its own statement and the rest belongs 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 · parser.parseNthIndex (cognitive 49) · ×1
  • parser.parseNthIndex (cognitive 49) internal/css_parser/css_parser_selector.go:850 — parser.parseNthIndex has cognitive complexity 49 (threshold 15). Drivers by points: if/else 46, 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 · bundler.RunOnResolvePlugins (cognitive 48) · ×1
  • bundler.RunOnResolvePlugins (cognitive 48) internal/bundler/bundler.go:1051 — bundler.RunOnResolvePlugins has cognitive complexity 48 (threshold 15). Drivers by points: if/else 36, loops 9, boolean chains 3 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.flattenLocalAndGlobalSelectors (cognitive 48) · ×1
  • parser.flattenLocalAndGlobalSelectors (cognitive 48) internal/css_parser/css_parser_selector.go:168 — parser.flattenLocalAndGlobalSelectors has cognitive complexity 48 (threshold 15). Drivers by points: if/else 36, loops 5, match/switch 4, boolean chains 3 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseClass (cognitive 47) · ×1
  • parser.parseClass (cognitive 47) internal/js_parser/js_parser.go:6457 — parser.parseClass has cognitive complexity 47 (threshold 15). Drivers by points: if/else 32, boolean chains 12, loops 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · apiHandler.broadcastBuildResult (cognitive 47) · ×1
  • apiHandler.broadcastBuildResult (cognitive 47) pkg/api/serve_other.go:474 — apiHandler.broadcastBuildResult has cognitive complexity 47 (threshold 15). Drivers by points: if/else 33, loops 12, boolean chains 2 (nesting depth added 26). Of this number, 43 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 · parser.parseSelectorList (cognitive 46) · ×1
  • parser.parseSelectorList (cognitive 46) internal/css_parser/css_parser_selector.go:22 — parser.parseSelectorList has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28, loops 11, boolean chains 4, match/switch 2, jumps 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseExportClause (cognitive 46) · ×1
  • parser.parseExportClause (cognitive 46) internal/js_parser/js_parser.go:5824 — parser.parseExportClause has cognitive complexity 46 (threshold 15). Drivers by points: if/else 39, boolean chains 6, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.lowerObjectRestHelper (cognitive 46) · ×1
  • parser.lowerObjectRestHelper (cognitive 46) internal/js_parser/js_parser_lower.go:1432 — parser.lowerObjectRestHelper has cognitive complexity 46 (threshold 15). Drivers by points: if/else 30, loops 9, boolean chains 4, match/switch 3 (nesting depth added 17). Most of this is not in the body itself: 4 of the 46 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1627, 1453, 1523, …). 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 · css_parser.isSafeSelectors (cognitive 45) · ×1
  • css_parser.isSafeSelectors (cognitive 45) internal/css_parser/css_parser.go:928 — css_parser.isSafeSelectors has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27, match/switch 10, loops 6, boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolver.NewResolver (cognitive 45) · ×1
  • resolver.NewResolver (cognitive 45) internal/resolver/resolver.go:242 — resolver.NewResolver has cognitive complexity 45 (threshold 15). Drivers by points: if/else 31, loops 10, boolean chains 3, match/switch 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 · parser.processAnimationShorthand (cognitive 44) · ×1
  • parser.processAnimationShorthand (cognitive 44) internal/css_parser/css_decls_animation.go:11 — parser.processAnimationShorthand has cognitive complexity 44 (threshold 15). Drivers by points: if/else 24, match/switch 18, boolean chains 1, loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.handleComposesPragma (cognitive 44) · ×1
  • parser.handleComposesPragma (cognitive 44) internal/css_parser/css_decls_composes.go:19 — parser.handleComposesPragma has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25, loops 15, boolean chains 2, match/switch 2 (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 · helpers.internalQuote (cognitive 44) · ×1
  • helpers.internalQuote (cognitive 44) internal/helpers/quote.go:28 — helpers.internalQuote has cognitive complexity 44 (threshold 15). Drivers by points: if/else 34, loops 5, match/switch 5 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.KnownPrimitiveType (cognitive 44) · ×1
  • js_ast.KnownPrimitiveType (cognitive 44) internal/js_ast/js_ast_helpers.go:245 — js_ast.KnownPrimitiveType has cognitive complexity 44 (threshold 15). Drivers by points: if/else 34, boolean chains 5, match/switch 5 (nesting depth added 25). 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 · parser.parseImportClause (cognitive 44) · ×1
  • parser.parseImportClause (cognitive 44) internal/js_parser/js_parser.go:5703 — parser.parseImportClause has cognitive complexity 44 (threshold 15). Drivers by points: if/else 42, boolean chains 1, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · logger.GenerateStringInJSTable (cognitive 44) · ×1
  • logger.GenerateStringInJSTable (cognitive 44) internal/logger/logger.go:1904 — logger.GenerateStringInJSTable has cognitive complexity 44 (threshold 15). Drivers by points: if/else 24, loops 8, match/switch 8, boolean chains 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_parser.parseGradient (cognitive 43) · ×1
  • css_parser.parseGradient (cognitive 43) internal/css_parser/css_decls_gradient.go:37 — css_parser.parseGradient has cognitive complexity 43 (threshold 15). Drivers by points: if/else 28, boolean chains 8, loops 6, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_parser.removeImpliedPositions (cognitive 43) · ×1
  • css_parser.removeImpliedPositions (cognitive 43) internal/css_parser/css_decls_gradient.go:259 — css_parser.removeImpliedPositions has cognitive complexity 43 (threshold 15). Drivers by points: if/else 22, loops 13, boolean chains 7, jumps 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 · parser.parseMediaInParens (cognitive 43) · ×1
  • parser.parseMediaInParens (cognitive 43) internal/css_parser/css_parser_media.go:170 — parser.parseMediaInParens has cognitive complexity 43 (threshold 15). Drivers by points: if/else 38, boolean chains 4, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · calcProduct.partiallySimplify (cognitive 43) · ×1
  • calcProduct.partiallySimplify (cognitive 43) internal/css_parser/css_reduce_calc.go:342 — calcProduct.partiallySimplify has cognitive complexity 43 (threshold 15). Drivers by points: if/else 34, loops 6, boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printIdent (cognitive 43) · ×1
  • printer.printIdent (cognitive 43) internal/css_printer/css_printer.go:1027 — printer.printIdent has cognitive complexity 43 (threshold 15). Drivers by points: if/else 28, boolean chains 10, loops 3, jumps 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.FoldStringAddition (cognitive 43) · ×1
  • js_ast.FoldStringAddition (cognitive 43) internal/js_ast/js_ast_helpers.go:1779 — js_ast.FoldStringAddition has cognitive complexity 43 (threshold 15). Drivers by points: if/else 32, match/switch 8, boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lexer.NextJSXElementChild (cognitive 43) · ×1
  • Lexer.NextJSXElementChild (cognitive 43) internal/js_lexer/js_lexer.go:702 — Lexer.NextJSXElementChild has cognitive complexity 43 (threshold 15). Drivers by points: if/else 27, loops 8, match/switch 6, boolean chains 1, jumps 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 · parser.prepareForVisitPass (cognitive 43) · ×1
  • parser.prepareForVisitPass (cognitive 43) internal/js_parser/js_parser.go:18276 — parser.prepareForVisitPass has cognitive complexity 43 (threshold 15). Drivers by points: if/else 36, boolean chains 7 (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 · binaryExprVisitor.checkAndPrepare (cognitive 43) · ×1