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

evanw/esbuild

Measured 24 October 2026, 00:07 UTC, at code version f6058f8

Regression: 1 dimension fell since the last survey Knowledge freshness: not measured

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

Knowledge freshness is not measured: Freshness signal contradicted by repo activity.

CAI score 45out of 100 At risk Down 1 since the last survey

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

A medium codebase: 92,696 lines of product code in 7 projects, tests not counted · Estimated rebuild effort: about 1.0 person-years · Weakest lens: Accessibility, 40

Findings by how serious they are

48 critical 1140 serious 36 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 October 2026, 00:07 UTC

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

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

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

76of 79 dimensions measured by tools. The other 3 are advisory notes from an AI model, which explain the code but don't count towards the score.
1203of 1224 findings point to an exact file and line, so you can open each one in the code. The other 21 concern the repository as a whole, such as missing documentation.
79dimensions across 7 lenses, read from 92,696 lines of product code in 7 projects.
Chapters

Executive summary

evanw/esbuild scores 45 out of 100, but it is rated At risk while a critical security finding is open; the score itself is unchanged. The project hasn't declared a stable release yet, so its lenses are rated against a lower bar than a released product's, while the score itself is worked out as for any repository.

The weakest lens counts most in the score, and here that is Accessibility, which scores 40 and is rated Weak. Its Text alternatives dimension scores 1 out of 10, and until that reaches 4, Accessibility can't be rated higher than Adequate. The first actions are to 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 and to 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, and if Accessibility rose to 70, the score would rise from 45 to about 49.

48 findings are critical: 22 in Dependency Vulnerabilities, 17 in Static Analysis (SAST), four in Page structure, three in Secrets (history), one in Circular Imports and one in Forms & labels.

Watchdog couldn't measure 13 dimensions in this code, among them Code Coverage, Internal API Consistency and Data Protection, so they are left out of the score. The product code is 92,696 lines, which would take an estimated 1.0 person-years, around €150,000, to rebuild.

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

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

If Accessibility rose from 40 to 70, the lowest score rated Strong, the score would rise from 45 to about 49.

Code composition: what the lines of code are
Product code 65%Tests 35%
New since the last survey: 90 findings

These 90 critical or serious findings weren't in the previous survey, on 9 October 2026.

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

Fixed since the last survey: 357 findings

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

  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED scripts/REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] scripts/REDACTED
  • Code Duplication · Duplicated block (21 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (21 lines × 4 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (21 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (21 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (20 lines × 3 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (20 lines × 3 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (20 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (20 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (20 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (20 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (20 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (20 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (20 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (20 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (19 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (19 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (19 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (19 lines × 2 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (19 lines × 2 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (18 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (18 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (18 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (18 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (18 lines × 3 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (17 lines × 4 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (17 lines × 6 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (17 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (17 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (17 lines × 4 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (16 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (16 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (16 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (16 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (16 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (16 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (16 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (16 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (16 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (16 lines × 6 locations) REDACTED
  • Code Duplication · Duplicated block (16 lines × 4 locations) REDACTED
  • Code Duplication · Duplicated block (16 lines × 4 locations) REDACTED
  • Code Duplication · Duplicated block (15 lines × 2 locations) compat-table/src/css_table.ts
  • Code Duplication · Duplicated block (15 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (15 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (15 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (15 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (15 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (15 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (15 lines × 2 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (15 lines × 7 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (14 lines × 21 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (14 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (14 lines × 3 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (14 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (14 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (14 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (14 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (14 lines × 4 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (14 lines × 2 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (14 lines × 4 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (14 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (14 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (14 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (14 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (14 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (14 lines × 2 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (14 lines × 2 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (14 lines × 7 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (14 lines × 2 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block with local edits (13 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (13 lines × 6 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (13 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (13 lines × 2 locations) scripts/decorator-tests.js
  • Code Duplication · Duplicated block (13 lines × 4 locations) scripts/decorator-tests.ts
  • Code Duplication · Duplicated block (13 lines × 4 locations) REDACTED
  • Code Duplication · Duplicated block (13 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (13 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (13 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (13 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (13 lines × 3 locations) REDACTED
  • Code Duplication · Duplicated block (13 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (13 lines × 2 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (13 lines × 2 locations) scripts/plugin-tests.js
  • Code Duplication · Duplicated block (13 lines × 2 locations) scripts/plugin-tests.js
Rebuild cost: about €150,000 · Estimate
Cost to rebuild€50,000 to €250,000, for 836 to 2,652 hours of work, about 1.0 person-years for 1 to 2 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 45. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 92,696 lines of product code

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

Top priorities

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

1
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.
Raises the score by about 4 points · Medium effort · Text alternatives
2
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.
Raises the score by about 3 points · Medium effort · A11y enforcement
3
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Raises the score by about 3 points · Medium effort · Page structure

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €150,000 to build again, about 1.0 person-years of work. Its weakest lens is Accessibility, at 40 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
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. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 7% to 15% on every change. The history of the code shows how much it changes: about 4,361 lines over the last 90 days, which is about 17,686 lines a year. At that pace, the extra work comes to an estimated 3 to 17.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

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

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

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 compat-table.src2 compat-table.src.caniuse3 compat-table.src.compat-table4 github.com/evanw/esbuild/internal/api_helpers5 github.com/evanw/esbuild/internal/fs6 github.com/evanw/esbuild/internal/logger7 github.com/evanw/esbuild/internal/xxhash8 lib.npm.browser9 lib.npm.node-install10 lib.shared.common11 lib.shared.types12 compat-table13 github.com/evanw/esbuild/internal/css_lexer14 github.com/evanw/esbuild/internal/helpers15 lib.npm.node16 lib.shared.stdio_protocol17 github.com/evanw/esbuild/internal/ast18 lib.npm19 lib.shared20 github.com/evanw/esbuild/internal/css_ast21 github.com/evanw/esbuild/internal/sourcemap22 github.com/evanw/esbuild/internal/compat23 github.com/evanw/esbuild/internal/js_ast24 github.com/evanw/esbuild/internal/runtime25 github.com/evanw/esbuild/internal/config26 github.com/evanw/esbuild/internal/renamer27 github.com/evanw/esbuild/internal/css_parser28 github.com/evanw/esbuild/internal/css_printer29 github.com/evanw/esbuild/internal/js_lexer30 github.com/evanw/esbuild/internal/js_printer31 github.com/evanw/esbuild/internal/js_parser32 github.com/evanw/esbuild/internal/cache33 github.com/evanw/esbuild/internal/resolver34 github.com/evanw/esbuild/internal/graph35 github.com/evanw/esbuild/internal/bundler36 github.com/evanw/esbuild/internal/linker37 github.com/evanw/esbuild/pkg/api38 github.com/evanw/esbuild/cmd/esbuild39 github.com/evanw/esbuild/internal/cli_helpers40 github.com/evanw/esbuild/pkg/cli
1 compat-table.src
2 compat-table.src.caniuse
3 compat-table.src.compat-table
4 github.com/evanw/esbuild/internal/api_helpers
5 github.com/evanw/esbuild/internal/fs
6 github.com/evanw/esbuild/internal/logger
7 github.com/evanw/esbuild/internal/xxhash
8 lib.npm.browser
9 lib.npm.node-install
10 lib.shared.common
11 lib.shared.types
12 compat-table1
13 github.com/evanw/esbuild/internal/css_lexer14
14 github.com/evanw/esbuild/internal/helpers11
15 lib.npm.node4
16 lib.shared.stdio_protocol2
17 github.com/evanw/esbuild/internal/ast61
18 lib.npm241
19 lib.shared1483
20 github.com/evanw/esbuild/internal/css_ast222121
21 github.com/evanw/esbuild/internal/sourcemap113
22 github.com/evanw/esbuild/internal/compat11
23 github.com/evanw/esbuild/internal/js_ast54362
24 github.com/evanw/esbuild/internal/runtime11
25 github.com/evanw/esbuild/internal/config142143
26 github.com/evanw/esbuild/internal/renamer133
27 github.com/evanw/esbuild/internal/css_parser143495222
28 github.com/evanw/esbuild/internal/css_printer1510413
29 github.com/evanw/esbuild/internal/js_lexer1222
30 github.com/evanw/esbuild/internal/js_printer29422542
31 github.com/evanw/esbuild/internal/js_parser351261491117
32 github.com/evanw/esbuild/internal/cache2172424
33 github.com/evanw/esbuild/internal/resolver431124113
34 github.com/evanw/esbuild/internal/graph421411511
35 github.com/evanw/esbuild/internal/bundler4243712113587
36 github.com/evanw/esbuild/internal/linker28512466411291
37 github.com/evanw/esbuild/pkg/api8131251421
38 github.com/evanw/esbuild/cmd/esbuild316
39 github.com/evanw/esbuild/internal/cli_helpers1
40 github.com/evanw/esbuild/pkg/cli18
Uses a module listed above itPart of a loopThe module itself
1 compat-table.src2 compat-table.src.caniuse3 compat-table.src.compat-table4 github.com/evanw/esbuild/internal/api_helpers5 github.com/evanw/esbuild/internal/fs6 github.com/evanw/esbuild/internal/logger7 github.com/evanw/esbuild/internal/xxhash8 lib.npm.browser9 lib.npm.node-install10 lib.shared.common11 lib.shared.types12 compat-table13 github.com/evanw/esbuild/internal/css_lexer14 github.com/evanw/esbuild/internal/helpers15 lib.npm.node16 lib.shared.stdio_protocol17 github.com/evanw/esbuild/internal/ast18 lib.npm19 lib.shared20 github.com/evanw/esbuild/internal/css_ast21 github.com/evanw/esbuild/internal/sourcemap22 github.com/evanw/esbuild/internal/compat23 github.com/evanw/esbuild/internal/js_ast24 github.com/evanw/esbuild/internal/runtime25 github.com/evanw/esbuild/internal/config26 github.com/evanw/esbuild/internal/renamer27 github.com/evanw/esbuild/internal/css_parser28 github.com/evanw/esbuild/internal/css_printer29 github.com/evanw/esbuild/internal/js_lexer30 github.com/evanw/esbuild/internal/js_printer31 github.com/evanw/esbuild/internal/js_parser32 github.com/evanw/esbuild/internal/cache33 github.com/evanw/esbuild/internal/resolver34 github.com/evanw/esbuild/internal/graph35 github.com/evanw/esbuild/internal/bundler36 github.com/evanw/esbuild/internal/linker37 github.com/evanw/esbuild/pkg/api38 github.com/evanw/esbuild/cmd/esbuild39 github.com/evanw/esbuild/internal/cli_helpers40 github.com/evanw/esbuild/pkg/clicompat-table.src1compat-table.src.caniuse2compat-table.src.compat-table3github.com/evanw/esbuild/internal/api_helpers4github.com/evanw/esbuild/internal/fs5github.com/evanw/esbuild/internal/logger6github.com/evanw/esbuild/internal/xxhash7lib.npm.browser8lib.npm.node-install9lib.shared.common10lib.shared.types11compat-table12github.com/evanw/esbuild/internal/css_lexer13github.com/evanw/esbuild/internal/helpers14lib.npm.node15lib.shared.stdio_protocol16github.com/evanw/esbuild/internal/ast17lib.npm18lib.shared19github.com/evanw/esbuild/internal/css_ast20github.com/evanw/esbuild/internal/sourcemap21github.com/evanw/esbuild/internal/compat22github.com/evanw/esbuild/internal/js_ast23github.com/evanw/esbuild/internal/runtime24github.com/evanw/esbuild/internal/config25github.com/evanw/esbuild/internal/renamer26github.com/evanw/esbuild/internal/css_parser27github.com/evanw/esbuild/internal/css_printer28github.com/evanw/esbuild/internal/js_lexer29github.com/evanw/esbuild/internal/js_printer30github.com/evanw/esbuild/internal/js_parser31github.com/evanw/esbuild/internal/cache32github.com/evanw/esbuild/internal/resolver33github.com/evanw/esbuild/internal/graph34github.com/evanw/esbuild/internal/bundler35github.com/evanw/esbuild/internal/linker36github.com/evanw/esbuild/pkg/api37github.com/evanw/esbuild/cmd/esbuild38github.com/evanw/esbuild/internal/cli_helpers39github.com/evanw/esbuild/pkg/cli401141142612411483222121113115436211142143133143495222151041312222942254235126149111721724244311241134214115114243712113587285124664112918131251421316118+6 more modules (most-connected shown)

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

At a glance — Architecture · 91% · Exemplary ·

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

At a glance — Readiness · 43% · Adequate · gated by R4, P3 ·

At a glance — Security · 49% · Adequate · gated by D29, D30, D36 ·

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

At a glance — Performance · 63% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection84High / Critical
A03:2025 — Software Supply Chain Failures33High / Critical
A07:2025 — Authentication Failures4High / Critical

Roadmap

First, ensure all media elements have appropriate text alternatives and captions to support users with disabilities. Second, enforce accessibility standards by integrating linting and automated testing into the development toolchain and CI pipeline. Third, correct page structure by defining language attributes, titles, landmarks, and proper heading hierarchies. Fourth, implement static analysis security testing in CI to prevent security regressions from reaching production. Finally, increase test coverage by adding tests for currently unreached production modules.

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

Do thisHelpsEffortDimension
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.7 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.0 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.0 ptsMediumPage structure
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.+2.2 ptsMediumSecurity & performance tooling
Add tests that import the unreached modules (directly or through their public entry).+2.2 ptsMediumTest Coverage
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+1.9 ptsMediumForms & labels
Resolve the 1 No ADRs found finding(s) in ADR Quality.+0.9 ptsLowADR Quality
Resolve the 1 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene.+0.8 ptsLowDependency Hygiene

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.6SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedDependency Vulnerabilities: Critical CVE: REDACTED
internal/js_parser/ts_parser.go6.0MixedExplicit Debt: HackComment
internal/css_parser/css_parser_selector.go6.0MixedExplicit Debt: HackComment
REDACTED6.3MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED6.4MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED6.9MixedDependency Vulnerabilities: Medium CVE: REDACTED
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)
pkg/cli/cli_impl.go7.0Near-cleanCyclomatic Complexity: cli.parseOptionsImpl (cyclomatic 249)
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)

How the grades work

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

Critical — 48

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

Serious — 1140

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

Minor — 36

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

Could not be resolved — 14

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

Methodology & how to trust this report

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

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

What we checked — 79 dimensions across the health lenses
D1D2D3D4D5D6D9D11D12D13D14D15D17D19D20D21D26D27D28D29D30D35D36D43D44AC1AC2AC3AC6AC7AX10AX2AX3AX5AX6AX9M1M2M3M4P1P10P2P3P4P6PF2PF3R1R10R2R3R4R5R6R7R8R9X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X26X28X29X3X30X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a16b3c-0bca-72de-93de-dd21e066e2b5.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the JavaScript/TypeScript suite(s) run through a browser-driven runner the coverage collector does not drive — scripts/browser/ (puppeteer) — a gap in the analyzer, not something this repository is missing. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Go module (REDACTED/go.sum), but the licence verdict published here was taken over its npm package dependencies. Nothing was read about its Go dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (131 contributor(s) across 4478 commit(s) sampled, automation and bot accounts excluded). One of them holds 96% of the history; the other 130 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D34 Knowledge Freshness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. File-level freshness contradicts repo activity: 34 commits in the last 90 days, yet 51 of 95 significant files carry no living knowledge. Those two readings cannot both be true, so the per-file recency signal is treated as unreliable here and freshness is not scored for this run.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 5 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Go is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Go is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • PF3 Async & latency hygiene — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 27 further occurrence(s) are not listed individually; the score already reflects all 67.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The filesystem refused the listing or the read of: scripts/browser/esbuild.wasm.bagel. Every other path was read.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 348 further occurrence(s) are not listed individually; the score already reflects all 388.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's Go is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.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 — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • 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.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • 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; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

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

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

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

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

259 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was parser.visitExprInOut at 618. A further 5 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 59 — they are counted neither in the figure above nor in this dimension's score. 3 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: internal/logger/msg_ids.go (logger.StringToMsgIDs at 59), scripts/try.html (try.html.esbuild.initialize().then() at 27), internal/cli_helpers/cli_helpers.go (cli_helpers.ParseLoader at 17). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

parser.visitExprInOut (cyclomatic 618)internal/js_parser/js_parser.go:13552
printer.printExpr (cyclomatic 377)internal/js_printer/js_printer.go:2005
parser.visitAndAppendStmt (cyclomatic 281)internal/js_parser/js_parser.go:10393
parser.parseStmt (cyclomatic 257)internal/js_parser/js_parser.go:7101
cli.parseOptionsImpl (cyclomatic 249)pkg/cli/cli_impl.go:85

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

What to do

  1. Bring the 259 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with parser.visitExprInOut (cyclomatic 618), printer.printExpr (cyclomatic 377), parser.visitAndAppendStmt (cyclomatic 281). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 259 together lifts Cyclomatic Complexity from 2.0 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive 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: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Prevented

370 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:13552
printer.printExpr (cognitive 745)internal/js_printer/js_printer.go:2005
parser.visitAndAppendStmt (cognitive 628)internal/js_parser/js_parser.go:10393
parser.parseStmt (cognitive 517)internal/js_parser/js_parser.go:7101
linkerContext.scanImportsAndExports (cognitive 424)internal/linker/linker.go:1294

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

What to do

  1. Bring the 370 bodies over 15 down to 15 or less in Cognitive Complexity — start with parser.visitExprInOut (cognitive 1654), printer.printExpr (cognitive 745), parser.visitAndAppendStmt (cognitive 628). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 370 together lifts Cognitive Complexity from 0.0 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

137 god class(es) detected.

MethodTooLong: parser.visitExprInOut · ×66internal/js_parser/js_parser.go:13552
FileTooLong: js_parser/js_parser.go · ×26internal/js_parser/js_parser.go
FunctionTooLong: cli.parseOptionsImpl · ×19pkg/cli/cli_impl.go:85
ClassTooLong: parser · ×12internal/js_parser/js_parser.go:36
TooManyFields: parser · ×8internal/js_parser/js_parser.go:36

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

What to do

  1. Resolve the 66 MethodTooLong finding(s) in God Classes — start with js_parser.go (17), linker.go (13), js_printer.go (5). — One of this dimension's main actionable groups (66 warning-level).
  2. Resolve the 26 FileTooLong finding(s) in God Classes — start with js_parser.go, linker.go, js_printer.go. — One of this dimension's main actionable groups (26 warning-level).
  3. Resolve the 19 FunctionTooLong finding(s) in God Classes — start with REDACTED (4), cli_impl.go (2), common.ts (2). — One of this dimension's main actionable groups (19 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.2 / 10Stronggated by 146 serious findings✓ Tool-verified

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

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

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

143 duplicated block group(s) detected. A further 3 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (5 lines × 2) · ×18internal/css_parser/css_decls_color.go:342
Duplicated block (7 lines × 2) · ×15REDACTED:984
Duplicated block (6 lines × 2) · ×13REDACTED:1761
Duplicated block (12 lines × 2) · ×9REDACTED:489
Duplicated block (11 lines × 2) · ×9internal/css_parser/css_reduce_calc.go:123

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

What to do

  1. Resolve the 18 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with js_parser.go (7), js_parser_lower_class.go (2), linker.go (2). — One of this dimension's main actionable groups (18 warning-level).
  2. Resolve the 15 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with js_parser.go (5), js_lexer.go (2), REDACTED. — One of this dimension's main actionable groups (15 warning-level).
  3. Resolve the 13 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with js_parser.go (5), linker.go (2), resolver.go (2). — One of this dimension's main actionable groups (13 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

3 production modules (npm+Go), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 1 of the 3 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

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

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

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

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

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

0 of 94 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

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

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

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

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

1401 test methods: 1401 unit, 0 integration, 0 BDD, 0 e2e. The Go suite contributes 1401 test case(s) across 33 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 4 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

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

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

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

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

0 flaky across 1 measured tier(s). Go (github.com/evanw/esbuild): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene9.7 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

Dependency pinned to a stale untagged commit: golang.org/x/sys
Outdated: golang.org/x/sys

What to do

  1. Resolve the 1 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 24 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 24 production dependency(ies) this repository's committed lockfile resolves, across 7 product REDACTED manifest(s). Its 0 `devDependencies` declaration(s) are excluded: a consumer installs none of them. ★ DEPTH: this is the DIRECT production set the lockfile resolves, NOT the transitive closure — only one of the four lock dialects this pass reads states a full graph, so a banned licence pulled in only by a dependency's OWN dependencies is outside this verdict, exactly as the JVM arm's declaration-site verdict is. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's npm package dependencies and nothing else. The repository also declares a Go module (REDACTED/go.sum), and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: internal/js_parser/js_parser.go (10×169=1690); internal/js_printer/js_printer.go (3×377=1131); REDACTED (5×74=370)

Hotspot: internal/js_parser/js_parser.go · ×6internal/js_parser/js_parser.go:4264

What to do

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

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

D17 · Explicit Debt10.0 / 10Stronggated by 4 serious findings✓ Tool-verified

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

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

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

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

HackComment · ×4internal/css_parser/css_parser_selector.go:396

What to do

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

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

D19 · Documentation QualityAdequate◐ Sampled · advisory

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

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

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

The repository's root README gives an overview (Why?, major features), links to the getting started and API docs, and begins a feature list before clipping; it is clear but does not yet show installation or usage. The remaining documents are per-package/dependency READMEs for directories like compat-table/, lib/, and platform binaries, each documenting their own directory rather than the repository as a whole, so they fall below the root's overview scope.

What to do

  1. Improve Documentation Quality — currently 6.0/10. — The repository's root README gives an overview (Why?, major features), links to the getting started and API docs, and begins a feature list before clipping; it is clear but does not yet show installation or usage. The remaining documents are per-package/dependency READMEs for directories like compat-table/, lib/, and platform binaries, each documenting their own directory rather than the repository as a whole, so they fall below the root's overview scope.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

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

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

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

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion4.3 / 10Weak✓ Tool-verified

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

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

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

2 of 7 build units (Go, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

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

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

D27 · Navigability8.7 / 10Strong✓ Tool-verified

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

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

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

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

60 % of calls cross a namespace and 5 % go through an interface, but 64 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

What to do

  1. Improve Navigability — currently 8.7/10. — 60 % of calls cross a namespace and 5 % go through an interface, but 64 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)7.0 / 10Adequategated by 3 critical findings✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

84 finding(s): 0 critical, 17 high, 62 medium, 5 low. semgrep hit a parse error in 3 file(s) — `internal/js_parser/js_parser.go`, `scripts/decorator-tests.js` (lines 3981–3982, line 3984, line 3991, …), `scripts/decorator-tests.ts` — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

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

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

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

29 finding(s): 1 critical, 21 high, 7 medium, 0 low.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.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.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • 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. — scripts/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 & labels6.4 / 10Adequate✓ Tool-verified

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

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

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

  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — scripts/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.

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

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×3) — REDACTED:2, scripts/graph-debugger.html:2, scripts/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>. — REDACTED:2
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×3) — REDACTED:2, scripts/graph-debugger.html:2, scripts/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.

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

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

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

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

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

  • No accessibility enforcement found — no 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 was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain: 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.
AX10 · Code composition9.5 / 10Exemplary✓ Tool-verified

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

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

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

What to do

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

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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

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

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

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.

  • 40 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.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add 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 numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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 accuracy1.0 / 10Critical◐ 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.

  • README claims a Dockerfile but the evidence shows no Docker-related project or file — searched for: `Dockerfile`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest and configuration files (REDACTED and other *.json, *.csproj, *.props, *.sln/*.slnx, *.yml, *.toml, *.config, tool configs such as eslint.config.js, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong. — README.md:1

What to do

  • Reconcile the README with reality: README claims a Dockerfile but the evidence shows no Docker-related project or file.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

P2 · Observability7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

What to do

  • Consider OpenTelemetry tracing/metrics (go.opentelemetry.io/otel) and a health-check endpoint (a /healthz handler) for operability.
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 was searched, so you can tell an absence from a miss: the 11461 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Add a SAST step to CI running what this repository's stack ships: 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.

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

What to do

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

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

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

PF2 · Allocation hygiene6.8 / 10Strong✓ Tool-verified

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

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

What to do

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

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

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

  • `fs.writeFileSync` in `windowsBackslashPathTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:126, REDACTED:130
  • `fs.mkdirSync` in `workingDirTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:151, REDACTED:152
  • `fs.writeFileSync` in `workingDirTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:153, REDACTED:154
  • `fs.mkdirSync` in `absPathsCodeTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:177
  • `fs.writeFileSync` in `absPathsCodeTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:178
  • `fs.mkdirSync` in `absPathsLogTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:211
  • `fs.writeFileSync` in `absPathsLogTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:212
  • `fs.mkdirSync` in `absPathsMetafileTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:245
  • `fs.writeFileSync` in `absPathsMetafileTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:246
  • `fs.mkdirSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:327, REDACTED:328
  • `fs.writeFileSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — REDACTED:329, REDACTED:334, REDACTED:335
  • `fs.chmodSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:336, REDACTED:352
  • `fs.mkdirSync` in `nodePathsTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:362, REDACTED:363
  • `fs.writeFileSync` in `nodePathsTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:364, REDACTED:365
  • `fs.mkdirSync` in `nodePathsLocalPreferredTestIssue1117` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — REDACTED:388, REDACTED:389, REDACTED:390
  • `fs.writeFileSync` in `nodePathsLocalPreferredTestIssue1117` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — REDACTED:391, REDACTED:392, REDACTED:393
  • `fs.readFileSync` in `fileLoaderWithAssetPath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:1100
  • `fs.readFileSync` in `fileLoaderWithAssetPathAndPublicPath` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:1123
  • `fs.existsSync` in `writeFalse` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:1776
  • `fs.readFileSync` in `anonymous function` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×4) — REDACTED:4145, REDACTED:4156, REDACTED:4178, …
  • `fs.existsSync` in `watchEditSession` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:4171, REDACTED:4192
  • `fs.existsSync` in `watchWriteFalse` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:4235, REDACTED:4244

What to do

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

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

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

  • 17 typed · 20 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/destructuring-fuzzer.js (+14 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 Duplication5.3 / 10Adequate✓ Tool-verified

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

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

  • REDACTED:22 · REDACTED:22 — the two spans are one implementation copied and then locally edited — 786 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:22
  • scripts/end-to-end-tests.js:9882 · REDACTED:8024 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — scripts/end-to-end-tests.js:9882
  • scripts/decorator-tests.ts:3104 · scripts/decorator-tests.ts:3333 · scripts/decorator-tests.ts:3562 · scripts/decorator-tests.ts:3791 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/decorator-tests.ts:3104
  • REDACTED:5404 · REDACTED:5469 — 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. — REDACTED:5404
  • REDACTED:293 · REDACTED:400 — the two spans are one implementation copied and then locally edited — 302 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:293
  • scripts/plugin-tests.js:3265 · scripts/plugin-tests.js:3314 — 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. — scripts/plugin-tests.js:3265
  • REDACTED:7668 · REDACTED:7898 — 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. — REDACTED:7668
  • REDACTED:173 · REDACTED:207 · REDACTED:241 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — REDACTED:173
  • scripts/decorator-tests.ts:671 · scripts/decorator-tests.ts:703 — 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. — scripts/decorator-tests.ts:671
  • scripts/decorator-tests.ts:1494 · scripts/decorator-tests.ts:1526 — 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. — scripts/decorator-tests.ts:1494
  • scripts/decorator-tests.ts:1931 · scripts/decorator-tests.ts:1963 — 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. — scripts/decorator-tests.ts:1931
  • scripts/decorator-tests.ts:2268 · scripts/decorator-tests.ts:2300 — 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. — scripts/decorator-tests.ts:2268
  • scripts/plugin-tests.js:245 · scripts/plugin-tests.js:303 — 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. — scripts/plugin-tests.js:245
  • scripts/plugin-tests.js:1502 · scripts/plugin-tests.js:1652 — 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. — scripts/plugin-tests.js:1502
  • scripts/decorator-tests.ts:2136 · scripts/decorator-tests.ts:2183 — the two spans are one implementation copied and then locally edited — 309 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — scripts/decorator-tests.ts:2136
  • scripts/plugin-tests.js:1103 · scripts/plugin-tests.js:1134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/plugin-tests.js:1103
  • scripts/decorator-tests.js:3670 · scripts/decorator-tests.js:3743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/decorator-tests.js:3670
  • scripts/plugin-tests.js:2258 · scripts/plugin-tests.js:2307 — 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. — scripts/plugin-tests.js:2258
  • REDACTED:888 · REDACTED:922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:888
  • REDACTED:5891 · REDACTED:5959 — 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. — REDACTED:5891
  • scripts/plugin-tests.js:1535 · scripts/plugin-tests.js:1685 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — scripts/plugin-tests.js:1535
  • scripts/decorator-tests.js:609 · scripts/decorator-tests.js:1900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/decorator-tests.js:609
  • REDACTED:1261 · REDACTED:1337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:1261
  • REDACTED:2918 · REDACTED:2954 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:2918
  • scripts/plugin-tests.js:534 · scripts/plugin-tests.js:589 — 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. — scripts/plugin-tests.js:534
  • scripts/plugin-tests.js:1978 · scripts/plugin-tests.js:2004 · scripts/plugin-tests.js:2030 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — scripts/plugin-tests.js:1978
  • scripts/plugin-tests.js:2976 · scripts/plugin-tests.js:3084 — 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. — scripts/plugin-tests.js:2976
  • scripts/decorator-tests.js:4678 · scripts/decorator-tests.js:4887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/decorator-tests.js:4678
  • scripts/decorator-tests.ts:512 · scripts/decorator-tests.ts:574 · scripts/decorator-tests.ts:1337 · scripts/decorator-tests.ts:1398 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/decorator-tests.ts:512
  • scripts/decorator-tests.ts:1774 · scripts/decorator-tests.ts:1835 — 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. — scripts/decorator-tests.ts:1774
  • scripts/plugin-tests.js:1317 · scripts/plugin-tests.js:1371 — 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. — scripts/plugin-tests.js:1317
  • scripts/plugin-tests.js:1433 · scripts/plugin-tests.js:1460 — 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. — scripts/plugin-tests.js:1433
  • scripts/decorator-tests.js:634 · scripts/decorator-tests.js:1925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/decorator-tests.js:634
  • scripts/decorator-tests.js:3813 · scripts/decorator-tests.js:3901 · scripts/decorator-tests.js:3989 · scripts/decorator-tests.js:4685 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/decorator-tests.js:3813
  • REDACTED:8120 · scripts/plugin-tests.js:3463 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:8120
  • scripts/decorator-tests.js:729 · scripts/decorator-tests.js:2018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/decorator-tests.js:729
  • scripts/decorator-tests.js:2204 · scripts/decorator-tests.js:2284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/decorator-tests.js:2204
  • scripts/decorator-tests.ts:483 · scripts/decorator-tests.ts:543 · scripts/decorator-tests.ts:1308 · scripts/decorator-tests.ts:1368 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — scripts/decorator-tests.ts:483
  • REDACTED:3243 · REDACTED:3266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:3243
  • scripts/plugin-tests.js:766 · scripts/plugin-tests.js:875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — scripts/plugin-tests.js:766

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic 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.

  • JSON_parse has cyclomatic complexity 93 and cognitive complexity 112; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/shared/uint8array_json_parser.ts:77
  • flagsForBuildOptions has cyclomatic complexity 56 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/shared/common.ts:237
  • pushCommonFlags has cyclomatic complexity 45 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/shared/common.ts:147
  • __decorateElement has cyclomatic complexity 44 and cognitive complexity 65; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/decorator-tests.js:19
  • (anonymous) has cyclomatic complexity 34 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/end-to-end-tests.js:9648
  • checkBuildAPI has cyclomatic complexity 32 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/test262.js:280
  • test_case has cyclomatic complexity 24 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:79
  • (anonymous) has cyclomatic complexity 21 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — compat-table/src/index.ts:209
  • test_case has cyclomatic complexity 19 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:70
  • sanitizeLocation has cyclomatic complexity 18 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/shared/common.ts:1714
  • (anonymous) has cyclomatic complexity 17 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — compat-table/src/mdn.ts:140
  • (anonymous) has cyclomatic complexity 17 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/shared/common.ts:1383
  • (anonymous) has cyclomatic complexity 16 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/shared/common.ts:1436
  • generateBinPath has cyclomatic complexity 15 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/npm/node-platform.ts:116
  • checkTransformAPI has cyclomatic complexity 15 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/test262.js:217
  • parseStackLinesV8 has cyclomatic complexity 13 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/shared/common.ts:1620
  • (anonymous) has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:294
  • (anonymous) has cyclomatic complexity 12 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/shared/common.ts:1488
  • main has cyclomatic complexity 11 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/ts-type-tests.js:387
  • (anonymous) has cyclomatic complexity 11 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/browser/browser-tests.js:13

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files4.6 / 10Weak✓ 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.

  • scripts/decorator-tests.ts has 3741 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — scripts/decorator-tests.ts:1
  • lib/shared/common.ts has 1704 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — lib/shared/common.ts:1
  • lib/shared/types.ts has 631 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — lib/shared/types.ts:1
  • lib/npm/node.ts has 559 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — lib/npm/node.ts:1
  • compat-table/src/index.ts has 505 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — compat-table/src/index.ts:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test 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 36 production file(s) reachable from 0 test file(s) via the import graph — 'production' here is the RESIDUE: every source file left once tests, tooling, generated output, config, declarations and declaration-only modules, fixture corpora, type fixtures, behaviour-free data modules, re-export barrels, registration/constant data modules and service workers are set aside, so the percentage is taken over a smaller denominator than the workspace's file count

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 D30 (JS/npm Dependency Vulnerabilities).

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

What to do

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

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED 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: REDACTED 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. — scripts/browser
  • Unreachable from the 13 application, 18 tooling and 0 test entry point(s) detected in this repo. This repository declares no build, type-check or test script, so nothing here would fail on a wrong deletion — confirm by hand that nothing loads each file (including by a path built at runtime) before removing it. An undetected custom entry would make these reachable.
  • no import path from any entry point (13 application, 18 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make — require/yarnpnp/in.mjs
R8 · Dependency Hygiene9.0 / 10Exemplary✓ Tool-verified

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

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

  • Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×2)

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports8.3 / 10Strong✓ 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 — compat-table/src/index.ts:7

What to do

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

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

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

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X2 · Cancellation propagation4.0 / 10Weak✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 0/2 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `downloadDirectlyFromNPM` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:236
  • `tryToInstantiateModule` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — lib/shared/worker.ts:84

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×3) — internal/config/config.go:742, internal/fs/fs_real.go:462, internal/fs/fs_real.go:483
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×20) — lib/npm/node.ts:27, lib/npm/node.ts:90, lib/npm/node-platform.ts:95, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — REDACTED:157, lib/shared/common.ts:1650
  • `if _, err := res.Write(msg); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — REDACTED:452
  • `if ctxErr != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/cli/cli_impl.go:1536
  • `catch (error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — scripts/test262.js:389
  • `catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — scripts/parse-ts-files.js:32, scripts/destructuring-fuzzer.js:277

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X5 · Nullable reference types5.0 / 10Adequate✓ Tool-verified

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

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

  • 4/5 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
  • ~12.7 `!` null assertions per 1k TypeScript source lines — 84 assertion(s) across the 6602 source line(s) of the 16 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: lib/shared/common.ts (49), lib/npm/node.ts (17), compat-table/src/css_table.ts (4). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

What to do

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

WCAG coverage — what static analysis assessed

Statically assessed 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 Health51%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture91%ExemplaryStrongest area.
Maturity55%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness43%Adequate — gated by R4, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security49%Adequate — gated by D29, D30, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility40%Weak — gated by AC1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance63%AdequateAcceptable, with room to improve.
Unscored — 1 check(s) recorded observations but carry no score

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

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

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

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 47 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 — Not applicable: Angular's root injector cannot see a component-level provider, so a root service asking for one fails with NullInjectorError instead of capturing it.
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.
  • D10 Test Quality — ~50095 lines of test source are present (.go, .js) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • 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.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D34 Knowledge Freshness — knowledge concentrated in recent work — freshness signal contradicted by repo activity
  • 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.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
  • DM1 Domain Modelling — applicable but not scored (1 of 2 signals for this style — below the bar we score at): 9 value object(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens 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 lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — no outbound HTTP usage detected — no HTTP client call or construction in the Go, JavaScript/TypeScript source (service entry point: REDACTED:942 (http.Server{))
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a `func BenchmarkXxx(b *testing.B)` in any `_test.go` file, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • 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.
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 48 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×20
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC3 · Page structure · <html> without a lang · ×3
  • <html> without a lang REDACTED:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang scripts/graph-debugger.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang scripts/try.html:3 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
D28 · Secrets (history) · High secret · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <textarea> without a programmatic label · ×1
  • <textarea> without a programmatic label scripts/try.html:247 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC3 · Page structure · Document without a <title> · ×1
  • Document without a <title> REDACTED:2 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×1
  • Import cycle (2 files) compat-table/src/index.ts:7 — compat-table/src/index.ts → compat-table/src/js_table.ts → compat-table/src/index.ts
Serious — 1140 finding(s)
D3 · God Classes · MethodTooLong · ×66
  • MethodTooLong: parser.visitExprInOut internal/js_parser/js_parser.go:13552 — MethodTooLong — visitExprInOut runs 1391 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1291 over it, 13.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: printer.printExpr internal/js_printer/js_printer.go:2005 — MethodTooLong — printExpr runs 930 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 830 over it, 9.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.parseStmt internal/js_parser/js_parser.go:7101 — MethodTooLong — parseStmt runs 842 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 742 over it, 8.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.visitAndAppendStmt internal/js_parser/js_parser.go:10393 — MethodTooLong — visitAndAppendStmt runs 677 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 577 over it, 6.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.parseSuffix internal/js_parser/js_parser.go:4264 — MethodTooLong — parseSuffix runs 495 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 395 over it, 4.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Lexer.Next internal/js_lexer/js_lexer.go:999 — MethodTooLong — Next runs 453 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 353 over it, 4.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.parsePrefix internal/js_parser/js_parser.go:3499 — MethodTooLong — parsePrefix runs 369 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: linkerContext.scanImportsAndExports internal/linker/linker.go:1294 — MethodTooLong — scanImportsAndExports runs 369 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.parseProperty internal/js_parser/js_parser.go:2185 — MethodTooLong — parseProperty runs 350 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: binaryExprVisitor.visitRightAndFinish internal/js_parser/js_parser.go:16067 — MethodTooLong — visitRightAndFinish runs 307 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 207 over it, 3.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: scanner.processScannedFiles REDACTED:2361 — MethodTooLong — processScannedFiles runs 290 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 190 over it, 2.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: linkerContext.generateChunkJS internal/linker/linker.go:5568 — MethodTooLong — generateChunkJS runs 278 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 178 over it, 2.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.mangleStmts internal/js_parser/js_parser.go:9156 — MethodTooLong — mangleStmts runs 249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 149 over it, 2.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: serviceType.handleIncomingPacket REDACTED:203 — MethodTooLong — handleIncomingPacket runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: linkerContext.generateChunkCSS internal/linker/linker.go:6098 — MethodTooLong — generateChunkCSS runs 238 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 138 over it, 2.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.processDeclarations internal/css_parser/css_decls.go:84 — MethodTooLong — processDeclarations runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: printer.printRule internal/css_printer/css_printer.go:107 — MethodTooLong — printRule runs 216 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 116 over it, 2.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: lowerClassContext.processProperties internal/js_parser/js_parser_lower_class.go:1471 — MethodTooLong — processProperties runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: serviceType.convertPlugins REDACTED:853 — MethodTooLong — convertPlugins runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: apiHandler.ServeHTTP REDACTED:105 — MethodTooLong — ServeHTTP runs 205 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.skipTypeScriptTypeWithFlags internal/js_parser/ts_parser.go:216 — MethodTooLong — skipTypeScriptTypeWithFlags runs 187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: linkerContext.generateCodeForFileInChunkJS internal/linker/linker.go:4662 — MethodTooLong — generateCodeForFileInChunkJS runs 187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: resolverQuery.finalizeImportsExportsResult internal/resolver/resolver.go:2605 — MethodTooLong — finalizeImportsExportsResult runs 184 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 84 over it, 1.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.visitClass internal/js_parser/js_parser.go:12177 — MethodTooLong — visitClass runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: parser.parseJSXElement internal/js_parser/js_parser.go:5251 — MethodTooLong — parseJSXElement runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 41 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×40
  • Sync-over-async blocking REDACTED:126 — `fs.writeFileSync` in `windowsBackslashPathTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:130 — `fs.writeFileSync` in `windowsBackslashPathTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:151 — `fs.mkdirSync` in `workingDirTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:152 — `fs.mkdirSync` in `workingDirTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:153 — `fs.writeFileSync` in `workingDirTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:154 — `fs.writeFileSync` in `workingDirTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:177 — `fs.mkdirSync` in `absPathsCodeTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:178 — `fs.writeFileSync` in `absPathsCodeTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:211 — `fs.mkdirSync` in `absPathsLogTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:212 — `fs.writeFileSync` in `absPathsLogTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:245 — `fs.mkdirSync` in `absPathsMetafileTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:246 — `fs.writeFileSync` in `absPathsMetafileTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:327 — `fs.mkdirSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:328 — `fs.mkdirSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:329 — `fs.writeFileSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:334 — `fs.writeFileSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:335 — `fs.writeFileSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:336 — `fs.chmodSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:352 — `fs.chmodSync` in `pathResolverEACCS` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:362 — `fs.mkdirSync` in `nodePathsTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:363 — `fs.mkdirSync` in `nodePathsTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:364 — `fs.writeFileSync` in `nodePathsTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:365 — `fs.writeFileSync` in `nodePathsTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:388 — `fs.mkdirSync` in `nodePathsLocalPreferredTestIssue1117` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:389 — `fs.mkdirSync` in `nodePathsLocalPreferredTestIssue1117` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • + 15 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 7 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×26
  • FileTooLong: js_parser/js_parser.go internal/js_parser/js_parser.go — FileTooLong — 10546 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: parser (150 blocks, 36-18846). The bar is 500 significant lines; this is 10046 over it, 21.09× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: linker/linker.go internal/linker/linker.go — FileTooLong — 3832 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: linkerContext (52 blocks, 45-7269). The bar is 500 significant lines; this is 3332 over it, 7.66× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: js_printer/js_printer.go internal/js_printer/js_printer.go — FileTooLong — 3352 significant lines (blank, comment-only and punctuation-only lines excluded), about 73% of them inside a single declaration: printer (63 blocks, 65-4093). The bar is 500 significant lines; this is 2852 over it, 6.70× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2179 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1679 over it, 4.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: js_lexer/js_lexer.go internal/js_lexer/js_lexer.go — FileTooLong — 1719 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: Lexer (34 blocks, 241-2665). The bar is 500 significant lines; this is 1219 over it, 3.44× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1684 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1184 over it, 3.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: js_ast/js_ast_helpers.go internal/js_ast/js_ast_helpers.go — FileTooLong — 1605 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1105 over it, 3.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: resolver/resolver.go internal/resolver/resolver.go — FileTooLong — 1510 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: resolverQuery (23 blocks, 235-2891). The bar is 500 significant lines; this is 1010 over it, 3.02× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: css_parser/css_parser.go internal/css_parser/css_parser.go — FileTooLong — 1422 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 922 over it, 2.84× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: js_parser/js_parser_lower_class.go internal/js_parser/js_parser_lower_class.go — FileTooLong — 1390 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: lowerClassContext (12 blocks, 624-2423). The bar is 500 significant lines; this is 890 over it, 2.78× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: shared/common.ts lib/shared/common.ts — FileTooLong — 1303 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 803 over it, 2.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: js_parser/js_parser_lower.go internal/js_parser/js_parser_lower.go — FileTooLong — 1206 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: parser (31 blocks, 18-2152). The bar is 500 significant lines; this is 706 over it, 2.41× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: js_parser/ts_parser.go internal/js_parser/ts_parser.go — FileTooLong — 1118 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: parser (31 blocks, 19-2086). The bar is 500 significant lines; this is 618 over it, 2.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: cli/cli_impl.go pkg/cli/cli_impl.go — FileTooLong — 1076 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: parseOptionsImpl (85-1023). The bar is 500 significant lines; this is 576 over it, 2.15× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: logger/logger.go internal/logger/logger.go — FileTooLong — 1003 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 503 over it, 2.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: css_ast/css_ast.go internal/css_ast/css_ast.go — FileTooLong — 929 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 429 over it, 1.86× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: js_ast/js_ast.go internal/js_ast/js_ast.go — FileTooLong — 929 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 429 over it, 1.86× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 926 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: serviceType (12 blocks, 42-1295). The bar is 500 significant lines; this is 426 over it, 1.85× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: css_printer/css_printer.go internal/css_printer/css_printer.go — FileTooLong — 848 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: printer (21 blocks, 20-1323). The bar is 500 significant lines; this is 348 over it, 1.70× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: resolver/package_json.go internal/resolver/package_json.go — FileTooLong — 835 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 335 over it, 1.67× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: css_lexer/css_lexer.go internal/css_lexer/css_lexer.go — FileTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: lexer (13 blocks, 174-954). The bar is 500 significant lines; this is 214 over it, 1.43× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: css_parser/css_decls_gradient.go internal/css_parser/css_decls_gradient.go — FileTooLong — 671 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 171 over it, 1.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 658 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 158 over it, 1.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: css_parser/css_parser_selector.go internal/css_parser/css_parser_selector.go — FileTooLong — 607 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: parser (10 blocks, 22-1030). The bar is 500 significant lines; this is 107 over it, 1.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: config/config.go internal/config/config.go — FileTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 38 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 1 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×20
  • Swallowed exception (empty catch) lib/npm/node.ts:27 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/npm/node.ts:90 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/npm/node-platform.ts:95 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/npm/node-platform.ts:103 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/npm/node-platform.ts:262 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:43 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:140 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:222 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/shared/common.ts:602 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/shared/common.ts:775 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/shared/common.ts:862 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/shared/common.ts:1520 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/shared/common.ts:1527 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/shared/common.ts:1597 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/shared/common.ts:1608 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/shared/common.ts:1614 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/parse-ts-files.js:53 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/parse-ts-files.js:59 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:296 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/destructuring-fuzzer.js:139 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D3 · God Classes · FunctionTooLong · ×19
  • FunctionTooLong: cli.parseOptionsImpl pkg/cli/cli_impl.go:85 — FunctionTooLong — parseOptionsImpl runs 661 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 561 over it, 6.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: bundler.parseFile REDACTED:124 — FunctionTooLong — parseFile runs 417 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 317 over it, 4.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: js_parser.ParseSourceMap internal/js_parser/sourcemap_parser.go:18 — FunctionTooLong — ParseSourceMap runs 251 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 151 over it, 2.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: common.createChannel lib/shared/common.ts:505 — FunctionTooLong — createChannel runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: uint8array_json_parser.JSON_parse lib/shared/uint8array_json_parser.ts:77 — FunctionTooLong — JSON_parse runs 188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: css_parser.parseColor internal/css_parser/css_decls_color.go:465 — FunctionTooLong — parseColor runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: resolver.ParseTSConfigJSON internal/resolver/tsconfig_json.go:95 — FunctionTooLong — ParseTSConfigJSON runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: api.analyzeMetafileImpl REDACTED:2291 — FunctionTooLong — analyzeMetafileImpl runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: api.validateBuildOptions REDACTED:1254 — FunctionTooLong — validateBuildOptions runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: js_parser.Parse internal/js_parser/js_parser.go:17815 — FunctionTooLong — Parse runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: common.flagsForBuildOptions lib/shared/common.ts:237 — FunctionTooLong — flagsForBuildOptions runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.runImpl pkg/cli/cli_impl.go:1198 — FunctionTooLong — runImpl runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: api.rebuildImpl REDACTED:1488 — FunctionTooLong — rebuildImpl runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: api.transformImpl REDACTED:1711 — FunctionTooLong — transformImpl runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: logger.StringToMsgIDs internal/logger/msg_ids.go:99 — FunctionTooLong — StringToMsgIDs runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: logger.msgIDToInfo internal/logger/msg_ids.go:243 — FunctionTooLong — msgIDToInfo runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: main.main cmd/esbuild/main.go:159 — FunctionTooLong — main runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: css_parser.tryToParseColorStops internal/css_parser/css_decls_gradient.go:467 — FunctionTooLong — tryToParseColorStops runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: graph.CloneLinkerGraph internal/graph/graph.go:126 — FunctionTooLong — CloneLinkerGraph runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×18
  • Duplicated block (5 lines × 2) internal/css_parser/css_decls_color.go:342 — internal/css_parser/css_decls_color.go:342-346 | internal/css_parser/css_decls_color.go:369-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 `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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/css_parser/css_decls_color.go:374` calls `IsNumeric` and `internal/css_parser/css_decls_color.go:347` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) internal/css_parser/css_parser.go:1727 — internal/css_parser/css_parser.go:1727-1731 | internal/css_parser/css_parser.go:1759-1763 — both copies are in the same file, so extract the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) internal/css_parser/css_reduce_calc.go:539 — internal/css_parser/css_reduce_calc.go:539-543 | internal/css_parser/css_reduce_calc.go:579-583 — both copies are in the same file, so extract the 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 (5 lines × 2) internal/js_lexer/js_lexer.go:2303 — internal/js_lexer/js_lexer.go:2303-2307 | internal/js_lexer/js_lexer.go:2337-2342 — both copies are in the same file, so extract the 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 (5 lines × 2) internal/js_parser/js_parser.go:5746 — internal/js_parser/js_parser.go:5746-5756 | internal/js_parser/js_parser.go:5881-5885 — both copies are in the same file, so extract the 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:5746` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/js_parser/js_parser.go:5879` calls `Loc` and `internal/js_parser/js_parser.go:5745` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) internal/js_parser/js_parser.go:7530 — internal/js_parser/js_parser.go:7530-7534 | internal/js_parser/js_parser.go:7561-7565 — both copies are in the same file, so extract the 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:9591 — internal/js_parser/js_parser.go:9591-9595 | internal/js_parser/js_parser.go:9648-9653 — both copies are in the same file, so extract the 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:9591` 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/js_parser/js_parser.go:9606 — internal/js_parser/js_parser.go:9606-9610 | internal/js_parser/js_parser.go:9662-9666 — both copies are in the same file, so extract the 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:14840 — internal/js_parser/js_parser.go:14840-14844 | internal/js_parser/js_parser.go:14879-14884 — both copies are in the same file, so extract the 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:14840` 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/js_parser/js_parser_lower_class.go:2319 — internal/js_parser/js_parser_lower_class.go:2319-2323 | internal/js_parser/js_parser_lower_class.go:2365-2369 — both copies are in the same file, so extract the 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 (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/js_parser/js_parser.go:4921 — internal/js_parser/js_parser.go:4921-4925 | internal/js_parser/js_parser.go:4947-4951 — both copies are in the same file, so extract the 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:4921` 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) REDACTED:2549 — REDACTED:2549-2553 | REDACTED:2561-2565 — both copies are in the same file, so extract the 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 `REDACTED:2549` 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:6028 — internal/linker/linker.go:6028-6032 | internal/linker/linker.go:6070-6074 — both copies are in the same file, so extract the 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:6028` 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/js_parser/js_parser_lower.go:1158 — internal/js_parser/js_parser_lower.go:1158-1162 | internal/js_parser/js_parser_lower.go:1166-1170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) internal/js_parser/js_parser.go:12112 — internal/js_parser/js_parser.go:12112-12116 | internal/js_parser/js_parser.go:12137-12141 — both copies are in the same file, so extract the 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:12112` 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_lower_class.go:2495 — internal/js_parser/js_parser_lower_class.go:2495-2499 | internal/js_parser/js_parser_lower_class.go:2502-2506 — both copies are in the same file, so extract the 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/linker/linker.go:2052 — internal/linker/linker.go:2052-2056 | internal/linker/linker.go:2152-2156 — both copies are in the same file, so extract the 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:2052` 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 (7 lines × 2) · ×15
  • Duplicated block (7 lines × 2) REDACTED:984 — REDACTED:984-990 | REDACTED:1075-1081 — both copies are in the same file, so extract the 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/css_parser/css_decls_color.go:566 — internal/css_parser/css_decls_color.go:566-572 | internal/css_parser/css_decls_color.go:594-600 — both copies are in the same file, so extract the 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 (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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_nesting.go:419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • 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/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.
  • Duplicated block (7 lines × 2) internal/js_lexer/js_lexer.go:2124 — internal/js_lexer/js_lexer.go:2124-2132 | internal/js_lexer/js_lexer.go:2423-2429 — both copies are in the same file, so extract the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. 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_lexer/js_lexer.go:2307 — internal/js_lexer/js_lexer.go:2307-2313 | internal/js_lexer/js_lexer.go:2373-2379 — both copies are in the same file, so extract the 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:2307` 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) internal/js_parser/js_parser.go:2192 — internal/js_parser/js_parser.go:2192-2198 | internal/js_parser/js_parser.go:2759-2765 — both copies are in the same file, so extract the 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:2192` 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:2346 — internal/js_parser/js_parser.go:2346-2352 | internal/js_parser/js_parser.go:2361-2387 — both copies are in the same file, so extract the 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:2346` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/js_parser/js_parser.go:7975 — internal/js_parser/js_parser.go:7975-7981 | internal/js_parser/js_parser.go:8013-8019 — both copies are in the same file, so extract the 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:15155 — internal/js_parser/js_parser.go:15155-15161 | internal/js_parser/js_parser.go:15747-15753 — both copies are in the same file, so extract the 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:15155` 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.
  • Duplicated block (7 lines × 2) internal/js_printer/js_printer.go:4833 — internal/js_printer/js_printer.go:4833-4839 | internal/js_printer/js_printer.go:4846-4852 — both copies are in the same file, so extract the 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/resolver/resolver.go:1876 — internal/resolver/resolver.go:1876-1882 | internal/resolver/resolver.go:2005-2011 — both copies are in the same file, so extract the 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.
  • Duplicated block (7 lines × 2) internal/resolver/yarnpnp.go:630 — internal/resolver/yarnpnp.go:630-636 | internal/resolver/yarnpnp.go:656-662 — both copies are in the same file, so extract the 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:630` 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_parser/js_parser.go:16191 — internal/js_parser/js_parser.go:16191-16197 | internal/js_parser/js_parser.go:16235-16241 — both copies are in the same file, so extract the 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:16191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×13
  • Duplicated block (6 lines × 2) REDACTED:1761 — REDACTED:1761-1766 | REDACTED:1881-1886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1761` 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:4272 — internal/js_parser/js_parser.go:4272-4277 | internal/js_parser/js_parser.go:4584-4589 — both copies are in the same file, so extract the 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:4272` 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:9318 — internal/js_parser/js_parser.go:9318-9323 | internal/js_parser/js_parser.go:9328-9333 — both copies are in the same file, so extract the 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:9318` 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:15538 — internal/js_parser/js_parser.go:15538-15543 | internal/js_parser/js_parser.go:15756-15761 — both copies are in the same file, so extract the 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_printer/js_printer.go:3846 — internal/js_printer/js_printer.go:3846-3851 | internal/js_printer/js_printer.go:4588-4593 — both copies are in the same file, so extract the 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.
  • Duplicated block (6 lines × 2) internal/linker/linker.go:2388 — internal/linker/linker.go:2388-2394 | internal/linker/linker.go:5052-5057 — both copies are in the same file, so extract the 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:2388` 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/resolver/resolver.go:2804 — internal/resolver/resolver.go:2804-2809 | internal/resolver/resolver.go:2821-2826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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.
  • Duplicated block (6 lines × 2) internal/compat/compat.go:129 — internal/compat/compat.go:129-134 | internal/fs/fs_mock.go:233-238 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) internal/resolver/resolver.go:1302 — internal/resolver/resolver.go:1302-1307 | internal/resolver/resolver.go:1308-1313 — both copies are in the same file, so extract the 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:1302` 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/css_parser/css_decls_color.go:236 — internal/css_parser/css_decls_color.go:236-241 | internal/css_parser/css_reduce_calc.go:80-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) internal/js_parser/js_parser.go:10253 — internal/js_parser/js_parser.go:10253-10258 | internal/js_parser/js_parser.go:10267-10272 — both copies are in the same file, so extract the 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.go:16300 — internal/js_parser/js_parser.go:16300-16305 | internal/js_parser/js_parser.go:16347-16352 — both copies are in the same file, so extract the 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:16300` 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:5030 — internal/linker/linker.go:5030-5035 | internal/linker/linker.go:5061-5066 — both copies are in the same file, so extract the 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:5030` 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.
D3 · God Classes · ClassTooLong · ×12
  • ClassTooLong: parser internal/js_parser/js_parser.go:36 — ClassTooLong — 9055 significant lines (blank, comment-only and punctuation-only lines excluded), 232 methods, 150 blocks, lines 36-18846. The bar is 400 significant lines; this is 8655 over it, 22.64× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: linkerContext internal/linker/linker.go:45 — ClassTooLong — 3432 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods, 52 blocks, lines 45-7269. The bar is 400 significant lines; this is 3032 over it, 8.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: printer internal/js_printer/js_printer.go:276 — ClassTooLong — 2445 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods, 63 blocks, lines 65-4093. The bar is 400 significant lines; this is 2045 over it, 6.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Lexer internal/js_lexer/js_lexer.go:241 — ClassTooLong — 1358 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods, 34 blocks, lines 241-2665. The bar is 400 significant lines; this is 958 over it, 3.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: resolverQuery internal/resolver/resolver.go:235 — ClassTooLong — 1034 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods, 23 blocks, lines 235-2891. The bar is 400 significant lines; this is 634 over it, 2.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: lowerClassContext internal/js_parser/js_parser_lower_class.go:624 — ClassTooLong — 903 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods, 12 blocks, lines 624-2423. The bar is 400 significant lines; this is 503 over it, 2.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: scanner REDACTED:1324 — ClassTooLong — 838 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods, 12 blocks, lines 1324-2952. The bar is 400 significant lines; this is 438 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: printer internal/css_printer/css_printer.go:20 — ClassTooLong — 729 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods, 21 blocks, lines 20-1323. The bar is 400 significant lines; this is 329 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: serviceType REDACTED:42 — ClassTooLong — 703 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods, 12 blocks, lines 42-1295. The bar is 400 significant lines; this is 303 over it, 1.76× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: printStmtFlags internal/js_printer/js_printer.go:4095 — ClassTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 233 over it, 1.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: HelperContext internal/js_ast/js_ast_helpers.go:14 — ClassTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods, 8 blocks, lines 14-2988. The bar is 400 significant lines; this is 138 over it, 1.35× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: lexer internal/css_lexer/css_lexer.go:174 — ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods, 13 blocks, lines 174-954. The bar is 400 significant lines; this is 25 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×10
  • Swallowed exception (caught, then discarded) internal/config/config.go:742 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/fs/fs_real.go:462 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) internal/fs/fs_real.go:483 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:157 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) lib/shared/common.ts:1650 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:452 — `if _, err := res.Write(msg); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/cli/cli_impl.go:1536 — `if ctxErr != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/test262.js:389 — `catch (error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/parse-ts-files.js:32 — `catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/destructuring-fuzzer.js:277 — `catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×9
  • Duplicated block (12 lines × 2) REDACTED:489 — REDACTED:489-500 | REDACTED:534-545 — both copies are in the same file, so extract the 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 `REDACTED:489` 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) REDACTED:1664 — REDACTED:1664-1675 | REDACTED:1684-1695 — both copies are in the same file, so extract the 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 `REDACTED:1664` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) internal/js_parser/js_parser.go:5782 — internal/js_parser/js_parser.go:5782-5793 | internal/js_parser/js_parser.go:5824-5835 — both copies are in the same file, so extract the 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:5782` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/js_parser/js_parser.go:5820` calls `ExpectedString` and `internal/js_parser/js_parser.go:5779` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) internal/js_parser/js_parser.go:10583 — internal/js_parser/js_parser.go:10583-10594 | internal/js_parser/js_parser.go:11390-11401 — both copies are in the same file, so extract the 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_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.
  • Duplicated block (12 lines × 2) internal/js_printer/js_printer.go:4327 — internal/js_printer/js_printer.go:4327-4338 | internal/js_printer/js_printer.go:4746-4757 — both copies are in the same file, so extract the 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/linker/linker.go:2448 — internal/linker/linker.go:2448-2459 | internal/linker/linker.go:2484-2495 — both copies are in the same file, so extract the 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:2448` 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) pkg/cli/cli_impl.go:1289 — pkg/cli/cli_impl.go:1289-1300 | pkg/cli/cli_impl.go:1335-1346 — both copies are in the same file, so extract the 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:1289` 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 (11 lines × 2) · ×9
  • 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/css_printer/css_printer.go:109 — internal/css_printer/css_printer.go:109-119 | internal/js_printer/js_printer.go:4111-4121 — 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.
  • Duplicated block (11 lines × 2) internal/js_ast/js_ast_helpers.go:2941 — internal/js_ast/js_ast_helpers.go:2941-2951 | internal/js_ast/js_ast_helpers.go:2954-2964 — both copies are in the same file, so extract the 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_lexer/js_lexer.go:2602 — internal/js_lexer/js_lexer.go:2602-2612 | internal/js_lexer/js_lexer.go:2620-2630 — both copies are in the same file, so extract the 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 (11 lines × 2) internal/js_parser/js_parser.go:3094 — internal/js_parser/js_parser.go:3094-3104 | internal/js_parser/js_parser.go:6759-6769 — both copies are in the same file, so extract the 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:3553 — internal/js_parser/js_parser.go:3553-3563 | internal/js_parser/json_parser.go:40-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/js_parser.go:3553` 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:16307 — internal/js_parser/js_parser.go:16307-16317 | internal/js_parser/js_parser.go:16354-16364 — both copies are in the same file, so extract the 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:16307` 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:1191 — internal/js_printer/js_printer.go:1191-1201 | internal/js_printer/js_printer.go:1326-1336 — both copies are in the same file, so extract the 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 (11 lines × 2) internal/resolver/resolver.go:369 — internal/resolver/resolver.go:369-379 | internal/resolver/resolver.go:581-592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · TooManyFields · ×8
  • TooManyFields: parser internal/js_parser/js_parser.go:36 — TooManyFields — 111 stored fields beside 232 methods. The bar is 30 stored fields; this is 81 over it, 3.70× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Options internal/config/config.go:400 — TooManyFields — 78 stored fields. The bar is 30 stored fields; this is 48 over it, 2.60× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: BuildOptions pkg/api/api.go:289 — TooManyFields — 70 stored fields. The bar is 30 stored fields; this is 40 over it, 2.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: TransformOptions pkg/api/api.go:422 — TooManyFields — 43 stored fields. The bar is 30 stored fields; this is 13 over it, 1.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Lexer internal/js_lexer/js_lexer.go:241 — TooManyFields — 41 stored fields beside 33 methods. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: lowerClassContext internal/js_parser/js_parser_lower_class.go:624 — TooManyFields — 33 stored fields beside 11 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AST internal/js_ast/js_ast.go:1553 — TooManyFields — 32 stored fields. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: printer internal/js_printer/js_printer.go:276 — TooManyFields — 31 stored fields beside 63 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×8
  • Duplicated block (10 lines × 2) REDACTED:993 — REDACTED:993-1002 | REDACTED:1084-1093 — both copies are in the same file, so extract the 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 `REDACTED:993` 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_ast/js_ast_helpers.go:815 — internal/js_ast/js_ast_helpers.go:815-824 | internal/js_ast/js_ast_helpers.go:876-885 — both copies are in the same file, so extract the 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 (10 lines × 2) internal/js_lexer/js_lexer.go:1859 — internal/js_lexer/js_lexer.go:1859-1868 | internal/js_lexer/js_lexer.go:1978-1987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) internal/js_parser/ts_parser.go:315 — internal/js_parser/ts_parser.go:315-327 | internal/js_parser/ts_parser.go:333-342 — both copies are in the same file, so extract the 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.
  • Duplicated block (10 lines × 2) internal/linker/linker.go:826 — internal/linker/linker.go:826-835 | internal/linker/linker.go:863-872 — both copies are in the same file, so extract the 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:826` 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:1328 — internal/linker/linker.go:1328-1337 | internal/linker/linker.go:1385-1394 — both copies are in the same file, so extract the 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:1328` 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:5957 — internal/linker/linker.go:5957-5966 | internal/linker/linker.go:6435-6444 — both copies are in the same file, so extract the 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:5957` 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/resolver/package_json.go:263 — internal/resolver/package_json.go:263-272 | internal/resolver/resolver.go:1226-1235 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×8
  • Duplicated block (8 lines × 2) REDACTED:1381 — REDACTED:1381-1388 | REDACTED:1425-1432 — both copies are in the same file, so extract the 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 `REDACTED:1381` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) REDACTED:2471 — REDACTED:2471-2478 | REDACTED:2509-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 `REDACTED:2471` 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/js_parser/js_parser.go:5069 — internal/js_parser/js_parser.go:5069-5076 | internal/js_parser/js_parser.go:5096-5103 — both copies are in the same file, so extract the 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:5069` 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/js_printer/js_printer.go:671 — internal/js_printer/js_printer.go:671-678 | internal/js_printer/js_printer.go:1165-1172 — both copies are in the same file, so extract the 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/js_printer/js_printer.go:2801 — internal/js_printer/js_printer.go:2801-2808 | internal/js_printer/js_printer.go:4233-4240 — both copies are in the same file, so extract the 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/linker/linker.go:2279 — internal/linker/linker.go:2279-2286 | internal/linker/linker.go:5190-5197 — both copies are in the same file, so extract the 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:2279` 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) REDACTED:1295 — REDACTED:1295-1302 | REDACTED:1765-1772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) internal/css_parser/css_decls_color.go:700 — internal/css_parser/css_decls_color.go:700-707 | internal/css_parser/css_decls_color.go:713-720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_decls_color.go:700` 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×7
  • Duplicated block (14 lines × 2) internal/css_parser/css_decls_color.go:583 — internal/css_parser/css_decls_color.go:583-596 | internal/css_parser/css_decls_color.go:677-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) internal/css_parser/css_nesting.go:299 — internal/css_parser/css_nesting.go:299-312 | internal/css_parser/css_nesting.go:322-335 — both copies are in the same file, so extract the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (14 lines × 2) internal/js_ast/js_ident.go:78 — internal/js_ast/js_ident.go:78-91 | internal/js_ast/js_ident.go:106-119 — both copies are in the same file, so extract the 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.
  • Duplicated block (14 lines × 2) internal/js_parser/js_parser.go:14286 — internal/js_parser/js_parser.go:14286-14299 | internal/js_parser/js_parser.go:14419-14432 — both copies are in the same file, so extract the 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:14286` 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.
  • Duplicated block (14 lines × 2) internal/js_parser/js_parser.go:16170 — internal/js_parser/js_parser.go:16170-16183 | internal/js_parser/js_parser.go:16214-16227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) internal/js_parser/ts_parser.go:1705 — internal/js_parser/ts_parser.go:1705-1718 | internal/js_parser/ts_parser.go:1721-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.
  • 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×6
  • Hotspot: internal/js_parser/js_parser.go internal/js_parser/js_parser.go:4264 — internal/js_parser/js_parser.go changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 169 in parser.parseSuffix at line 4264. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-11..2026-08-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-11 13:17:12 -04:00' --until='2026-08-09 13:17:12 -04:00' --full-history --no-merges -- internal/js_parser/js_parser.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/js_printer/js_printer.go internal/js_printer/js_printer.go:2005 — internal/js_printer/js_printer.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 377 in printer.printExpr at line 2005. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-11..2026-08-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-11 13:17:12 -04:00' --until='2026-08-09 13:17:12 -04:00' --full-history --no-merges -- internal/js_printer/js_printer.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:105 — REDACTED changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in apiHandler.ServeHTTP at line 105. 1 of those changes was a fix/bug commit, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-11..2026-08-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-11 13:17:12 -04:00' --until='2026-08-09 13:17:12 -04:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:2361 — REDACTED changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in scanner.processScannedFiles at line 2361. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-11..2026-08-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-11 13:17:12 -04:00' --until='2026-08-09 13:17:12 -04:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:313 — REDACTED changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in api.validateFeatures at line 313. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-11..2026-08-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-11 13:17:12 -04:00' --until='2026-08-09 13:17:12 -04:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: internal/logger/msg_ids.go internal/logger/msg_ids.go:243 — internal/logger/msg_ids.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in logger.msgIDToInfo at line 243. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-05-11..2026-08-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-11 13:17:12 -04:00' --until='2026-08-09 13:17:12 -04:00' --full-history --no-merges -- internal/logger/msg_ids.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D3 · God Classes · 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). The bar is 30 methods; this is 202 over it, 7.73× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: 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). The bar is 30 methods; this is 48 over it, 2.60× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: printer internal/js_printer/js_printer.go:276 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: linkerContext internal/linker/linker.go:45 — TooManyMethods — 52 methods, declared across 2 files: linker/linker.go (51), linker/debug.go (1). The bar is 30 methods; this is 22 over it, 1.73× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: 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). The bar is 30 methods; this is 8 over it, 1.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Lexer internal/js_lexer/js_lexer.go:241 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
R10 · Code Duplication · Duplicated block (32 lines × 2 locations) · ×6
  • Duplicated block (32 lines × 2 locations) scripts/decorator-tests.ts:671 — scripts/decorator-tests.ts:671 · scripts/decorator-tests.ts:703 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (32 lines × 2 locations) scripts/decorator-tests.ts:1494 — scripts/decorator-tests.ts:1494 · scripts/decorator-tests.ts:1526 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (32 lines × 2 locations) scripts/decorator-tests.ts:1931 — scripts/decorator-tests.ts:1931 · scripts/decorator-tests.ts:1963 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (32 lines × 2 locations) scripts/decorator-tests.ts:2268 — scripts/decorator-tests.ts:2268 · scripts/decorator-tests.ts:2300 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (32 lines × 2 locations) scripts/plugin-tests.js:245 — scripts/plugin-tests.js:245 · scripts/plugin-tests.js:303 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (32 lines × 2 locations) scripts/plugin-tests.js:1502 — scripts/plugin-tests.js:1502 · scripts/plugin-tests.js:1652 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×5
  • Duplicated block (9 lines × 2) internal/js_lexer/js_lexer.go:1656 — internal/js_lexer/js_lexer.go:1656-1664 | internal/js_lexer/js_lexer.go:1669-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:1656` 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_parser/js_parser.go:4911 — internal/js_parser/js_parser.go:4911-4919 | internal/js_parser/js_parser.go:4936-4945 — both copies are in the same file, so extract the 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:4911` 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:634 — internal/js_printer/js_printer.go:634-642 | internal/js_printer/js_printer.go:2856-2864 — both copies are in the same file, so extract the 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:4825 — internal/linker/linker.go:4825-4833 | internal/linker/linker.go:4897-4905 — both copies are in the same file, so extract the 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:4825` 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:5991 — internal/linker/linker.go:5991-5999 | internal/linker/linker.go:6466-6474 — both copies are in the same file, so extract the 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:5991` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
R10 · Code Duplication · Duplicated block (25 lines × 2 locations) · ×5
  • Duplicated block (25 lines × 2 locations) scripts/decorator-tests.js:609 — scripts/decorator-tests.js:609 · scripts/decorator-tests.js:1900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2 locations) REDACTED:1261 — REDACTED:1261 · REDACTED:1337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2 locations) REDACTED:2918 — REDACTED:2918 · REDACTED:2954 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2 locations) scripts/plugin-tests.js:534 — scripts/plugin-tests.js:534 · scripts/plugin-tests.js:589 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (25 lines × 2 locations) scripts/plugin-tests.js:2976 — scripts/plugin-tests.js:2976 · scripts/plugin-tests.js:3084 — 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.
D17 · Explicit Debt · HackComment · ×4
  • HackComment internal/css_parser/css_parser_selector.go:396 — // Hack: Create an empty "identifier" to represent this — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment internal/fs/iswin_wasm.go:17 — // Hack: Assume that we're on Windows if we're running WebAssembly and — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment internal/js_parser/ts_parser.go:940 — // THIS IS A GROSS HACK. Some context: — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment REDACTED:962 — // HACK: Go's HTTP API doesn't appear to provide a way to separate argument — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (24 lines × 2 locations) · ×4
  • Duplicated block (24 lines × 2 locations) scripts/decorator-tests.js:4678 — scripts/decorator-tests.js:4678 · scripts/decorator-tests.js:4887 — both copies are in the same file, so extract the 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 (24 lines × 2 locations) scripts/decorator-tests.ts:1774 — scripts/decorator-tests.ts:1774 · scripts/decorator-tests.ts:1835 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (24 lines × 2 locations) scripts/plugin-tests.js:1317 — scripts/plugin-tests.js:1317 · scripts/plugin-tests.js:1371 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (24 lines × 2 locations) scripts/plugin-tests.js:1433 — scripts/plugin-tests.js:1433 · scripts/plugin-tests.js:1460 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×4
  • Duplicated block (22 lines × 2 locations) scripts/decorator-tests.js:729 — scripts/decorator-tests.js:729 · scripts/decorator-tests.js:2018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2 locations) scripts/decorator-tests.js:2204 — scripts/decorator-tests.js:2204 · scripts/decorator-tests.js:2284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2 locations) REDACTED:3243 — REDACTED:3243 · REDACTED:3266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2 locations) scripts/plugin-tests.js:766 — scripts/plugin-tests.js:766 · scripts/plugin-tests.js:875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC3 · Page structure · Page without a main landmark · ×3
  • Page without a main landmark REDACTED:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark scripts/graph-debugger.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark scripts/try.html:3 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×3
  • Duplicated block (24 lines × 2) internal/js_ast/js_ast_helpers.go:1495 — internal/js_ast/js_ast_helpers.go:1495-1518 | internal/js_ast/js_ast_helpers.go:1528-1551 — both copies are in the same file, so extract the 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:1495` 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 (24 lines × 2) internal/js_parser/js_parser.go:5829 — internal/js_parser/js_parser.go:5829-5852 | internal/js_parser/js_parser.go:5959-5982 — both copies are in the same file, so extract the 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:5829` 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 (24 lines × 2) internal/js_printer/js_printer.go:4268 — internal/js_printer/js_printer.go:4268-4291 | internal/js_printer/js_printer.go:4315-4338 — both copies are in the same file, so extract the 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:4268` 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 (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) REDACTED:1052 — REDACTED:1052-1070 | REDACTED:1136-1154 — both copies are in the same file, so extract the 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 `REDACTED:1052` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) internal/js_printer/js_printer.go:583 — internal/js_printer/js_printer.go:583-601 | internal/js_printer/js_printer.go:2815-2833 — both copies are in the same file, so extract the 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 (19 lines × 2) internal/js_printer/js_printer.go:643 — internal/js_printer/js_printer.go:643-661 | internal/js_printer/js_printer.go:2870-2888 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) internal/js_parser/js_parser.go:4350 — internal/js_parser/js_parser.go:4350-4367 | internal/js_parser/js_parser.go:4489-4506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) internal/js_parser/js_parser.go:6072 — internal/js_parser/js_parser.go:6072-6089 | internal/js_parser/js_parser.go:6122-6139 — both copies are in the same file, so extract the 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:6072` 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 (18 lines × 2) internal/js_parser/js_parser.go:14301 — internal/js_parser/js_parser.go:14301-14318 | internal/js_parser/js_parser.go:14438-14455 — both copies are in the same file, so extract the 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:14301` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) internal/js_parser/js_parser.go:3881 — internal/js_parser/js_parser.go:3881-3896 | internal/js_parser/js_parser.go:3950-3965 — both copies are in the same file, so extract the 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:3881` 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:16934 — internal/js_parser/js_parser.go:16934-16949 | internal/js_parser/js_parser.go:17010-17025 — both copies are in the same file, so extract the 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:16934` 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/js_printer/js_printer.go:1686 — internal/js_printer/js_printer.go:1686-1701 | internal/js_printer/js_printer.go:2305-2320 — both copies are in the same file, so extract the 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:1686` 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 (15 lines × 2) · ×3
  • Duplicated block (15 lines × 2) internal/css_parser/css_parser.go:1630 — internal/css_parser/css_parser.go:1630-1644 | internal/css_parser/css_parser.go:1739-1753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) internal/css_printer/css_printer.go:983 — internal/css_printer/css_printer.go:983-997 | internal/js_printer/js_printer.go:792-806 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) internal/js_printer/js_printer.go:2772 — internal/js_printer/js_printer.go:2772-2786 | internal/js_printer/js_printer.go:4214-4228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×3
  • Duplicated block (13 lines × 2) REDACTED:324 — REDACTED:324-336 | REDACTED:361-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 `REDACTED:324` 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 (13 lines × 2) internal/js_ast/js_ident.go:156 — internal/js_ast/js_ident.go:156-168 | internal/js_ast/js_ident.go:197-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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.
  • Duplicated block (13 lines × 2) REDACTED:1279 — REDACTED:1279-1291 | REDACTED:1747-1759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/css_parser/css_color_spaces.go:82 — internal/css_parser/css_color_spaces.go:82-89 | internal/css_parser/css_color_spaces.go:108-115 | internal/css_parser/css_color_spaces.go:182-189 | internal/css_parser/css_color_spaces.go:226-233 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/js_parser/js_parser.go:2969 — internal/js_parser/js_parser.go:2969-2988 | internal/js_parser/ts_parser.go:895-921 | internal/js_parser/ts_parser.go:1001-1022 | internal/js_parser/ts_parser.go:1024-1048 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) REDACTED:1011 — REDACTED:1011-1032 | REDACTED:1100-1121 — both copies are in the same file, so extract the 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 `REDACTED:1011` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1010` calls `resolveKindToString` and `REDACTED:1099` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (22 lines × 2) REDACTED:1086 — REDACTED:1086-1107 | REDACTED:1204-1225 — both copies are in the same file, so extract the 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 `REDACTED:1086` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) internal/js_parser/js_parser.go:4371 — internal/js_parser/js_parser.go:4371-4386 | internal/js_parser/js_parser.go:4398-4413 | internal/js_parser/js_parser.go:4510-4525 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (16 lines × 3) internal/js_parser/js_parser_lower_class.go:260 — internal/js_parser/js_parser_lower_class.go:260-275 | internal/js_parser/js_parser_lower_class.go:285-300 | internal/js_parser/js_parser_lower_class.go:312-327 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) internal/css_parser/css_decls_color.go:505 — internal/css_parser/css_decls_color.go:505-513 | internal/css_parser/css_decls_color.go:543-551 | internal/css_parser/css_decls_color.go:583-591 | internal/css_parser/css_decls_color.go:677-685 — 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_decls_color.go:505` 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 × 4) internal/js_ast/js_ident.go:137 — internal/js_ast/js_ident.go:137-145 | internal/js_ast/js_ident.go:155-163 | internal/js_ast/js_ident.go:178-186 | internal/js_ast/js_ident.go:196-204 — 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/js_ast/js_ident.go:137` 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 (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) internal/linker/linker.go:828 — internal/linker/linker.go:828-835 | internal/linker/linker.go:865-872 | internal/linker/linker.go:6716-6723 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) REDACTED:247 — REDACTED:247-254 | REDACTED:300-307 | REDACTED:314-321 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) REDACTED:339 — REDACTED:339-345 | REDACTED:353-359 | REDACTED:376-382 | REDACTED:394-400 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:348` calls `guessMimeType` and `REDACTED:362` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) REDACTED:276 — REDACTED:276-282 | REDACTED:301-307 | REDACTED:315-321 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:276` 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 × 3) internal/css_parser/css_decls_color.go:702 — internal/css_parser/css_decls_color.go:702-708 | internal/css_parser/css_decls_color.go:715-721 | internal/css_parser/css_decls_color.go:726-732 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_parser/css_decls_color.go:702` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) internal/js_ast/js_ast_helpers.go:1168 — internal/js_ast/js_ast_helpers.go:1168-1172 | internal/js_ast/js_ast_helpers.go:1182-1186 | internal/js_ast/js_ast_helpers.go:1191-1195 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/js_ast/js_ast_helpers.go:1175` calls `extractStringValues` and `internal/js_ast/js_ast_helpers.go:1188` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) REDACTED:2549 — REDACTED:2549-2553 | REDACTED:2561-2565 | REDACTED:2584-2588 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2549` 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.
R10 · Code Duplication · Duplicated block (29 lines × 2 locations) · ×2
  • Duplicated block (29 lines × 2 locations) scripts/decorator-tests.js:3670 — scripts/decorator-tests.js:3670 · scripts/decorator-tests.js:3743 — both copies are in the same file, so extract the 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 (29 lines × 2 locations) scripts/plugin-tests.js:2258 — scripts/plugin-tests.js:2258 · scripts/plugin-tests.js:2307 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (27 lines × 2 locations) · ×2
  • Duplicated block (27 lines × 2 locations) REDACTED:888 — REDACTED:888 · REDACTED:922 — both copies are in the same file, so extract the 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 (27 lines × 2 locations) REDACTED:5891 — REDACTED:5891 · REDACTED:5959 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (23 lines × 2 locations) · ×2
  • Duplicated block (23 lines × 2 locations) scripts/decorator-tests.js:634 — scripts/decorator-tests.js:634 · scripts/decorator-tests.js:1925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (23 lines × 2 locations) REDACTED:8120 — REDACTED:8120 · scripts/plugin-tests.js:3463 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X2 · Cancellation propagation · Async function without AbortSignal · ×2
  • Async function without AbortSignal: downloadDirectlyFromNPM REDACTED:236 — `downloadDirectlyFromNPM` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: tryToInstantiateModule lib/shared/worker.ts:84 — `tryToInstantiateModule` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
AC1 · Text alternatives · <canvas> without a text alternative · ×1
  • <canvas> without a text alternative scripts/graph-debugger.html:47 — 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.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — 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 was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · parser.visitExprInOut (cyclomatic 618) · ×1
  • parser.visitExprInOut (cyclomatic 618) internal/js_parser/js_parser.go:13552 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:10393 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.parseStmt (cyclomatic 257) · ×1
  • parser.parseStmt (cyclomatic 257) internal/js_parser/js_parser.go:7101 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · cli.parseOptionsImpl (cyclomatic 249) · ×1
  • cli.parseOptionsImpl (cyclomatic 249) pkg/cli/cli_impl.go:85 — cli.parseOptionsImpl has cyclomatic complexity 249 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 169) · ×1
  • parser.parseSuffix (cyclomatic 169) internal/js_parser/js_parser.go:4264 — parser.parseSuffix has cyclomatic complexity 169 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.parseProperty (cyclomatic 161) · ×1
  • parser.parseProperty (cyclomatic 161) internal/js_parser/js_parser.go:2185 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · binaryExprVisitor.visitRightAndFinish (cyclomatic 153) · ×1
  • binaryExprVisitor.visitRightAndFinish (cyclomatic 153) internal/js_parser/js_parser.go:16067 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:1294 — 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:9156 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:3499 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · bundler.parseFile (cyclomatic 109) · ×1
  • bundler.parseFile (cyclomatic 109) REDACTED:124 — 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 · uint8array_json_parser.JSON_parse (cyclomatic 93) · ×1
  • uint8array_json_parser.JSON_parse (cyclomatic 93) lib/shared/uint8array_json_parser.ts:77 — uint8array_json_parser.JSON_parse has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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:17332 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · scanner.processScannedFiles (cyclomatic 83) · ×1
  • scanner.processScannedFiles (cyclomatic 83) REDACTED:2361 — scanner.processScannedFiles has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 · apiHandler.ServeHTTP (cyclomatic 74) · ×1
  • apiHandler.ServeHTTP (cyclomatic 74) REDACTED:105 — apiHandler.ServeHTTP has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 · common.handlePlugins (cyclomatic 71) · ×1
  • common.handlePlugins (cyclomatic 71) lib/shared/common.ts:1169 — common.handlePlugins has cyclomatic complexity 71 (threshold 15). Of this number, 17 points are the body's own statements and 54 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · parser.substituteSingleUseSymbolInExpr (cyclomatic 69) · ×1
  • parser.substituteSingleUseSymbolInExpr (cyclomatic 69) internal/js_parser/js_parser.go:9735 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.visitClass (cyclomatic 69) · ×1
  • parser.visitClass (cyclomatic 69) internal/js_parser/js_parser.go:12177 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:5568 — 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:6098 — 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:3411 — 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) REDACTED:853 — 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 908, 865). 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) REDACTED:1842 — 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:4316 — 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 · common.flagsForBuildOptions (cyclomatic 55) · ×1
  • common.flagsForBuildOptions (cyclomatic 55) lib/shared/common.ts:237 — common.flagsForBuildOptions 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:913 — 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) REDACTED: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:12939 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 · common.buildOrContextImpl (cyclomatic 51) · ×1
  • common.buildOrContextImpl (cyclomatic 51) lib/shared/common.ts:844 — common.buildOrContextImpl has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 8 of the 51 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 1083, buildOrContextContinue, buildOrContextContinue::buildResponseToResult, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · 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 · 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:4662 — 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:5251 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 · common.pushCommonFlags (cyclomatic 45) · ×1
  • common.pushCommonFlags (cyclomatic 45) lib/shared/common.ts:147 — common.pushCommonFlags has cyclomatic complexity 45 (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.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:17058 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · cli.runImpl (cyclomatic 44) · ×1
  • cli.runImpl (cyclomatic 44) pkg/cli/cli_impl.go:1198 — 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:17815 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.minifySwitchStmt (cyclomatic 43) · ×1
  • parser.minifySwitchStmt (cyclomatic 43) internal/js_parser/js_parser.go:11612 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.toAST (cyclomatic 43) · ×1
  • parser.toAST (cyclomatic 43) internal/js_parser/js_parser.go:18606 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · api.validateBuildOptions (cyclomatic 43) · ×1
  • api.validateBuildOptions (cyclomatic 43) REDACTED:1254 — 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:5320 — 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) REDACTED:2291 — 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:1535 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:6152 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.visitStmts (cyclomatic 36) · ×1
  • parser.visitStmts (cyclomatic 36) internal/js_parser/js_parser.go:8960 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:3153 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 · api.rebuildImpl (cyclomatic 35) · ×1
  • api.rebuildImpl (cyclomatic 35) REDACTED:1488 — api.rebuildImpl has cyclomatic complexity 35 (threshold 15). Of this number, 27 points are the body's own statements and 8 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 · test262.checkBuildAPI (cyclomatic 35) · ×1
  • test262.checkBuildAPI (cyclomatic 35) scripts/test262.js:280 — test262.checkBuildAPI has cyclomatic complexity 35 (threshold 15). Of this number, 32 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.parsePseudoClassSelector (cyclomatic 34) · ×1
  • parser.parsePseudoClassSelector (cyclomatic 34) internal/css_parser/css_parser_selector.go:653 — 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 · 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:5019 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.isUnsupportedRegularExpression (cyclomatic 33) · ×1
  • parser.isUnsupportedRegularExpression (cyclomatic 33) internal/js_parser/js_parser.go:13415 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.lowerObjectRestHelper (cyclomatic 33) · ×1
  • parser.lowerObjectRestHelper (cyclomatic 33) internal/js_parser/js_parser_lower.go:1452 — 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 1473, 1647, 1543, …). 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:3875 — 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:6758 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.mangleIf (cyclomatic 32) · ×1
  • parser.mangleIf (cyclomatic 32) internal/js_parser/js_parser.go:10246 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.handleGlobPattern (cyclomatic 32) · ×1
  • parser.handleGlobPattern (cyclomatic 32) internal/js_parser/js_parser.go:16617 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:883 — 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:1391 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.parseClass (cyclomatic 31) · ×1
  • parser.parseClass (cyclomatic 31) internal/js_parser/js_parser.go:6489 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:7001 — 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:376 — 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:4997 — 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 · parser.parseBinding (cyclomatic 29) · ×1
  • parser.parseBinding (cyclomatic 29) internal/js_parser/js_parser.go:5999 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.prepareForVisitPass (cyclomatic 29) · ×1
  • parser.prepareForVisitPass (cyclomatic 29) internal/js_parser/js_parser.go:18319 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:2633 — 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 · logger.formatLineSpan (cyclomatic 29) · ×1
  • logger.formatLineSpan (cyclomatic 29) internal/logger/style.go:125 — logger.formatLineSpan 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 · serviceType.handleBuildRequest (cyclomatic 28) · ×1
  • serviceType.handleBuildRequest (cyclomatic 28) REDACTED:597 — serviceType.handleBuildRequest has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bundler.runOnLoadPlugins (cyclomatic 28) · ×1
  • bundler.runOnLoadPlugins (cyclomatic 28) REDACTED:1182 — 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:539 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · linkerContext.maybeAppendLegalComments (cyclomatic 28) · ×1
  • linkerContext.maybeAppendLegalComments (cyclomatic 28) internal/linker/linker.go:6549 — 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 · index.html.testStart (cyclomatic 28) · ×1
  • index.html.testStart (cyclomatic 28) scripts/browser/index.html:357 — index.html.testStart has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · 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:556 — 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:1006 — 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 1007). 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 · api.validateFeatures (cyclomatic 26) · ×1
  • api.validateFeatures (cyclomatic 26) REDACTED:313 — api.validateFeatures 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:8820 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.instantiateDefineExpr (cyclomatic 25) · ×1
  • parser.instantiateDefineExpr (cyclomatic 25) internal/js_parser/js_parser.go:12678 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.maybeMarkKnownGlobalConstructorAsPure (cyclomatic 25) · ×1
  • parser.maybeMarkKnownGlobalConstructorAsPure (cyclomatic 25) internal/js_parser/js_parser.go:16929 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:979 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.parseAndDeclareDecls (cyclomatic 24) · ×1
  • parser.parseAndDeclareDecls (cyclomatic 24) internal/js_parser/js_parser.go:5601 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.parseExportClause (cyclomatic 24) · ×1
  • parser.parseExportClause (cyclomatic 24) internal/js_parser/js_parser.go:5856 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 · Bundle.Compile (cyclomatic 23) · ×1
  • Bundle.Compile (cyclomatic 23) REDACTED:3050 — Bundle.Compile 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_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.scanForEndOfRule (cyclomatic 23) · ×1
  • parser.scanForEndOfRule (cyclomatic 23) internal/css_parser/css_parser.go:2308 — parser.scanForEndOfRule 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:2992 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:2110 — 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 · apiHandler.broadcastBuildResult (cyclomatic 23) · ×1
  • apiHandler.broadcastBuildResult (cyclomatic 23) REDACTED:491 — 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 · destructuring-fuzzer.generateTestCase (cyclomatic 23) · ×1
  • destructuring-fuzzer.generateTestCase (cyclomatic 23) scripts/destructuring-fuzzer.js:1 — destructuring-fuzzer.generateTestCase has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (object, array, patternAndValue, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · scanner.maybeParseFile (cyclomatic 22) · ×1
  • scanner.maybeParseFile (cyclomatic 22) REDACTED:1540 — 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:8504 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:4144 — 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 4168). 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:1477 — 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) REDACTED:569 — 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) REDACTED:1711 — 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 · parser.parseDeclaration (cyclomatic 21) · ×1
  • parser.parseDeclaration (cyclomatic 21) internal/css_parser/css_parser.go:2391 — 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 · index.supportMapToVersionRanges (cyclomatic 21) · ×1
  • index.supportMapToVersionRanges (cyclomatic 21) compat-table/src/index.ts:209 — index.supportMapToVersionRanges 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) REDACTED:1052 — 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:5735 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.parseDecorator (cyclomatic 20) · ×1
  • parser.parseDecorator (cyclomatic 20) internal/js_parser/js_parser.go:6956 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:6004 — 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 · logger.msgString (cyclomatic 20) · ×1
  • logger.msgString (cyclomatic 20) internal/logger/style_default.go:43 — logger.msgString 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 · common.createChannel.transform (cyclomatic 20) · ×1
  • common.createChannel.transform (cyclomatic 20) lib/shared/common.ts:689 — common.createChannel.transform has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (start, a function literal at line 724, a function literal at line 729, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · test262-async.main (cyclomatic 20) · ×1
  • test262-async.main (cyclomatic 20) scripts/test262-async.js:19 — test262-async.main has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (check, a function literal at line 53, a function literal at line 55). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · bundler.ResolveFailureErrorTextSuggestionNotes (cyclomatic 19) · ×1
  • bundler.ResolveFailureErrorTextSuggestionNotes (cyclomatic 19) REDACTED:803 — 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 · 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:1043 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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) REDACTED:2119 — 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:12029 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.isDotOrIndexDefineMatch (cyclomatic 18) · ×1
  • parser.isDotOrIndexDefineMatch (cyclomatic 18) internal/js_parser/js_parser.go:12619 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:3220 — 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 · common.sanitizeLocation (cyclomatic 18) · ×1
  • common.sanitizeLocation (cyclomatic 18) lib/shared/common.ts:1714 — common.sanitizeLocation 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 · scanner.preprocessInjectedFiles (cyclomatic 17) · ×1
  • scanner.preprocessInjectedFiles (cyclomatic 17) REDACTED:1697 — 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 1756). 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 · compat.CompareSemver (cyclomatic 17) · ×1
  • compat.CompareSemver (cyclomatic 17) internal/compat/compat.go:60 — compat.CompareSemver 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 · 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:925 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.globPatternFromExpr (cyclomatic 17) · ×1
  • parser.globPatternFromExpr (cyclomatic 17) internal/js_parser/js_parser.go:16758 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 · mdn.addFeatures (cyclomatic 17) · ×1
  • mdn.addFeatures (cyclomatic 17) compat-table/src/mdn.ts:140 — mdn.addFeatures 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 · InputFile.renderHover (cyclomatic 17) · ×1
  • InputFile.renderHover (cyclomatic 17) scripts/graph-debugger.html:160 — InputFile.renderHover 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) REDACTED:2176 — 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:766 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.parsePropertyBinding (cyclomatic 16) · ×1
  • parser.parsePropertyBinding (cyclomatic 16) internal/js_parser/js_parser.go:2741 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · parser.parsePath (cyclomatic 16) · ×1
  • parser.parsePath (cyclomatic 16) internal/js_parser/js_parser.go:6648 — 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. This file is where this pass's cyclomatic complexity CONCENTRATES: internal/js_parser/js_parser.go holds 49 of the 259 functions over the threshold — including the worst — and 2468 of the 7606 points over it (32%), 3.4× the next-largest file (internal/js_printer/js_printer.go at 723). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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:3167 — 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:6927 — 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) REDACTED:1952 — 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 1963). 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. This is NOT this file's highest cyclomatic complexity: api.validateLoader (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cli.parseServeOptionsImpl (cyclomatic 16) · ×1
  • cli.parseServeOptionsImpl (cyclomatic 16) pkg/cli/cli_impl.go:1427 — 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.
D12 · Dependency Hygiene · Dependency pinned to a stale untagged commit · ×1
  • Dependency pinned to a stale untagged commit: golang.org/x/sys — Direct dependency `golang.org/x/sys` is required at `v0.0.0-20220715151400-c0bba94af5f8` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2022-07-15, 4.3 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `golang.org/x/sys` and has not moved this requirement in 4.3 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `golang.org/x/sys` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
D2 · Cognitive Complexity · parser.visitExprInOut (cognitive 1654) · ×1
  • parser.visitExprInOut (cognitive 1654) internal/js_parser/js_parser.go:13552 — parser.visitExprInOut has cognitive complexity 1654 (threshold 15). Drivers by points: if/else 382 (1334 pts), boolean chains 130, match/switch 26 (117 pts), loops 22 (73 pts) (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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 239 (610 pts), boolean chains 83, loops 12 (31 pts), match/switch 8 (21 pts) (nesting depth added 403). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.visitAndAppendStmt (cognitive 628) · ×1
  • parser.visitAndAppendStmt (cognitive 628) internal/js_parser/js_parser.go:10393 — parser.visitAndAppendStmt has cognitive complexity 628 (threshold 15). Drivers by points: if/else 177 (515 pts), boolean chains 56, loops 18 (48 pts), match/switch 4 (9 pts) (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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.parseStmt (cognitive 517) · ×1
  • parser.parseStmt (cognitive 517) internal/js_parser/js_parser.go:7101 — parser.parseStmt has cognitive complexity 517 (threshold 15). Drivers by points: if/else 127 (392 pts), boolean chains 63, match/switch 13 (45 pts), loops 5 (15 pts), jumps 2 (nesting depth added 307). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · linkerContext.scanImportsAndExports (cognitive 424) · ×1
  • linkerContext.scanImportsAndExports (cognitive 424) internal/linker/linker.go:1294 — linkerContext.scanImportsAndExports has cognitive complexity 424 (threshold 15). Drivers by points: if/else 81 (315 pts), loops 29 (80 pts), boolean chains 22, match/switch 2 (6 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cli.parseOptionsImpl (cognitive 413) · ×1
  • cli.parseOptionsImpl (cognitive 413) pkg/cli/cli_impl.go:85 — cli.parseOptionsImpl has cognitive complexity 413 (threshold 15). Drivers by points: if/else 153 (335 pts), boolean chains 41, match/switch 11 (33 pts), loops 2 (4 pts) (nesting depth added 206). To reduce it, split the body into named stages: move each independent step or branch 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:9156 — parser.mangleStmts has cognitive complexity 380 (threshold 15). Drivers by points: if/else 80 (313 pts), boolean chains 23, loops 7 (22 pts), match/switch 5 (15 pts), jumps 7 (nesting depth added 258). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.parseSuffix (cognitive 331) · ×1
  • parser.parseSuffix (cognitive 331) internal/js_parser/js_parser.go:4264 — parser.parseSuffix has cognitive complexity 331 (threshold 15). Drivers by points: if/else 94 (301 pts), boolean chains 13, match/switch 4 (13 pts), loops 2 (4 pts) (nesting depth added 218). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · bundler.parseFile (cognitive 325) · ×1
  • bundler.parseFile (cognitive 325) REDACTED:124 — bundler.parseFile has cognitive complexity 325 (threshold 15). Drivers by points: if/else 82 (258 pts), loops 9 (39 pts), match/switch 4 (16 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 40 (140 pts), match/switch 29 (109 pts), loops 12 (46 pts), 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 · binaryExprVisitor.visitRightAndFinish (cognitive 302) · ×1
  • binaryExprVisitor.visitRightAndFinish (cognitive 302) internal/js_parser/js_parser.go:16067 — binaryExprVisitor.visitRightAndFinish has cognitive complexity 302 (threshold 15). Drivers by points: if/else 104 (276 pts), boolean chains 17, match/switch 4 (9 pts) (nesting depth added 177). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 36 (242 pts), loops 6 (37 pts), boolean chains 6 (nesting depth added 237). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 65 (207 pts), match/switch 9 (23 pts), boolean chains 20, loops 6 (19 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.parseProperty (cognitive 262) · ×1
  • parser.parseProperty (cognitive 262) internal/js_parser/js_parser.go:2185 — parser.parseProperty has cognitive complexity 262 (threshold 15). Drivers by points: if/else 76 (201 pts), boolean chains 42, match/switch 6 (19 pts) (nesting depth added 138). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 99 (220 pts), boolean chains 17, loops 5 (12 pts), match/switch 5 (10 pts) (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 45 (220 pts), match/switch 10 (33 pts), 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 254) · ×1
  • scanner.processScannedFiles (cognitive 254) REDACTED:2361 — scanner.processScannedFiles has cognitive complexity 254 (threshold 15). Drivers by points: if/else 58 (211 pts), loops 10 (23 pts), boolean chains 11, match/switch 2 (9 pts) (nesting depth added 173). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 56 (170 pts), loops 10 (29 pts), match/switch 4 (21 pts), boolean chains 9 (nesting depth added 150). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.scanForImportsAndExports (cognitive 216) · ×1
  • parser.scanForImportsAndExports (cognitive 216) internal/js_parser/js_parser.go:17332 — parser.scanForImportsAndExports has cognitive complexity 216 (threshold 15). Drivers by points: if/else 40 (150 pts), loops 10 (41 pts), boolean chains 23, match/switch 1 (2 pts) (nesting depth added 142). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 52 (187 pts), loops 5 (14 pts), 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 47 (195 pts), loops 2 (7 pts), boolean chains 6, match/switch 1 (4 pts) (nesting depth added 156). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 58 (174 pts), loops 9 (27 pts), boolean chains 3, match/switch 1 (2 pts) (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 48 (154 pts), loops 10 (28 pts), match/switch 5 (13 pts), 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 56 (166 pts), loops 4 (17 pts), match/switch 4 (16 pts), boolean chains 1, jumps 1 (nesting depth added 135). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.parsePrefix (cognitive 197) · ×1
  • parser.parsePrefix (cognitive 197) internal/js_parser/js_parser.go:3499 — parser.parsePrefix has cognitive complexity 197 (threshold 15). Drivers by points: if/else 63 (163 pts), match/switch 8 (22 pts), boolean chains 8, loops 2 (4 pts) (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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 48 (134 pts), boolean chains 29, loops 7 (20 pts), match/switch 2 (5 pts), jumps 1 (nesting depth added 102). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 40 (156 pts), boolean chains 16, loops 4 (12 pts), 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 69 (154 pts), loops 5 (13 pts), boolean chains 11, match/switch 3 (6 pts) (nesting depth added 96). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 36 (136 pts), loops 7 (30 pts), match/switch 4 (11 pts), boolean chains 7 (nesting depth added 130). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · linkerContext.computeCrossChunkDependencies (cognitive 182) · ×1
  • linkerContext.computeCrossChunkDependencies (cognitive 182) internal/linker/linker.go:913 — linkerContext.computeCrossChunkDependencies has cognitive complexity 182 (threshold 15). Drivers by points: if/else 31 (121 pts), loops 17 (50 pts), match/switch 3 (8 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 38 (129 pts), boolean chains 22, loops 5 (12 pts), match/switch 3 (7 pts), 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 · apiHandler.ServeHTTP (cognitive 168) · ×1
  • apiHandler.ServeHTTP (cognitive 168) REDACTED:105 — apiHandler.ServeHTTP has cognitive complexity 168 (threshold 15). Drivers by points: if/else 54 (137 pts), boolean chains 13, loops 5 (13 pts), match/switch 1 (5 pts) (nesting depth added 95). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 51 (130 pts), loops 7 (20 pts), boolean chains 9, match/switch 2 (7 pts) (nesting depth added 97). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · linkerContext.convertStmtsForChunk (cognitive 157) · ×1
  • linkerContext.convertStmtsForChunk (cognitive 157) internal/linker/linker.go:4316 — linkerContext.convertStmtsForChunk has cognitive complexity 157 (threshold 15). Drivers by points: if/else 35 (123 pts), loops 6 (21 pts), boolean chains 7, match/switch 2 (6 pts) (nesting depth added 107). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · api.analyzeMetafileImpl (cognitive 157) · ×1
  • api.analyzeMetafileImpl (cognitive 157) REDACTED:2291 — api.analyzeMetafileImpl has cognitive complexity 157 (threshold 15). Drivers by points: if/else 24 (106 pts), loops 12 (49 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.visitClass (cognitive 151) · ×1
  • parser.visitClass (cognitive 151) internal/js_parser/js_parser.go:12177 — parser.visitClass has cognitive complexity 151 (threshold 15). Drivers by points: if/else 51 (122 pts), boolean chains 13, match/switch 2 (9 pts), loops 4 (7 pts) (nesting depth added 81). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · linkerContext.generateChunkJS (cognitive 142) · ×1
  • linkerContext.generateChunkJS (cognitive 142) internal/linker/linker.go:5568 — linkerContext.generateChunkJS has cognitive complexity 142 (threshold 15). Drivers by points: if/else 54 (104 pts), loops 14 (33 pts), 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) REDACTED:203 — serviceType.handleIncomingPacket has cognitive complexity 139 (threshold 15). Drivers by points: if/else 41 (127 pts), loops 2 (10 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · linkerContext.findImportedFilesInCSSOrder (cognitive 137) · ×1
  • linkerContext.findImportedFilesInCSSOrder (cognitive 137) internal/linker/linker.go:3411 — linkerContext.findImportedFilesInCSSOrder has cognitive complexity 137 (threshold 15). Drivers by points: if/else 30 (93 pts), loops 15 (28 pts), boolean chains 11, jumps 3, match/switch 1 (2 pts) (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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · scanner.addEntryPoints (cognitive 136) · ×1
  • scanner.addEntryPoints (cognitive 136) REDACTED:1842 — scanner.addEntryPoints has cognitive complexity 136 (threshold 15). Drivers by points: if/else 43 (108 pts), loops 9 (18 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · linkerContext.generateChunkCSS (cognitive 136) · ×1
  • linkerContext.generateChunkCSS (cognitive 136) internal/linker/linker.go:6098 — linkerContext.generateChunkCSS has cognitive complexity 136 (threshold 15). Drivers by points: if/else 41 (95 pts), loops 12 (29 pts), boolean chains 6, match/switch 2 (6 pts) (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 19 (78 pts), match/switch 8 (36 pts), loops 4 (15 pts), 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 38 (107 pts), boolean chains 14, match/switch 5 (12 pts) (nesting depth added 76). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · linkerContext.renameSymbolsInChunk (cognitive 132) · ×1
  • linkerContext.renameSymbolsInChunk (cognitive 132) internal/linker/linker.go:5320 — linkerContext.renameSymbolsInChunk has cognitive complexity 132 (threshold 15). Drivers by points: if/else 19 (70 pts), loops 18 (55 pts), match/switch 1 (6 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 34 (106 pts), boolean chains 10, loops 4 (9 pts), match/switch 2 (5 pts), 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:9735 — parser.substituteSingleUseSymbolInExpr has cognitive complexity 121 (threshold 15). Drivers by points: if/else 40 (100 pts), boolean chains 9, loops 4 (9 pts), match/switch 2 (3 pts) (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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.maybeRewritePropertyAccess (cognitive 120) · ×1
  • parser.maybeRewritePropertyAccess (cognitive 120) internal/js_parser/js_parser.go:12939 — parser.maybeRewritePropertyAccess has cognitive complexity 120 (threshold 15). Drivers by points: if/else 34 (101 pts), boolean chains 10, match/switch 2 (6 pts), loops 1 (3 pts) (nesting depth added 73). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · serviceType.convertPlugins (cognitive 117) · ×1
  • serviceType.convertPlugins (cognitive 117) REDACTED:853 — serviceType.convertPlugins has cognitive complexity 117 (threshold 15). Drivers by points: if/else 52 (99 pts), loops 9 (18 pts) (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 908, 865). 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:4662 — linkerContext.generateCodeForFileInChunkJS has cognitive complexity 117 (threshold 15). Drivers by points: if/else 34 (90 pts), loops 5 (15 pts), boolean chains 6, match/switch 2 (6 pts) (nesting depth added 70). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · uint8array_json_parser.JSON_parse (cognitive 111) · ×1
  • uint8array_json_parser.JSON_parse (cognitive 111) lib/shared/uint8array_json_parser.ts:77 — uint8array_json_parser.JSON_parse has cognitive complexity 111 (threshold 15). Drivers by points: if/else 29 (76 pts), loops 5 (15 pts), match/switch 4 (13 pts), boolean chains 7 (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 · 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 33 (89 pts), loops 4 (10 pts), boolean chains 7, match/switch 1 (nesting depth added 62). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 27 (97 pts), loops 2 (8 pts), boolean chains 1 (nesting depth added 76). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.parseJSXElement (cognitive 104) · ×1
  • parser.parseJSXElement (cognitive 104) internal/js_parser/js_parser.go:5251 — parser.parseJSXElement has cognitive complexity 104 (threshold 15). Drivers by points: if/else 36 (88 pts), loops 3 (6 pts), match/switch 2 (5 pts), boolean chains 4, jumps 1 (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 28 (80 pts), loops 9 (20 pts), 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 30 (83 pts), loops 4 (13 pts), boolean chains 6 (nesting depth added 62). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 36 (83 pts), loops 4 (8 pts), boolean chains 6, match/switch 2 (5 pts) (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 31 (79 pts), match/switch 4 (9 pts), boolean chains 7, jumps 3, loops 2 (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cli.runImpl (cognitive 99) · ×1
  • cli.runImpl (cognitive 99) pkg/cli/cli_impl.go:1198 — cli.runImpl has cognitive complexity 99 (threshold 15). Drivers by points: if/else 38 (93 pts), 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 34 (72 pts), boolean chains 20, loops 1 (4 pts), match/switch 1 (2 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · js_parser.Parse (cognitive 97) · ×1
  • js_parser.Parse (cognitive 97) internal/js_parser/js_parser.go:17815 — js_parser.Parse has cognitive complexity 97 (threshold 15). Drivers by points: if/else 29 (66 pts), loops 8 (21 pts), match/switch 2 (5 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 35 (83 pts), boolean chains 7, loops 3, match/switch 1 (3 pts) (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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 23 (78 pts), match/switch 4 (10 pts), 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 16 (63 pts), match/switch 4 (16 pts), loops 3 (10 pts), 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:1535 — parser.hoistSymbols has cognitive complexity 95 (threshold 15). Drivers by points: if/else 20 (72 pts), boolean chains 11, loops 5 (10 pts), jumps 2 (nesting depth added 57). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · common.flagsForBuildOptions (cognitive 95) · ×1
  • common.flagsForBuildOptions (cognitive 95) lib/shared/common.ts:237 — common.flagsForBuildOptions has cognitive complexity 95 (threshold 15). Drivers by points: if/else 44 (70 pts), loops 10 (22 pts), ternaries 1 (2 pts), 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.minifySwitchStmt (cognitive 94) · ×1
  • parser.minifySwitchStmt (cognitive 94) internal/js_parser/js_parser.go:11612 — parser.minifySwitchStmt has cognitive complexity 94 (threshold 15). Drivers by points: if/else 32 (75 pts), loops 4 (12 pts), boolean chains 7 (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 27 (58 pts), boolean chains 19, loops 7 (15 pts) (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 20 (65 pts), boolean chains 11, loops 2 (5 pts), match/switch 2 (5 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 36 (76 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · api.rebuildImpl (cognitive 86) · ×1
  • api.rebuildImpl (cognitive 86) REDACTED:1488 — api.rebuildImpl has cognitive complexity 86 (threshold 15). Drivers by points: if/else 26 (64 pts), loops 9 (20 pts), boolean chains 2 (nesting depth added 49). Of this number, 56 points are the body's own statements and 30 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 16 (47 pts), boolean chains 17, loops 5 (13 pts), match/switch 4 (8 pts) (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:16929 — parser.maybeMarkKnownGlobalConstructorAsPure has cognitive complexity 84 (threshold 15). Drivers by points: if/else 14 (55 pts), match/switch 5 (23 pts), loops 1 (6 pts) (nesting depth added 64). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.mangleIf (cognitive 82) · ×1
  • parser.mangleIf (cognitive 82) internal/js_parser/js_parser.go:10246 — parser.mangleIf has cognitive complexity 82 (threshold 15). Drivers by points: if/else 36 (76 pts), boolean chains 6 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · linkerContext.generateEntryPointTailJS (cognitive 81) · ×1
  • linkerContext.generateEntryPointTailJS (cognitive 81) internal/linker/linker.go:4997 — linkerContext.generateEntryPointTailJS has cognitive complexity 81 (threshold 15). Drivers by points: if/else 27 (69 pts), loops 3 (10 pts), 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 · parser.parsePseudoClassSelector (cognitive 76) · ×1
  • parser.parsePseudoClassSelector (cognitive 76) internal/css_parser/css_parser_selector.go:653 — parser.parsePseudoClassSelector has cognitive complexity 76 (threshold 15). Drivers by points: if/else 18 (66 pts), match/switch 2 (6 pts), boolean chains 4 (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 28 (57 pts), loops 4 (9 pts), boolean chains 6, match/switch 1 (2 pts) (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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 32 (64 pts), boolean chains 7, match/switch 1 (3 pts) (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:16617 — parser.handleGlobPattern has cognitive complexity 73 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 6 (12 pts), 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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · linkerContext.computeChunks (cognitive 73) · ×1
  • linkerContext.computeChunks (cognitive 73) internal/linker/linker.go:3875 — linkerContext.computeChunks has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (52 pts), loops 11 (16 pts), match/switch 2 (4 pts), 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:13415 — parser.isUnsupportedRegularExpression has cognitive complexity 72 (threshold 15). Drivers by points: if/else 15 (50 pts), match/switch 3 (9 pts), loops 3 (6 pts), 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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 21 (56 pts), match/switch 2 (6 pts), boolean chains 4, loops 2 (3 pts), 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:8960 — parser.visitStmts has cognitive complexity 71 (threshold 15). Drivers by points: if/else 23 (57 pts), loops 5 (9 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · linkerContext.maybeAppendLegalComments (cognitive 71) · ×1
  • linkerContext.maybeAppendLegalComments (cognitive 71) internal/linker/linker.go:6549 — linkerContext.maybeAppendLegalComments has cognitive complexity 71 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 12 (34 pts), 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 31 (61 pts), 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 13 (44 pts), loops 4 (17 pts), boolean chains 5, jumps 2, match/switch 1 (2 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 21 (51 pts), boolean chains 11, match/switch 2 (5 pts), loops 2 (3 pts) (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 7 (26 pts), loops 6 (20 pts), match/switch 5 (19 pts), 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 17 (60 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 21 (53 pts), boolean chains 7, loops 3 (7 pts), match/switch 1 (2 pts) (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 34 (68 pts), 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:17058 — parser.handleIdentifier has cognitive complexity 68 (threshold 15). Drivers by points: if/else 24 (46 pts), boolean chains 14, match/switch 2 (8 pts) (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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 35 (53 pts), boolean chains 9, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 28 (64 pts), boolean chains 4 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 23 (48 pts), loops 3 (9 pts), boolean chains 5, match/switch 2 (5 pts) (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:376 — parser.parseCompoundSelector has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (44 pts), match/switch 4 (11 pts), loops 2 (5 pts), 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:6152 — parser.parseFn has cognitive complexity 67 (threshold 15). Drivers by points: if/else 25 (54 pts), boolean chains 8, loops 2 (5 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.toAST (cognitive 67) · ×1
  • parser.toAST (cognitive 67) internal/js_parser/js_parser.go:18606 — parser.toAST has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 10 (19 pts), boolean chains 13, match/switch 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · linkerContext.generateSourceMapForChunk (cognitive 67) · ×1
  • linkerContext.generateSourceMapForChunk (cognitive 67) internal/linker/linker.go:7001 — linkerContext.generateSourceMapForChunk has cognitive complexity 67 (threshold 15). Drivers by points: if/else 27 (56 pts), loops 7 (10 pts), 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) REDACTED:1182 — bundler.runOnLoadPlugins has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (49 pts), loops 4 (9 pts), match/switch 1 (5 pts), boolean chains 3 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 12 (55 pts), boolean chains 8, match/switch 1 (3 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · linkerContext.matchImportWithExport (cognitive 66) · ×1
  • linkerContext.matchImportWithExport (cognitive 66) internal/linker/linker.go:2633 — linkerContext.matchImportWithExport has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (51 pts), loops 5 (10 pts), boolean chains 2, match/switch 1 (2 pts), 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 27 (61 pts), loops 2 (3 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 18 (42 pts), boolean chains 12, loops 4 (11 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · linkerContext.generateCodeForLazyExport (cognitive 65) · ×1
  • linkerContext.generateCodeForLazyExport (cognitive 65) internal/linker/linker.go:2110 — linkerContext.generateCodeForLazyExport has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (47 pts), loops 4 (15 pts), 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · logger.PrintSummary (cognitive 65) · ×1
  • logger.PrintSummary (cognitive 65) internal/logger/logger.go:1006 — logger.PrintSummary has cognitive complexity 65 (threshold 15). Drivers by points: if/else 22 (59 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 39). None of this is in the body itself: all 65 points belong to one function literal inside it that branches (line 1007). 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 25 (52 pts), boolean chains 5, match/switch 2 (4 pts), 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 · 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 12 (50 pts), loops 2 (7 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.parseBinding (cognitive 63) · ×1
  • parser.parseBinding (cognitive 63) internal/js_parser/js_parser.go:5999 — parser.parseBinding has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (52 pts), boolean chains 6, loops 2 (4 pts), 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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 13 (33 pts), loops 7 (25 pts), 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:3153 — parser.parseParenExpr has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (45 pts), loops 4 (10 pts), boolean chains 6 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.parseAndDeclareDecls (cognitive 61) · ×1
  • parser.parseAndDeclareDecls (cognitive 61) internal/js_parser/js_parser.go:5601 — parser.parseAndDeclareDecls has cognitive complexity 61 (threshold 15). Drivers by points: if/else 13 (49 pts), boolean chains 7, match/switch 1 (4 pts), loops 1 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 27 (48 pts), loops 3 (7 pts), boolean chains 4, match/switch 1 (2 pts) (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 27 (54 pts), 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 · common.pushCommonFlags (cognitive 59) · ×1
  • common.pushCommonFlags (cognitive 59) lib/shared/common.ts:147 — common.pushCommonFlags has cognitive complexity 59 (threshold 15). Drivers by points: if/else 37 (45 pts), loops 5 (10 pts), ternaries 2 (4 pts) (nesting depth added 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · 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 14 (40 pts), loops 4 (13 pts), boolean chains 3, match/switch 1 (2 pts) (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 15 (43 pts), loops 3 (12 pts), boolean chains 2 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · index.supportMapToVersionRanges (cognitive 57) · ×1
  • index.supportMapToVersionRanges (cognitive 57) compat-table/src/index.ts:209 — index.supportMapToVersionRanges has cognitive complexity 57 (threshold 15). Drivers by points: if/else 8 (30 pts), loops 7 (19 pts), boolean chains 4, ternaries 1 (4 pts) (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 17 (40 pts), boolean chains 8, loops 4 (8 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 22 (46 pts), match/switch 3 (7 pts), loops 1 (2 pts), 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 19 (37 pts), loops 4 (12 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 17 (46 pts), loops 4 (7 pts), 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) REDACTED:2176 — scanner.scanAllDependencies has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (49 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 15 (37 pts), match/switch 7 (13 pts), 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 19 (46 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (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 12 (28 pts), if/else 7 (20 pts), boolean chains 3, match/switch 1 (2 pts) (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 15 (47 pts), loops 2 (4 pts), 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 · common.buildOrContextImpl (cognitive 53) · ×1
  • common.buildOrContextImpl (cognitive 53) lib/shared/common.ts:844 — common.buildOrContextImpl has cognitive complexity 53 (threshold 15). Drivers by points: if/else 37 (43 pts), boolean chains 5, error handling 3 (4 pts), ternaries 1 (nesting depth added 7). Most of this is not in the body itself: 11 of the 53 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 1083, buildOrContextContinue, buildOrContextContinue::buildResponseToResult, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · index.html.testStart (cognitive 53) · ×1
  • index.html.testStart (cognitive 53) scripts/browser/index.html:357 — index.html.testStart has cognitive complexity 53 (threshold 15). Drivers by points: loops 7 (22 pts), ternaries 2 (12 pts), boolean chains 8, error handling 2 (8 pts), if/else 3 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseStmtsUpTo (cognitive 52) · ×1
  • parser.parseStmtsUpTo (cognitive 52) internal/js_parser/js_parser.go:8504 — parser.parseStmtsUpTo has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (45 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 17 (43 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (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 18 (43 pts), loops 5 (9 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 16 (37 pts), boolean chains 11, match/switch 2 (3 pts) (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 22 (44 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 12 (44 pts), loops 1 (4 pts), boolean chains 3 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · api.validateBuildOptions (cognitive 51) · ×1
  • api.validateBuildOptions (cognitive 51) REDACTED:1254 — api.validateBuildOptions has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 10, loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseExprOrLetOrUsingStmt (cognitive 50) · ×1
  • parser.parseExprOrLetOrUsingStmt (cognitive 50) internal/js_parser/js_parser.go:5019 — parser.parseExprOrLetOrUsingStmt has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
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 15 (39 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 13 (34 pts), loops 3 (7 pts), match/switch 2 (5 pts), 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:883 — parser.parseNthIndex has cognitive complexity 49 (threshold 15). Drivers by points: if/else 31 (46 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bundler.RunOnResolvePlugins (cognitive 48) · ×1
  • bundler.RunOnResolvePlugins (cognitive 48) REDACTED:1052 — bundler.RunOnResolvePlugins has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 4 (9 pts), 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 9 (36 pts), loops 2 (5 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · test262.checkBuildAPI (cognitive 48) · ×1
  • test262.checkBuildAPI (cognitive 48) scripts/test262.js:280 — test262.checkBuildAPI has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 9, error handling 5 (7 pts), loops 1 (nesting depth added 18). Of this number, 37 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.parseClass (cognitive 47) · ×1
  • parser.parseClass (cognitive 47) internal/js_parser/js_parser.go:6489 — parser.parseClass has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 12, loops 2 (3 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · apiHandler.broadcastBuildResult (cognitive 47) · ×1
  • apiHandler.broadcastBuildResult (cognitive 47) REDACTED:491 — apiHandler.broadcastBuildResult has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 6 (12 pts), 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 12 (28 pts), loops 4 (11 pts), boolean chains 4, match/switch 1 (2 pts), 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:5856 — parser.parseExportClause has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 6, loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.lowerObjectRestHelper (cognitive 46) · ×1
  • parser.lowerObjectRestHelper (cognitive 46) internal/js_parser/js_parser_lower.go:1452 — parser.lowerObjectRestHelper has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (30 pts), loops 5 (9 pts), 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 1647, 1473, 1543, …). 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 7 (27 pts), match/switch 2 (10 pts), loops 3 (6 pts), 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 16 (31 pts), loops 7 (10 pts), 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 · common.handlePlugins (cognitive 45) · ×1
  • common.handlePlugins (cognitive 45) lib/shared/common.ts:1169 — common.handlePlugins has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 7, error handling 1 (2 pts), loops 1 (nesting depth added 17). Of this number, 23 points are the body's own statements and 22 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scanner.reportInvalidTLA (cognitive 44) · ×1
  • scanner.reportInvalidTLA (cognitive 44) REDACTED:2887 — scanner.reportInvalidTLA has cognitive complexity 44 (threshold 15). Drivers by points: if/else 7 (31 pts), loops 3 (11 pts), boolean chains 2 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 8 (24 pts), match/switch 5 (18 pts), 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 8 (25 pts), loops 5 (15 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 14 (34 pts), loops 3 (5 pts), match/switch 2 (5 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 11 (34 pts), boolean chains 5, match/switch 3 (5 pts) (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:5735 — parser.parseImportClause has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 1, loops 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · logger.GenerateStringInJSTable (cognitive 44) · ×1
  • logger.GenerateStringInJSTable (cognitive 44) internal/logger/logger.go:1477 — logger.GenerateStringInJSTable has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (8 pts), match/switch 3 (8 pts), 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 · mdn.addFeatures (cognitive 44) · ×1
  • mdn.addFeatures (cognitive 44) compat-table/src/mdn.ts:140 — mdn.addFeatures has cognitive complexity 44 (threshold 15). Drivers by points: if/else 3 (17 pts), loops 5 (13 pts), ternaries 2 (9 pts), boolean chains 5 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Bundle.Compile (cognitive 43) · ×1
  • Bundle.Compile (cognitive 43) REDACTED:3050 — Bundle.Compile has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 6 (12 pts), match/switch 1 (5 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 13 (28 pts), boolean chains 8, loops 4 (6 pts), 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 9 (22 pts), loops 5 (13 pts), 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 15 (38 pts), boolean chains 4, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 14 (34 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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 14 (28 pts), boolean chains 10, loops 2 (3 pts), 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 13 (32 pts), match/switch 4 (8 pts), 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 8 (27 pts), loops 3 (8 pts), match/switch 2 (6 pts), 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:18319 — parser.prepareForVisitPass has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (36 pts), 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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · binaryExprVisitor.checkAndPrepare (cognitive 43) · ×1
  • binaryExprVisitor.checkAndPrepare (cognitive 43) internal/js_printer/js_printer.go:3374 — binaryExprVisitor.checkAndPrepare has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 10, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.mangleLocalCSS (cognitive 43) · ×1
  • linkerContext.mangleLocalCSS (cognitive 43) internal/linker/linker.go:450 — linkerContext.mangleLocalCSS has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 7 (16 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.findImportedPartsInJSOrder (cognitive 43) · ×1
  • linkerContext.findImportedPartsInJSOrder (cognitive 43) internal/linker/linker.go:4144 — linkerContext.findImportedPartsInJSOrder has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 4 (7 pts), boolean chains 5 (nesting depth added 23). Most of this is not in the body itself: 2 of the 43 points are its own statements and the rest belongs to one function literal inside it that branches (line 4168). 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 · resolverQuery.resolveToUnqualified (cognitive 43) · ×1
  • resolverQuery.resolveToUnqualified (cognitive 43) internal/resolver/yarnpnp.go:148 — resolverQuery.resolveToUnqualified has cognitive complexity 43 (threshold 15). Drivers by points: if/else 28 (41 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_lexer.decodeEscapesInToken (cognitive 42) · ×1
  • css_lexer.decodeEscapesInToken (cognitive 42) internal/css_lexer/css_lexer.go:997 — css_lexer.decodeEscapesInToken has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HelperContext.ClassCanBeRemovedIfUnused (cognitive 42) · ×1
  • HelperContext.ClassCanBeRemovedIfUnused (cognitive 42) internal/js_ast/js_ast_helpers.go:2335 — HelperContext.ClassCanBeRemovedIfUnused has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (32 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.lateConstantFoldUnaryOrBinaryOrIfExpr (cognitive 42) · ×1
  • printer.lateConstantFoldUnaryOrBinaryOrIfExpr (cognitive 42) internal/js_printer/js_printer.go:1765 — printer.lateConstantFoldUnaryOrBinaryOrIfExpr has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (35 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 24). 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 · js_ast.IsBinaryNullAndUndefined (cognitive 41) · ×1
  • js_ast.IsBinaryNullAndUndefined (cognitive 41) internal/js_ast/js_ast_helpers.go:1379 — js_ast.IsBinaryNullAndUndefined has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (38 pts), boolean chains 3 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.skipTypeScriptObjectType (cognitive 41) · ×1
  • parser.skipTypeScriptObjectType (cognitive 41) internal/js_parser/ts_parser.go:557 — parser.skipTypeScriptObjectType has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 5, match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · duplicateCaseChecker.check (cognitive 41) · ×1
  • duplicateCaseChecker.check (cognitive 41) internal/js_parser/js_parser.go:881 — duplicateCaseChecker.check has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (38 pts), loops 1 (3 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · logger.formatLineSpan (cognitive 41) · ×1
  • logger.formatLineSpan (cognitive 41) internal/logger/style.go:125 — logger.formatLineSpan has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25 (38 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.esmPackageImportsExportsResolve (cognitive 41) · ×1
  • resolverQuery.esmPackageImportsExportsResolve (cognitive 41) internal/resolver/package_json.go:997 — resolverQuery.esmPackageImportsExportsResolve has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (36 pts), boolean chains 4, loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.parseAttributeSelector (cognitive 40) · ×1
  • parser.parseAttributeSelector (cognitive 40) internal/css_parser/css_parser_selector.go:556 — parser.parseAttributeSelector has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 3, match/switch 2 (3 pts) (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 · fs.ParseYarnPnPVirtualPath (cognitive 40) · ×1
  • fs.ParseYarnPnPVirtualPath (cognitive 40) internal/fs/fs_zip.go:337 — fs.ParseYarnPnPVirtualPath has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · printer.printDecorators (cognitive 40) · ×1
  • printer.printDecorators (cognitive 40) internal/js_printer/js_printer.go:919 — printer.printDecorators has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (28 pts), match/switch 2 (5 pts), jumps 3, loops 2 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_parser.removeColorInterpolation (cognitive 39) · ×1
  • css_parser.removeColorInterpolation (cognitive 39) internal/css_parser/css_decls_gradient.go:362 — css_parser.removeColorInterpolation has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (24 pts), match/switch 2 (11 pts), boolean chains 3, loops 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · css_parser.parseRangeMediaFeature (cognitive 39) · ×1
  • css_parser.parseRangeMediaFeature (cognitive 39) internal/css_parser/css_parser_media.go:273 — css_parser.parseRangeMediaFeature has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (35 pts), boolean chains 4 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.processListStyleShorthand (cognitive 39) · ×1
  • parser.processListStyleShorthand (cognitive 39) internal/css_parser/css_decls_list_style.go:20 — parser.processListStyleShorthand has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 2 (6 pts), boolean chains 5, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.warnAboutDuplicateProperties (cognitive 39) · ×1
  • parser.warnAboutDuplicateProperties (cognitive 39) internal/js_parser/js_parser.go:1043 — parser.warnAboutDuplicateProperties has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 6, match/switch 1 (6 pts), loops 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · resolverQuery.esmPackageTargetReverseResolve (cognitive 39) · ×1
  • resolverQuery.esmPackageTargetReverseResolve (cognitive 39) internal/resolver/package_json.go:1401 — resolverQuery.esmPackageTargetReverseResolve has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 24). 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 · api.validateDefines (cognitive 39) · ×1
  • api.validateDefines (cognitive 39) REDACTED:569 — api.validateDefines has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 4, match/switch 1 (4 pts), boolean chains 3 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.insertPrefixedDeclaration (cognitive 38) · ×1
  • parser.insertPrefixedDeclaration (cognitive 38) internal/css_parser/css_decls.go:424 — parser.insertPrefixedDeclaration has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 4 (9 pts), boolean chains 5, loops 2 (5 pts) (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.parseAsyncPrefixExpr (cognitive 38) · ×1
  • parser.parseAsyncPrefixExpr (cognitive 38) internal/js_parser/js_parser.go:2992 — parser.parseAsyncPrefixExpr has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.parseDecorator (cognitive 38) · ×1
  • parser.parseDecorator (cognitive 38) internal/js_parser/js_parser.go:6956 — parser.parseDecorator has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 4, jumps 3, match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.parseTypeScriptEnumStmt (cognitive 38) · ×1
  • parser.parseTypeScriptEnumStmt (cognitive 38) internal/js_parser/ts_parser.go:1360 — parser.parseTypeScriptEnumStmt has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 4, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.generateGlobalNamePrefix (cognitive 38) · ×1
  • linkerContext.generateGlobalNamePrefix (cognitive 38) internal/linker/linker.go:6004 — linkerContext.generateGlobalNamePrefix has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (33 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printNumber (cognitive 37) · ×1
  • printer.printNumber (cognitive 37) internal/js_printer/js_printer.go:484 — printer.printNumber has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.generateChunksInParallel (cognitive 37) · ×1
  • linkerContext.generateChunksInParallel (cognitive 37) internal/linker/linker.go:603 — linkerContext.generateChunksInParallel has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 7 (11 pts), match/switch 4 (10 pts), boolean chains 1 (nesting depth added 19). Most of this is not in the body itself: 9 of the 37 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.
D2 · Cognitive Complexity · InputFile.renderHover (cognitive 37) · ×1
  • InputFile.renderHover (cognitive 37) scripts/graph-debugger.html:160 — InputFile.renderHover has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 7 (17 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Bundle.computeDataForSourceMapsInParallel (cognitive 36) · ×1
  • Bundle.computeDataForSourceMapsInParallel (cognitive 36) REDACTED:3258 — Bundle.computeDataForSourceMapsInParallel has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 2 (6 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 23). Most of this is not in the body itself: 7 of the 36 points are its own statements and the rest belongs to one function literal inside it that branches (line 3278). 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 · Token.Equal (cognitive 36) · ×1
  • Token.Equal (cognitive 36) internal/css_ast/css_ast.go:163 — Token.Equal has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (33 pts), boolean chains 3 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.instantiateDefineExpr (cognitive 36) · ×1
  • parser.instantiateDefineExpr (cognitive 36) internal/js_parser/js_parser.go:12678 — parser.instantiateDefineExpr has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.lowerAndMangleBoxShadow (cognitive 35) · ×1
  • parser.lowerAndMangleBoxShadow (cognitive 35) internal/css_parser/css_decls_box_shadow.go:10 — parser.lowerAndMangleBoxShadow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.mangleFamilyNameOrGenericName (cognitive 35) · ×1
  • parser.mangleFamilyNameOrGenericName (cognitive 35) internal/css_parser/css_decls_font_family.go:77 — parser.mangleFamilyNameOrGenericName has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.scanForEndOfRule (cognitive 35) · ×1
  • parser.scanForEndOfRule (cognitive 35) internal/css_parser/css_parser.go:2308 — parser.scanForEndOfRule has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lexer.scanIdentifierWithEscapes (cognitive 35) · ×1
  • Lexer.scanIdentifierWithEscapes (cognitive 35) internal/js_lexer/js_lexer.go:1641 — Lexer.scanIdentifierWithEscapes has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 2 (10 pts), loops 3 (9 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.mangleProps (cognitive 35) · ×1
  • linkerContext.mangleProps (cognitive 35) internal/linker/linker.go:352 — linkerContext.mangleProps has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 8 (13 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serviceType.handleBuildRequest (cognitive 34) · ×1
  • serviceType.handleBuildRequest (cognitive 34) REDACTED:597 — serviceType.handleBuildRequest has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 4, loops 1 (nesting depth added 9). Of this number, 16 points are the body's own statements and 18 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 · js_ast.ValuesLookTheSame (cognitive 34) · ×1
  • js_ast.ValuesLookTheSame (cognitive 34) internal/js_ast/js_ast_helpers.go:1593 — js_ast.ValuesLookTheSame has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 9, loops 1 (3 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseFnStmt (cognitive 34) · ×1
  • parser.parseFnStmt (cognitive 34) internal/js_parser/js_parser.go:6758 — parser.parseFnStmt has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 8, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · linkerContext.markFileLiveForTreeShaking (cognitive 34) · ×1
  • linkerContext.markFileLiveForTreeShaking (cognitive 34) internal/linker/linker.go:3220 — linkerContext.markFileLiveForTreeShaking has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · test262-async.main (cognitive 34) · ×1
  • test262-async.main (cognitive 34) scripts/test262-async.js:19 — test262-async.main has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 13). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to 3 function items inside it that branch (check, a function literal at line 53, a function literal at line 55). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · lexer.consumeNumeric (cognitive 33) · ×1
  • lexer.consumeNumeric (cognitive 33) internal/css_lexer/css_lexer.go:900 — lexer.consumeNumeric has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 9, loops 3 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printQuotedWithQuote (cognitive 33) · ×1
  • printer.printQuotedWithQuote (cognitive 33) internal/css_printer/css_printer.go:903 — printer.printQuotedWithQuote has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · common.parseStackLinesV8 (cognitive 33) · ×1
  • common.parseStackLinesV8 (cognitive 33) lib/shared/common.ts:1620 — common.parseStackLinesV8 has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (16 pts), error handling 1 (5 pts), loops 2 (5 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.skipTypeScriptBinding (cognitive 32) · ×1
  • parser.skipTypeScriptBinding (cognitive 32) internal/js_parser/ts_parser.go:19 — parser.skipTypeScriptBinding has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (6 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 19). 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 · compat.CompareSemver (cognitive 31) · ×1
  • compat.CompareSemver (cognitive 31) internal/compat/compat.go:60 — compat.CompareSemver has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.breakOutputIntoPieces (cognitive 31) · ×1
  • linkerContext.breakOutputIntoPieces (cognitive 31) internal/linker/linker.go:6744 — linkerContext.breakOutputIntoPieces has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (6 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.substituteAmpersandsInCompoundSelector (cognitive 30) · ×1
  • parser.substituteAmpersandsInCompoundSelector (cognitive 30) internal/css_parser/css_nesting.go:370 — parser.substituteAmpersandsInCompoundSelector has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parsePath (cognitive 30) · ×1
  • parser.parsePath (cognitive 30) internal/js_parser/js_parser.go:6648 — parser.parsePath has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.warnAboutEqualityCheck (cognitive 30) · ×1
  • parser.warnAboutEqualityCheck (cognitive 30) internal/js_parser/js_parser.go:12867 — parser.warnAboutEqualityCheck has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 2, match/switch 1 (nesting depth added 17). 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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.warnAboutImportNamespaceCall (cognitive 30) · ×1
  • parser.warnAboutImportNamespaceCall (cognitive 30) internal/js_parser/js_parser.go:16859 — parser.warnAboutImportNamespaceCall has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · linkerContext.validateComposesFromProperties (cognitive 30) · ×1
  • linkerContext.validateComposesFromProperties (cognitive 30) internal/linker/linker.go:2030 — linkerContext.validateComposesFromProperties has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 18). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to one function literal inside it that branches (line 2041). 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 · logger.NewStderrLog (cognitive 30) · ×1
  • logger.NewStderrLog (cognitive 30) internal/logger/logger.go:685 — logger.NewStderrLog has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, match/switch 3, loops 1 (nesting depth added 9). Most of this is not in the body itself: 2 of the 30 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.
D2 · Cognitive Complexity · resolverQuery.esmPackageExportsResolve (cognitive 30) · ×1
  • resolverQuery.esmPackageExportsResolve (cognitive 30) internal/resolver/package_json.go:948 — resolverQuery.esmPackageExportsResolve has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · node-platform.generateBinPath (cognitive 30) · ×1
  • node-platform.generateBinPath (cognitive 30) lib/npm/node-platform.ts:116 — node-platform.generateBinPath has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), error handling 3 (6 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lexer.consumeURL (cognitive 29) · ×1
  • lexer.consumeURL (cognitive 29) internal/css_lexer/css_lexer.go:795 — lexer.consumeURL has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (5 pts), jumps 4, match/switch 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseDeclaration (cognitive 29) · ×1
  • parser.parseDeclaration (cognitive 29) internal/css_parser/css_parser.go:2391 — parser.parseDeclaration has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 5, match/switch 1 (2 pts), jumps 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.MangleObjectSpread (cognitive 29) · ×1
  • js_ast.MangleObjectSpread (cognitive 29) internal/js_ast/js_ast_helpers.go:2737 — js_ast.MangleObjectSpread has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (18 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MinifyRenamer.AssignNamesByFrequency (cognitive 29) · ×1
  • MinifyRenamer.AssignNamesByFrequency (cognitive 29) internal/renamer/renamer.go:260 — MinifyRenamer.AssignNamesByFrequency has cognitive complexity 29 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 2 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 19). 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 · apiHandler.serveEventStream (cognitive 29) · ×1
  • apiHandler.serveEventStream (cognitive 29) REDACTED:418 — apiHandler.serveEventStream has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 2 (7 pts), loops 2 (6 pts) (nesting depth added 20). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 438). 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 · scanner.preprocessInjectedFiles (cognitive 28) · ×1
  • scanner.preprocessInjectedFiles (cognitive 28) REDACTED:1697 — scanner.preprocessInjectedFiles has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 3, loops 3 (nesting depth added 11). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 1756). 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 · lexer.consumeToEndOfMultiLineComment (cognitive 28) · ×1
  • lexer.consumeToEndOfMultiLineComment (cognitive 28) internal/css_lexer/css_lexer.go:493 — lexer.consumeToEndOfMultiLineComment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (6 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.mangleFont (cognitive 28) · ×1
  • parser.mangleFont (cognitive 28) internal/css_parser/css_decls_font.go:13 — parser.mangleFont has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lexer.ScanRegExp (cognitive 28) · ×1
  • Lexer.ScanRegExp (cognitive 28) internal/js_lexer/js_lexer.go:2034 — Lexer.ScanRegExp has cognitive complexity 28 (threshold 15). Drivers by points: loops 4 (13 pts), if/else 3 (7 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 17). Of this number, 26 points are the body's own statements and 2 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 · parser.canMergeSymbols (cognitive 28) · ×1
  • parser.canMergeSymbols (cognitive 28) internal/js_parser/js_parser.go:1391 — parser.canMergeSymbols has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 15, if/else 11, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.visitBinding (cognitive 28) · ×1
  • parser.visitBinding (cognitive 28) internal/js_parser/js_parser.go:10083 — parser.visitBinding has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 17). 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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.globPatternFromExpr (cognitive 28) · ×1
  • parser.globPatternFromExpr (cognitive 28) internal/js_parser/js_parser.go:16758 — parser.globPatternFromExpr has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · Source.CommentTextWithoutIndent (cognitive 28) · ×1
  • Source.CommentTextWithoutIndent (cognitive 28) internal/logger/logger.go:570 — Source.CommentTextWithoutIndent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 5 (6 pts), match/switch 2 (4 pts), boolean chains 3, jumps 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LineColumnTracker.scanTo (cognitive 28) · ×1
  • LineColumnTracker.scanTo (cognitive 28) internal/logger/logger.go:1285 — LineColumnTracker.scanTo has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.validateExternals (cognitive 28) · ×1
  • api.validateExternals (cognitive 28) REDACTED:448 — api.validateExternals has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · compat-table.mergeAllTestResults (cognitive 28) · ×1
  • compat-table.mergeAllTestResults (cognitive 28) compat-table/src/compat-table.ts:172 — compat-table.mergeAllTestResults has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (8 pts) (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 · main.decodePacket (cognitive 27) · ×1
  • main.decodePacket (cognitive 27) cmd/esbuild/stdio_protocol.go:110 — main.decodePacket has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 13). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 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.
D2 · Cognitive Complexity · calcSum.convertToToken (cognitive 27) · ×1
  • calcSum.convertToToken (cognitive 27) internal/css_parser/css_reduce_calc.go:100 — calcSum.convertToToken has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_lexer.RangeOfIdentifier (cognitive 27) · ×1
  • js_lexer.RangeOfIdentifier (cognitive 27) internal/js_lexer/js_lexer.go:631 — js_lexer.RangeOfIdentifier has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.lowerSuperPropertyOrPrivateInAssign (cognitive 27) · ×1
  • parser.lowerSuperPropertyOrPrivateInAssign (cognitive 27) internal/js_parser/js_parser_lower_class.go:174 — parser.lowerSuperPropertyOrPrivateInAssign has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 15). 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 · lowerUsingDeclarationContext.scanStmts (cognitive 27) · ×1
  • lowerUsingDeclarationContext.scanStmts (cognitive 27) internal/js_parser/js_parser_lower.go:1931 — lowerUsingDeclarationContext.scanStmts has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.markFileReachableForCodeSplitting (cognitive 27) · ×1
  • linkerContext.markFileReachableForCodeSplitting (cognitive 27) internal/linker/linker.go:3167 — linkerContext.markFileReachableForCodeSplitting has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (9 pts), boolean chains 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · logger.msgString (cognitive 27) · ×1
  • logger.msgString (cognitive 27) internal/logger/style_default.go:43 — logger.msgString has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.checkForBuiltInNodeModules (cognitive 27) · ×1
  • resolverQuery.checkForBuiltInNodeModules (cognitive 27) internal/resolver/resolver.go:2539 — resolverQuery.checkForBuiltInNodeModules has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · common.createChannel.transform (cognitive 27) · ×1
  • common.createChannel.transform (cognitive 27) lib/shared/common.ts:689 — common.createChannel.transform has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 6). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (start, a function literal at line 729, a function literal at line 724, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · bundler.ResolveFailureErrorTextSuggestionNotes (cognitive 26) · ×1
  • bundler.ResolveFailureErrorTextSuggestionNotes (cognitive 26) REDACTED:803 — bundler.ResolveFailureErrorTextSuggestionNotes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bundler.lowestCommonAncestorDirectory (cognitive 26) · ×1
  • bundler.lowestCommonAncestorDirectory (cognitive 26) REDACTED:2119 — bundler.lowestCommonAncestorDirectory has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scanner.maybeParseFile (cognitive 26) · ×1
  • scanner.maybeParseFile (cognitive 26) REDACTED:1540 — scanner.maybeParseFile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseMediaCondition (cognitive 26) · ×1
  • parser.parseMediaCondition (cognitive 26) internal/css_parser/css_parser_media.go:111 — parser.parseMediaCondition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_parser.analyzeSwitchCasesForLiveness (cognitive 26) · ×1
  • js_parser.analyzeSwitchCasesForLiveness (cognitive 26) internal/js_parser/js_parser.go:766 — js_parser.analyzeSwitchCasesForLiveness has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · js_parser.mangleFor (cognitive 26) · ×1
  • js_parser.mangleFor (cognitive 26) internal/js_parser/js_parser.go:10184 — js_parser.mangleFor has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.parseDecorators (cognitive 26) · ×1
  • parser.parseDecorators (cognitive 26) internal/js_parser/js_parser.go:6890 — parser.parseDecorators has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.generateClosureForTypeScriptNamespaceOrEnum (cognitive 26) · ×1
  • parser.generateClosureForTypeScriptNamespaceOrEnum (cognitive 26) internal/js_parser/ts_parser.go:1822 — parser.generateClosureForTypeScriptNamespaceOrEnum has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.preventExportsFromBeingRenamed (cognitive 26) · ×1
  • linkerContext.preventExportsFromBeingRenamed (cognitive 26) internal/linker/linker.go:6927 — linkerContext.preventExportsFromBeingRenamed has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (5 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_lexer.RangeOfIdentifier (cognitive 25) · ×1
  • css_lexer.RangeOfIdentifier (cognitive 25) internal/css_lexer/css_lexer.go:615 — css_lexer.RangeOfIdentifier has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.ToBooleanWithSideEffects (cognitive 25) · ×1
  • js_ast.ToBooleanWithSideEffects (cognitive 25) internal/js_ast/js_ast_helpers.go:2014 — js_ast.ToBooleanWithSideEffects has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 13). 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 · js_lexer.decodeJSXEntities (cognitive 25) · ×1
  • js_lexer.decodeJSXEntities (cognitive 25) internal/js_lexer/js_lexer.go:2095 — js_lexer.decodeJSXEntities has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parser.findSymbol (cognitive 25) · ×1
  • parser.findSymbol (cognitive 25) internal/js_parser/js_parser.go:8682 — parser.findSymbol has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · Options.Equal (cognitive 25) · ×1
  • Options.Equal (cognitive 25) internal/js_parser/js_parser.go:539 — Options.Equal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · linkerContext.addExportsForExportStar (cognitive 25) · ×1
  • linkerContext.addExportsForExportStar (cognitive 25) internal/linker/linker.go:2970 — linkerContext.addExportsForExportStar has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (7 pts), jumps 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · logger.PlatformIndependentPathDirBaseExt (cognitive 25) · ×1
  • logger.PlatformIndependentPathDirBaseExt (cognitive 25) internal/logger/logger.go:353 — logger.PlatformIndependentPathDirBaseExt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 8, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sourcemap.GenerateLineOffsetTables (cognitive 25) · ×1
  • sourcemap.GenerateLineOffsetTables (cognitive 25) internal/sourcemap/sourcemap.go:513 — sourcemap.GenerateLineOffsetTables has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.validateFeatures (cognitive 25) · ×1
  • api.validateFeatures (cognitive 25) REDACTED:313 — api.validateFeatures has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 2, loops 2, match/switch 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · api.transformImpl (cognitive 25) · ×1
  • api.transformImpl (cognitive 25) REDACTED:1711 — api.transformImpl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.printMangleCache (cognitive 25) · ×1
  • cli.printMangleCache (cognitive 25) pkg/cli/mangle_cache.go:100 — cli.printMangleCache has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (10 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · destructuring-fuzzer.generateTestCase (cognitive 25) · ×1
  • destructuring-fuzzer.generateTestCase (cognitive 25) scripts/destructuring-fuzzer.js:1 — destructuring-fuzzer.generateTestCase has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 3 (5 pts), ternaries 3 (4 pts), loops 2 (nesting depth added 9). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 4 function items inside it that branch (object, array, patternAndValue, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · bundler.PathRelativeToOutbase (cognitive 24) · ×1
  • bundler.PathRelativeToOutbase (cognitive 24) REDACTED:3443 — bundler.PathRelativeToOutbase has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.MaybeSimplifyEqualityComparison (cognitive 24) · ×1
  • js_ast.MaybeSimplifyEqualityComparison (cognitive 24) internal/js_ast/js_ast_helpers.go:141 — js_ast.MaybeSimplifyEqualityComparison has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · printer.simplifyUnusedExpr (cognitive 24) · ×1
  • printer.simplifyUnusedExpr (cognitive 24) internal/js_printer/js_printer.go:1673 — printer.simplifyUnusedExpr has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (3 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 13). 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 · logger.wrapWordsInString (cognitive 24) · ×1
  • logger.wrapWordsInString (cognitive 24) internal/logger/style.go:59 — logger.wrapWordsInString has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 2 (7 pts), boolean chains 4, jumps 1 (nesting depth added 11). 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 · resolverQuery.loadAsFile (cognitive 24) · ×1
  • resolverQuery.loadAsFile (cognitive 24) internal/resolver/resolver.go:1732 — resolverQuery.loadAsFile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). Of this number, 19 points are the body's own statements and 5 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.recursivelyValidateTLA (cognitive 23) · ×1
  • scanner.recursivelyValidateTLA (cognitive 23) REDACTED:2851 — scanner.recursivelyValidateTLA has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · config.ProcessDefines (cognitive 23) · ×1
  • config.ProcessDefines (cognitive 23) internal/config/globals.go:975 — config.ProcessDefines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printImportAssertOrWithClause (cognitive 23) · ×1
  • printer.printImportAssertOrWithClause (cognitive 23) internal/js_printer/js_printer.go:4028 — printer.printImportAssertOrWithClause has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linker.Link (cognitive 23) · ×1
  • linker.Link (cognitive 23) internal/linker/linker.go:227 — linker.Link has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linkerContext.createExportsForFile (cognitive 23) · ×1
  • linkerContext.createExportsForFile (cognitive 23) internal/linker/linker.go:2265 — linkerContext.createExportsForFile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceMapPieces.Finalize (cognitive 23) · ×1
  • SourceMapPieces.Finalize (cognitive 23) internal/sourcemap/sourcemap.go:275 — SourceMapPieces.Finalize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_parser.tryToParseValue (cognitive 22) · ×1
  • css_parser.tryToParseValue (cognitive 22) internal/css_parser/css_decls_gradient.go:636 — css_parser.tryToParseValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · borderRadiusTracker.mangleCorners (cognitive 22) · ×1
  • borderRadiusTracker.mangleCorners (cognitive 22) internal/css_parser/css_decls_border_radius.go:38 — borderRadiusTracker.mangleCorners has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.tryToGenerateColor (cognitive 22) · ×1
  • parser.tryToGenerateColor (cognitive 22) internal/css_parser/css_decls_color.go:857 — parser.tryToGenerateColor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fs.tryToReadZipArchive (cognitive 22) · ×1
  • fs.tryToReadZipArchive (cognitive 22) internal/fs/fs_zip.go:102 — fs.tryToReadZipArchive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mockFS.Rel (cognitive 22) · ×1
  • mockFS.Rel (cognitive 22) internal/fs/fs_mock.go:240 — mockFS.Rel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.TryToInsertOptionalChain (cognitive 22) · ×1
  • js_ast.TryToInsertOptionalChain (cognitive 22) internal/js_ast/js_ast_helpers.go:1661 — js_ast.TryToInsertOptionalChain has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · parser.convertExprToBinding (cognitive 22) · ×1
  • parser.convertExprToBinding (cognitive 22) internal/js_parser/js_parser.go:3399 — parser.convertExprToBinding has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 13). 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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.maybeInlineIIFE (cognitive 22) · ×1
  • parser.maybeInlineIIFE (cognitive 22) internal/js_parser/js_parser.go:11927 — parser.maybeInlineIIFE has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.isDotOrIndexDefineMatch (cognitive 22) · ×1
  • parser.isDotOrIndexDefineMatch (cognitive 22) internal/js_parser/js_parser.go:12619 — parser.isDotOrIndexDefineMatch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, match/switch 1 (nesting depth added 10). 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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.lowerTemplateLiteral (cognitive 22) · ×1
  • parser.lowerTemplateLiteral (cognitive 22) internal/js_parser/js_parser_lower.go:1765 — parser.lowerTemplateLiteral has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lowerClassContext.analyzeProperty (cognitive 22) · ×1
  • lowerClassContext.analyzeProperty (cognitive 22) internal/js_parser/js_parser_lower_class.go:1124 — lowerClassContext.analyzeProperty has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 9 (11 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · printer.printExprCommentsAtLoc (cognitive 22) · ×1
  • printer.printExprCommentsAtLoc (cognitive 22) internal/js_printer/js_printer.go:1917 — printer.printExprCommentsAtLoc has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · printer.printIf (cognitive 22) · ×1
  • printer.printIf (cognitive 22) internal/js_printer/js_printer.go:3825 — printer.printIf has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (22 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · linker.wrapRulesWithConditions (cognitive 22) · ×1
  • linker.wrapRulesWithConditions (cognitive 22) internal/linker/linker.go:6478 — linker.wrapRulesWithConditions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printWithEscape (cognitive 21) · ×1
  • printer.printWithEscape (cognitive 21) internal/css_printer/css_printer.go:863 — printer.printWithEscape has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 9, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.ShouldFoldBinaryOperatorWhenMinifying (cognitive 21) · ×1
  • js_ast.ShouldFoldBinaryOperatorWhenMinifying (cognitive 21) internal/js_ast/js_ast_helpers.go:1140 — js_ast.ShouldFoldBinaryOperatorWhenMinifying has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · js_lexer.fixWhitespaceAndDecodeJSXEntities (cognitive 21) · ×1
  • js_lexer.fixWhitespaceAndDecodeJSXEntities (cognitive 21) internal/js_lexer/js_lexer.go:2135 — js_lexer.fixWhitespaceAndDecodeJSXEntities has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.lowerClass (cognitive 21) · ×1
  • parser.lowerClass (cognitive 21) internal/js_parser/js_parser_lower_class.go:683 — parser.lowerClass has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolver.isValidTSConfigPathNoBaseURLPattern (cognitive 21) · ×1
  • resolver.isValidTSConfigPathNoBaseURLPattern (cognitive 21) internal/resolver/tsconfig_json.go:437 — resolver.isValidTSConfigPathNoBaseURLPattern has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.parseServeOptionsImpl (cognitive 21) · ×1
  • cli.parseServeOptionsImpl (cognitive 21) pkg/cli/cli_impl.go:1427 — cli.parseServeOptionsImpl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · borderRadiusTracker.mangleCorner (cognitive 20) · ×1
  • borderRadiusTracker.mangleCorner (cognitive 20) internal/css_parser/css_decls_border_radius.go:108 — borderRadiusTracker.mangleCorner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.maybeSimplifyMediaNot (cognitive 20) · ×1
  • parser.maybeSimplifyMediaNot (cognitive 20) internal/css_parser/css_parser_media.go:315 — parser.maybeSimplifyMediaNot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolver.globstarToEscapedRegexp (cognitive 20) · ×1
  • resolver.globstarToEscapedRegexp (cognitive 20) internal/resolver/package_json.go:481 — resolver.globstarToEscapedRegexp has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · apiHandler.matchQueryPathToResult (cognitive 20) · ×1
  • apiHandler.matchQueryPathToResult (cognitive 20) REDACTED:616 — apiHandler.matchQueryPathToResult has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Bundle.generateMetadataJSON (cognitive 19) · ×1
  • Bundle.generateMetadataJSON (cognitive 19) REDACTED:3321 — Bundle.generateMetadataJSON has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lexer.wouldStartNumber (cognitive 19) · ×1
  • lexer.wouldStartNumber (cognitive 19) internal/css_lexer/css_lexer.go:663 — lexer.wouldStartNumber has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lexer.consumeIdentLike (cognitive 19) · ×1
  • lexer.consumeIdentLike (cognitive 19) internal/css_lexer/css_lexer.go:759 — lexer.consumeIdentLike has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 1 (4 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DeadRuleRemover.RemoveDeadRulesInPlace (cognitive 19) · ×1
  • DeadRuleRemover.RemoveDeadRulesInPlace (cognitive 19) internal/css_parser/css_parser.go:742 — DeadRuleRemover.RemoveDeadRulesInPlace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), jumps 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fs.MockFS (cognitive 19) · ×1
  • fs.MockFS (cognitive 19) internal/fs/fs_mock.go:29 — fs.MockFS has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · helpers.PrettyPrintedStack (cognitive 19) · ×1
  • helpers.PrettyPrintedStack (cognitive 19) internal/helpers/stack.go:8 — helpers.PrettyPrintedStack has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parsePropertyBinding (cognitive 19) · ×1
  • parser.parsePropertyBinding (cognitive 19) internal/js_parser/js_parser.go:2741 — parser.parsePropertyBinding has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.generateClosureForTypeScriptEnum (cognitive 19) · ×1
  • parser.generateClosureForTypeScriptEnum (cognitive 19) internal/js_parser/ts_parser.go:1954 — parser.generateClosureForTypeScriptEnum has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChunkBuilder.updateGeneratedLineAndColumn (cognitive 19) · ×1
  • ChunkBuilder.updateGeneratedLineAndColumn (cognitive 19) internal/sourcemap/sourcemap.go:744 — ChunkBuilder.updateGeneratedLineAndColumn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bundler.logPluginMessages (cognitive 18) · ×1
  • bundler.logPluginMessages (cognitive 18) REDACTED:993 — bundler.logPluginMessages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_parser.mangleNumber (cognitive 18) · ×1
  • css_parser.mangleNumber (cognitive 18) internal/css_parser/css_parser.go:2123 — css_parser.mangleNumber has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.parseURLOrString (cognitive 18) · ×1
  • parser.parseURLOrString (cognitive 18) internal/css_parser/css_parser.go:986 — parser.parseURLOrString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · helpers.DecodeWTF8Rune (cognitive 18) · ×1
  • helpers.DecodeWTF8Rune (cognitive 18) internal/helpers/utf.go:168 — helpers.DecodeWTF8Rune has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · js_ast.ConvertBindingToExpr (cognitive 18) · ×1
  • js_ast.ConvertBindingToExpr (cognitive 18) internal/js_ast/js_ast_helpers.go:471 — js_ast.ConvertBindingToExpr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 9). 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 · js_ast.simplifyUnusedStringAdditionChain (cognitive 18) · ×1
  • js_ast.simplifyUnusedStringAdditionChain (cognitive 18) internal/js_ast/js_ast_helpers.go:893 — js_ast.simplifyUnusedStringAdditionChain has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · js_ast.IsIdentifierUTF16 (cognitive 18) · ×1
  • js_ast.IsIdentifierUTF16 (cognitive 18) internal/js_ast/js_ident.go:77 — js_ast.IsIdentifierUTF16 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (js_ast.IsIdentifierES5AndESNextUTF16) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · js_ast.IsIdentifierES5AndESNextUTF16 (cognitive 18) · ×1
  • js_ast.IsIdentifierES5AndESNextUTF16 (cognitive 18) internal/js_ast/js_ident.go:105 — js_ast.IsIdentifierES5AndESNextUTF16 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (js_ast.IsIdentifierUTF16) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · js_parser.duplicateCaseEquals (cognitive 18) · ×1
  • js_parser.duplicateCaseEquals (cognitive 18) internal/js_parser/js_parser.go:979 — js_parser.duplicateCaseEquals has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 7, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · js_parser.isValidJSON (cognitive 18) · ×1
  • js_parser.isValidJSON (cognitive 18) internal/js_parser/json_parser.go:218 — js_parser.isValidJSON has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 10). 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.warnAboutTypeofAndString (cognitive 18) · ×1
  • parser.warnAboutTypeofAndString (cognitive 18) internal/js_parser/js_parser.go:12832 — parser.warnAboutTypeofAndString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.lowerObjectSpread (cognitive 18) · ×1
  • parser.lowerObjectSpread (cognitive 18) internal/js_parser/js_parser_lower.go:1010 — parser.lowerObjectSpread has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lowerClassContext.insertInitializersIntoConstructor (cognitive 18) · ×1
  • lowerClassContext.insertInitializersIntoConstructor (cognitive 18) internal/js_parser/js_parser_lower_class.go:1974 — lowerClassContext.insertInitializersIntoConstructor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linker.mergeAdjacentLocalStmts (cognitive 18) · ×1
  • linker.mergeAdjacentLocalStmts (cognitive 18) internal/linker/linker.go:4590 — linker.mergeAdjacentLocalStmts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Source.RangeOfString (cognitive 18) · ×1
  • Source.RangeOfString (cognitive 18) internal/logger/logger.go:498 — Source.RangeOfString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · numberScope.findUnusedName (cognitive 18) · ×1
  • numberScope.findUnusedName (cognitive 18) internal/renamer/renamer.go:580 — numberScope.findUnusedName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · caniuse.addFeatures (cognitive 18) · ×1
  • caniuse.addFeatures (cognitive 18) compat-table/src/caniuse.ts:68 — caniuse.addFeatures has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (8 pts) (nesting depth added 12). 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 · main.runService (cognitive 17) · ×1
  • main.runService (cognitive 17) REDACTED:84 — main.runService has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 7). Of this number, 12 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RAtKeyframes.Equal (cognitive 17) · ×1
  • RAtKeyframes.Equal (cognitive 17) internal/css_ast/css_ast.go:560 — RAtKeyframes.Equal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComplexSelector.ContainsNestingCombinator (cognitive 17) · ×1
  • ComplexSelector.ContainsNestingCombinator (cognitive 17) internal/css_ast/css_ast.go:1172 — ComplexSelector.ContainsNestingCombinator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (7 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.lowerNestingInRule (cognitive 17) · ×1
  • parser.lowerNestingInRule (cognitive 17) internal/css_parser/css_nesting.go:11 — parser.lowerNestingInRule has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 2 (5 pts), match/switch 1 (nesting depth added 9). 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 · calcSum.partiallySimplify (cognitive 17) · ×1
  • calcSum.partiallySimplify (cognitive 17) internal/css_parser/css_reduce_calc.go:297 — calcSum.partiallySimplify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_printer.functionMultiLineCommaPeriod (cognitive 17) · ×1
  • css_printer.functionMultiLineCommaPeriod (cognitive 17) internal/css_printer/css_printer.go:1132 — css_printer.functionMultiLineCommaPeriod has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.logAssignToDefine (cognitive 17) · ×1
  • parser.logAssignToDefine (cognitive 17) internal/js_parser/js_parser.go:2016 — parser.logAssignToDefine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.parseClassStmt (cognitive 17) · ×1
  • parser.parseClassStmt (cognitive 17) internal/js_parser/js_parser.go:6395 — parser.parseClassStmt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.appendPart (cognitive 17) · ×1
  • parser.appendPart (cognitive 17) internal/js_parser/js_parser.go:17682 — parser.appendPart has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.lowerObjectRestInDecls (cognitive 17) · ×1
  • parser.lowerObjectRestInDecls (cognitive 17) internal/js_parser/js_parser_lower.go:1317 — parser.lowerObjectRestInDecls has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lowerUsingDeclarationContext.finalize (cognitive 17) · ×1
  • lowerUsingDeclarationContext.finalize (cognitive 17) internal/js_parser/js_parser_lower.go:1964 — lowerUsingDeclarationContext.finalize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_printer.QuoteIdentifier (cognitive 17) · ×1
  • js_printer.QuoteIdentifier (cognitive 17) internal/js_printer/js_printer.go:33 — js_printer.QuoteIdentifier has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printFnArgs (cognitive 17) · ×1
  • printer.printFnArgs (cognitive 17) internal/js_printer/js_printer.go:865 — printer.printFnArgs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printQuotedUTF16 (cognitive 17) · ×1
  • printer.printQuotedUTF16 (cognitive 17) internal/js_printer/js_printer.go:1353 — printer.printQuotedUTF16 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pluginImpl.onResolve (cognitive 17) · ×1
  • pluginImpl.onResolve (cognitive 17) REDACTED:1952 — pluginImpl.onResolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 1963). 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 · watcher.tryToFindDirtyPath (cognitive 17) · ×1
  • watcher.tryToFindDirtyPath (cognitive 17) REDACTED:142 — watcher.tryToFindDirtyPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · node-platform.pkgForSomeOtherPlatform (cognitive 17) · ×1
  • node-platform.pkgForSomeOtherPlatform (cognitive 17) lib/npm/node-platform.ts:86 — node-platform.pkgForSomeOtherPlatform has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 2 (6 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · test262.checkTransformAPI (cognitive 17) · ×1
  • test262.checkTransformAPI (cognitive 17) scripts/test262.js:217 — test262.checkTransformAPI has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 4, boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serviceType.handleTransformRequest (cognitive 16) · ×1
  • serviceType.handleTransformRequest (cognitive 16) REDACTED:1159 — serviceType.handleTransformRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bundler.extractSourceMapFromComment (cognitive 16) · ×1
  • bundler.extractSourceMapFromComment (cognitive 16) REDACTED:903 — bundler.extractSourceMapFromComment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · scanner.generateResultForGlobResolve (cognitive 16) · ×1
  • scanner.generateResultForGlobResolve (cognitive 16) REDACTED:2252 — scanner.generateResultForGlobResolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RAtLayer.Equal (cognitive 16) · ×1
  • RAtLayer.Equal (cognitive 16) internal/css_ast/css_ast.go:741 — RAtLayer.Equal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComplexSelector.Equal (cognitive 16) · ×1
  • ComplexSelector.Equal (cognitive 16) internal/css_ast/css_ast.go:1236 — ComplexSelector.Equal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · css_parser.containsLocalOrGlobalSelector (cognitive 16) · ×1
  • css_parser.containsLocalOrGlobalSelector (cognitive 16) internal/css_parser/css_parser_selector.go:148 — css_parser.containsLocalOrGlobalSelector has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · helpers.EncodeStringAsPercentEscapedDataURL (cognitive 16) · ×1
  • helpers.EncodeStringAsPercentEscapedDataURL (cognitive 16) internal/helpers/dataurl.go:21 — helpers.EncodeStringAsPercentEscapedDataURL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · helpers.UTF16ToStringWithValidation (cognitive 16) · ×1
  • helpers.UTF16ToStringWithValidation (cognitive 16) internal/helpers/utf.go:64 — helpers.UTF16ToStringWithValidation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · helpers.UTF16EqualsString (cognitive 16) · ×1
  • helpers.UTF16EqualsString (cognitive 16) internal/helpers/utf.go:91 — helpers.UTF16EqualsString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_ast.foldAdditionPreProcess (cognitive 16) · ×1
  • js_ast.foldAdditionPreProcess (cognitive 16) internal/js_ast/js_ast_helpers.go:1732 — js_ast.foldAdditionPreProcess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 9). 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 · js_ast.InlineSpreadsOfArrayLiterals (cognitive 16) · ×1
  • js_ast.InlineSpreadsOfArrayLiterals (cognitive 16) internal/js_ast/js_ast_helpers.go:2716 — js_ast.InlineSpreadsOfArrayLiterals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · js_parser.shouldKeepStmtInDeadControlFlow (cognitive 16) · ×1
  • js_parser.shouldKeepStmtInDeadControlFlow (cognitive 16) internal/js_parser/js_parser.go:8820 — js_parser.shouldKeepStmtInDeadControlFlow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 2 (4 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 3). 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. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.visitStmtsAndPrependTempRefs (cognitive 16) · ×1
  • parser.visitStmtsAndPrependTempRefs (cognitive 16) internal/js_parser/js_parser.go:8884 — parser.visitStmtsAndPrependTempRefs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.checkForUnusedTSImportEquals (cognitive 16) · ×1
  • parser.checkForUnusedTSImportEquals (cognitive 16) internal/js_parser/js_parser.go:17270 — parser.checkForUnusedTSImportEquals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 1 (2 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: internal/js_parser/js_parser.go holds 62 of the 370 functions over the threshold — including the worst — and 6138 of the 20194 points over it (30%), 3.3× the next-largest file (internal/linker/linker.go at 1871). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · parser.getOrCreateExportedNamespaceMembers (cognitive 16) · ×1
  • parser.getOrCreateExportedNamespaceMembers (cognitive 16) internal/js_parser/ts_parser.go:1598 — parser.getOrCreateExportedNamespaceMembers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (16 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · lowerClassContext.lowerPrivateMethod (cognitive 16) · ×1
  • lowerClassContext.lowerPrivateMethod (cognitive 16) internal/js_parser/js_parser_lower_class.go:979 — lowerClassContext.lowerPrivateMethod has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · printer.printIdentifierUTF16 (cognitive 16) · ×1
  • printer.printIdentifierUTF16 (cognitive 16) internal/js_printer/js_printer.go:454 — printer.printIdentifierUTF16 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · linker.isConditionalImportRedundant (cognitive 16) · ×1
  • linker.isConditionalImportRedundant (cognitive 16) internal/linker/linker.go:3819 — linker.isConditionalImportRedundant has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolverQuery.esmHandlePostConditions (cognitive 16) · ×1
  • resolverQuery.esmHandlePostConditions (cognitive 16) internal/resolver/package_json.go:879 — resolverQuery.esmHandlePostConditions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · resolverQuery.findLocator (cognitive 16) · ×1
  • resolverQuery.findLocator (cognitive 16) internal/resolver/yarnpnp.go:312 — resolverQuery.findLocator has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dataurl-escapes.html.check (cognitive 16) · ×1
  • dataurl-escapes.html.check (cognitive 16) scripts/dataurl-escapes.html:26 — dataurl-escapes.html.check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · test262.runCodeInHarness (cognitive 16) · ×1
  • test262.runCodeInHarness (cognitive 16) scripts/test262.js:537 — test262.runCodeInHarness has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (runCode::findModule, runCode::importModuleDynamically, runCode, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 9 shared lines) · ×1
  • Near-duplicate member family (4 members, 9 shared lines) internal/js_ast/js_ident.go:132 — internal/js_ast/js_ident.go:132-148 | internal/js_ast/js_ident.go:150-171 | internal/js_ast/js_ident.go:173-189 | internal/js_ast/js_ident.go:191-212 — These 4 members are variants of one another: a block of 9 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) internal/js_lexer/js_lexer.go:883 — internal/js_lexer/js_lexer.go:883-911 | internal/js_lexer/js_lexer.go:1300-1328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–27 lines × 2) · ×1
  • Duplicated block (10–27 lines × 2) internal/js_parser/ts_parser.go:1498 — internal/js_parser/ts_parser.go:1498-1507 | internal/js_parser/ts_parser.go:1780-1806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/js_parser/ts_parser.go:1780` 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 (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) internal/linker/linker.go:5754 — internal/linker/linker.go:5754-5779 | internal/linker/linker.go:6319-6343 — both copies are in the same file, so extract the 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:5754` 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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) internal/resolver/package_json.go:125 — internal/resolver/package_json.go:125-147 | internal/resolver/package_json.go:156-178 — both copies are in the same file, so extract the 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 (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) internal/css_parser/css_decls_color.go:505 — internal/css_parser/css_decls_color.go:505-525 | internal/css_parser/css_decls_color.go:543-563 — both copies are in the same file, so extract the 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:505` 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 (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) internal/js_parser/js_parser.go:4307 — internal/js_parser/js_parser.go:4307-4327 | internal/js_parser/js_parser.go:4418-4437 — both copies are in the same file, so extract the 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:4307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) internal/js_parser/js_parser.go:14360 — internal/js_parser/js_parser.go:14360-14379 | internal/js_parser/js_parser.go:14533-14552 — both copies are in the same file, so extract the 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:14360` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) internal/js_parser/ts_parser.go:116 — internal/js_parser/ts_parser.go:116-131 | internal/js_parser/ts_parser.go:439-450 — both copies are in the same file, so extract the 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:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) internal/resolver/yarnpnp.go:637 — internal/resolver/yarnpnp.go:637-650 | internal/resolver/yarnpnp.go:663-677 — both copies are in the same file, so extract the 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:637` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) internal/js_printer/js_printer.go:3828 — internal/js_printer/js_printer.go:3828-3841 | internal/js_printer/js_printer.go:4403-4416 | internal/js_printer/js_printer.go:4498-4511 | internal/js_printer/js_printer.go:4650-4663 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) internal/js_printer/js_printer.go:2437 — internal/js_printer/js_printer.go:2437-2450 | internal/js_printer/js_printer.go:2473-2485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) internal/css_parser/css_nesting.go:292 — internal/css_parser/css_nesting.go:292-304 | internal/css_parser/css_nesting.go:315-327 | internal/css_parser/css_nesting.go:339-351 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) internal/js_parser/js_parser.go:2970 — internal/js_parser/js_parser.go:2970-2981 | internal/js_parser/ts_parser.go:896-907 | internal/js_parser/ts_parser.go:1002-1013 | internal/js_parser/ts_parser.go:1025-1036 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also 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 (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) internal/js_parser/js_parser.go:12352 — internal/js_parser/js_parser.go:12352-12363 | internal/js_parser/js_parser.go:14919-14929 — both copies are in the same file, so extract the 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:12352` 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–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) internal/cache/cache_ast.go:44 — internal/cache/cache_ast.go:44-54 | internal/cache/cache_ast.go:155-164 — both copies are in the same file, so extract the 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:44` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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.
D4 · Code Duplication · Duplicated block (2–11 lines × 3) · ×1
  • Duplicated block (2–11 lines × 3) internal/linker/linker.go:4403 — internal/linker/linker.go:4403-4413 | internal/linker/linker.go:4428-4429 | internal/linker/linker.go:4448-4458 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/linker/linker.go:4403` 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 (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) REDACTED:392 — REDACTED:392-400 | REDACTED:408-417 — both copies are in the same file, so extract the 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 `REDACTED:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) internal/js_parser/js_parser.go:7705 — internal/js_parser/js_parser.go:7705-7711 | internal/js_parser/js_parser.go:7750-7758 — both copies are in the same file, so extract the 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 × 4) · ×1
  • Duplicated block (5 lines × 4) REDACTED:270 — REDACTED:270-274 | REDACTED:279-283 | REDACTED:289-293 | REDACTED:299-303 — 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.
M1 · Documentation (README) · README may be stale · ×1
  • README may be stale — 40 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 17 typed · 20 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/destructuring-fuzzer.js (+14 more). 0 production file(s) opt out entirely with @ts-nocheck · 2 @ts-ignore suppression(s).
R10 · Code Duplication · Duplicated block with local edits (117 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (117 matched lines × 2 locations) REDACTED:22 — REDACTED:22 · REDACTED:22 — the two spans are one implementation copied and then locally edited — 786 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (58 lines × 2 locations) · ×1
  • Duplicated block (58 lines × 2 locations) scripts/end-to-end-tests.js:9882 — scripts/end-to-end-tests.js:9882 · REDACTED:8024 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (48 lines × 4 locations) · ×1
  • Duplicated block (48 lines × 4 locations) scripts/decorator-tests.ts:3104 — scripts/decorator-tests.ts:3104 · scripts/decorator-tests.ts:3333 · scripts/decorator-tests.ts:3562 · scripts/decorator-tests.ts:3791 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (46 lines × 2 locations) · ×1
  • Duplicated block (46 lines × 2 locations) REDACTED:5404 — REDACTED:5404 · REDACTED:5469 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (43 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (43 matched lines × 2 locations) REDACTED:293 — REDACTED:293 · REDACTED:400 — the two spans are one implementation copied and then locally edited — 302 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (40 lines × 2 locations) · ×1
  • Duplicated block (40 lines × 2 locations) scripts/plugin-tests.js:3265 — scripts/plugin-tests.js:3265 · scripts/plugin-tests.js:3314 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (35 lines × 2 locations) · ×1
  • Duplicated block (35 lines × 2 locations) REDACTED:7668 — REDACTED:7668 · REDACTED:7898 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (33 lines × 3 locations) · ×1
  • Duplicated block (33 lines × 3 locations) REDACTED:173 — REDACTED:173 · REDACTED:207 · REDACTED:241 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block with local edits (31 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (31 matched lines × 2 locations) scripts/decorator-tests.ts:2136 — scripts/decorator-tests.ts:2136 · scripts/decorator-tests.ts:2183 — the two spans are one implementation copied and then locally edited — 309 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (30 lines × 2 locations) · ×1
  • Duplicated block (30 lines × 2 locations) scripts/plugin-tests.js:1103 — scripts/plugin-tests.js:1103 · scripts/plugin-tests.js:1134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (26 lines × 2 locations) · ×1
  • Duplicated block (26 lines × 2 locations) scripts/plugin-tests.js:1535 — scripts/plugin-tests.js:1535 · scripts/plugin-tests.js:1685 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (25 lines × 3 locations) · ×1
  • Duplicated block (25 lines × 3 locations) scripts/plugin-tests.js:1978 — scripts/plugin-tests.js:1978 · scripts/plugin-tests.js:2004 · scripts/plugin-tests.js:2030 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (24 lines × 4 locations) · ×1
  • Duplicated block (24 lines × 4 locations) scripts/decorator-tests.ts:512 — scripts/decorator-tests.ts:512 · scripts/decorator-tests.ts:574 · scripts/decorator-tests.ts:1337 · scripts/decorator-tests.ts:1398 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (23 lines × 4 locations) · ×1
  • Duplicated block (23 lines × 4 locations) scripts/decorator-tests.js:3813 — scripts/decorator-tests.js:3813 · scripts/decorator-tests.js:3901 · scripts/decorator-tests.js:3989 · scripts/decorator-tests.js:4685 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (22 lines × 4 locations) · ×1
  • Duplicated block (22 lines × 4 locations) scripts/decorator-tests.ts:483 — scripts/decorator-tests.ts:483 · scripts/decorator-tests.ts:543 · scripts/decorator-tests.ts:1308 · scripts/decorator-tests.ts:1368 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function JSON_parse (cyclomatic 93, cognitive 112) · ×1
  • Complex function JSON_parse (cyclomatic 93, cognitive 112) lib/shared/uint8array_json_parser.ts:77 — JSON_parse has cyclomatic complexity 93 and cognitive complexity 112; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function flagsForBuildOptions (cyclomatic 56, cognitive 96) · ×1
  • Complex function flagsForBuildOptions (cyclomatic 56, cognitive 96) lib/shared/common.ts:237 — flagsForBuildOptions has cyclomatic complexity 56 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function pushCommonFlags (cyclomatic 45, cognitive 59) · ×1
  • Complex function pushCommonFlags (cyclomatic 45, cognitive 59) lib/shared/common.ts:147 — pushCommonFlags has cyclomatic complexity 45 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function __decorateElement (cyclomatic 44, cognitive 65) · ×1
  • Complex function __decorateElement (cyclomatic 44, cognitive 65) scripts/decorator-tests.js:19 — __decorateElement has cyclomatic complexity 44 and cognitive complexity 65; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 34, cognitive 66) · ×1
  • Complex function (anonymous) (cyclomatic 34, cognitive 66) scripts/end-to-end-tests.js:9648 — (anonymous) has cyclomatic complexity 34 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function checkBuildAPI (cyclomatic 32, cognitive 41) · ×1
  • Complex function checkBuildAPI (cyclomatic 32, cognitive 41) scripts/test262.js:280 — checkBuildAPI has cyclomatic complexity 32 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function test_case (cyclomatic 24, cognitive 36) · ×1
  • Complex function test_case (cyclomatic 24, cognitive 36) REDACTED:79 — test_case has cyclomatic complexity 24 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 21, cognitive 57) · ×1
  • Complex function (anonymous) (cyclomatic 21, cognitive 57) compat-table/src/index.ts:209 — (anonymous) has cyclomatic complexity 21 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function test_case (cyclomatic 19, cognitive 27) · ×1
  • Complex function test_case (cyclomatic 19, cognitive 27) REDACTED:70 — test_case has cyclomatic complexity 19 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function sanitizeLocation (cyclomatic 18, cognitive 21) · ×1
  • Complex function sanitizeLocation (cyclomatic 18, cognitive 21) lib/shared/common.ts:1714 — sanitizeLocation has cyclomatic complexity 18 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 17, cognitive 45) · ×1
  • Complex function (anonymous) (cyclomatic 17, cognitive 45) compat-table/src/mdn.ts:140 — (anonymous) has cyclomatic complexity 17 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 17, cognitive 42) · ×1
  • Complex function (anonymous) (cyclomatic 17, cognitive 42) lib/shared/common.ts:1383 — (anonymous) has cyclomatic complexity 17 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 16, cognitive 37) · ×1
  • Complex function (anonymous) (cyclomatic 16, cognitive 37) lib/shared/common.ts:1436 — (anonymous) has cyclomatic complexity 16 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateBinPath (cyclomatic 15, cognitive 30) · ×1
  • Complex function generateBinPath (cyclomatic 15, cognitive 30) lib/npm/node-platform.ts:116 — generateBinPath has cyclomatic complexity 15 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function checkTransformAPI (cyclomatic 15, cognitive 17) · ×1
  • Complex function checkTransformAPI (cyclomatic 15, cognitive 17) scripts/test262.js:217 — checkTransformAPI has cyclomatic complexity 15 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseStackLinesV8 (cyclomatic 13, cognitive 33) · ×1
  • Complex function parseStackLinesV8 (cyclomatic 13, cognitive 33) lib/shared/common.ts:1620 — parseStackLinesV8 has cyclomatic complexity 13 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 13, cognitive 18) · ×1
  • Complex function (anonymous) (cyclomatic 13, cognitive 18) REDACTED:294 — (anonymous) has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 12, cognitive 25) · ×1
  • Complex function (anonymous) (cyclomatic 12, cognitive 25) lib/shared/common.ts:1488 — (anonymous) has cyclomatic complexity 12 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 11, cognitive 29) · ×1
  • Complex function main (cyclomatic 11, cognitive 29) scripts/ts-type-tests.js:387 — main has cyclomatic complexity 11 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 11, cognitive 17) · ×1
  • Complex function (anonymous) (cyclomatic 11, cognitive 17) scripts/browser/browser-tests.js:13 — (anonymous) has cyclomatic complexity 11 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · scripts/decorator-tests.ts · ×1
  • scripts/decorator-tests.ts: 3741 lines of code scripts/decorator-tests.ts:1 — scripts/decorator-tests.ts has 3741 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · lib/shared/common.ts · ×1
  • lib/shared/common.ts: 1704 lines of code lib/shared/common.ts:1 — lib/shared/common.ts has 1704 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · lib/shared/types.ts · ×1
  • lib/shared/types.ts: 631 lines of code lib/shared/types.ts:1 — lib/shared/types.ts has 631 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · lib/npm/node.ts · ×1
  • lib/npm/node.ts: 559 lines of code lib/npm/node.ts:1 — lib/npm/node.ts has 559 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · compat-table/src/index.ts · ×1
  • compat-table/src/index.ts: 505 lines of code compat-table/src/index.ts:1 — compat-table/src/index.ts has 505 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R4 · Test Coverage · Test Coverage · ×1
  • Test Coverage — 0% of 36 production file(s) reachable from 0 test file(s) via the import graph — 'production' here is the RESIDUE: every source file left once tests, tooling, generated output, config, declarations and declaration-only modules, fixture corpora, type fixtures, behaviour-free data modules, re-export barrels, registration/constant data modules and service workers are set aside, so the percentage is taken over a smaller denominator than the workspace's file count
R7 · Dead Code · Dead file (~26 LoC) · ×1
  • Dead file (~26 LoC) require/yarnpnp/in.mjs — no import path from any entry point (13 application, 18 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'fuse.js' · ×1
  • Unused dependency 'fuse.js' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'source-map' · ×1
  • Unused dependency 'source-map' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Minor — 35 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×16
  • Duplicated predicate cmd/esbuild/main.go:236 — `arg == "--serve" || strings.HasPrefix(arg, "--serve=") || strings.HasPrefix(arg, "--servedir=") || strings.HasPrefix(arg, "--serve-fallback=…` appears character-identically in 2 files — cmd/esbuild/main.go, pkg/cli/cli_impl.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/css_lexer/css_lexer.go:672 — `lexer.codePoint == '+' || lexer.codePoint == '-'` appears character-identically in 2 files — internal/css_lexer/css_lexer.go, internal/js_lexer/js_lexer.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/css_lexer/css_lexer.go:920 — `lexer.codePoint == 'e' || lexer.codePoint == 'E'` appears character-identically in 2 files — internal/css_lexer/css_lexer.go, internal/js_lexer/js_lexer.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/css_lexer/css_lexer.go:664 — `lexer.codePoint >= '0' && lexer.codePoint <= '9'` appears character-identically in 2 files — internal/css_lexer/css_lexer.go, internal/js_lexer/js_lexer.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/js_parser/js_parser.go:6925 — `p.options.ts.Parse && p.options.ts.Config.ExperimentalDecorators == config.True` appears character-identically in 2 files — internal/js_parser/js_parser.go, internal/js_parser/js_parser_lower_class.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/js_parser/js_parser.go:13686 — `p.suppressWarningsAboutWeirdCode || p.fnOrArrowDataVisit.tryBodyCount > 0` appears character-identically in 2 files — internal/js_parser/js_parser.go, internal/js_parser/js_parser_lower.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/js_parser/js_parser.go:13816 — `r == '\n' || r == '\r' || r == '\u2028' || r == '\u2029'` appears character-identically in 2 files — internal/js_parser/js_parser.go, internal/logger/logger.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/resolver/package_json.go:254 — `r.debugLogs != nil && originalError != nil` appears character-identically in 3 files — internal/resolver/package_json.go, internal/resolver/resolver.go, internal/resolver/yarnpnp.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/resolver/package_json.go:1053 — `status == pjStatusExact || status == pjStatusExactEndsWithStar` appears character-identically in 2 files — internal/resolver/package_json.go, internal/resolver/resolver.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate internal/css_printer/css_printer.go:925 — `wrapLongLines && startLineLength+i >= p.options.LineLimit` appears character-identically in 2 files — internal/css_printer/css_printer.go, internal/js_printer/js_printer.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate scripts/end-to-end-tests.js:9934 — `!expectedStdout.length && !expectedStderr.length` appears character-identically in 2 files — scripts/end-to-end-tests.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:335 — `ctor === Error || ctor.prototype instanceof Error` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:324 — `label.name == "expect_exact" || label.name == "node_version"` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:238 — `node instanceof U.AST_LabeledStatement && tw.parent() instanceof U.AST_Toplevel` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:3966 — `res.statusCode < 200 || res.statusCode > 299` appears character-identically in 2 files — REDACTED, scripts/plugin-tests.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate compat-table/src/compat-table.ts:131 — `typeof value === 'object' && value !== null` appears character-identically in 2 files — compat-table/src/compat-table.ts, lib/shared/common.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 2 of 7 project(s) overshoot their size bounds, lowering Project Cohesion to 4.3/10. The most over is `(repository root)` (82891 LoC, 469 module-visible types across 28 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift README.md:1 — README claims a Dockerfile but the evidence shows no Docker-related project or file — searched for: `Dockerfile`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest and configuration files (REDACTED and other *.json, *.csproj, *.props, *.sln/*.slnx, *.yml, *.toml, *.config, tool configs such as eslint.config.js, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — 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 was searched, so you can tell an absence from a miss: the 11461 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 0/2 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 4/5 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
X5 · Nullable reference types · Null assertions (`!`) reduce the strict null checking score · ×1
  • Null assertions (`!`) reduce the strict null checking score — ~12.7 `!` null assertions per 1k TypeScript source lines — 84 assertion(s) across the 6602 source line(s) of the 16 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: lib/shared/common.ts (49), lib/npm/node.ts (17), compat-table/src/css_table.ts (4). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Minor — 1 finding(s)
D12 · Dependency Hygiene · Outdated · ×1
  • Outdated: golang.org/x/sys — `golang.org/x/sys` is required at v0.0.0-20220715151400-c0bba94af5f8 in REDACTED, but v0.49.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sys@v0.49.0 && go mod tidy` and commit the updated REDACTED and go.sum.

Appendix B — Reproduction & audit trail

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

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

Run 01a16b3c-0bca-72de-93de-dd21e066e2b5 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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