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

evanw/esbuild

Measured 13 November 2026, 11:39 UTC, at code version f6058f8

CAI score 50out of 100 At risk Up 5 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.1 person-years · Weakest lens: Production Readiness, 44

Findings by how serious they are

43 critical 1149 serious 73 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
13 November 2026, 11:39 UTC

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

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

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

56of 56 dimensions measured by tools.
1248of 1265 findings point to an exact file and line, so you can open each one in the code. The other 17 concern the repository as a whole, such as missing documentation.
56dimensions across 6 lenses, read from 92,696 lines of product code in 7 projects.
Chapters

Executive summary

evanw/esbuild is rated At risk because critical security findings are open, most of them in the packages it uses. Its score is held back in part because we found no automated security scanning of the code, its secrets or its dependencies. It scores 50 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Production Readiness, at 44, is the weakest lens and counts most in the score. The best first steps are adding automated security scanning and adding tests for the code no test reaches, each worth about 5 points. Raising Production Readiness to 62 would lift the score to about 55.

Twenty-five known security holes in the packages the code depends on can be used by attackers. Ten places in the code run text as code, which an attacker could use, and seven pipeline steps run downloads nobody checks. Updating the vulnerable packages, replacing text run as code with direct calls and checking each download against a checksum would close these risks. The loop of files that import each other needs breaking.

The product code is 92,696 lines, about €160,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.
Production Readiness 44 · counts for 46%Code Health 50 · counts for 25%Security and Compliance 56 · counts for 14%Performance 60 · counts for 8%Maturity 62 · counts for 4%Architecture 84 · counts for 2%

If Production Readiness rose from 44 to 62, the lowest score rated Strong, the score would rise from 50 to about 55.

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

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

  • Code Duplication · Edited copy of a member (25 corresponding lines) internal/resolver/yarnpnp.go
  • Code Duplication · Edited copy of a member (48 corresponding lines) internal/css_parser/css_color_spaces.go
  • Code Duplication · Edited copies of one member (3 members, 38+ corresponding lines) internal/cache/cache_ast.go
  • Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) internal/js_parser/js_parser_lower_class.go
  • Code Duplication · Edited copy of a member (26 corresponding lines) internal/js_ast/js_ident.go
  • Code Duplication · Edited copy of a member (19 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (17 corresponding lines) internal/helpers/utf.go
  • Code Duplication · Edited copy of a member (12 corresponding lines) internal/css_parser/css_color_spaces.go
  • Code Duplication · Edited copy of a member (19 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (19 corresponding lines) internal/css_ast/css_ast.go
  • Code Duplication · Edited copy of a member (12 corresponding lines) internal/js_printer/js_printer.go
  • Code Duplication · Edited copy of a member (14 corresponding lines) internal/css_parser/css_color_spaces.go
  • Code Duplication · Edited copy of a member (7 corresponding lines) internal/css_ast/css_ast.go
  • Code Duplication · Edited copy of a member (24 corresponding lines) internal/js_parser/ts_parser.go
  • Code Duplication · Edited copy of a member (19 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (21 corresponding lines) internal/ast/ast.go
  • Code Duplication · Edited copy of a member (20 corresponding lines) internal/css_printer/css_printer.go
  • Code Duplication · Edited copy of a member (25 corresponding lines) internal/sourcemap/sourcemap.go
  • Code Duplication · Edited copy of a member (18 corresponding lines) internal/css_parser/css_reduce_calc.go
  • Code Duplication · Edited copy of a member (15 corresponding lines) internal/css_parser/css_decls_gradient.go
  • Code Duplication · Edited copy of a member (9 corresponding lines) internal/js_parser/js_parser_lower_class.go
  • Code Duplication · Edited copy of a member (14 corresponding lines) internal/js_parser/js_parser.go
  • Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) internal/css_parser/css_color_spaces.go
  • Code Duplication · Edited copy of a member (8 corresponding lines) internal/css_parser/css_decls_border_radius.go
  • Code Duplication · Edited copy of a member (16 corresponding lines) internal/css_printer/css_printer.go
  • Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) internal/css_parser/css_color_spaces.go
  • Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) internal/js_lexer/js_lexer.go
  • Code Duplication · Edited copy of a member (8 corresponding lines) internal/logger/logger.go
  • Code Duplication · Edited copy of a member (5 corresponding lines) internal/css_ast/css_ast.go
  • Code Duplication · Edited copy of a member (13 corresponding lines) cmd/esbuild/main_other.go
  • Code Duplication · Edited copy of a member (12 corresponding lines) internal/cache/cache.go
  • Code Duplication · Edited copy of a member (22 corresponding lines) internal/css_lexer/css_lexer.go
  • Code Duplication · Edited copy of a member (8 corresponding lines) internal/css_parser/css_decls_list_style.go
  • Code Duplication · Edited copy of a member (11 corresponding lines) internal/css_ast/css_ast.go
  • Code Duplication · Edited copy of a member (11 corresponding lines) internal/css_ast/css_ast.go
  • Code Duplication · Edited copy of a member (4 corresponding lines) internal/ast/ast.go
  • Code Duplication · Edited copy of a member (7 corresponding lines) internal/css_ast/css_ast.go
  • Code Duplication · Edited copy of a member (8 corresponding lines) internal/css_printer/css_printer.go
  • Code Duplication · Duplicated block (14 lines × 2) internal/css_printer/css_printer.go
  • Code Duplication · Duplicated block (13 lines × 2) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2) internal/linker/linker.go
  • Code Duplication · Duplicated block (6 lines × 2) internal/js_parser/js_parser.go
  • Code Duplication · Duplicated block (5 lines × 2) internal/css_parser/css_reduce_calc.go
  • Code Duplication · Duplicated block (4–5 lines × 3) internal/js_parser/js_parser.go
  • Code Duplication · Duplicated block (7–8 lines × 2) internal/js_parser/js_parser.go
  • Code Duplication · Duplicated block (6 lines × 2) internal/js_parser/js_parser.go
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Import Boundaries · Boundary violation [package:relative-cross-package] scripts/test262-async.js
  • Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 11, cognitive 11) lib/shared/common.ts
  • Cyclomatic Complexity · Complex function generateRangeTable (cyclomatic 11, cognitive 11) scripts/gen-unicode-table.js
  • Exception handling · Swallowed exception (empty catch) lib/shared/common.ts
  • Exception handling · Swallowed exception (empty catch) lib/shared/common.ts
  • Exception handling · Swallowed exception (empty catch) lib/shared/common.ts
  • Exception handling · Swallowed exception (empty catch) lib/shared/common.ts
  • Exception handling · Swallowed exception (empty catch) lib/shared/common.ts
  • Exception handling · Swallowed exception (empty catch) lib/shared/common.ts
  • Exception handling · Swallowed exception (empty catch) lib/shared/common.ts
  • Exception handling · Swallowed exception (empty catch) lib/shared/common.ts
  • Exception handling · Swallowed exception (empty catch) REDACTED
  • Exception handling · Swallowed exception (empty catch) REDACTED
  • Exception handling · Swallowed exception (empty catch) REDACTED
  • Exception handling · Swallowed exception (empty catch) lib/npm/node-platform.ts
  • Exception handling · Swallowed exception (empty catch) lib/npm/node-platform.ts
  • Exception handling · Swallowed exception (empty catch) lib/npm/node-platform.ts
  • Exception handling · Swallowed exception (empty catch) lib/npm/node.ts
  • Exception handling · Swallowed exception (empty catch) lib/npm/node.ts

We compare 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: 442 findings

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

  • Cyclomatic Complexity · test262.checkBuildAPI (cyclomatic 35) scripts/test262.js
  • Cyclomatic Complexity · index.html.testStart (cyclomatic 28) scripts/browser/index.html
  • Cyclomatic Complexity · destructuring-fuzzer.generateTestCase (cyclomatic 23) scripts/destructuring-fuzzer.js
  • Cyclomatic Complexity · test262-async.main (cyclomatic 20) scripts/test262-async.js
  • Cyclomatic Complexity · InputFile.renderHover (cyclomatic 17) scripts/graph-debugger.html
  • Cognitive Complexity · index.html.testStart (cognitive 53) scripts/browser/index.html
  • Cognitive Complexity · test262.checkBuildAPI (cognitive 48) scripts/test262.js
  • Cognitive Complexity · InputFile.renderHover (cognitive 37) scripts/graph-debugger.html
  • Cognitive Complexity · test262-async.main (cognitive 34) scripts/test262-async.js
  • Cognitive Complexity · destructuring-fuzzer.generateTestCase (cognitive 25) scripts/destructuring-fuzzer.js
  • Cognitive Complexity · test262.checkTransformAPI (cognitive 17) scripts/test262.js
  • Cognitive Complexity · dataurl-escapes.html.check (cognitive 16) scripts/dataurl-escapes.html
  • Cognitive Complexity · test262.runCodeInHarness (cognitive 16) scripts/test262.js
  • Code Duplication · Duplicated block (24 lines × 2) internal/js_ast/js_ast_helpers.go
  • Code Duplication · Duplicated block (15 lines × 2) internal/css_printer/css_printer.go
  • Code Duplication · Duplicated block (14–15 lines × 2) internal/resolver/yarnpnp.go
  • Code Duplication · Duplicated block (13 lines × 2) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2) internal/js_parser/ts_parser.go
  • Code Duplication · Duplicated block (10 lines × 2) internal/linker/linker.go
  • Code Duplication · Duplicated block (5 lines × 2) internal/css_parser/css_decls_color.go
  • Code Duplication · Duplicated block (5 lines × 2) internal/css_parser/css_reduce_calc.go
  • Code Duplication · Duplicated block (5 lines × 2) internal/js_parser/js_parser.go
  • Code Duplication · Duplicated block (7 lines × 2) internal/js_parser/js_parser.go
  • Code Duplication · Duplicated block (5 lines × 2) internal/js_parser/js_parser.go
  • Code Duplication · Duplicated block (6 lines × 2) internal/js_parser/js_parser.go
  • Code Duplication · Duplicated block (5 lines × 2) internal/linker/linker.go
  • Churn × Complexity Hotspots · Hotspot: internal/logger/msg_ids.go internal/logger/msg_ids.go
  • Secrets (history) · High secret: WD-SECRET-0005 REDACTED
  • Secrets (history) · High secret: WD-SECRET-0005 require/webpack/package-lock.json
  • Secrets (history) · High secret: WD-SECRET-0005 scripts/readmin-package-lock.json
  • Static Analysis (SAST) · Medium: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED 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
Rebuild cost: about €160,000 · Estimate
Cost to rebuild€53,000 to €270,000, for 886 to 2,811 hours of work, about 1.1 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 50. 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
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
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.
Raises the score by about 5 points · Medium effort · Security & performance tooling
2
Add tests that import the unreached modules (directly or through their public entry).
Raises the score by about 5 points · Medium effort · Test Coverage
3
Bring the 362 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).
Raises the score by about 3 points · High effort · Cognitive Complexity

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €160,000 to build again, about 1.1 person-years of work. Its weakest lens is Production Readiness, at 44 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
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. Of all the actions in this report, it raises the score most for the work it takes: about 5 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 we estimate 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 our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · 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 · 50% · Adequate · gated by D1, D2 ·

At a glance — Architecture · 84% · Strong ·

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

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

At a glance — Security · 56% · Checked 4 of 10 · gated by D29, D36 ·

At a glance — Performance · 60% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection83High / Critical
A03:2025 — Software Supply Chain Failures36High / Critical

Roadmap

Top priorities: 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; Add tests that import the unreached modules (directly or through their public entry); Bring the 362 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).

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

Do thisHelpsEffortDimension
Add a SAST step to CI running what this repository's stack ships: gosec / govulncheck (or golangci-lint) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+4.9 ptsMediumSecurity & performance tooling
Add tests that import the unreached modules (directly or through their public entry).+4.9 ptsMediumTest Coverage
Bring the 362 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).+2.8 ptsHighCognitive Complexity
Resolve the 1 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene.+1.4 ptsLowDependency Hygiene
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.+2.6 ptsMediumDeployment & Rollback
Bring the 254 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).+2.6 ptsHighCyclomatic Complexity
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.go.+1.2 ptsLowADR Quality
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.+1.5 ptsMediumAsync & latency hygiene

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.3SlopDependency 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.4MixedDependency 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.5MixedStatic Analysis (SAST): High: REDACTED
REDACTED6.9MixedDependency Vulnerabilities: Medium CVE: REDACTED
cmd/esbuild/main.go6.9MixedCyclomatic Complexity: main.main (cyclomatic 44)
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)

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

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

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

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

Could not be resolved — 21

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

Methodology & how to trust this report

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

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

What we checked — 56 dimensions across the health lenses
D1D2D3D4D5D6D11D12D13D14D15D17D19D20D24D26D27D28D29D30D34D35D36D43D44AX10AX2AX3AX5AX9M1M2M3P1P10P2P3P4P6PF3R1R10R11R2R3R4R5R6R7R8R9X2X26X28X3X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1d4b4-375e-7d1d-803b-16892c1ed97e.

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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 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.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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. We then boot 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 349 further occurrence(s) are not listed individually; the score already reflects all 389.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X21 Side-effecting pattern guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X26 Unsynchronised callback handoff — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and 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.
  • X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • 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.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • 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.
  • 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.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

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

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

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

254 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was parser.visitExprInOut at 618. A further 4 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being logger.StringToMsgIDs at 59 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: internal/logger/msg_ids.go (logger.StringToMsgIDs at 59), 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

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

What to do

  1. Bring the 254 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 254 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.

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

362 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

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

What to do

  1. Bring the 362 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 362 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.

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

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

D4 · Code Duplication9.3 / 10Stronggated by 179 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.3 / 10 · rule-coverage 100% · ceiling Verified

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

Duplicated block (7 lines × 2) · ×16REDACTED:984
Duplicated block (5 lines × 2) · ×13internal/css_parser/css_parser.go:1727
Duplicated block (11 lines × 2) · ×10internal/css_parser/css_reduce_calc.go:123
Duplicated block (6 lines × 2) · ×10internal/js_parser/js_parser.go:4272
Duplicated block (12 lines × 2) · ×9REDACTED:489

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

What to do

  1. Resolve the 16 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with js_parser.go (5), js_lexer.go (2), js_printer.go (2). — One of this dimension's main actionable groups (16 warning-level).
  2. Resolve the 13 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with js_parser.go (5), js_parser_lower_class.go (2), css_parser.go. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 10 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with js_parser.go (3), css_reduce_calc.go, css_printer.go. — One of this dimension's main actionable groups (10 warning-level).

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.

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, not deprecated, and not bloated. Known vulnerabilities are D30's.

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

Maturity: Documented → Verified → Prevented · effective 9.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).

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 414 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 414 package(s) this repository's committed lockfile installs for a consumer — its 24 production, optional and peer dependency(ies), across 7 product REDACTED manifest(s), and everything those install in turn. Its 0 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ 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 · ×5internal/js_parser/js_parser.go:4264

What to do

  1. Resolve the 5 Hotspot finding(s) in Churn × Complexity Hotspots — start with js_parser.go, js_printer.go, REDACTED. — One of this dimension's main actionable groups (5 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 · ×4REDACTED:962

What to do

  1. Resolve the 4 HackComment finding(s) in Explicit Debt — start with REDACTED, ts_parser.go, iswin_wasm.go. — One of this dimension's main actionable groups (4 warning-level).

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

D19 · Documentation Quality5.0 / 10Adequate✓ Tool-verified

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

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

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

1 of 2 documentation facets pass in full; short on: F2 example. 36 document(s) read across 31 unit(s).

Documentation: no build, run or usage example · ×30README.md:1

What to do

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

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

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

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

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundcmd/esbuild/main.go:1

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.go. — 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.

D24 · Comment Value9.1 8.4 / 10Strong✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 8.4 / 10 · rule-coverage 92% · ceiling Documented

5 of 538 judged comments only repeat the code they sit on (0.9 %). 79 comment(s) in another language or script were not judged.

redundant comment · ×5scripts/end-to-end-tests.js:316

What to do

  1. Resolve the 5 redundant comment finding(s) in Comment Value — start with end-to-end-tests.js (2), REDACTED (2), gen-unicode-table.js. — One of this dimension's main actionable groups (5 recommendation-level).

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

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.

Detailed fixes: d27_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

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

REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

2 of 95 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is internal/css_parser/css_decls_font_family.go. Counted over 95 of the 137 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×2internal/css_parser/css_decls_font_family.go:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling10.0 / 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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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.

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.

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.

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)7.6 / 10Strong✓ Tool-verified

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

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

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.
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 repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

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

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

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

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

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

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

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

  • Add a health-check endpoint (a /healthz handler) so orchestrators and load balancers can probe liveness/readiness.
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 4 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:6
  • `compat-table/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — compat-table/package.json:5

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.

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

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

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

  • `fs.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).
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.
R11 · Import Boundaries6.8 / 10Strong✓ Tool-verified

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

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

  • scripts/test262-async.js:7 reaches into another package with a relative path (./node_modules/typescript) — import the package by name instead. — scripts/test262-async.js:7

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
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
  • (anonymous) has cyclomatic complexity 11 and cognitive complexity 11; 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:1083
  • generateRangeTable has cyclomatic complexity 11 and cognitive complexity 11; 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/gen-unicode-table.js:71
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 18 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.6 / 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.

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.
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, got, undici, node:http) 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.
  • `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
  • `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

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
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.

X3 · Exception handling5.4 / 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 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
  • `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
  • 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. (×16) — lib/shared/common.ts:602, lib/shared/common.ts:775, lib/shared/common.ts:862, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. (×2) — lib/shared/common.ts:1650, REDACTED:157
  • `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/fs/fs_real.go:462, internal/fs/fs_real.go:483, internal/config/config.go:742

What to do

  • Swallowed exception (caught, then discarded)
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. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

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

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 Health50%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture84%StrongStrongest area.
Maturity62%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness44%Adequate — gated by R4, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security56%Checked 4 of 10Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateAcceptable, with room to improve.
Unscored — 2 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.

  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • 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 — 66 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
  • AC2 Forms & labels — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
  • AC3 Page structure — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
  • 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)
  • AX6 Interface segregation — AX6 reached only 32% of this repository's production lines — go (82,891 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; Go, JavaScript, html not measured.
  • 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+ sibling projects each declaring an entity of their own or taking another project's integration events. 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"]`.
  • 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.
  • 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.
  • 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
  • M4 Documentation accuracy — Not applicable: the 36 current-state document(s) make no claim of a kind M4 checks.
  • 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • 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.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • 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.
  • X1 Async correctness — X1 reached only 32% of this repository's production lines — go (82,891 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X12 Unreachable branch — X12 reached only 32% of this repository's production lines — go (82,891 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — X13 reached only 32% of this repository's production lines — go (82,891 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 32% of this repository's production lines — go (82,891 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.
  • X21 Side-effecting pattern guard — X21 reached only 32% of this repository's production lines — go (82,891 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X29 Per-element action decided by a fixed element — X29 reached only 32% of this repository's production lines — go (82,891 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 — 43 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×22
  • REDACTED
  • REDACTED
  • 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
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×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 — 1149 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.
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 (7 lines × 2) · ×16
  • 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/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) REDACTED:1761 — REDACTED:1761-1767 | REDACTED:1881-1887 — both copies are in the same file, so extract the 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 (7 lines × 2) internal/js_parser/js_parser.go:9317 — internal/js_parser/js_parser.go:9317-9323 | internal/js_parser/js_parser.go:9327-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.
  • Duplicated block (7 lines × 2) internal/js_printer/js_printer.go:3845 — internal/js_printer/js_printer.go:3845-3851 | internal/js_printer/js_printer.go:4587-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.
  • Duplicated block (7 lines × 2) internal/resolver/resolver.go:2803 — internal/resolver/resolver.go:2803-2809 | internal/resolver/resolver.go:2820-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:2803` 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×16
  • 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) 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/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) 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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×13
  • 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_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) 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.
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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×10
  • 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/linker/linker.go:1327 — internal/linker/linker.go:1327-1337 | internal/linker/linker.go:1384-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:1327` 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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×10
  • 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:12799 — internal/js_parser/js_parser.go:12799-12804 | internal/js_parser/js_parser.go:13753-13758 — both copies are in the same file, so extract the 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:12799` 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 (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/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/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.
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.
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 (14 lines × 2) · ×8
  • 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/css_printer/css_printer.go:984 — internal/css_printer/css_printer.go:984-997 | internal/js_printer/js_printer.go:793-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/css_printer/css_printer.go:984` 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 (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.
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) internal/js_parser/ts_parser.go:1924 — internal/js_parser/ts_parser.go:1924-1931 | internal/js_parser/ts_parser.go:2034-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:1924` 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/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 (10 lines × 2) · ×7
  • 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/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: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.
  • Duplicated block (10 lines × 2) internal/linker/linker.go:4825 — internal/linker/linker.go:4825-4834 | internal/linker/linker.go:4897-4906 — both copies are in the same file, so extract the 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×7
  • 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) 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) 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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) 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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) 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) 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.
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.
D15 · Churn × Complexity Hotspots · Hotspot · ×5
  • 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.
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_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: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.
  • Duplicated block (9 lines × 2) REDACTED:1295 — REDACTED:1295-1303 | REDACTED:1765-1773 — both copies are in the same file, so extract the 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/helpers/utf.go:50 — internal/helpers/utf.go:50-58 | internal/helpers/utf.go:99-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/helpers/utf.go:50` 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.
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 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.
  • 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 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/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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×4
  • Edited copy of a member (19 corresponding lines) REDACTED:1390 — REDACTED:1390-1411 | REDACTED:1434-1452 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) REDACTED:1370 — REDACTED:1370-1388 | REDACTED:1413-1432 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) internal/css_ast/css_ast.go:560 — internal/css_ast/css_ast.go:560-579 | internal/css_ast/css_ast.go:741-759 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) REDACTED:1657 — REDACTED:1657-1675 | REDACTED:1677-1695 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×4
  • Edited copy of a member (8 corresponding lines) internal/css_parser/css_decls_border_radius.go:29 — internal/css_parser/css_decls_border_radius.go:29-36 | internal/css_parser/css_decls_box.go:87-94 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/logger/logger.go:480 — internal/logger/logger.go:480-487 | internal/logger/logger.go:489-496 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/css_parser/css_decls_list_style.go:99 — internal/css_parser/css_decls_list_style.go:99-106 | internal/css_parser/css_decls_container.go:46-53 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) internal/css_printer/css_printer.go:999 — internal/css_printer/css_printer.go:999-1008 | internal/js_printer/js_printer.go:808-815 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×3
  • Edited copy of a member (12 corresponding lines) internal/css_parser/css_color_spaces.go:502 — internal/css_parser/css_color_spaces.go:502-515 | internal/css_parser/css_decls_color.go:752-763 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/js_printer/js_printer.go:377 — internal/js_printer/js_printer.go:377-388 | internal/js_printer/js_printer.go:390-402 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) internal/cache/cache.go:91 — internal/cache/cache.go:91-102 | internal/cache/cache.go:104-115 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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 (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
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 · Edited copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) internal/resolver/yarnpnp.go:629 — internal/resolver/yarnpnp.go:629-653 | internal/resolver/yarnpnp.go:655-684 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) internal/sourcemap/sourcemap.go:206 — internal/sourcemap/sourcemap.go:206-232 | internal/sourcemap/sourcemap.go:234-258 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×2
  • Edited copy of a member (14 corresponding lines) internal/css_parser/css_color_spaces.go:332 — internal/css_parser/css_color_spaces.go:332-345 | internal/css_parser/css_color_spaces.go:347-360 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) internal/js_parser/js_parser.go:2897 — internal/js_parser/js_parser.go:2897-2912 | internal/js_parser/js_parser.go:2914-2927 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×2
  • Edited copy of a member (7 corresponding lines) internal/css_ast/css_ast.go:850 — internal/css_ast/css_ast.go:850-856 | internal/css_ast/css_ast.go:858-864 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) internal/css_ast/css_ast.go:828 — internal/css_ast/css_ast.go:828-834 | internal/helpers/hash.go:8-14 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 10+ corresponding lines) internal/css_parser/css_color_spaces.go:62 — internal/css_parser/css_color_spaces.go:62-71 | internal/css_parser/css_color_spaces.go:129-139 | internal/css_parser/css_color_spaces.go:204-215 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) internal/css_parser/css_color_spaces.go:51 — internal/css_parser/css_color_spaces.go:51-60 | internal/css_parser/css_color_spaces.go:117-127 | internal/css_parser/css_color_spaces.go:191-202 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×2
  • Edited copy of a member (11 corresponding lines) internal/css_ast/css_ast.go:218 — internal/css_ast/css_ast.go:218-228 | internal/helpers/strings.go:20-30 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) internal/css_ast/css_ast.go:260 — internal/css_ast/css_ast.go:260-270 | internal/helpers/strings.go:8-18 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • 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 (23 lines × 2) · ×2
  • 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.
  • Duplicated block (23 lines × 2) internal/css_parser/css_decls_color.go:505 — internal/css_parser/css_decls_color.go:505-527 | internal/css_parser/css_decls_color.go:543-565 — both copies are in the same file, so extract the 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 (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 (15 lines × 2) · ×2
  • 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/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 (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: 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 })`.
  • 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 })`.
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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 · 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 · 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 · 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 · 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 · 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 254 functions over the threshold — including the worst — and 2468 of the 7558 points over it (33%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 · 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 · 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 · 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 · 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 · 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 · 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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 362 functions over the threshold — including the worst — and 6138 of the 20068 points over it (31%), 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.
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
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 · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) internal/css_parser/css_color_spaces.go:524 — internal/css_parser/css_color_spaces.go:524-571 | internal/css_parser/css_color_spaces.go:573-620 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 38+ corresponding lines) internal/cache/cache_ast.go:41 — internal/cache/cache_ast.go:41-78 | internal/cache/cache_ast.go:96-134 | internal/cache/cache_ast.go:152-190 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) internal/js_parser/js_parser_lower_class.go:259 — internal/js_parser/js_parser_lower_class.go:259-282 | internal/js_parser/js_parser_lower_class.go:284-307 | internal/js_parser/js_parser_lower_class.go:309-335 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) internal/js_ast/js_ident.go:77 — internal/js_ast/js_ident.go:77-102 | internal/js_ast/js_ident.go:105-130 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×1
  • Edited copy of a member (17 corresponding lines) internal/helpers/utf.go:46 — internal/helpers/utf.go:46-62 | internal/helpers/utf.go:64-88 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) internal/js_parser/ts_parser.go:843 — internal/js_parser/ts_parser.go:843-868 | internal/js_parser/ts_parser.go:870-893 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×1
  • Edited copy of a member (21 corresponding lines) internal/ast/ast.go:700 — internal/ast/ast.go:700-720 | internal/js_parser/js_parser.go:1358-1378 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) internal/css_printer/css_printer.go:538 — internal/css_printer/css_printer.go:538-557 | internal/js_printer/js_printer.go:3905-3929 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) internal/css_parser/css_reduce_calc.go:423 — internal/css_parser/css_reduce_calc.go:423-440 | internal/css_parser/css_reduce_calc.go:442-459 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) internal/css_parser/css_decls_gradient.go:1008 — internal/css_parser/css_decls_gradient.go:1008-1022 | internal/css_parser/css_decls_gradient.go:1024-1038 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×1
  • Edited copy of a member (9 corresponding lines) internal/js_parser/js_parser_lower_class.go:137 — internal/js_parser/js_parser_lower_class.go:137-145 | internal/js_parser/js_parser_lower_class.go:337-347 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) internal/css_printer/css_printer.go:982 — internal/css_printer/css_printer.go:982-997 | internal/js_printer/js_printer.go:791-806 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) internal/js_lexer/js_lexer.go:305 — internal/js_lexer/js_lexer.go:305-318 | internal/js_lexer/js_lexer.go:320-333 | internal/js_lexer/js_lexer.go:351-364 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) internal/css_ast/css_ast.go:1012 — internal/css_ast/css_ast.go:1012-1016 | internal/css_ast/css_ast.go:1018-1022 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) cmd/esbuild/main_other.go:15 — cmd/esbuild/main_other.go:15-27 | cmd/esbuild/main_other.go:45-57 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) internal/css_lexer/css_lexer.go:256 — internal/css_lexer/css_lexer.go:256-277 | internal/js_lexer/js_lexer.go:2447-2468 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) internal/ast/ast.go:781 — internal/ast/ast.go:781-785 | internal/renamer/renamer.go:395-398 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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 (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 (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) internal/resolver/yarnpnp.go:630 — internal/resolver/yarnpnp.go:630-650 | internal/resolver/yarnpnp.go:656-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.
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 (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) internal/js_parser/js_parser.go:4911 — internal/js_parser/js_parser.go:4911-4925 | internal/js_parser/js_parser.go:4936-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: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.
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 (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) REDACTED:269 — REDACTED:269-274 | REDACTED:278-283 | REDACTED:288-293 | REDACTED:298-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.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) internal/js_parser/js_parser.go:2441 — internal/js_parser/js_parser.go:2441-2445 | internal/js_parser/js_parser.go:2795-2799 | internal/js_parser/js_parser.go:6969-6972 — 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. 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 (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) internal/js_parser/js_parser.go:14838 — internal/js_parser/js_parser.go:14838-14844 | internal/js_parser/js_parser.go:14877-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.
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.
R11 · Import Boundaries · Boundary violation [package · ×1
  • Boundary violation [package:relative-cross-package] scripts/test262-async.js:7 — scripts/test262-async.js:7 reaches into another package with a relative path (./node_modules/typescript) — import the package by name instead.
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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 11, cognitive 11) · ×1
  • Complex function (anonymous) (cyclomatic 11, cognitive 11) lib/shared/common.ts:1083 — (anonymous) has cyclomatic complexity 11 and cognitive complexity 11; 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 generateRangeTable (cyclomatic 11, cognitive 11) · ×1
  • Complex function generateRangeTable (cyclomatic 11, cognitive 11) scripts/gen-unicode-table.js:71 — generateRangeTable has cyclomatic complexity 11 and cognitive complexity 11; 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 18 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.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×1
  • JavaScript dependencies are not locked npm/esbuild/package.json:20 — npm/esbuild/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
Minor — 72 finding(s)
D19 · Documentation Quality · Documentation · ×30
  • Documentation: no build, run or usage example README.md:1 — the repository holds project manifests and neither `README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/aix-ppc64/README.md:1 — `aix-ppc64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/aix-ppc64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/android-arm/README.md:1 — `android-arm` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/android-arm/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/android-arm64/README.md:1 — `android-arm64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/android-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/android-x64/README.md:1 — `android-x64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/android-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/darwin-arm64/README.md:1 — `darwin-arm64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/darwin-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/darwin-x64/README.md:1 — `darwin-x64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/darwin-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/freebsd-arm64/README.md:1 — `freebsd-arm64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/freebsd-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/freebsd-x64/README.md:1 — `freebsd-x64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/freebsd-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/linux-arm/README.md:1 — `linux-arm` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/linux-arm/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/linux-arm64/README.md:1 — `linux-arm64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/linux-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/linux-ia32/README.md:1 — `linux-ia32` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/linux-ia32/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/linux-loong64/README.md:1 — `linux-loong64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/linux-loong64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/linux-mips64el/README.md:1 — `linux-mips64el` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/linux-mips64el/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/linux-ppc64/README.md:1 — `linux-ppc64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/linux-ppc64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/linux-riscv64/README.md:1 — `linux-riscv64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/linux-riscv64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/linux-s390x/README.md:1 — `linux-s390x` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/linux-s390x/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/linux-x64/README.md:1 — `linux-x64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/linux-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/netbsd-arm64/README.md:1 — `netbsd-arm64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/netbsd-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/netbsd-x64/README.md:1 — `netbsd-x64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/netbsd-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/openbsd-arm64/README.md:1 — `openbsd-arm64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/openbsd-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/openbsd-x64/README.md:1 — `openbsd-x64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/openbsd-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/openharmony-arm64/README.md:1 — `openharmony-arm64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/openharmony-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/sunos-x64/README.md:1 — `sunos-x64` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/sunos-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example npm/@esbuild/wasi-preview1/README.md:1 — `wasi-preview1` is a published package (`REDACTED` without `"private": true`) and neither `npm/@esbuild/wasi-preview1/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • + 5 more in this group — see findings.md.
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.
D24 · Comment Value · redundant comment · ×5
  • redundant comment scripts/end-to-end-tests.js:316 — "Test the "browser" field in "REDACTED"" repeats the code it sits on: 4 of its 5 words (test, browser, package, json) are already in `tests.push(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/end-to-end-tests.js:6591 — "Test class accessors" repeats the code it sits on: 3 of its 3 words (test, class, accessors) are already in `const classAccessorTest = ``. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:20 — "Generate "npm/esbuild/install.js"" repeats the code it sits on: 4 of its 5 words (npm, esbuild, install, js) are already in `childProcess.execFileSync(esbuildPath, [`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:36 — "Generate "npm/esbuild/lib/main.js"" repeats the code it sits on: 5 of its 6 words (npm, esbuild, lib, main, js) are already in `childProcess.execFileSync(esbuildPath, [`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/gen-unicode-table.js:59 — "UnicodeIDContinue: any Unicode code point with the Unicode property “ID_Continue”" repeats the code it sits on: 6 of its 6 words (unicode, id, continue, code, point, property) are already in `const idContinueESNext = require('@unicode/unicode-15.1.0/Binary_Property/ID_Continue/code-points')`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned file · ×2
  • Orphaned file internal/css_parser/css_decls_font_family.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file internal/css_parser/css_decls_font.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found cmd/esbuild/main.go:1 — 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/`. ADRs are expected here because `cmd/esbuild/main.go` makes this repository a deployable product (line 1).
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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 2 of 95 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 95 of the 137 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: internal/css_parser/css_decls_font_family.go, internal/css_parser/css_decls_font.go. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:6 — 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 4 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation compat-table/package.json:5 — `compat-table/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
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, got, undici, node:http) 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 (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~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. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
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.50.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.50.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/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-841a1dcf6fd84ba5b03af93c7a956fd8/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-841a1dcf6fd84ba5b03af93c7a956fd8/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .83artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .32artifacts/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/** .0artifacts/raw/trivy-fs.json

Run 01a1d4b4-375e-7d1d-803b-16892c1ed97e · 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