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

garrytan/gstack

Measured 26 October 2026, 11:41 UTC, at code version 6c3cf1b

Regression: 1 dimension fell since the last survey

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

CAI score 43out of 100 Weak
CriticalWeakAdequateStrongExemplary
Down 4 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 large codebase: 145,228 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 3.1 person-years · Weakest lens: Accessibility, 26

Findings by how serious they are

38 critical 1975 serious 494 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 October 2026, 11:41 UTC

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

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

84of 84 dimensions measured by tools.
2492of 2507 findings point to an exact file and line, so you can open each one in the code. The other 15 concern the repository as a whole, such as missing documentation.
84dimensions across 7 lenses, read from 145,228 lines of product code in 3 projects.
Chapters

Executive summary

garrytan/gstack falls short of our standard for production, held back most by its Accessibility lens, the interface's usability with a keyboard or assistive technology. It scores 43 out of 100 and is rated Weak, and 22 of its 38 critical findings are security problems.

Accessibility, at 26, is the weakest lens and counts most in the score. The best first steps are making the controls keyboard-usable and fixing focus, motion and contrast, each worth about 5 points. Raising Accessibility to 70 would lift the score to about 56.

Fifteen places in the code run text as code, which an attacker could use. Two weaknesses in the code could be used by an attacker, and one automatic update takes new releases before a bad one can be spotted. Replacing text run as code with direct calls, fixing the weaknesses the scanner points to and setting a waiting period for automatic updates would close these risks. Loading the key from a secret store instead of the code would fix the encryption key written into the code, and the pipeline step that runs a download without checking it needs each download checked against a known checksum first. The four tests that check nothing need to check the result they produce.

The product code is 145,228 lines, about €450,000 to rebuild.

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

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

If Accessibility rose from 26 to 70, the lowest score rated Strong, the score would rise from 43 to about 56.

Code composition: what the lines of code are
Product code 28%Tests 72%
New since the last survey: 477 findings

These 477 critical or serious findings weren't in the previous survey, on 12 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

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

Fixed since the last survey: 533 findings

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

  • Cyclomatic Complexity · autoplan-reconcile.parseReviewResult (cyclomatic 28) lib/autoplan-reconcile.ts
  • Cyclomatic Complexity · snapshot.readStable (cyclomatic 24) lib/cso/snapshot.ts
  • Cyclomatic Complexity · import-graph.resolveRef (cyclomatic 20) lib/pregate/import-graph.ts
  • Cognitive Complexity · autoplan-reconcile.parseReviewResult (cognitive 41) lib/autoplan-reconcile.ts
  • Cognitive Complexity · import-graph.resolveRef (cognitive 21) lib/pregate/import-graph.ts
  • Cognitive Complexity · gstack-autoplan-snapshot.implementationBounds (cognitive 20) bin/gstack-autoplan-snapshot.ts
  • Cognitive Complexity · eval-bg.followWorkflow (cognitive 19) scripts/eval-bg.ts
  • God Classes · FunctionTooLong: cookie-import-native.importNativeCookies browse/src/cookie-import-native.ts
  • Test Quality · No assertions: the committed seed holds the ceiling and the allowlist only shrinks test/free-seed-ratchet.test.ts
  • Churn × Complexity Hotspots · Repeated repair: test/helpers/e2e-helpers.ts test/helpers/e2e-helpers.ts
  • Churn × Complexity Hotspots · Repeated repair: hosts/claude/hooks/auq-error-fallback-hook.ts hosts/claude/hooks/auq-error-fallback-hook.ts
  • Churn × Complexity Hotspots · Repeated repair: scripts/eval-list.ts scripts/eval-list.ts
  • Static Analysis (SAST) · Medium: REDACTED REDACTED
  • Static Analysis (SAST) · Medium: REDACTED REDACTED
  • Static Analysis (SAST) · Medium: REDACTED REDACTED
  • Static Analysis (SAST) · Medium: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Code Duplication · Duplicated block (21 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (13 lines × 2 locations) design/src/diff.ts
  • Code Duplication · Duplicated block (13 lines × 2 locations) lib/cso/preparation-docker.ts
  • Code Duplication · Duplicated block (13 lines × 2 locations) lib/cso/preparation-executor.ts
  • Code Duplication · Duplicated block (13 lines × 2 locations) lib/cso/state.ts
  • Code Duplication · Duplicated block with local edits (13 matched lines × 2 locations) lib/gbrain-guards.ts
  • Code Duplication · Duplicated block (13 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (12 matched lines × 2 locations) browse/src/cli.ts
  • Code Duplication · Duplicated block (12 lines × 2 locations) browse/src/pty-session-lease.ts
  • Code Duplication · Duplicated block (12 lines × 2 locations) browse/src/read-commands.ts
  • Code Duplication · Duplicated block (12 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (12 matched lines × 2 locations) design/src/cli.ts
  • Code Duplication · Duplicated block (12 lines × 3 locations) extension/sidepanel-terminal.js
  • Code Duplication · Duplicated block with local edits (12 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (12 lines × 2 locations) lib/cso/admission.ts
  • Code Duplication · Duplicated block (12 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (12 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (12 lines × 3 locations) lib/cso/preparation-docker.ts
  • Code Duplication · Duplicated block (12 lines × 2 locations) scripts/capture-baseline.ts
  • Code Duplication · Duplicated block (11 lines × 2 locations) browse/src/meta-commands.ts
  • Code Duplication · Duplicated block (11 lines × 2 locations) design/src/daemon.ts
  • Code Duplication · Duplicated block (11 lines × 2 locations) lib/cso/preparation-docker.ts
  • Code Duplication · Duplicated block (11 lines × 2 locations) lib/cso/preparation-docker.ts
  • Code Duplication · Duplicated block (11 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (11 lines × 2 locations) lib/cso/state.ts
  • Code Duplication · Duplicated block (11 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (11 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2 locations) browse/src/cdp-inspector.ts
  • Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) browse/src/cli.ts
  • Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2 locations) browse/src/cookie-picker-routes.ts
  • Code Duplication · Duplicated block (10 lines × 2 locations) browse/src/domain-skill-commands.ts
  • Code Duplication · Duplicated block (10 lines × 2 locations) browse/src/find-browse.ts
  • Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) browse/src/read-commands.ts
  • Code Duplication · Duplicated block (10 lines × 2 locations) browse/src/routes/pty.ts
  • Code Duplication · Duplicated block (10 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2 locations) browse/src/write-commands.ts
  • Code Duplication · Duplicated block (10 lines × 2 locations) browse/src/xvfb.ts
  • Code Duplication · Duplicated block (10 lines × 2 locations) design/src/iterate.ts
  • Code Duplication · Duplicated block (10 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (10 lines × 2 locations) lib/model-policy.ts
  • Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) lib/model-policy.ts
  • Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) lib/spend-ledger.ts
  • Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) scripts/eval-bg.ts
  • Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) scripts/eval-bg.ts
  • Code Duplication · Duplicated block with local edits (9 matched lines × 2 locations) browse/src/browser-manager.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) browse/src/browser-skill-commands.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (9 lines × 2 locations) browse/src/domain-skill-commands.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) browse/src/routes/inspector.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (9 lines × 2 locations) design/src/design-to-code.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) design/src/diff.ts
  • Code Duplication · Duplicated block (9 lines × 3 locations) design/src/generate.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) ios-qa/daemon/src/devicectl.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) lib/code-intelligence/gbrain-adapter.ts
  • Code Duplication · Duplicated block with local edits (9 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (9 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (9 lines × 2 locations) lib/cso/preparation-executor.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) lib/cso/preparation-executor.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) lib/cso/snapshot.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) lib/cso/state.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) lib/cso/state.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) lib/cso/state.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) lib/cso/verification.ts
  • Code Duplication · Duplicated block with local edits (9 matched lines × 2 locations) lib/cso/verifier.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) lib/redact-patterns.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) scripts/eval-compare.ts
  • Code Duplication · Duplicated block with local edits (9 matched lines × 2 locations) scripts/external-skill-names.ts
  • Code Duplication · Duplicated block (8 lines × 3 locations) browse/src/browser-manager.ts
  • Code Duplication · Duplicated block (8 lines × 2 locations) browse/src/browser-skills.ts
  • Code Duplication · Duplicated block (8 lines × 2 locations) browse/src/meta-commands.ts
  • Code Duplication · Duplicated block (8 lines × 2 locations) browse/src/pty-session-lease.ts
  • Code Duplication · Duplicated block (8 lines × 2 locations) browse/src/read-commands.ts
  • Code Duplication · Duplicated block (8 lines × 2 locations) browse/src/routes/pairing.ts
  • Code Duplication · Duplicated block (8 lines × 2 locations) browse/src/write-commands.ts
  • Code Duplication · Duplicated block with local edits (8 matched lines × 2 locations) design/src/check.ts
  • Code Duplication · Duplicated block (8 lines × 2 locations) design/src/compare.ts
Rebuild cost: about €450,000 · Estimate
Cost to rebuild€150,000 to €760,000, for 2,507 to 7,953 hours of work, about 3.1 person-years for 1 to 6 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 43. 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.
SizeLarge: 145,228 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: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

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

1
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 5 points · Medium effort · Keyboard semantics
2
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Raises the score by about 5 points · Medium effort · Visual & motion safety
3
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Raises the score by about 4 points · Medium effort · Page structure

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €450,000 to build again, about 3.1 person-years of work. Its weakest lens is Accessibility, at 26 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. 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 4.5 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 9% to 19% on every change. The history of the code shows how much it changes: about 678,147 lines over the last 90 days, which is about 2,750,263 lines a year. At that pace, the extra work comes to an estimated 594.5 to 3566.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

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

388 modules, with 487 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; 348 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 bin.gstack-memory-ingest2 browse.src.browser-manager3 browse.src.security4 browse.src.security-sidecar-entry5 design.src.check6 design.src.persist7 ios-qa.daemon.src8 lib.autoplan-state9 lib.code-intelligence.contract10 lib.cso.runtime-catalog11 lib.gate-cost12 lib.gate-diff13 lib.redact-engine14 lib.ship-policy15 scripts.lib.paid-types16 scripts.resolvers17 bin18 browse.src.routes.table19 design.src.generate20 lib.cso.contracts21 lib.cso.preparation-executor22 lib.cso.scanner-catalog23 lib.headless-artifacts24 lib.pregate25 lib.pregate.checks26 lib.ship-queue-gate27 scripts.lib.paid-plan28 browse.src29 design.src30 lib.cso.scanner-executor31 lib.cso.verification32 lib.ship-queue-train33 make-pdf.src34 scripts.lib.paid-rerun35 autoplan.bin36 lib.autoplan-run37 lib.cso38 scripts39 scripts.lib40 lib
1 bin.gstack-memory-ingest
2 browse.src.browser-manager
3 browse.src.security
4 browse.src.security-sidecar-entry
5 design.src.check
6 design.src.persist
7 ios-qa.daemon.src
8 lib.autoplan-state
9 lib.code-intelligence.contract
10 lib.cso.runtime-catalog
11 lib.gate-cost
12 lib.gate-diff
13 lib.redact-engine
14 lib.ship-policy
15 scripts.lib.paid-types
16 scripts.resolvers
17 bin141
18 browse.src.routes.table11
19 design.src.generate1
20 lib.cso.contracts1
21 lib.cso.preparation-executor4
22 lib.cso.scanner-catalog1
23 lib.headless-artifacts1
24 lib.pregate1
25 lib.pregate.checks7
26 lib.ship-queue-gate1
27 scripts.lib.paid-plan8
28 browse.src10581
29 design.src1292
30 lib.cso.scanner-executor3312
31 lib.cso.verification25
32 lib.ship-queue-train211
33 make-pdf.src21
34 scripts.lib.paid-rerun1
35 autoplan.bin1
36 lib.autoplan-run311
37 lib.cso7329373
38 scripts2443322121
39 scripts.lib834
40 lib11114181510127936
Uses a module listed above itPart of a loopThe module itself
1 bin.gstack-memory-ingest2 browse.src.browser-manager3 browse.src.security4 browse.src.security-sidecar-entry5 design.src.check6 design.src.persist7 ios-qa.daemon.src8 lib.autoplan-state9 lib.code-intelligence.contract10 lib.cso.runtime-catalog11 lib.gate-cost12 lib.gate-diff13 lib.redact-engine14 lib.ship-policy15 scripts.lib.paid-types16 scripts.resolvers17 bin18 browse.src.routes.table19 design.src.generate20 lib.cso.contracts21 lib.cso.preparation-executor22 lib.cso.scanner-catalog23 lib.headless-artifacts24 lib.pregate25 lib.pregate.checks26 lib.ship-queue-gate27 scripts.lib.paid-plan28 browse.src29 design.src30 lib.cso.scanner-executor31 lib.cso.verification32 lib.ship-queue-train33 make-pdf.src34 scripts.lib.paid-rerun35 autoplan.bin36 lib.autoplan-run37 lib.cso38 scripts39 scripts.lib40 libbin.gstack-memory-ingest1browse.src.browser-manager2browse.src.security3browse.src.security-sidecar-entry4design.src.check5design.src.persist6ios-qa.daemon.src7lib.autoplan-state8lib.code-intelligence.contract9lib.cso.runtime-catalog10lib.gate-cost11lib.gate-diff12lib.redact-engine13lib.ship-policy14scripts.lib.paid-types15scripts.resolvers16bin17browse.src.routes.table18design.src.generate19lib.cso.contracts20lib.cso.preparation-executor21lib.cso.scanner-catalog22lib.headless-artifacts23lib.pregate24lib.pregate.checks25lib.ship-queue-gate26scripts.lib.paid-plan27browse.src28design.src29lib.cso.scanner-executor30lib.cso.verification31lib.ship-queue-train32make-pdf.src33scripts.lib.paid-rerun34autoplan.bin35lib.autoplan-run36lib.cso37scripts38scripts.lib39lib401411111411171810581129233122521121113117329373244332212183411114181510127936+348 more modules (most-connected shown)

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

At a glance — Architecture · 75% · Adequate · gated by D26 ·

At a glance — Maturity · 84% · Strong ·

At a glance — Readiness · 55% · Adequate · gated by P2, P7 ·

At a glance — Security · 61% · Adequate · gated by D29, S1 ·

At a glance — Accessibility · 26% · Weak · gated by AC3, AC4, AC6 ·

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 — Injection87High / Critical
A02:2025 — Security Misconfiguration8High / Critical
A03:2025 — Software Supply Chain Failures1Medium

Roadmap

First, ensure all interactive elements are fully keyboard-operable and visually distinct with proper focus styles, high-contrast colors, and motion safeguards. Next, correct the page structure by adding essential landmarks and language attributes, while simultaneously fixing forms by attaching programmatic labels to every control and button. Finally, integrate accessibility checks into the development toolchain and CI pipeline to enforce these standards automatically and prevent future regressions.

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

Do thisHelpsEffortDimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+5.5 ptsMediumKeyboard semantics
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+5.5 ptsMediumVisual & motion safety
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+4.0 ptsMediumPage structure
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with your test runner's axe binding (jest-axe, vitest-axe, cypress-axe or @axe-core/playwright) in tests, then gate axe/pa11y/Lighthouse in CI.+2.7 ptsMediumA11y enforcement
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+2.3 ptsMediumForms & labels
Resolve the 4 No assertions (empty test) finding(s) in Test Quality — start with unhandled-between-tests.fixture.ts (2), module-load-error.fixture.ts, commands.test.ts.+1.0 ptsLowTest Quality
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+1.5 ptsMediumLarge Files
Adopt pino (or winston) and log at meaningful points in the services you run.+1.2 ptsMediumObservability

File quality

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

FileScoreBandWorst signal
REDACTED1.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: 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.0MixedStatic Analysis (SAST): Medium: 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.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: REDACTED
browse/src/read-commands.ts4.8MixedCyclomatic Complexity: read-commands.handleReadCommand (cyclomatic 140)
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED

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

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

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

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

Could not be resolved — 11

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

Methodology & how to trust this report

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

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

What we checked — 84 dimensions across the health lenses
D1D2D3D5D6D7D9D10D12D13D14D15D17D19D20D26D28D29D30D31D34D35D36D37D43D44AC2AC3AC4AC5AC6AC7AX10AX3AX4AX6AX9C2GD1IC1M1M2M3M4P1P2P3P4P6P7P8PF3R1R10R11R2R3R4R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X26X28X29X3X30X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a17803-901a-77d7-a9ba-22072db44286.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in test/fixtures/ios-qa/FixtureApp produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.ts, .js, .cjs) and the reliability runner does support this ecosystem — it drives jest, vitest, mocha and egg-bin — but no test command in this repository names a runner the analyzer recognises, so it could not tell what to re-run. Read from the manifests: the root package has a `scripts.test` of `bun run scripts/test-free-shards.ts`. So flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's reading of test commands, not a missing .ts/.js/.cjs runner and not a finding about this repository.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its SwiftPM package dependencies. Nothing was read about its npm 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 (15 contributor(s) across 616 commit(s) sampled, automation and bot accounts excluded). One of them holds 93% of the history; the other 14 hold 0.5% 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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.
  • D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `autoplan/bin/guard-reasons.ts`, `browse/src/browser-manager.ts`, `browse/src/routes/table.ts`, `hosts/define-host.ts`, `ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift`, … (+20 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in browse/src/browser-manager.ts, whose lifetimes are not modelled 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.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • PF3 Async & latency hygiene — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 671 further occurrence(s) are not listed individually; the score already reflects all 711.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 198 further occurrence(s) are not listed individually; the score already reflects all 238.
  • R11 Import Boundaries — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 46 further occurrence(s) are not listed individually; the score already reflects all 86.
  • R3 Large Files — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 59 further occurrence(s) are not listed individually; the score already reflects all 99.
  • R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 93 further occurrence(s) are not listed individually; the score already reflects all 133.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's C 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.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 444 further occurrence(s) are not listed individually; the score already reflects all 484.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 24 further occurrence(s) are not listed individually; the score already reflects all 64.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • 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.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • 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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • 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.
  • 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.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • 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 (go.mod, 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.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

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

551 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was write-commands.handleWriteCommand at 383. A further 21 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 review-evidence.canReuseSharedLibsAdvisory at 33 — they are counted neither in the figure above nor in this dimension's score.

write-commands.handleWriteCommand (cyclomatic 383)browse/src/write-commands.ts:134
meta-commands.handleMetaCommand (cyclomatic 213)browse/src/meta-commands.ts:253
snapshot.handleSnapshot (cyclomatic 156)browse/src/snapshot.ts:103
paid-plan.parseRunManifest (cyclomatic 154)scripts/lib/paid-plan.ts:486
paid-report.runPaidReport (cyclomatic 143)REDACTED:540

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

What to do

  1. Bring the 23 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with write-commands.handleWriteCommand (cyclomatic 383), meta-commands.handleMetaCommand (cyclomatic 213), snapshot.handleSnapshot (cyclomatic 156). — 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 23 together lifts Cyclomatic Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

679 method(s) exceeded the cognitive complexity threshold of 15; the worst was write-commands.handleWriteCommand at 753.

BrowseClient.command (cognitive 16) · ×2browse/src/browse-client.ts:149
write-commands.handleWriteCommand (cognitive 753)browse/src/write-commands.ts:134
meta-commands.handleMetaCommand (cognitive 390)browse/src/meta-commands.ts:253
snapshot.handleSnapshot (cognitive 284)browse/src/snapshot.ts:103
read-commands.handleReadCommand (cognitive 218)browse/src/read-commands.ts:300

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

What to do

  1. Bring the 54 bodies over 60 down to 60 or less in Cognitive Complexity — start with write-commands.handleWriteCommand (cognitive 753), meta-commands.handleMetaCommand (cognitive 390), snapshot.handleSnapshot (cognitive 284). — 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 54 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.3 / 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.3 / 10 · rule-coverage 100% · ceiling Prevented

100 god class(es) detected.

FunctionTooLong: write-commands.handleWriteCommand · ×54browse/src/write-commands.ts:134
FileTooLong: REDACTED · ×34REDACTED
MethodTooLong: DockerGroup.createContainer · ×7REDACTED:627
ClassTooLong: BrowserManager · ×4browse/src/browser-manager.ts:357
TooManyMethods: BrowserManagerbrowse/src/browser-manager.ts:357

What to do

  1. Resolve the 54 FunctionTooLong finding(s) in God Classes — start with REDACTED (9), verification.ts (6), scanners.ts (3). — One of this dimension's main actionable groups (54 warning-level).
  2. Resolve the 34 FileTooLong finding(s) in God Classes — start with REDACTED (2), state.ts, verification.ts. — One of this dimension's main actionable groups (34 warning-level).
  3. Resolve the 7 MethodTooLong finding(s) in God Classes — start with preparation-executor.ts (2), preparation-docker.ts (2), browser-manager.ts (2). — One of this dimension's main actionable groups (7 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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+SwiftPM), 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.

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.6 / 10Stronggated by 1 serious finding✓ 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 9.6 / 10 · rule-coverage 100% · ceiling Verified

1 of 32 classes have LCOM4 above 3.

Low cohesion: BrowserManager (LCOM4 4)browse/src/browser-manager.ts:357

What to do

  1. Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with browser-manager.ts. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

What to do

  1. Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d7_recommendation.md.

D9 · Test Distribution9.9 / 10Exemplary✓ Tool-verified

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

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

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

18664 test methods: 18482 unit, 0 integration, 0 BDD, 182 e2e. The JavaScript/TypeScript suite contributes 18661 `it`/`test` case(s) across 1391 test file(s) declaring at least one beside 3 .NET test method(s); its tier split is read from package names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality9.9 / 10Adequategated by 4 critical findings✓ Tool-verified

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

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

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

372 skipped (368 with a documented reason), 90 zero-assertion, 4 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 18661 tests.

No assertions (empty test): never registered · ×4test/fixtures/shard-equivalence/module-load-error.fixture.ts:5
No assertions: every expected interactive skill still ships the AUQ format block · ×86test/auq-format-always-loaded.test.ts:130
Skipped test: needs Aside · ×4test/skill-e2e-design.test.ts:604
Fixed-sleep synchronisation: SIGTERM to the shim while the vendor is running: the vendor group dies with it, exit 0, logged · ×4test/memorable-user-prompt-hook.test.ts:919
Skipped (documented): (unnamed test) · ×368test/aside-render.test.ts:146

What to do

  1. Resolve the 4 No assertions (empty test) finding(s) in Test Quality — start with unhandled-between-tests.fixture.ts (2), module-load-error.fixture.ts, commands.test.ts. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 86 No assertions finding(s) in Test Quality — start with redact-prepush-scan-range.test.ts (6), skill-budget-regression.test.ts (4), skill-size-budget.test.ts (4). — One of this dimension's main actionable groups (86 warning-level).
  3. Resolve the 4 Skipped test finding(s) in Test Quality — start with skill-e2e-design.test.ts, skill-routing-e2e.test.ts, overlay-case.ts. — One of this dimension's main actionable groups (4 warning-level).
  4. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

6 outdated direct production npm dependency(ies) of 18 graded, 0 pinning defect(s), across 2 package.json (2 of them the product) and 2 committed lockfile(s). Development dependencies are deliberately not graded for currency: that grade is about what SHIPS. 0 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.

Outdated (npm): @anthropic-ai/sdk · ×6

✓ On the Gold path — maintain.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 1 SwiftPM package(s) use a banned license. SwiftPM has no package registry, so each package's licence is the one its repository declares: 0 of them read from the licence file the repository carries at the revision Package.resolved pins, and 1 — unpinned, or whose licence file could not be read or named — from api.deps.dev, which reports the licence the repository declares today. Graded: every package a committed Package.resolved pins, direct and transitive, and every declared dependency none pins. 1 of them are declared by a manifest that commits no Package.resolved (a library, whose resolution is its consumer's), so their own dependencies are resolved by whoever builds it and are not in this verdict. ★ COVERAGE OF THIS VERDICT: it grades this repository's SwiftPM package dependencies and nothing else. The repository also declares package.json, 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 Hotspots9.7 / 10Stronggated by 165 serious findings✓ 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 9.7 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: browse/src/write-commands.ts (7×383=2681); scripts/test-paid-shards.ts (21×98=2058); browse/src/meta-commands.ts (8×213=1704) Repeated repair below the complexity floor: scripts/lib/windows-curation.ts (12 of 18 changes were fixes); scripts/resolvers/qa.ts (9 of 13 changes were fixes); scripts/resolvers/constants.ts (8 of 15 changes were fixes)

Hotspot: browse/src/write-commands.ts · ×125browse/src/write-commands.ts:134
Repeated repair: scripts/lib/windows-curation.ts · ×40scripts/lib/windows-curation.ts:496

What to do

  1. Resolve the 125 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (4), snapshot.ts (2), write-commands.ts. — One of this dimension's main actionable groups (125 warning-level).
  2. Resolve the 40 Repeated repair finding(s) in Churn × Complexity Hotspots — start with windows-curation.ts, qa.ts, constants.ts. — One of this dimension's main actionable groups (40 warning-level).

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

D17 · Explicit Debt10.0 / 10Stronggated by 13 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

13 deducted task-comment markers across 141215 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.

TodoComment · ×12test/eng-batching-native-replay.test.ts:112
HackCommentbrowse/test/sidepanel-restart-dispose.test.ts:38

What to do

  1. Resolve the 12 TodoComment finding(s) in Explicit Debt — start with pregate-rust.test.ts (2), claude-pty-runner.boundaries.unit.test.ts (2), eng-batching-native-replay.test.ts. — One of this dimension's main actionable groups (12 warning-level).
  2. Resolve the 1 HackComment finding(s) in Explicit Debt — start with sidepanel-restart-dispose.test.ts. — One of this dimension's main actionable groups (1 warning-level).
  3. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality9.4 / 10Exemplary✓ Tool-verified

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

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

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

3 of 10 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question). How well each record argues its case is not measured.

ADR declares no status · ×3docs/designs/CONDUCTOR_SESSION_API.md:1detected by adr-integrity

✓ On the Gold path — maintain.

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

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

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

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

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

1 of 3 build units (SwiftPM, 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.

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

91 finding(s): 0 critical, 20 high, 68 medium, 0 low. semgrep hit a parse error in 111 file(s) — `.github/scripts/qualify-dia-macos.ts`, `autoplan/bin/guard-reasons.ts` (line 74), `autoplan/bin/phase-publication-hook` (line 4), `bin/gstack-analytics` (line 133), `bin/gstack-artifacts-init` (line 434, lines 434–450), … (+106 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. Separately, one or more rules could not re-parse an embedded snippet in 12 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D30 · Dependency Vulnerabilities9.9 / 10Exemplary✓ Tool-verified

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

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

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

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

REDACTED

✓ On the Gold path — maintain.

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

D31 · IaC & Container Security9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

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

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

REDACTED
REDACTED

What to do

  1. Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 7 Medium IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (7 warning-level).

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

D34 · Knowledge Freshness10.0 / 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 462 of the 532 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.9 / 10Stronggated by 3 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: read-commands.ts↔write-commands.ts 67%; meta-commands.ts↔write-commands.ts 60%; read-commands.ts↔snapshot.ts 50%

Change coupling: read-commands.ts ↔ write-commands.ts · ×3browse/src/read-commands.ts:1

What to do

  1. Resolve the 3 Change coupling finding(s) in Change Coupling — start with read-commands.ts (2), meta-commands.ts. — One of this dimension's main actionable groups (3 warning-level).

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

D36 · Supply-chain Provenance & Signing10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

Build pipeline generates provenance, signs artifacts and produces an SBOM.

✓ On the Gold path — maintain.

Detailed fixes: d36_recommendation.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 13 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.

AC2 · Forms & labels4.8 / 10Weak✓ Tool-verified

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

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

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

  • This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. — extension/popup.html:85
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. — extension/popup.html:86

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure2.4 / 10Critical✓ Tool-verified

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

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

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

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×3) — browse/src/commands.ts:0, extension/popup.html:2, extension/sidepanel.html:2
  • A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. (×3) — browse/src/commands.ts:0, extension/popup.html:2, extension/sidepanel.html:2
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×3) — browse/src/commands.ts:0, browse/src/welcome.html:2, extension/popup.html:2
  • A document must expose only one main landmark. Multiple visible <main> (or role="main") elements confuse the landmark map and the "skip to content" target. Keep one; remove or hide the rest. — extension/sidepanel.html:2

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • The repo's own CSS styles .footer-port with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — extension/sidepanel.html:186
  • This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — extension/sidepanel.html:165

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

AC6 · Visual & motion safety1.0 / 10Critical✓ Tool-verified

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

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

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

  • `.sidebar-prompt .arrow-right` moves (`animation: nudge 1.5s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — browse/src/welcome.html:67
  • `#gstack-inspector-highlight` moves (`transition: top 50ms ease, left 50ms ease, width 50ms ease, height 50ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/inspector.css:13
  • `.conn-banner.reconnected` moves (`animation: fadeOut 3s ease forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:80
  • `.chat-loading-spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:187
  • `.chat-bubble` moves (`animation: slideIn 150ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:225
  • `.agent-response` moves (`animation: slideIn 150ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:277
  • `.thinking-dot` moves (`animation: thinkingPulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:336
  • `.activity-entry.pending` moves (`animation: slideIn 150ms ease-out, borderPulse 2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:592
  • `.gap-banner` moves (`animation: bannerSlide 250ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:727
  • `.quick-action-btn.loading::after` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:791
  • `.command-input.error` moves (`animation: shake 300ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:831
  • `.inspector-action-btn.loading::after` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — extension/sidepanel.css:1134

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

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

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

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

  • No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 8 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

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

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

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

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

What to do

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

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

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

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

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

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

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

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

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

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

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

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

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

C2 · Access Controls10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary✓ Tool-verified

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

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

  • A placeholder string ("CHANGEME") is still in shipped code — typical of generated boilerplate that was never filled in. — lib/redact-patterns.ts:529
  • A placeholder string ("CHANGE_ME") is still in shipped code — typical of generated boilerplate that was never filled in. — lib/redact-patterns.ts:530
  • A placeholder string (", ...) → flag `[overused-font]`; as body…") is still in shipped code — typical of generated boilerplate that was never filled in. — scripts/resolvers/design.ts:301
  • A placeholder string ("## Visual Sketch (UI ideas only) If the…") is still in shipped code — typical of generated boilerplate that was never filled in. — scripts/resolvers/design.ts:594

What to do

  • Finish or delete the functions that still throw "not implemented", and replace placeholder text before shipping.
IC1 · Incompleteness & stubs7.6 / 10Strong✓ Tool-verified

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

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

  • `flushBuffers` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:646
  • `ensureDir` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — browse/src/tunnel-denial-log.ts:30
  • `gracefulShutdown` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — design/src/daemon.ts:199
  • The guard above `return selector;` also returns `selector`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — extension/inspector.js:153
  • Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition. — extension/sidepanel-terminal.js:376
  • `read` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:1619
  • `history` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:1629
  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×5) — test/fixtures/shard-equivalence/skip.fixture.ts:3, test/helpers/overlay-case.ts:63, test/skill-e2e-design.test.ts:604, …

What to do

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

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 1 of 2 project(s) that lack one — worth up to 1 pts.
M2 · Architecture documentation7.0 / 10Strong✓ 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.

  • 10 ADR-shaped document(s) detected by content — `docs/designs/CODE_INTELLIGENCE_PROVIDER_CONTRACT.md`, `docs/designs/CONDUCTOR_SESSION_API.md`, `docs/designs/GCOMPACTION.md`, `docs/designs/ML_PROMPT_INJECTION_KILLER.md`, `docs/designs/PLAN_TUNING_V0.md`, `docs/designs/PLAN_TUNING_V1.md`, `docs/designs/SYNC_GBRAIN_BATCH_INGEST.md`, `docs/designs/multi-agent-wave-2026-10-10/ceo-native.md`, `docs/designs/v2_PLAN.md`, `document-generate/SKILL.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.

What to do

  • Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

P2 · Observability1.0 / 10Critical✓ 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.

  • No logging call was found in the 368 JavaScript/TypeScript production file(s) this check read across 2 module(s). Each was searched for its ecosystem's logging libraries (JavaScript/TypeScript: pino, winston, bunyan, log4js, loglevel, consola, the NestJS Logger) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.

What to do

  • Adopt pino (or winston) and log at meaningful points in the services you run.
  • Add OpenTelemetry tracing/metrics (@opentelemetry/sdk-node) so requests are traceable across the system, not just health-probable.
P3 · Security & performance tooling9.0 / 10Exemplary✓ 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.

  • `cso-scanner-images.yml`, `scorecard.yml` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.

What to do

  • Trigger your SAST workflow on pull requests — a scan that only runs on a cron reports history, it does not gate.
  • Dependabot is configured but does not watch `npm` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
P4 · Deployment & Rollback7.0 / 10Strong✓ 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.

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.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×6) — REDACTED:79, browse/src/security-classifier.ts:82, browse/src/terminal-agent.ts:1050, …
  • `fetchImpl(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — design/src/receipted-fetch.ts:56

What to do

  • Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

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

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

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, 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.existsSync` in `install` 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. — bin/gstack-design-detect.ts:656
  • `fs.mkdirSync` in `install` 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. — bin/gstack-design-detect.ts:701
  • `fs.writeFileSync` in `install` 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. — bin/gstack-design-detect.ts:703
  • `fs.chmodSync` in `install` 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. — bin/gstack-design-detect.ts:704
  • `fs.renameSync` in `install` 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. — bin/gstack-design-detect.ts:705
  • `statSync` in `probeMode` 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. — bin/gstack-memory-ingest.ts:1412
  • `existsSync` in `ingestPassScoped` 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. — bin/gstack-memory-ingest.ts:2099
  • `existsSync` in `importBatch` 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. — bin/gstack-memory-ingest.ts:2841
  • `statSync` in `importBatch` 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. — bin/gstack-memory-ingest.ts:2841
  • `mkdirSync` in `launch` 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. — browse/src/browser-manager.ts:684
  • `fs.mkdirSync` in `launchHeaded` 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. — browse/src/browser-manager.ts:849
  • `Bun.spawnSync` in `launchHeaded` 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. — browse/src/browser-manager.ts:904
  • `fs.mkdirSync` in `promoteToHeaded` 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. — browse/src/browser-manager.ts:2137
  • `fs.existsSync` in `handleTest` 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. — browse/src/browser-skill-commands.ts:185
  • `fs.mkdtempSync` in `runToFiles` 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. — browse/src/browser-skill-commands.ts:250
  • `fs.rmSync` in `runToFiles` 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. — browse/src/browser-skill-commands.ts:288
  • `fs.existsSync` in `spawnSkill` 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. — browse/src/browser-skill-commands.ts:367
  • `Bun.spawnSync` in `killServer` 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. — browse/src/cli.ts:269
  • `Bun.spawnSync` in `startServer` 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. — browse/src/cli.ts:764
  • `fs.readFileSync` in `startServer` 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. — browse/src/cli.ts:827
  • `fs.mkdirSync` in `handlePairAgent` 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. — browse/src/cli.ts:1725
  • `fs.readFileSync` in `callback to readChainFlow` 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. — browse/src/cli.ts:2184
  • `fs.readFileSync` in `getWindowsAesKey` 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:627
  • `statSync` in `callback to executables.find` 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. — browse/src/cookie-import-native.ts:86
  • `realpathSync` in `importNativeCookies` 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) — browse/src/cookie-import-native.ts:91, browse/src/cookie-import-native.ts:92
  • `statSync` in `importNativeCookies` 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. — browse/src/cookie-import-native.ts:93
  • `spawnSync` in `handleEdit` 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. — browse/src/domain-skill-commands.ts:194
  • `fsSync.writeSync` in `writeAndSync` 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. — browse/src/domain-skills.ts:131
  • `fsSync.fsyncSync` in `writeAndSync` 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. — browse/src/domain-skills.ts:132
  • `fsSync.closeSync` in `writeAndSync` 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) — browse/src/domain-skills.ts:133, browse/src/domain-skills.ts:137
  • `execSync` in `handleMetaCommand` 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) — browse/src/meta-commands.ts:785, browse/src/meta-commands.ts:849
  • `fs.existsSync` in `handleMetaCommand` 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) — browse/src/meta-commands.ts:857, browse/src/meta-commands.ts:936
  • `fs.readdirSync` in `handleMetaCommand` 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. — browse/src/meta-commands.ts:859
  • `fs.readFileSync` in `handleMetaCommand` 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) — browse/src/meta-commands.ts:869, browse/src/meta-commands.ts:937
  • `fs.unlinkSync` in `handleMetaCommand` 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. — browse/src/meta-commands.ts:899

What to do

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

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

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

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

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

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

  • 20 duplicated blocks under the repository root have copies in at least two of the sibling directories browse, browser-skills, design, extension, hosts, ios-qa (+3 more sibling(s) not listed) — 11 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 20 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 20 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 20 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — browse/src/browse-client.ts:34
  • browse/src/browse-client.ts:34 · browser-skills/hackernews-frontpage/_lib/browse-client.ts:34 — these 2 files are line-for-line copies of one another — 136 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — browse/src/browse-client.ts:34
  • extension/sidepanel-terminal.js:571 · extension/sidepanel-terminal.js:805 — 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. — extension/sidepanel-terminal.js:571
  • browse/src/snapshot.ts:332 · browse/src/snapshot.ts:462 — the two spans are one implementation copied and then locally edited — 485 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. — browse/src/snapshot.ts:332
  • lib/cso/bounded-file.ts:13 · lib/cso/snapshot.ts:132 — the two spans are one implementation copied and then locally edited — 365 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. — lib/cso/bounded-file.ts:13
  • extension/content.js:176 · extension/inspector.js:214 — 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. — extension/content.js:176
  • design/src/evolve.ts:14 · design/src/iterate.ts:15 — the two spans are one implementation copied and then locally edited — 315 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. — design/src/evolve.ts:14
  • REDACTED:1246 · REDACTED:1291 — 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:1246
  • extension/content.js:146 · extension/inspector.js:182 — 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. — extension/content.js:146
  • REDACTED:272 · lib/cso/preparation-executor.ts:777 — the two spans are one implementation copied and then locally edited — 238 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:272
  • lib/model-policy.ts:555 · lib/model-policy.ts:619 — 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. — lib/model-policy.ts:555
  • design/src/daemon.ts:429 · design/src/serve.ts:184 — the two spans are one implementation copied and then locally edited — 187 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. — design/src/daemon.ts:429
  • design/src/serve.ts:124 · design/src/serve.ts:184 — the two spans are one implementation copied and then locally edited — 144 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. — design/src/serve.ts:124
  • REDACTED:1017 · REDACTED:1043 — 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:1017
  • lib/cso/state.ts:755 · lib/cso/state.ts:776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — lib/cso/state.ts:755
  • design/src/check.ts:29 · design/src/design-to-code.ts:28 — the two spans are one implementation copied and then locally edited — 107 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. — design/src/check.ts:29
  • lib/gate-cost-history.ts:378 · lib/gate-cost.ts:592 — the two spans are one implementation copied and then locally edited — 109 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. — lib/gate-cost-history.ts:378
  • lib/cso/verification.ts:2005 · lib/cso/verification.ts:2030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — lib/cso/verification.ts:2005
  • make-pdf/src/orchestrator.ts:82 · make-pdf/src/orchestrator.ts:264 — the two spans are one implementation copied and then locally edited — 127 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. — make-pdf/src/orchestrator.ts:82
  • lib/ship-queue-gate.ts:79 · lib/ship-queue-train.ts:149 — 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. — lib/ship-queue-gate.ts:79
  • browse/src/content-security.ts:163 · browse/src/read-commands.ts:246 — 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. — browse/src/content-security.ts:163
  • design/src/cli.ts:371 · design/src/serve.ts:238 — the two spans are one implementation copied and then locally edited — 86 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. — design/src/cli.ts:371
  • lib/cso/contracts.ts:682 · lib/cso/scanner-executor.ts:171 — the two spans are one implementation copied and then locally edited — 97 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. — lib/cso/contracts.ts:682
  • lib/cso/preparation-docker.ts:831 · lib/cso/verification.ts:107 — 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. — lib/cso/preparation-docker.ts:831
  • lib/cso/preparation-docker.ts:103 · lib/cso/preparation-executor.ts:553 — the two spans are one implementation copied and then locally edited — 126 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. — lib/cso/preparation-docker.ts:103
  • scripts/cso-eval-producer.ts:136 · scripts/cso-eval-producer.ts:159 — the two spans are one implementation copied and then locally edited — 128 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/cso-eval-producer.ts:136
  • design/src/daemon-state.ts:136 · lib/memory-ingest-landing.ts:184 — the two spans are one implementation copied and then locally edited — 53 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. — design/src/daemon-state.ts:136
  • REDACTED:539 · lib/cso/preparation-docker.ts:841 · lib/cso/preparation-docker.ts:1023 · lib/cso/verification.ts:117 — the 4 copies are spread across 3 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:539
  • make-pdf/src/cli.ts:126 · make-pdf/src/cli.ts:177 — 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. — make-pdf/src/cli.ts:126
  • browse/src/file-permissions.ts:115 · browse/src/file-permissions.ts:181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — browse/src/file-permissions.ts:115
  • browse/src/routes/pairing.ts:39 · browse/src/routes/tokens.ts:26 — the two spans are one implementation copied and then locally edited — 51 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. — browse/src/routes/pairing.ts:39
  • extension/sidepanel-terminal.js:342 · extension/sidepanel-terminal.js:645 · extension/sidepanel-terminal.js:854 — 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. — extension/sidepanel-terminal.js:342
  • hosts/claude/hooks/auq-error-fallback-hook.ts:43 · hosts/claude/hooks/question-log-hook.ts:71 · hosts/claude/hooks/question-preference-hook.ts:75 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — hosts/claude/hooks/auq-error-fallback-hook.ts:43
  • REDACTED:1233 · REDACTED:1319 — 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:1233
  • lib/cso/image-provisioning.ts:266 · lib/cso/image-provisioning.ts:314 — 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. — lib/cso/image-provisioning.ts:266
  • REDACTED:364 · lib/cso/preparation-executor.ts:580 — 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. — REDACTED:364
  • lib/cso/scanner-executor.ts:792 · lib/cso/verification.ts:1688 — 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. — lib/cso/scanner-executor.ts:792
  • browse/src/cdp-inspector.ts:634 · browse/src/cdp-inspector.ts:649 · browse/src/cdp-inspector.ts:698 — 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. — browse/src/cdp-inspector.ts:634
  • REDACTED:33 · browse/src/find-browse.ts:14 — the two spans are one implementation copied and then locally edited — 74 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:33
  • browse/src/routes/pty.ts:39 · browse/src/routes/pty.ts:114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — browse/src/routes/pty.ts:39

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 Boundaries5.4 / 10Adequate✓ 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.

  • lib/ship-queue-train-ready.ts:41 imports test/helpers/touchfiles.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — lib/ship-queue-train-ready.ts:41
  • scripts/capture-baseline.ts:16 imports test/helpers/capture-parity-baseline.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/capture-baseline.ts:16
  • scripts/capture-baseline.ts:17 imports test/helpers/parity-harness.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/capture-baseline.ts:17
  • scripts/cso-eval-producer.ts:15 imports test/helpers/providers/claude.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/cso-eval-producer.ts:15
  • scripts/cso-eval-producer.ts:16 imports test/helpers/providers/gpt.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/cso-eval-producer.ts:16
  • scripts/cso-eval-producer.ts:17 imports test/helpers/providers/gemini.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/cso-eval-producer.ts:17
  • scripts/cso-eval-producer.ts:18 imports test/helpers/pricing.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/cso-eval-producer.ts:18
  • scripts/cso-eval.ts:12 imports test/fixtures/cso-eval/materialize.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/cso-eval.ts:12
  • scripts/dev-skill.ts:9 imports test/helpers/skill-parser.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/dev-skill.ts:9
  • scripts/e2e-shard-reuse.ts:31 imports test/helpers/test-selection.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/e2e-shard-reuse.ts:31
  • scripts/e2e-shard-reuse.ts:32 imports test/helpers/touchfiles-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/e2e-shard-reuse.ts:32
  • scripts/e2e-shard-reuse.ts:34 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/e2e-shard-reuse.ts:34
  • scripts/eval-bg.ts:31 imports test/helpers/touchfiles.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/eval-bg.ts:31
  • scripts/eval-compare.ts:14 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/eval-compare.ts:14
  • scripts/eval-flake-rank.ts:53 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/eval-flake-rank.ts:53
  • scripts/eval-flake-rank.ts:56 imports test/helpers/touchfiles-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/eval-flake-rank.ts:56
  • scripts/eval-flake-rank.ts:57 imports test/helpers/periodic-exclude-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/eval-flake-rank.ts:57
  • scripts/eval-list.ts:10 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/eval-list.ts:10
  • scripts/eval-select.ts:18 imports test/helpers/touchfiles.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/eval-select.ts:18
  • scripts/eval-summary.ts:11 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/eval-summary.ts:11
  • REDACTED:26 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — REDACTED:26
  • scripts/gate-cost-replay.ts:43 imports test/helpers/touchfiles.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/gate-cost-replay.ts:43
  • scripts/judge-calibration-configs.ts:7 imports test/helpers/llm-judge.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/judge-calibration-configs.ts:7
  • scripts/judge-calibration-configs.ts:15 imports test/helpers/workflow-judge-input.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/judge-calibration-configs.ts:15
  • scripts/judge-calibration-configs.ts:16 imports test/helpers/cookie-workflow-judge-input.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/judge-calibration-configs.ts:16
  • scripts/judge-calibration.ts:26 imports test/helpers/llm-judge.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/judge-calibration.ts:26
  • scripts/judge-calibration.ts:27 imports test/helpers/eval-budgets.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/judge-calibration.ts:27
  • scripts/judge-calibration.ts:28 imports test/helpers/pricing.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/judge-calibration.ts:28
  • scripts/judge-controls.ts:15 imports test/helpers/llm-judge.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/judge-controls.ts:15
  • scripts/judge-controls.ts:16 imports test/helpers/workflow-judge-input.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/judge-controls.ts:16
  • scripts/lib/eval-history.ts:23 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/eval-history.ts:23
  • scripts/lib/eval-history.ts:24 imports test/helpers/eval-budgets.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/eval-history.ts:24
  • scripts/lib/paid-cases.ts:7 imports test/helpers/periodic-exclude-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/paid-cases.ts:7
  • scripts/lib/paid-cases.ts:9 imports test/helpers/touchfiles-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/paid-cases.ts:9
  • scripts/lib/paid-cases.ts:10 imports test/helpers/touchfiles.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/paid-cases.ts:10
  • scripts/lib/paid-cases.ts:12 imports test/helpers/e2e-hosts.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/paid-cases.ts:12
  • scripts/lib/paid-plan.ts:7 imports test/helpers/periodic-exclude-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/paid-plan.ts:7
  • scripts/lib/paid-plan.ts:8 imports test/helpers/eval-budgets.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/paid-plan.ts:8
  • scripts/lib/paid-plan.ts:9 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/paid-plan.ts:9
  • scripts/lib/paid-plan.ts:10 imports test/helpers/touchfiles-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/lib/paid-plan.ts:10

What to do

  • Fix the listed violations: move the shared test helper into a source directory production code may depend on (86 rows).
R2 · Cyclomatic Complexity7.0 / 10Strong✓ Tool-verified

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

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

  • handleWriteCommand has cyclomatic complexity 316 and cognitive complexity 601; 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. — browse/src/write-commands.ts:134
  • handleMetaCommand has cyclomatic complexity 193 and cognitive complexity 362; 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. — browse/src/meta-commands.ts:253
  • hasStructuredStaleFillFinding has cyclomatic complexity 178 and cognitive complexity 285; 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. — test/helpers/ceo-section-loading-fixture.ts:440
  • readPlanSkillQuestions has cyclomatic complexity 165 and cognitive complexity 265; 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. — test/helpers/plan-skill-questions.ts:148
  • parseRunManifest has cyclomatic complexity 136 and cognitive complexity 137; 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/lib/paid-plan.ts:486
  • runSkillTest has cyclomatic complexity 123 and cognitive complexity 186; 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. — test/helpers/session-runner.ts:232
  • runPaidReport has cyclomatic complexity 121 and cognitive complexity 181; 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:540
  • validatePlanReviewDecisionResponse has cyclomatic complexity 120 and cognitive complexity 196; 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. — test/helpers/plan-review-decisions.ts:224
  • validateCallerEvidence has cyclomatic complexity 114 and cognitive complexity 142; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — test/helpers/qa-callers-fixture.ts:271
  • handleSnapshot has cyclomatic complexity 113 and cognitive complexity 209; 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. — browse/src/snapshot.ts:103
  • validateRepairBundle has cyclomatic complexity 110 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/cso/verification.ts:1310
  • recordedBatchingIssue has cyclomatic complexity 98 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — test/helpers/eng-seeded-coverage.ts:126
  • main has cyclomatic complexity 95 and cognitive complexity 144; 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/test-paid-shards.ts:855
  • docsAtomicSources has cyclomatic complexity 95 and cognitive complexity 123; 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. — test/helpers/docsync-observer.ts:26
  • engCacheWriterDecision has cyclomatic complexity 95 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — test/helpers/eng-cache-writer-decision.ts:5
  • autoplanDualVoiceEvidence has cyclomatic complexity 94 and cognitive complexity 149; 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. — test/helpers/autoplan-dual-voice-evidence.ts:63
  • validateResult has cyclomatic complexity 94 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/cso-eval.ts:644
  • readPlanCountTranscript has cyclomatic complexity 90 and cognitive complexity 178; 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/claude-public-transcript.ts:75
  • validateQACheckpoints has cyclomatic complexity 90 and cognitive complexity 124; 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. — test/helpers/qa-checkpoint-evidence.ts:88
  • handleReadCommand has cyclomatic complexity 89 and cognitive complexity 137; 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. — browse/src/read-commands.ts:300

What to do

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

  • REDACTED has 2957 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • lib/cso/state.ts has 2607 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/cso/state.ts:1
  • browse/src/browser-manager.ts has 2263 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — browse/src/browser-manager.ts:1
  • lib/cso/verification.ts has 2179 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/cso/verification.ts:1
  • browse/src/cli.ts has 2121 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — browse/src/cli.ts:1
  • REDACTED has 2081 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • scripts/test-free-shards.ts has 2004 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/test-free-shards.ts:1
  • lib/cso/preparation-docker.ts has 1687 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/cso/preparation-docker.ts:1
  • lib/cso/preparation-executor.ts has 1495 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/cso/preparation-executor.ts:1
  • lib/context-bill.ts has 1340 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/context-bill.ts:1
  • browse/src/write-commands.ts has 1334 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — browse/src/write-commands.ts:1
  • scripts/resolvers/design.ts has 1318 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/resolvers/design.ts:1
  • extension/sidepanel.js has 1282 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — extension/sidepanel.js:1
  • REDACTED has 1251 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • lib/cso/snapshot.ts has 1189 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/cso/snapshot.ts:1
  • browse/src/terminal-agent.ts has 1149 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — browse/src/terminal-agent.ts:1
  • REDACTED has 1133 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 1127 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • scripts/test-paid-shards.ts has 1119 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/test-paid-shards.ts:1
  • lib/cso/contracts.ts has 1072 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/cso/contracts.ts:1
  • lib/cso/scanners.ts has 1045 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/cso/scanners.ts:1
  • REDACTED has 1036 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • browse/src/meta-commands.ts has 1031 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — browse/src/meta-commands.ts:1
  • lib/redact-patterns.ts has 1024 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/redact-patterns.ts:1
  • extension/sidepanel-terminal.js has 984 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — extension/sidepanel-terminal.js:1
  • lib/cso/cache.ts has 969 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/cso/cache.ts:1
  • scripts/cso-eval.ts has 946 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/cso-eval.ts:1
  • lib/cso/scanner-executor.ts has 883 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/cso/scanner-executor.ts:1
  • scripts/lib/paid-plan.ts has 854 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/lib/paid-plan.ts:1
  • REDACTED has 822 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • ios-qa/scripts/gen-accessors.ts has 815 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — ios-qa/scripts/gen-accessors.ts:1
  • lib/result-codes.ts has 790 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/result-codes.ts:1
  • REDACTED has 776 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 775 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • make-pdf/src/diagram-prepass.ts has 759 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — make-pdf/src/diagram-prepass.ts:1
  • lib/cso/process.ts has 745 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/cso/process.ts:1
  • browse/src/cdp-inspector.ts has 736 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — browse/src/cdp-inspector.ts:1
  • REDACTED has 731 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • lib/design-catalog.ts has 713 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/design-catalog.ts:1
  • browse/src/read-commands.ts has 695 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — browse/src/read-commands.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 Coverage9.7 / 10Exemplary✓ Tool-verified

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×14) — REDACTED:1, supabase/functions/community-pulse/index.ts:1, lib/autoplan-revise.ts:1, …

What to do

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

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

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

R7 · Dead Code7.9 / 10Strong✓ Tool-verified

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

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

  • Unreachable from the 604 application, 68 tooling and 1713 test entry point(s) detected in this repo. Gate removals on `bun run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (604 application, 68 tooling, 1713 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 (×8) — REDACTED, scripts/preflight-agent-sdk.ts, ios-qa/daemon/src/cli-mint.ts, …
  • no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (REDACTED) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×2) — lib/autoplan-revise.ts, lib/autoplan-migrate.ts
  • Nothing imports this binding — it is safe to review for removal. (×28) — ios-qa/daemon/src/devicectl.ts:364, REDACTED:26, ios-qa/daemon/src/single-instance.ts:133, …
  • Nothing ultimately consumes this binding: its only referrer is the re-export in lib/code-intelligence/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in lib/code-intelligence/index.ts in the same commit, or the barrel will import a name that no longer exists. — lib/code-intelligence/contract.ts:48

What to do

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

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

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

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. — test/dependency-security.test.ts:5
  • Declared in the root package.json 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.
  • Declared in lib/diagram-render/package.json 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.

What to do

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

  • lib/gbrain-guards.ts → REDACTED → lib/gbrain-guards.ts — lib/gbrain-guards.ts:39
  • scripts/exercised-map.ts → scripts/test-paid-shards.ts → REDACTED → scripts/exercised-map.ts (one verified cycle inside a mutually-dependent group of 4 files) — scripts/exercised-map.ts:38

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture2.0 / 10Critical✓ Tool-verified

Other · Security — Read from this repository's JavaScript/TypeScript source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository. Its Node HTTP listeners were read for HTTPS enforcement alone — TLS served, a redirect to https:// or HSTS, or a TLS-terminating proxy configuration committed beside the server — each judged per server package.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash. — REDACTED:578
  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×3) — hosts/claude/hooks/question-log-hook.ts:90, REDACTED:381, REDACTED:386
  • `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) (×2) — REDACTED:94, ios-qa/daemon/src/index.ts:230
  • `srv.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) — browse/src/port-allocator.ts:103

What to do

  • Load cryptographic key and salt material from configuration, an environment variable or a secrets manager rather than fixing it in the source, and fail fast at startup when it is absent — a default that silently works is the one that reaches production. Rotate anything already committed: it must be treated as disclosed. Salts should be generated per password and stored with the hash, never shared across installations.
  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 3 sites, not one: `hosts/claude/hooks/question-log-hook.ts:90` (createHash("sha1")), `REDACTED:381` (createHash("sha1")), `REDACTED:386` (createHash("sha1")). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Enforce HTTPS on each listed server: serve TLS itself, or redirect plain requests to `https://` and send `Strict-Transport-Security` (`helmet()` does by default) behind the TLS-terminating proxy — and commit that proxy's configuration beside the service. A server only this machine reaches should bind `127.0.0.1`.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document3.2 / 10Weak✓ Tool-verified

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

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

  • `tokensFlat` is exported, takes a document from its caller (line 367) and hands it to `walk`, which calls itself at line 374 (`walk`) with a piece of `v` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:374
  • `checkSchema` is exported and takes `value: unknown` from its caller, and it calls itself at line 263 (`checkSchema`) with a piece of `value` (and at line 270) — and nowhere in `checkSchema` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `checkSchema` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/headless-artifacts.ts:263
  • `canonical` is exported and takes `value: unknown` from its caller, and it calls itself at line 47 (`canonical`) with a piece of `value` (and at line 51) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/cso/contracts.ts:47
  • `sanitizeForJson` is exported, takes a document from its caller (line 293) and hands it to `sanitizeJson`, which calls itself at line 279 (`sanitizeJson`) with a piece of `value` (and at line 287) — and nowhere in `sanitizeJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sanitizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/cso/process.ts:279
  • `checkCanaryInStructure` is exported and takes `value: unknown` from its caller, and it calls itself at line 301 (`checkCanaryInStructure`) with a piece of `value` (and at line 305) — and nowhere in `checkCanaryInStructure` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `checkCanaryInStructure` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — browse/src/security.ts:301

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X2 · Cancellation propagation8.2 / 10Strong✓ 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 27/39 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `download` 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:424
  • `mintSession` 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 })`. — extension/sidepanel-terminal.js:183
  • `tick` 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 })`. — extension/sidepanel-terminal.js:240
  • `checkClaudeAvailable` 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 })`. — extension/sidepanel-terminal.js:386
  • `gstackScanForPTYInject` 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 })`. — extension/sidepanel-terminal.js:507
  • `forceRestart` 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 })`. — extension/sidepanel-terminal.js:724
  • `ensureSseSessionCookie` 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 })`. — extension/sidepanel.js:251
  • `onclick` 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 })`. — extension/sidepanel.js:488
  • `publishBoard` 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:188
  • `superviseNativeCookieImport` awaits `sleep(…)` 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: `sleep(url, { signal })`. — browse/src/cookie-import-native-worker.ts:92
  • `downloadFile` 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 })`. — browse/src/security-classifier.ts:81
  • `handleWriteCommand` 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 })`. — browse/src/write-commands.ts:134

What to do

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

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

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

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

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

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

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

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

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

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

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

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

  • `formatTime(entry.timestamp)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:186
  • `duration` is text this program did not author, and it is written into the text of an element through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:193
  • `fmtBoxVal(m.top)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:739
  • `fmtBoxVal(m.right)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:740
  • `fmtBoxVal(m.bottom)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:741
  • `fmtBoxVal(m.left)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:742
  • `fmtBoxVal(b.top)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:745
  • `fmtBoxVal(b.right)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:746
  • `fmtBoxVal(b.bottom)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:747
  • `fmtBoxVal(b.left)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:748
  • `fmtBoxVal(p.top)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:751
  • `fmtBoxVal(p.right)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:752
  • `fmtBoxVal(p.bottom)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:753
  • `fmtBoxVal(p.left)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — extension/sidepanel.js:754
  • `svgText` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — lib/diagram-render/src/entry.ts:151

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

X3 · Exception handling4.6 / 10Weak✓ 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.

  • 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. (×31) — scripts/analytics.ts:41, scripts/eval-bg.ts:331, scripts/exercised-map.ts:81, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×9) — scripts/eval-flake-rank.ts:83, scripts/eval-flake-rank.ts:129, scripts/eval-flake-rank.ts:228, …

What to do

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

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

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

X5 · Nullable reference types6.5 / 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.

  • ~8.7 `!` null assertions per 1k TypeScript source lines — 1272 assertion(s) across the 146456 source line(s) of the 510 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: scripts/pr-dependencies.ts (53), scripts/lib/paid-plan.ts (48), lib/eval-plan.ts (39). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

What to do

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

WCAG coverage — what static analysis assessed

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

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health52%Adequate — gated by D1, D2, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture75%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity84%StrongStrongest area.
Readiness55%Adequate — gated by P2, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security61%Adequate — gated by D29, S1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility26%Weak — gated by AC3, AC4, AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateAcceptable, with room to improve.
Unscored — 3 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

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

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 43 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
  • AX1 Captive dependencies — 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
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
  • D11 Test Reliability — Test reliability not included — the test command names no runner the analyzer recognises
  • 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# only; JavaScript, Swift, TypeScript, html not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .swift, .ts, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — None of 3 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.ts), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 25 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D4 Code Duplication — This repository's production source (.ts) is not read by D4's token comparison, which compares .NET source: duplication in it is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream. Not scored here — read the R10 card for this repository's duplication. The rest — .c (728 lines, 0.5% of production source) — is compared by neither card, so duplication there is unmeasured; it is a corner of this repository, not its product.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D8 Code Coverage — Coverage not measured — Swift suite
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (a Domain/Aggregates/ValueObjects layer)
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: allocation awareness is rated where code engineers for it — at least 400 production lines that ship benchmarks or already use allocation-aware idioms (8 or more). This repository's Swift code has 711 production line(s), 0 such use(s) and no benchmarks, so there is no allocation work to rate. The card is reward-only: its absence costs nothing.
  • R5 Dependency Freshness — uses a bun lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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 — 38 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D10 · Test Quality · No assertions (empty test) · ×4
  • No assertions (empty test): never registered test/fixtures/shard-equivalence/module-load-error.fixture.ts:5 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): first test/fixtures/shard-equivalence/unhandled-between-tests.fixture.ts:3 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): second test/fixtures/shard-equivalence/unhandled-between-tests.fixture.ts:6 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): form: goto → snapshot → fill @ref → click @ref browse/test/commands.test.ts:1708 — Test method has an empty body — it asserts nothing and exercises no code.
AC3 · Page structure · <html> without a lang · ×3
  • <html> without a lang browse/src/commands.ts — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang extension/popup.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang extension/sidepanel.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure · Document without a <title> · ×3
  • Document without a <title> browse/src/commands.ts — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
  • Document without a <title> extension/popup.html:2 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
  • Document without a <title> extension/sidepanel.html:2 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
AC2 · Forms & labels · <label> that labels no control · ×1
  • <label> that labels no control extension/popup.html:85 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels · <input> without a programmatic label · ×1
  • <input> without a programmatic label extension/popup.html:86 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×1
  • Clickable element isn't keyboard-operable extension/sidepanel.html:186 — The repo's own CSS styles .footer-port with `cursor: pointer`, so this <span> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
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
D31 · IaC & Container Security · High IaC · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import 'adm-zip' · ×1
  • Unlisted import 'adm-zip' test/dependency-security.test.ts:5 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (2 files) · ×1
  • Import cycle (2 files) lib/gbrain-guards.ts:39 — lib/gbrain-guards.ts → REDACTED → lib/gbrain-guards.ts
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) scripts/exercised-map.ts:38 — scripts/exercised-map.ts → scripts/test-paid-shards.ts → REDACTED → scripts/exercised-map.ts (one verified cycle inside a mutually-dependent group of 4 files)
S1 · Web-Security Posture · Cryptographic key material is a compile-time constant · ×1
  • Cryptographic key material is a compile-time constant REDACTED:578 — The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
Serious — 1975 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×125
  • Hotspot: browse/src/write-commands.ts browse/src/write-commands.ts:134 — browse/src/write-commands.ts changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 383 in write-commands.handleWriteCommand at line 134. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- browse/src/write-commands.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/test-paid-shards.ts scripts/test-paid-shards.ts:855 — scripts/test-paid-shards.ts changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 98 in test-paid-shards.main at line 855. 7 of those changes were fix/bug commits, and the other 14 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/test-paid-shards.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: browse/src/meta-commands.ts browse/src/meta-commands.ts:253 — browse/src/meta-commands.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 213 in meta-commands.handleMetaCommand at line 253. 7 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- browse/src/meta-commands.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/test-free-shards.ts scripts/test-free-shards.ts:1898 — scripts/test-free-shards.ts changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in test-free-shards.main at line 1898. 13 of those changes were fix/bug commits, and the other 16 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/test-free-shards.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: browse/src/cli.ts browse/src/cli.ts:1794 — browse/src/cli.ts changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in cli.main at line 1794. 18 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- browse/src/cli.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: test/helpers/docsync-observer.ts test/helpers/docsync-observer.ts:26 — test/helpers/docsync-observer.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in docsAtomicSources at line 26. 10 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- test/helpers/docsync-observer.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:920 — REDACTED changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in gen-skill-docs.runGeneration at line 920. 11 of those changes were fix/bug commits, and the other 12 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00: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:970 — REDACTED changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in server.handleCommandInternalImpl at line 970. 16 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00: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: test/helpers/session-runner.ts test/helpers/session-runner.ts:232 — test/helpers/session-runner.ts changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in runSkillTest at line 232. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- test/helpers/session-runner.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/test-pr-profile.ts scripts/test-pr-profile.ts:367 — scripts/test-pr-profile.ts changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in test-pr-profile.selectPrProfile at line 367. 8 of those changes were fix/bug commits, and the other 16 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/test-pr-profile.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:540 — REDACTED changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 143 in paid-report.runPaidReport at line 540. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00: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: test/helpers/qa-callers-fixture.ts test/helpers/qa-callers-fixture.ts:271 — test/helpers/qa-callers-fixture.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 114 in validateCallerEvidence at line 271. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- test/helpers/qa-callers-fixture.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: browse/src/terminal-agent.ts browse/src/terminal-agent.ts:594 — browse/src/terminal-agent.ts changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in terminal-agent.buildServer at line 594. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- browse/src/terminal-agent.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/cso-eval.ts scripts/cso-eval.ts:644 — scripts/cso-eval.ts changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in cso-eval.validateResult at line 644. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/cso-eval.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:627 — REDACTED changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in DockerGroup.createContainer at line 627. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00: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: bin/gstack-gbrain-sync.ts bin/gstack-gbrain-sync.ts:1154 — bin/gstack-gbrain-sync.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in gstack-gbrain-sync.runCodeImport at line 1154. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- bin/gstack-gbrain-sync.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/lib/paid-plan.ts scripts/lib/paid-plan.ts:486 — scripts/lib/paid-plan.ts changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 154 in paid-plan.parseRunManifest at line 486. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/lib/paid-plan.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: bin/gstack-memory-ingest.ts bin/gstack-memory-ingest.ts:2091 — bin/gstack-memory-ingest.ts changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in gstack-memory-ingest.ingestPassScoped at line 2091. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- bin/gstack-memory-ingest.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/cso/state.ts lib/cso/state.ts:1570 — lib/cso/state.ts changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in state.scanRunLeases at line 1570. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- lib/cso/state.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: browse/src/browser-manager.ts browse/src/browser-manager.ts:789 — browse/src/browser-manager.ts changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in BrowserManager.launchHeaded at line 789. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- browse/src/browser-manager.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: lib/cso/snapshot.ts lib/cso/snapshot.ts:633 — lib/cso/snapshot.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 100 in snapshot.capture at line 633. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- lib/cso/snapshot.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: test/helpers/eng-seeded-coverage.ts test/helpers/eng-seeded-coverage.ts:126 — test/helpers/eng-seeded-coverage.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 98 in recordedBatchingIssue at line 126. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- test/helpers/eng-seeded-coverage.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: test/helpers/auq-sdk-capture.ts test/helpers/auq-sdk-capture.ts:260 — test/helpers/auq-sdk-capture.ts changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in captureSectionReads at line 260. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- test/helpers/auq-sdk-capture.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: test/helpers/autoplan-dual-voice-evidence.ts test/helpers/autoplan-dual-voice-evidence.ts:63 — test/helpers/autoplan-dual-voice-evidence.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in autoplanDualVoiceEvidence at line 63. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- test/helpers/autoplan-dual-voice-evidence.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: browse/src/snapshot.ts browse/src/snapshot.ts:103 — browse/src/snapshot.ts changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 156 in snapshot.handleSnapshot at line 103. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- browse/src/snapshot.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 100 more in this group — see findings.md.
D10 · Test Quality · No assertions · ×86
  • No assertions: every expected interactive skill still ships the AUQ format block test/auq-format-always-loaded.test.ts:130 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: ${skill}: full AUQ format spec present in always-loaded SKILL.md test/auq-format-always-loaded.test.ts:143 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: ${skill}: per-skill AUQ rules survive in skeleton+sections union test/auq-format-always-loaded.test.ts:185 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: cleanup test/compare-pr-version.test.ts:383 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: tolerates the directory already existing test/fs-utils.test.ts:43 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: templates with parameterized resolvers pass unresolved check test/gen-skill-docs.test.ts:2224 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: no generated SKILL.md contains find with -delete flag test/gen-skill-docs.test.ts:4045 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: every DEFAULTS key is read by code or listed as prose-only test/gstack-config-defaults.test.ts:222 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: seal validates the saved verdict and prints the receipt that check requires test/office-hours-review.test.ts:486 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: no resolver or template hand-writes the failure bullets test/outside-voice-failure-policy.test.ts:150 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: capturedFromCommit is on the allowlist (rejects ad-hoc regeneration) test/parity-baseline-integrity.test.ts:67 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: content hash is stable (catches any byte-level edit) test/parity-baseline-integrity.test.ts:120 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: all PARITY_INVARIANTS pass test/parity-suite.test.ts:41 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: (unnamed test) test/plan-tune-cathedral.test.ts:105 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: does NOT check out the PR head ref (no fork-code execution) test/pr-title-sync-workflow-safety.test.ts:87 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: does NOT interpolate ${{ github.event.pull_request.* }} inside a run: block test/pr-title-sync-workflow-safety.test.ts:105 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: global, system, and environment-injected hooksPath cannot reject the push test/redact-prepush-rebase-force-push.test.ts:159 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: an inherited global hooksPath cannot reject the fixture push test/redact-prepush-scan-range.test.ts:333 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: an inherited system hooksPath cannot reject the fixture push test/redact-prepush-scan-range.test.ts:338 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: GIT_CONFIG_COUNT cannot inject a rejecting hooksPath test/redact-prepush-scan-range.test.ts:343 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: GIT_CONFIG_PARAMETERS cannot inject a rejecting hooksPath test/redact-prepush-scan-range.test.ts:352 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: an inherited init.templateDir cannot install a rejecting hook test/redact-prepush-scan-range.test.ts:359 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: a hooksPath in the default global files under HOME or XDG_CONFIG_HOME cannot reject the fixture push test/redact-prepush-scan-range.test.ts:381 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: all 5 planning skills produce output under ~600 chars (~150 tokens) test/resolvers-gbrain-save-results.test.ts:73 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: structural scanner: every generated dispatch imperative carries the flag test/run-in-background-guidance.test.ts:517 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • + 61 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×54
  • FunctionTooLong: write-commands.handleWriteCommand browse/src/write-commands.ts:134 — FunctionTooLong — handleWriteCommand runs 867 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 767 over it, 8.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: meta-commands.handleMetaCommand browse/src/meta-commands.ts:253 — FunctionTooLong — handleMetaCommand runs 555 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 455 over it, 5.55× 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: read-commands.handleReadCommand browse/src/read-commands.ts:300 — FunctionTooLong — handleReadCommand runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.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.
  • FunctionTooLong: verification.verifyRepair lib/cso/verification.ts:1836 — FunctionTooLong — verifyRepair runs 310 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 210 over it, 3.10× 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.main browse/src/cli.ts:1794 — FunctionTooLong — main runs 256 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 156 over it, 2.56× 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: scanners.scannerPlans lib/cso/scanners.ts:205 — FunctionTooLong — scannerPlans runs 256 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 156 over it, 2.56× 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: verification.certify lib/cso/verification.ts:1043 — FunctionTooLong — certify runs 240 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× 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: paid-report.runPaidReport REDACTED:540 — FunctionTooLong — runPaidReport runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: verification.validateRepairBundle lib/cso/verification.ts:1310 — FunctionTooLong — validateRepairBundle runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× 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: server.buildFetchHandler REDACTED:1511 — FunctionTooLong — buildFetchHandler runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.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.
  • FunctionTooLong: terminal-agent.buildServer browse/src/terminal-agent.ts:594 — FunctionTooLong — buildServer runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× 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: server.start REDACTED:1877 — FunctionTooLong — start 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: verification.canonicalStartPlan lib/cso/verification.ts:775 — FunctionTooLong — canonicalStartPlan runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: cli.verify REDACTED:2304 — FunctionTooLong — verify runs 178 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 78 over it, 1.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.
  • FunctionTooLong: cli.replay REDACTED:2604 — FunctionTooLong — replay runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× 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: image-provisioning.provisionCatalogImages lib/cso/image-provisioning.ts:162 — FunctionTooLong — provisionCatalogImages runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× 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: paid-plan.buildRunManifest scripts/lib/paid-plan.ts:279 — FunctionTooLong — buildRunManifest 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: runtime-catalog.validateRuntimeCatalog REDACTED:171 — FunctionTooLong — validateRuntimeCatalog runs 162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× 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: scanner-executor.createDockerScannerRunner lib/cso/scanner-executor.ts:704 — FunctionTooLong — createDockerScannerRunner 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: cookie-picker-routes.handleCookiePickerRoute browse/src/cookie-picker-routes.ts:118 — FunctionTooLong — handleCookiePickerRoute runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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: state.scanRunLeases lib/cso/state.ts:1570 — FunctionTooLong — scanRunLeases runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.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.
  • FunctionTooLong: cli.doctor REDACTED:805 — FunctionTooLong — doctor 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: verification.canonicalTestPlan lib/cso/verification.ts:562 — FunctionTooLong — canonicalTestPlan runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: gallery.generateGalleryHtml design/src/gallery.ts:50 — FunctionTooLong — generateGalleryHtml runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× 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.preparedVerificationExecutor REDACTED:2139 — FunctionTooLong — preparedVerificationExecutor runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× 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.
  • + 29 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×40
  • Repeated repair: scripts/lib/windows-curation.ts scripts/lib/windows-curation.ts:496 — scripts/lib/windows-curation.ts changed 18 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is windows-curation.curateWindowsSafe at line 496), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.227.0 fix(windows): shell bins pass NUL as Bun's empty config when MSYS path conversion is off (#3415) (#3431)”; “v1.91.183.0 fix(evals): a rejected API key is INFRA, never 131 assertion reds and reruns (#3361)”; “v1.91.161.0 fix(pregate): Django, Dart, asset and tool-config lanes; init drafts from the repo (#3266-#3269) (#3306)”; “v1.91.117.0 fix: pregate bats lanes, WTREE_UNAVAILABLE, doctor rows, SKILL.md size guard, planMode hosts (fix wave PR 5) (#3236)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/lib/windows-curation.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/qa.ts scripts/resolvers/qa.ts:46 — scripts/resolvers/qa.ts changed 13 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is qa.generateQAExploratory at line 46), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.127.0 fix(evals): paid-gate reliability round 2: docsync candidate protocol, scope-block detection, qa fix-loop budgets, lettered consent (#3260)”; “v1.91.117.0 fix: pregate bats lanes, WTREE_UNAVAILABLE, doctor rows, SKILL.md size guard, planMode hosts (fix wave PR 5) (#3236)”; “v1.91.106.0 fix: the 2026-10-15 issue wave (#3209)”; “v1.91.101.0 fix: close the field wave's residual gaps (#3173)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/qa.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/constants.ts scripts/resolvers/constants.ts:158 — scripts/resolvers/constants.ts changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is constants.codexPreflight at line 158), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.34.0 fix: /autoplan on current Claude Code and long sessions, quieter pre-push and sync guards, gstack-post, gstack-doctor (#3069)”; “v1.91.32.0 fix: Codex works from zsh, free text never enters shell commands, honest failures (#3057)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/constants.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: test/helpers/manual-judge-review-fixture.ts test/helpers/manual-judge-review-fixture.ts:62 — test/helpers/manual-judge-review-fixture.ts changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is approvedCookieWorkflowSource at line 62), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.66.0 fix: /autoplan without permission prompts after background reviewers, 34 contributor PRs from the backlog triage (#3087)”; “v1.91.34.0 fix: /autoplan on current Claude Code and long sessions, quieter pre-push and sync guards, gstack-post, gstack-doctor (#3069)”; “v1.91.30.0 fix: honest eval failure reports, Bun floor with safe auto-update, make-pdf and /review on Codex (#3033)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- test/helpers/manual-judge-review-fixture.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:107 — REDACTED changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is config.ensureStateDir at line 107), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.91.13.0 fix: severe bug wave (autoplan guard, land-and-deploy CI gate, project identity, gbrain, review gates) (#3013)”; “v1.68.0.0 fix: next tracker wave — 16 verified fixes in, 90 stale PRs and 21 issues closed with receipts (#2632)”; “v1.67.1.0 fix: external-contributor security sweep — 6 findings hardened, regression-pinned (#2605)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00: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.
  • Repeated repair: scripts/resolvers/question-tuning.ts scripts/resolvers/question-tuning.ts:13 — scripts/resolvers/question-tuning.ts changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is question-tuning.binDir at line 13), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.34.0 fix: /autoplan on current Claude Code and long sessions, quieter pre-push and sync guards, gstack-post, gstack-doctor (#3069)”; “v1.91.32.0 fix: Codex works from zsh, free text never enters shell commands, honest failures (#3057)”; “v1.87.6.0 fix: make checks reliable and everyday validation faster (#2898)”; “v1.67.0.0 fix: the tracker wave — XProtect self-heal, complete installs, brain-sync integrity, 31 community PRs credited (#2604)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/question-tuning.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: browse/src/file-permissions.ts browse/src/file-permissions.ts:166 — browse/src/file-permissions.ts changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is file-permissions.restrictDirectoryPermissions at line 166), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”; “v1.91.12.0 v1.91.12.0: audit fix wave, ~11-minute paid eval lanes, eval reliability policy (#2999)”; “v1.67.0.0 fix: the tracker wave — XProtect self-heal, complete installs, brain-sync integrity, 31 community PRs credited (#2604)”; “v1.65.0.0 feat: fork port wave 2 — feature fixes, session persistence, Apple releases, supply-chain CI (#2577)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- browse/src/file-permissions.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/gbrain.ts scripts/resolvers/gbrain.ts:140 — scripts/resolvers/gbrain.ts changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is gbrain.generateBrainPreflight at line 140), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.34.0 fix: /autoplan on current Claude Code and long sessions, quieter pre-push and sync guards, gstack-post, gstack-doctor (#3069)”; “v1.91.32.0 fix: Codex works from zsh, free text never enters shell commands, honest failures (#3057)”; “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”; “v1.91.13.0 fix: severe bug wave (autoplan guard, land-and-deploy CI gate, project identity, gbrain, review gates) (#3013)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/gbrain.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/lib/paid-cases.ts scripts/lib/paid-cases.ts:176 — scripts/lib/paid-cases.ts changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is paid-cases.expandTrialShards at line 176), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.54.0 fix: office-hours first sessions get the first-session closing, design doc shown before approval, strict timeline --limit (#3075)”; “v1.91.47.0 fix(careful,freeze): safety hooks cover PowerShell and NotebookEdit (#3077)”; “v1.91.30.0 fix: honest eval failure reports, Bun floor with safe auto-update, make-pdf and /review on Codex (#3033)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/lib/paid-cases.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/preamble.ts scripts/resolvers/preamble.ts:67 — scripts/resolvers/preamble.ts changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is preamble.generatePreamble at line 67), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.117.0 fix: pregate bats lanes, WTREE_UNAVAILABLE, doctor rows, SKILL.md size guard, planMode hosts (fix wave PR 5) (#3236)”; “v1.89.1.0 fix: remove continuous checkpoint commits (#2970)”; “v1.87.6.0 fix: make checks reliable and everyday validation faster (#2898)”; “v1.65.0.0 feat: fork port wave 2 — feature fixes, session persistence, Apple releases, supply-chain CI (#2577)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/preamble.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: hosts/define-host.ts hosts/define-host.ts:120 — hosts/define-host.ts changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is define-host.defineHost at line 120), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.66.0 fix: /autoplan without permission prompts after background reviewers, 34 contributor PRs from the backlog triage (#3087)”; “v1.91.65.0 fix(install): skills only for the agents you installed, every runtime-root file their skills read (#3080)”; “v1.91.30.0 fix: honest eval failure reports, Bun floor with safe auto-update, make-pdf and /review on Codex (#3033)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- hosts/define-host.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: browse/src/commands.ts browse/src/commands.ts:234 — browse/src/commands.ts changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is commands.levenshtein at line 234), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.66.0 fix: /autoplan without permission prompts after background reviewers, 34 contributor PRs from the backlog triage (#3087)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.91.12.0 v1.91.12.0: audit fix wave, ~11-minute paid eval lanes, eval reliability policy (#2999)”; “v1.91.4.0 fix: Windows Opera cookie import wave (#2980, refs #2957) (#2987)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- browse/src/commands.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: design/src/evolve.ts design/src/evolve.ts:74 — design/src/evolve.ts changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is evolve.requestEvolvedImage at line 74), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.66.0 fix: /autoplan without permission prompts after background reviewers, 34 contributor PRs from the backlog triage (#3087)”; “v1.91.17.0 fix: mvanhorn wave (checkpoint provenance, never-overwrite design images) (#3022)”; “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”; “v1.64.0.0 fix wave: full tracker audit — 90 fixes, 52 issues closed, ~50 community PRs absorbed (#2571)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- design/src/evolve.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/redact-doc.ts scripts/resolvers/redact-doc.ts:36 — scripts/resolvers/redact-doc.ts changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is redact-doc.generateRedactInvocationBlock at line 36), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.34.0 fix: /autoplan on current Claude Code and long sessions, quieter pre-push and sync guards, gstack-post, gstack-doctor (#3069)”; “v1.91.32.0 fix: Codex works from zsh, free text never enters shell commands, honest failures (#3057)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.78.0.0 fix: the two-red-lanes wave — AUQ collapse rooted, OSV green from 105, 18 community PRs absorbed, upgrade path can't eat installs (#2752)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/redact-doc.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:56 — REDACTED changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is (anonymous) at line 56), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”; “v1.67.1.0 fix: external-contributor security sweep — 6 findings hardened, regression-pinned (#2605)”; “v1.67.0.0 fix: the tracker wave — XProtect self-heal, complete installs, brain-sync integrity, 31 community PRs credited (#2604)”; “v1.65.0.0 feat: fork port wave 2 — feature fixes, session persistence, Apple releases, supply-chain CI (#2577)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00: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.
  • Repeated repair: design/src/iterate.ts design/src/iterate.ts:25 — design/src/iterate.ts changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is iterate.iterate at line 25), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.66.0 fix: /autoplan without permission prompts after background reviewers, 34 contributor PRs from the backlog triage (#3087)”; “v1.91.17.0 fix: mvanhorn wave (checkpoint provenance, never-overwrite design images) (#3022)”; “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”; “v1.64.0.0 fix wave: full tracker audit — 90 fixes, 52 issues closed, ~50 community PRs absorbed (#2571)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- design/src/iterate.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/third-party-actions.ts scripts/resolvers/third-party-actions.ts:35 — scripts/resolvers/third-party-actions.ts changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is third-party-actions.asideProbe at line 35), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.127.0 fix(evals): paid-gate reliability round 2: docsync candidate protocol, scope-block detection, qa fix-loop budgets, lettered consent (#3260)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.91.2.0 fix: consolidate gstack reliability wave (#2959)”; “v1.84.1.0 fix: default Codex and Claude to frontier models (#2835)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/third-party-actions.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/preamble/generate-preamble-bash.ts scripts/resolvers/preamble/generate-preamble-bash.ts:26 — scripts/resolvers/preamble/generate-preamble-bash.ts changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is generate-preamble-bash.generatePreambleBash at line 26), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”; “v1.67.0.0 fix: the tracker wave — XProtect self-heal, complete installs, brain-sync integrity, 31 community PRs credited (#2604)”; “v1.64.0.0 fix wave: full tracker audit — 90 fixes, 52 issues closed, ~50 community PRs absorbed (#2571)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/preamble/generate-preamble-bash.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/preamble/generate-context-recovery.ts scripts/resolvers/preamble/generate-context-recovery.ts:3 — scripts/resolvers/preamble/generate-context-recovery.ts changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is generate-context-recovery.generateContextRecovery at line 3), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”; “v1.87.6.0 fix: make checks reliable and everyday validation faster (#2898)”; “v1.67.0.0 fix: the tracker wave — XProtect self-heal, complete installs, brain-sync integrity, 31 community PRs credited (#2604)”; “v1.64.1.0 v1.64.1.0: the code-smell fix wave — every pipeline guard now provably fires (net −24,943 lines) (#2572)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/preamble/generate-context-recovery.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: test/helpers/docsync-fixture.ts test/helpers/docsync-fixture.ts:15 — test/helpers/docsync-fixture.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is fixtureDocs at line 15), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.169.0 fix(evals): docs-sync fixture accepts joined Git reads, literal loops and tr pipes; late-result says what its repair fixes (GSTA-57) (#3325)”; “v1.91.127.0 fix(evals): paid-gate reliability round 2: docsync candidate protocol, scope-block detection, qa fix-loop budgets, lettered consent (#3260)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- test/helpers/docsync-fixture.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/preamble/generate-brain-sync-block.ts scripts/resolvers/preamble/generate-brain-sync-block.ts:19 — scripts/resolvers/preamble/generate-brain-sync-block.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is generate-brain-sync-block.generateBrainSyncBlock at line 19), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.34.0 fix: /autoplan on current Claude Code and long sessions, quieter pre-push and sync guards, gstack-post, gstack-doctor (#3069)”; “v1.68.0.0 fix: next tracker wave — 16 verified fixes in, 90 stale PRs and 21 issues closed with receipts (#2632)”; “v1.67.0.0 fix: the tracker wave — XProtect self-heal, complete installs, brain-sync integrity, 31 community PRs credited (#2604)”; “v1.64.0.0 fix wave: full tracker audit — 90 fixes, 52 issues closed, ~50 community PRs absorbed (#2571)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/preamble/generate-brain-sync-block.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/resolvers/make-pdf.ts scripts/resolvers/make-pdf.ts:15 — scripts/resolvers/make-pdf.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is make-pdf.generateMakePdfSetup at line 15), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.30.0 fix: honest eval failure reports, Bun floor with safe auto-update, make-pdf and /review on Codex (#3033)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.91.16.0 fix: safe installs and upgrades, skills start everywhere, truthful completion (parallel wave) (#3014)”; “v1.64.0.0 fix wave: full tracker audit — 90 fixes, 52 issues closed, ~50 community PRs absorbed (#2571)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- scripts/resolvers/make-pdf.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: browse/src/xvfb.ts browse/src/xvfb.ts:217 — browse/src/xvfb.ts changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is xvfb.awaitXvfbReady at line 217), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.91.2.0 fix: consolidate gstack reliability wave (#2959)”; “v1.78.0.0 fix: the two-red-lanes wave — AUQ collapse rooted, OSV green from 105, 18 community PRs absorbed, upgrade path can't eat installs (#2752)”; “v1.68.0.0 fix: next tracker wave — 16 verified fixes in, 90 stale PRs and 21 issues closed with receipts (#2632)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- browse/src/xvfb.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:120 — REDACTED changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is gbrain-exec.buildGbrainEnv at line 120), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.106.0 fix: the 2026-10-15 issue wave (#3209)”; “v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, every host finds gstack) (#3025)”; “v1.78.0.0 fix: the two-red-lanes wave — AUQ collapse rooted, OSV green from 105, 18 community PRs absorbed, upgrade path can't eat installs (#2752)”; “v1.67.0.0 fix: the tracker wave — XProtect self-heal, complete installs, brain-sync integrity, 31 community PRs credited (#2604)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00: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.
  • Repeated repair: lib/pregate/index.ts lib/pregate/index.ts:176 — lib/pregate/index.ts changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is index.clearDecision at line 176), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.117.0 fix: pregate bats lanes, WTREE_UNAVAILABLE, doctor rows, SKILL.md size guard, planMode hosts (fix wave PR 5) (#3236)”; “v1.91.107.0 fix: the GBRA-40 field list (one Bun for install and check, `rec` gate approval, pregate never silent) (#3190)”; “v1.91.98.0 fix: plan obligations meet repo gates; priced paid gates; machine-proved restamps (field wave C, items 14-17) (#3166)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 10:57:52 +00:00' --until='2026-10-26 10:57:52 +00:00' --full-history --no-merges -- lib/pregate/index.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 15 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×40
  • Sync-over-async blocking bin/gstack-design-detect.ts:656 — `fs.existsSync` in `install` 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 bin/gstack-design-detect.ts:701 — `fs.mkdirSync` in `install` 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 bin/gstack-design-detect.ts:703 — `fs.writeFileSync` in `install` 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 bin/gstack-design-detect.ts:704 — `fs.chmodSync` in `install` 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 bin/gstack-design-detect.ts:705 — `fs.renameSync` in `install` 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 bin/gstack-memory-ingest.ts:1412 — `statSync` in `probeMode` 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 bin/gstack-memory-ingest.ts:2099 — `existsSync` in `ingestPassScoped` 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 bin/gstack-memory-ingest.ts:2841 — `existsSync` in `importBatch` 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 bin/gstack-memory-ingest.ts:2841 — `statSync` in `importBatch` 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 browse/src/browser-manager.ts:684 — `mkdirSync` in `launch` 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 browse/src/browser-manager.ts:849 — `fs.mkdirSync` in `launchHeaded` 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 browse/src/browser-manager.ts:904 — `Bun.spawnSync` in `launchHeaded` 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 browse/src/browser-manager.ts:2137 — `fs.mkdirSync` in `promoteToHeaded` 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 browse/src/browser-skill-commands.ts:185 — `fs.existsSync` in `handleTest` 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 browse/src/browser-skill-commands.ts:250 — `fs.mkdtempSync` in `runToFiles` 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 browse/src/browser-skill-commands.ts:288 — `fs.rmSync` in `runToFiles` 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 browse/src/browser-skill-commands.ts:367 — `fs.existsSync` in `spawnSkill` 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 browse/src/cli.ts:269 — `Bun.spawnSync` in `killServer` 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 browse/src/cli.ts:764 — `Bun.spawnSync` in `startServer` 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 browse/src/cli.ts:827 — `fs.readFileSync` in `startServer` 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 browse/src/cli.ts:1725 — `fs.mkdirSync` in `handlePairAgent` 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 browse/src/cli.ts:2184 — `fs.readFileSync` in `callback to readChainFlow` 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:627 — `fs.readFileSync` in `getWindowsAesKey` 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 browse/src/cookie-import-native.ts:86 — `statSync` in `callback to executables.find` 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 browse/src/cookie-import-native.ts:91 — `realpathSync` in `importNativeCookies` 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.
R11 · Import Boundaries · Boundary violation [package · ×40
  • Boundary violation [package:test-suite-dependency] lib/ship-queue-train-ready.ts:41 — lib/ship-queue-train-ready.ts:41 imports test/helpers/touchfiles.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/capture-baseline.ts:16 — scripts/capture-baseline.ts:16 imports test/helpers/capture-parity-baseline.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/capture-baseline.ts:17 — scripts/capture-baseline.ts:17 imports test/helpers/parity-harness.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/cso-eval-producer.ts:15 — scripts/cso-eval-producer.ts:15 imports test/helpers/providers/claude.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/cso-eval-producer.ts:16 — scripts/cso-eval-producer.ts:16 imports test/helpers/providers/gpt.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/cso-eval-producer.ts:17 — scripts/cso-eval-producer.ts:17 imports test/helpers/providers/gemini.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/cso-eval-producer.ts:18 — scripts/cso-eval-producer.ts:18 imports test/helpers/pricing.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/cso-eval.ts:12 — scripts/cso-eval.ts:12 imports test/fixtures/cso-eval/materialize.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/dev-skill.ts:9 — scripts/dev-skill.ts:9 imports test/helpers/skill-parser.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/e2e-shard-reuse.ts:31 — scripts/e2e-shard-reuse.ts:31 imports test/helpers/test-selection.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/e2e-shard-reuse.ts:32 — scripts/e2e-shard-reuse.ts:32 imports test/helpers/touchfiles-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/e2e-shard-reuse.ts:34 — scripts/e2e-shard-reuse.ts:34 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/eval-bg.ts:31 — scripts/eval-bg.ts:31 imports test/helpers/touchfiles.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/eval-compare.ts:14 — scripts/eval-compare.ts:14 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/eval-flake-rank.ts:53 — scripts/eval-flake-rank.ts:53 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/eval-flake-rank.ts:56 — scripts/eval-flake-rank.ts:56 imports test/helpers/touchfiles-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/eval-flake-rank.ts:57 — scripts/eval-flake-rank.ts:57 imports test/helpers/periodic-exclude-data.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/eval-list.ts:10 — scripts/eval-list.ts:10 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/eval-select.ts:18 — scripts/eval-select.ts:18 imports test/helpers/touchfiles.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/eval-summary.ts:11 — scripts/eval-summary.ts:11 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] REDACTED:26 — REDACTED:26 imports test/helpers/eval-store.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/gate-cost-replay.ts:43 — scripts/gate-cost-replay.ts:43 imports test/helpers/touchfiles.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/judge-calibration-configs.ts:7 — scripts/judge-calibration-configs.ts:7 imports test/helpers/llm-judge.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/judge-calibration-configs.ts:15 — scripts/judge-calibration-configs.ts:15 imports test/helpers/workflow-judge-input.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • Boundary violation [package:test-suite-dependency] scripts/judge-calibration-configs.ts:16 — scripts/judge-calibration-configs.ts:16 imports test/helpers/cookie-workflow-judge-input.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • + 15 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×36
  • 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
  • + 11 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×34
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2508 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2008 over it, 5.02× 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: cso/state.ts lib/cso/state.ts — FileTooLong — 2164 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1664 over it, 4.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: cso/verification.ts lib/cso/verification.ts — FileTooLong — 1869 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1369 over it, 3.74× 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: cso/preparation-docker.ts lib/cso/preparation-docker.ts — FileTooLong — 1421 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 921 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: cso/preparation-executor.ts lib/cso/preparation-executor.ts — FileTooLong — 1285 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 785 over it, 2.57× 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: src/cli.ts browse/src/cli.ts — FileTooLong — 1250 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 750 over it, 2.50× 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: src/browser-manager.ts browse/src/browser-manager.ts — FileTooLong — 1213 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: BrowserManager (357-2471). The bar is 500 significant lines; this is 713 over it, 2.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: REDACTED REDACTED — FileTooLong — 1078 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 578 over it, 2.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1018 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 518 over it, 2.04× 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: cso/snapshot.ts lib/cso/snapshot.ts — FileTooLong — 981 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 481 over it, 1.96× 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: src/write-commands.ts browse/src/write-commands.ts — FileTooLong — 963 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: handleWriteCommand (134-1425). The bar is 500 significant lines; this is 463 over it, 1.93× 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 — 946 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 446 over it, 1.89× 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 — 934 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: DockerGroup (458-1134). The bar is 500 significant lines; this is 434 over it, 1.87× 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: extension/sidepanel.js extension/sidepanel.js — FileTooLong — 914 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 414 over it, 1.83× 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: cso/contracts.ts lib/cso/contracts.ts — FileTooLong — 909 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 409 over it, 1.82× 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: lib/context-bill.ts lib/context-bill.ts — FileTooLong — 891 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 391 over it, 1.78× 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: cso/scanners.ts lib/cso/scanners.ts — FileTooLong — 858 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 358 over it, 1.72× 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: cso/cache.ts lib/cso/cache.ts — FileTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: PublicArchiveCache (346-1020). The bar is 500 significant lines; this is 311 over it, 1.62× 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: scripts/cso-eval.ts scripts/cso-eval.ts — FileTooLong — 764 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 264 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: cso/scanner-executor.ts lib/cso/scanner-executor.ts — FileTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 254 over it, 1.51× 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: src/meta-commands.ts browse/src/meta-commands.ts — FileTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: handleMetaCommand (253-1154). The bar is 500 significant lines; this is 224 over it, 1.45× 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 — 648 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 148 over it, 1.30× 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 — 639 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 139 over it, 1.28× 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: scripts/gen-accessors.ts ios-qa/scripts/gen-accessors.ts — FileTooLong — 623 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 123 over it, 1.25× 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: src/terminal-agent.ts browse/src/terminal-agent.ts — FileTooLong — 609 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 109 over it, 1.22× 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.
  • + 9 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×31
  • Swallowed exception (empty catch) scripts/analytics.ts:41 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/eval-bg.ts:331 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/exercised-map.ts:81 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/exercised-map.ts:85 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/exercised-map.ts:132 — 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:54 — 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:276 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/gate-cost-replay.ts:446 — 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:731 — 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:1139 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/host-config-export.ts:73 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/pr-dependencies.ts:163 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/pr-dependencies.ts:181 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/pr-dependencies.ts:189 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/pr-dependencies.ts:465 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/pr-dependencies.ts:493 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/preflight-codex-overlap.ts:124 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/release-cut.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) scripts/replay-pr-selection.ts:146 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/slop-diff.ts:86 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/slop-diff.ts:111 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/train-backstop.ts:96 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/train-gate.ts:161 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/lib/ci-history.ts:240 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) scripts/lib/eval-history.ts:268 — 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.
  • + 6 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×16
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×15
  • Untrusted text written into markup unescaped extension/sidepanel.js:186 — `formatTime(entry.timestamp)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:193 — `duration` is text this program did not author, and it is written into the text of an element through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:739 — `fmtBoxVal(m.top)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:740 — `fmtBoxVal(m.right)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:741 — `fmtBoxVal(m.bottom)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:742 — `fmtBoxVal(m.left)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:745 — `fmtBoxVal(b.top)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:746 — `fmtBoxVal(b.right)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:747 — `fmtBoxVal(b.bottom)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:748 — `fmtBoxVal(b.left)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:751 — `fmtBoxVal(p.top)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:752 — `fmtBoxVal(p.right)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:753 — `fmtBoxVal(p.bottom)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped extension/sidepanel.js:754 — `fmtBoxVal(p.left)` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped lib/diagram-render/src/entry.ts:151 — `svgText` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
R4 · Test Coverage · No test reaches this file · ×14
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/community-pulse/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file lib/autoplan-revise.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/telemetry-ingest/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file ios-qa/daemon/src/cli-mint.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file design/prototype.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file browse/src/security-sidecar-entry.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file test-setup.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file lib/autoplan-migrate.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file extension/sender-auth.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file extension/popup.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/gen-ship-goldens.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/update-check/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×12
  • Animation without a prefers-reduced-motion guard browse/src/welcome.html:67 — `.sidebar-prompt .arrow-right` moves (`animation: nudge 1.5s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/inspector.css:13 — `#gstack-inspector-highlight` moves (`transition: top 50ms ease, left 50ms ease, width 50ms ease, height 50ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:80 — `.conn-banner.reconnected` moves (`animation: fadeOut 3s ease forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:187 — `.chat-loading-spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:225 — `.chat-bubble` moves (`animation: slideIn 150ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:277 — `.agent-response` moves (`animation: slideIn 150ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:336 — `.thinking-dot` moves (`animation: thinkingPulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:592 — `.activity-entry.pending` moves (`animation: slideIn 150ms ease-out, borderPulse 2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:727 — `.gap-banner` moves (`animation: bannerSlide 250ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:791 — `.quick-action-btn.loading::after` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:831 — `.command-input.error` moves (`animation: shake 300ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard extension/sidepanel.css:1134 — `.inspector-action-btn.loading::after` moves (`animation: spin 0.6s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D17 · Explicit Debt · TodoComment · ×12
  • TodoComment test/eng-batching-native-replay.test.ts:112 — // setup, TODO and navigation calls also never inflate the original floor3. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/eng-batching-saved-ledger.test.ts:322 — // these guards. Setup, TODO and those unproved links receive no credit. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/eng-published-navigation.test.ts:95 — // unrelated TODO is still modifying — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/gen-skill-docs.test.ts:4862 — // filed TODO — this guard is the stopgap that makes the duplication safe. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/pregate-rust.test.ts:304 — // TODO(#3380): Windows gap. This case is skipped on win32 until the cargo stand-in runs under the lane's Git Bash there; https://github.com/garrytan/gstack/pull/3380
  • TodoComment test/pregate-rust.test.ts:319 — // TODO(#3380): Windows gap. This case is skipped on win32 until the cargo stand-in runs under the lane's Git Bash there; https://github.com/garrytan/gstack/pull/3380
  • TodoComment test/skill-collision-sentinel.test.ts:73 — // TODO: codex CLI built-ins (login, logout, exec, review, etc. — but we — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/helpers/claude-pty-runner.boundaries.unit.test.ts:371 — // The later answered observability TODO retains the existing phase policy. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/helpers/claude-pty-runner.boundaries.unit.test.ts:719 — // and both substantive TODO decisions must remain in review coverage. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/helpers/pty/classify.ts:474 — // Historical TODO prose and stale approval menus cannot finish a seeded — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment scripts/lib/shard-engine.ts:35 — // summary — see the last-summary-anchoring TODO in the audit). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment lib/egress-receipt.ts:49 — // TODO(rotation): ledger rotation. Chain-genesis sketch: when the ledger — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
X2 · Cancellation propagation · Async function without AbortSignal · ×12
  • Async function without AbortSignal: download REDACTED:424 — `download` 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: mintSession extension/sidepanel-terminal.js:183 — `mintSession` 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: tick extension/sidepanel-terminal.js:240 — `tick` 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: checkClaudeAvailable extension/sidepanel-terminal.js:386 — `checkClaudeAvailable` 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: gstackScanForPTYInject extension/sidepanel-terminal.js:507 — `gstackScanForPTYInject` 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: forceRestart extension/sidepanel-terminal.js:724 — `forceRestart` 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: ensureSseSessionCookie extension/sidepanel.js:251 — `ensureSseSessionCookie` 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: onclick extension/sidepanel.js:488 — `onclick` 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: publishBoard REDACTED:188 — `publishBoard` 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: superviseNativeCookieImport browse/src/cookie-import-native-worker.ts:92 — `superviseNativeCookieImport` awaits `sleep(…)` 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: `sleep(url, { signal })`.
  • Async function without AbortSignal: downloadFile browse/src/security-classifier.ts:81 — `downloadFile` 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: handleWriteCommand browse/src/write-commands.ts:134 — `handleWriteCommand` 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 })`.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×9
  • Swallowed exception (caught, then discarded) scripts/eval-flake-rank.ts:83 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/eval-flake-rank.ts:129 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/eval-flake-rank.ts:228 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/eval-list.ts:87 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/eval-summary.ts:28 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/gate-cost-replay.ts:160 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/recover-receipts.ts:241 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) scripts/ship-measure-sweep.ts:187 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) REDACTED:262 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D3 · God Classes · MethodTooLong · ×7
  • MethodTooLong: DockerGroup.createContainer REDACTED:627 — MethodTooLong — createContainer runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PreparationExecutor.acquire lib/cso/preparation-executor.ts:1139 — MethodTooLong — acquire runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× 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: DockerPreparationSandboxRunner.prepareOffline lib/cso/preparation-docker.ts:1498 — MethodTooLong — prepareOffline runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DockerPreparationSandboxRunner.acquire lib/cso/preparation-docker.ts:1296 — MethodTooLong — acquire runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× 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: BrowserManager.launchHeaded browse/src/browser-manager.ts:789 — MethodTooLong — launchHeaded runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× 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: PreparationExecutor.prepareOffline lib/cso/preparation-executor.ts:1372 — MethodTooLong — prepareOffline runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× 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: BrowserManager.promoteToHeaded browse/src/browser-manager.ts:2093 — MethodTooLong — promoteToHeaded runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× 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.
D31 · IaC & Container Security · Medium IaC · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×7
  • Outbound HTTP without resilience REDACTED:79 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience browse/src/security-classifier.ts:82 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience browse/src/terminal-agent.ts:1050 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience browse/src/write-commands.ts:1181 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:194 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience design/src/receipted-fetch.ts:56 — `fetchImpl(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:427 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Fake-async · ×5
  • Fake-async — async method never awaits REDACTED:646 — `flushBuffers` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits browse/src/tunnel-denial-log.ts:30 — `ensureDir` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits design/src/daemon.ts:199 — `gracefulShutdown` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits REDACTED:1619 — `read` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits REDACTED:1629 — `history` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×5
  • Duplicated block (14 lines × 2 locations) browse/src/file-permissions.ts:115 — browse/src/file-permissions.ts:115 · browse/src/file-permissions.ts:181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2 locations) REDACTED:1233 — REDACTED:1233 · REDACTED:1319 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (14 lines × 2 locations) lib/cso/image-provisioning.ts:266 — lib/cso/image-provisioning.ts:266 · lib/cso/image-provisioning.ts:314 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (14 lines × 2 locations) REDACTED:364 — REDACTED:364 · lib/cso/preparation-executor.ts:580 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (14 lines × 2 locations) lib/cso/scanner-executor.ts:792 — lib/cso/scanner-executor.ts:792 · lib/cso/verification.ts:1688 — 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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×5
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:374 — `tokensFlat` is exported, takes a document from its caller (line 367) and hands it to `walk`, which calls itself at line 374 (`walk`) with a piece of `v` — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap lib/headless-artifacts.ts:263 — `checkSchema` is exported and takes `value: unknown` from its caller, and it calls itself at line 263 (`checkSchema`) with a piece of `value` (and at line 270) — and nowhere in `checkSchema` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `checkSchema` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap lib/cso/contracts.ts:47 — `canonical` is exported and takes `value: unknown` from its caller, and it calls itself at line 47 (`canonical`) with a piece of `value` (and at line 51) — and nowhere in `canonical` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap lib/cso/process.ts:279 — `sanitizeForJson` is exported, takes a document from its caller (line 293) and hands it to `sanitizeJson`, which calls itself at line 279 (`sanitizeJson`) with a piece of `value` (and at line 287) — and nowhere in `sanitizeJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `sanitizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap browse/src/security.ts:301 — `checkCanaryInStructure` is exported and takes `value: unknown` from its caller, and it calls itself at line 301 (`checkCanaryInStructure`) with a piece of `value` (and at line 305) — and nowhere in `checkCanaryInStructure` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `checkCanaryInStructure` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D10 · Test Quality · Skipped test · ×4
  • Skipped test: needs Aside test/skill-e2e-design.test.ts:604 — Skipped — switched off by test.skip
  • Skipped test: (unnamed test) test/skill-routing-e2e.test.ts:172 — Skipped — switched off by test.skip
  • Skipped test: no local `claude` binary on PATH — cannot pin for harness parity test/helpers/overlay-case.ts:63 — Skipped — switched off by test.skip
  • Skipped test: skipped test/fixtures/shard-equivalence/skip.fixture.ts:3 — Skipped — switched off by test.skip
D10 · Test Quality · Fixed-sleep synchronisation · ×4
  • Fixed-sleep synchronisation: SIGTERM to the shim while the vendor is running: the vendor group dies with it, exit 0, logged test/memorable-user-prompt-hook.test.ts:919 — This test starts work it did not wait for (`child`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(30)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: cancel() terminates the child and reports cancelled test/outside-runner-contract.test.ts:160 — This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(400)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: global lock blocks all tab locks; tab locks block global lock browse/test/cdp-mutex.test.ts:47 — This test starts work it did not wait for (`tab1`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 10))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: held owner readiness follows its marker or terminal reply, not an earlier checkpoint browse/test/cookie-import-native-job.test.ts:1057 — This test starts work it did not wait for (`waiting`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(50)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · ClassTooLong · ×4
  • ClassTooLong: BrowserManager browse/src/browser-manager.ts:357 — ClassTooLong — 1084 significant lines (blank, comment-only and punctuation-only lines excluded), 83 methods. The bar is 400 significant lines; this is 684 over it, 2.71× 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: DockerGroup REDACTED:458 — ClassTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 166 over it, 1.42× 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: PublicArchiveCache lib/cso/cache.ts:346 — ClassTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 149 over it, 1.37× 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: DockerPreparationSandboxRunner lib/cso/preparation-docker.ts:1128 — ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 98 over it, 1.25× 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 with local edits (16 matched lines × 2 locations) · ×4
  • Duplicated block with local edits (16 matched lines × 2 locations) design/src/cli.ts:371 — design/src/cli.ts:371 · design/src/serve.ts:238 — the two spans are one implementation copied and then locally edited — 86 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (16 matched lines × 2 locations) lib/cso/contracts.ts:682 — lib/cso/contracts.ts:682 · lib/cso/scanner-executor.ts:171 — the two spans are one implementation copied and then locally edited — 97 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (16 matched lines × 2 locations) lib/cso/preparation-docker.ts:103 — lib/cso/preparation-docker.ts:103 · lib/cso/preparation-executor.ts:553 — the two spans are one implementation copied and then locally edited — 126 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (16 matched lines × 2 locations) scripts/cso-eval-producer.ts:136 — scripts/cso-eval-producer.ts:136 · scripts/cso-eval-producer.ts:159 — the two spans are one implementation copied and then locally edited — 128 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.
AC3 · Page structure · Page without a main landmark · ×3
  • Page without a main landmark browse/src/commands.ts — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark browse/src/welcome.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark extension/popup.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: read-commands.ts ↔ write-commands.ts browse/src/read-commands.ts:1 — `browse/src/read-commands.ts` and `browse/src/write-commands.ts` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `7e96fe29` fix: security wave 3 — 12 fixes, 7 contributors (v0.16.4.0) (#988); `c6e6a21d` refactor: AI slop reduction with cross-model quality review (v0.16.3.…; `b73f3644` feat: browser data platform for AI agents (v0.16.0.0) (#907) — run `git show` on any of them.
  • Change coupling: meta-commands.ts ↔ write-commands.ts browse/src/meta-commands.ts:1 — `browse/src/meta-commands.ts` and `browse/src/write-commands.ts` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `19770ea8` v1.51.0.0 feat: $B memory diagnostic + 4 CDP-resource leak fixes (#1751); `54d4cde7` security: tunnel dual-listener + SSRF + envelope + path wave (v1.6.0.…; `c15b805c` feat(browse): Puppeteer parity — load-html, screenshot --selector, vi… — run `git show` on any of them.
  • Change coupling: read-commands.ts ↔ snapshot.ts browse/src/read-commands.ts:1 — `browse/src/read-commands.ts` and `browse/src/snapshot.ts` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `ea51b45e` v1.38.1.0 fix wave: surrogate-safe page captures (#1440), Implementat…; `c6e6a21d` refactor: AI slop reduction with cross-model quality review (v0.16.3.…; `1868636f` refactor: extract TabSession for per-tab state isolation (v0.15.16.0)… — run `git show` on any of them.
R10 · Code Duplication · Duplicated block (26 lines × 2 locations) · ×3
  • Duplicated block (26 lines × 2 locations) REDACTED:1246 — REDACTED:1246 · REDACTED:1291 — 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 (26 lines × 2 locations) extension/content.js:146 — extension/content.js:146 · extension/inspector.js:182 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (26 lines × 2 locations) lib/model-policy.ts:555 — lib/model-policy.ts:555 · lib/model-policy.ts:619 — 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.
S1 · Web-Security Posture · Weak hash algorithm · ×3
  • Weak hash algorithm hosts/claude/hooks/question-log-hook.ts:90 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:381 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:386 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
D2 · Cognitive Complexity · BrowseClient.command (cognitive 16) · ×2
  • BrowseClient.command (cognitive 16) browse/src/browse-client.ts:149 — BrowseClient.command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • BrowseClient.command (cognitive 16) browser-skills/hackernews-frontpage/_lib/browse-client.ts:149 — BrowseClient.command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×2
  • Duplicated block (21 lines × 2 locations) REDACTED:1017 — REDACTED:1017 · REDACTED:1043 — 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 (21 lines × 2 locations) lib/cso/state.ts:755 — lib/cso/state.ts:755 · lib/cso/state.ts:776 — both copies are in the same file, so extract the 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 (16 lines × 2 locations) · ×2
  • Duplicated block (16 lines × 2 locations) browse/src/content-security.ts:163 — browse/src/content-security.ts:163 · browse/src/read-commands.ts:246 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (16 lines × 2 locations) lib/cso/preparation-docker.ts:831 — lib/cso/preparation-docker.ts:831 · lib/cso/verification.ts:107 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (14 lines × 3 locations) · ×2
  • Duplicated block (14 lines × 3 locations) extension/sidepanel-terminal.js:342 — extension/sidepanel-terminal.js:342 · extension/sidepanel-terminal.js:645 · extension/sidepanel-terminal.js:854 — 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 (14 lines × 3 locations) hosts/claude/hooks/auq-error-fallback-hook.ts:43 — hosts/claude/hooks/auq-error-fallback-hook.ts:43 · hosts/claude/hooks/question-log-hook.ts:71 · hosts/claude/hooks/question-preference-hook.ts:75 — the 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
AC3 · Page structure · More than one main landmark · ×1
  • More than one main landmark extension/sidepanel.html:2 — A document must expose only one main landmark. Multiple visible <main> (or role="main") elements confuse the landmark map and the "skip to content" target. Keep one; remove or hide the rest.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×1
  • Modal dialog does not manage focus extension/sidepanel.html:165 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 8 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · write-commands.handleWriteCommand (cyclomatic 383) · ×1
  • write-commands.handleWriteCommand (cyclomatic 383) browse/src/write-commands.ts:134 — write-commands.handleWriteCommand has cyclomatic complexity 383 (threshold 15). Of this number, 313 points are the body's own statements and 70 belong to 18 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 · meta-commands.handleMetaCommand (cyclomatic 213) · ×1
  • meta-commands.handleMetaCommand (cyclomatic 213) browse/src/meta-commands.ts:253 — meta-commands.handleMetaCommand has cyclomatic complexity 213 (threshold 15). Of this number, 189 points are the body's own statements and 24 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · snapshot.handleSnapshot (cyclomatic 156) · ×1
  • snapshot.handleSnapshot (cyclomatic 156) browse/src/snapshot.ts:103 — snapshot.handleSnapshot has cyclomatic complexity 156 (threshold 15). Of this number, 112 points are the body's own statements and 44 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · paid-plan.parseRunManifest (cyclomatic 154) · ×1
  • paid-plan.parseRunManifest (cyclomatic 154) scripts/lib/paid-plan.ts:486 — paid-plan.parseRunManifest has cyclomatic complexity 154 (threshold 15). Of this number, 141 points are the body's own statements and 13 belong to 10 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · paid-report.runPaidReport (cyclomatic 143) · ×1
  • paid-report.runPaidReport (cyclomatic 143) REDACTED:540 — paid-report.runPaidReport has cyclomatic complexity 143 (threshold 15). Of this number, 102 points are the body's own statements and 41 belong to 21 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · read-commands.handleReadCommand (cyclomatic 140) · ×1
  • read-commands.handleReadCommand (cyclomatic 140) browse/src/read-commands.ts:300 — read-commands.handleReadCommand has cyclomatic complexity 140 (threshold 15). Of this number, 89 points are the body's own statements and 51 belong to 17 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 · verification.validateRepairBundle (cyclomatic 111) · ×1
  • verification.validateRepairBundle (cyclomatic 111) lib/cso/verification.ts:1310 — verification.validateRepairBundle has cyclomatic complexity 111 (threshold 15). Of this number, 106 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · claude-public-transcript.readPlanCountTranscript (cyclomatic 98) · ×1
  • claude-public-transcript.readPlanCountTranscript (cyclomatic 98) lib/claude-public-transcript.ts:75 — claude-public-transcript.readPlanCountTranscript has cyclomatic complexity 98 (threshold 15). Of this number, 90 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cso-eval.validateResult (cyclomatic 95) · ×1
  • cso-eval.validateResult (cyclomatic 95) scripts/cso-eval.ts:644 — cso-eval.validateResult has cyclomatic complexity 95 (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 · gstack-design-detect.probe (cyclomatic 94) · ×1
  • gstack-design-detect.probe (cyclomatic 94) bin/gstack-design-detect.ts:344 — gstack-design-detect.probe 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. This shape REPEATS in the file: one other method here (gstack-design-detect.probe::checkSkillDir) 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.
D1 · Cyclomatic Complexity · DockerGroup.createContainer (cyclomatic 93) · ×1
  • DockerGroup.createContainer (cyclomatic 93) REDACTED:627 — DockerGroup.createContainer has cyclomatic complexity 93 (threshold 15). Of this number, 81 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · runtime-catalog.validateRuntimeCatalog (cyclomatic 91) · ×1
  • runtime-catalog.validateRuntimeCatalog (cyclomatic 91) REDACTED:171 — runtime-catalog.validateRuntimeCatalog has cyclomatic complexity 91 (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 · paid-plan.verifySliceResults (cyclomatic 81) · ×1
  • paid-plan.verifySliceResults (cyclomatic 81) scripts/lib/paid-plan.ts:713 — paid-plan.verifySliceResults has cyclomatic complexity 81 (threshold 15). Of this number, 80 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · terminal-agent.buildServer (cyclomatic 80) · ×1
  • terminal-agent.buildServer (cyclomatic 80) browse/src/terminal-agent.ts:594 — terminal-agent.buildServer has cyclomatic complexity 80 (threshold 15). Of this number, 64 points are the body's own statements and 16 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.main (cyclomatic 79) · ×1
  • cli.main (cyclomatic 79) browse/src/cli.ts:1794 — cli.main has cyclomatic complexity 79 (threshold 15). Of this number, 76 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preparation-docker.materializePreparedExport (cyclomatic 79) · ×1
  • preparation-docker.materializePreparedExport (cyclomatic 79) lib/cso/preparation-docker.ts:258 — preparation-docker.materializePreparedExport 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 · gen-accessors.parseFields (cyclomatic 78) · ×1
  • gen-accessors.parseFields (cyclomatic 78) ios-qa/scripts/gen-accessors.ts:264 — gen-accessors.parseFields has cyclomatic complexity 78 (threshold 15). Of this number, 68 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · snapshot.capture (cyclomatic 72) · ×1
  • snapshot.capture (cyclomatic 72) lib/cso/snapshot.ts:633 — snapshot.capture has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent 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 shape REPEATS in the file: one other method here (snapshot.capture::assertEntriesStable) 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.
D1 · Cyclomatic Complexity · verification.verifyRepair (cyclomatic 72) · ×1
  • verification.verifyRepair (cyclomatic 72) lib/cso/verification.ts:1836 — verification.verifyRepair has cyclomatic complexity 72 (threshold 15). Of this number, 71 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 · config.validateConfig (cyclomatic 72) · ×1
  • config.validateConfig (cyclomatic 72) lib/pregate/config.ts:116 — config.validateConfig has cyclomatic complexity 72 (threshold 15). Of this number, 67 points are the body's own statements and 5 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.handleCommandInternalImpl (cyclomatic 69) · ×1
  • server.handleCommandInternalImpl (cyclomatic 69) REDACTED:970 — server.handleCommandInternalImpl has cyclomatic complexity 69 (threshold 15). Of this number, 66 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · snapshot.assertSnapshot (cyclomatic 67) · ×1
  • snapshot.assertSnapshot (cyclomatic 67) lib/cso/snapshot.ts:1074 — snapshot.assertSnapshot has cyclomatic complexity 67 (threshold 15). Of this number, 38 points are the body's own statements and 29 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · state.scanRunLeases (cyclomatic 62) · ×1
  • state.scanRunLeases (cyclomatic 62) lib/cso/state.ts:1570 — state.scanRunLeases has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cdp-inspector.inspectElement (cyclomatic 60) · ×1
  • cdp-inspector.inspectElement (cyclomatic 60) browse/src/cdp-inspector.ts:229 — cdp-inspector.inspectElement has cyclomatic complexity 60 (threshold 15). Of this number, 59 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 · witness.testExecutionSummary (cyclomatic 60) · ×1
  • witness.testExecutionSummary (cyclomatic 60) REDACTED:354 — witness.testExecutionSummary has cyclomatic complexity 60 (threshold 15). Of this number, 54 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · gate-reuse.findReusableGate (cyclomatic 60) · ×1
  • gate-reuse.findReusableGate (cyclomatic 60) scripts/gate-reuse.ts:350 — gate-reuse.findReusableGate has cyclomatic complexity 60 (threshold 15). Of this number, 58 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gen-skill-docs.runGeneration (cyclomatic 60) · ×1
  • gen-skill-docs.runGeneration (cyclomatic 60) REDACTED:920 — gen-skill-docs.runGeneration has cyclomatic complexity 60 (threshold 15). Of this number, 48 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cookie-picker-routes.handleCookiePickerRoute (cyclomatic 59) · ×1
  • cookie-picker-routes.handleCookiePickerRoute (cyclomatic 59) browse/src/cookie-picker-routes.ts:118 — cookie-picker-routes.handleCookiePickerRoute has cyclomatic complexity 59 (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 · ship-policy.validatePolicy (cyclomatic 59) · ×1
  • ship-policy.validatePolicy (cyclomatic 59) REDACTED:297 — ship-policy.validatePolicy has cyclomatic complexity 59 (threshold 15). Of this number, 53 points are the body's own statements and 6 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · verification.certify (cyclomatic 57) · ×1
  • verification.certify (cyclomatic 57) lib/cso/verification.ts:1043 — verification.certify has cyclomatic complexity 57 (threshold 15). Of this number, 55 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · claude-journal-records.ownedCausalOrder (cyclomatic 56) · ×1
  • claude-journal-records.ownedCausalOrder (cyclomatic 56) lib/claude-journal-records.ts:303 — claude-journal-records.ownedCausalOrder has cyclomatic complexity 56 (threshold 15). Of this number, 36 points are the body's own statements and 20 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude-owned-journal.readOwnedClaudePublicTranscript (cyclomatic 56) · ×1
  • claude-owned-journal.readOwnedClaudePublicTranscript (cyclomatic 56) lib/claude-owned-journal.ts:244 — claude-owned-journal.readOwnedClaudePublicTranscript has cyclomatic complexity 56 (threshold 15). Of this number, 41 points are the body's own statements and 15 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gstack-gbrain-read-capability.readCapability (cyclomatic 55) · ×1
  • gstack-gbrain-read-capability.readCapability (cyclomatic 55) bin/gstack-gbrain-read-capability.ts:11 — gstack-gbrain-read-capability.readCapability has cyclomatic complexity 55 (threshold 15). Of this number, 51 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · cso-eval.scoreEval (cyclomatic 55) · ×1
  • cso-eval.scoreEval (cyclomatic 55) scripts/cso-eval.ts:767 — cso-eval.scoreEval has cyclomatic complexity 55 (threshold 15). Of this number, 39 points are the body's own statements and 16 belong to 12 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · forceRestart (cyclomatic 54) · ×1
  • forceRestart (cyclomatic 54) extension/sidepanel-terminal.js:724 — forceRestart has cyclomatic complexity 54 (threshold 15). Of this number, 25 points are the body's own statements and 29 belong to 7 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · autoplan-gate.answerGate (cyclomatic 53) · ×1
  • autoplan-gate.answerGate (cyclomatic 53) lib/autoplan-gate.ts:359 — autoplan-gate.answerGate has cyclomatic complexity 53 (threshold 15). Of this number, 42 points are the body's own statements and 11 belong to 4 function literals 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 · PreparationExecutor.acquire (cyclomatic 53) · ×1
  • PreparationExecutor.acquire (cyclomatic 53) lib/cso/preparation-executor.ts:1139 — PreparationExecutor.acquire has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cookie-import-operation.runCookieImport (cyclomatic 51) · ×1
  • cookie-import-operation.runCookieImport (cyclomatic 51) browse/src/cookie-import-operation.ts:122 — cookie-import-operation.runCookieImport has cyclomatic complexity 51 (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 · server.start (cyclomatic 51) · ×1
  • server.start (cyclomatic 51) REDACTED:1877 — server.start has cyclomatic complexity 51 (threshold 15). Of this number, 41 points are the body's own statements and 10 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preparation-docker.superviseRegistrySocket (cyclomatic 51) · ×1
  • preparation-docker.superviseRegistrySocket (cyclomatic 51) lib/cso/preparation-docker.ts:942 — preparation-docker.superviseRegistrySocket has cyclomatic complexity 51 (threshold 15). Of this number, 36 points are the body's own statements and 15 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · gstack-autoplan-snapshot.initializePlan (cyclomatic 50) · ×1
  • gstack-autoplan-snapshot.initializePlan (cyclomatic 50) bin/gstack-autoplan-snapshot.ts:396 — gstack-autoplan-snapshot.initializePlan has cyclomatic complexity 50 (threshold 15). Of this number, 32 points are the body's own statements and 18 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · media-extract.extractMedia (cyclomatic 50) · ×1
  • media-extract.extractMedia (cyclomatic 50) browse/src/media-extract.ts:71 — media-extract.extractMedia has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 3 of the 50 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 75, 88, 110, …). 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 · model-policy-freshness.assessFreshness (cyclomatic 50) · ×1
  • model-policy-freshness.assessFreshness (cyclomatic 50) lib/model-policy-freshness.ts:121 — model-policy-freshness.assessFreshness has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · guard-journal.select (cyclomatic 48) · ×1
  • guard-journal.select (cyclomatic 48) autoplan/bin/guard-journal.ts:49 — guard-journal.select has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 1 of the 48 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 50, 53, 70, …). 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 · gstack-gbrain-sync.runCodeImport (cyclomatic 48) · ×1
  • gstack-gbrain-sync.runCodeImport (cyclomatic 48) bin/gstack-gbrain-sync.ts:1154 — gstack-gbrain-sync.runCodeImport has cyclomatic complexity 48 (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 · question-preference-hook.main (cyclomatic 48) · ×1
  • question-preference-hook.main (cyclomatic 48) hosts/claude/hooks/question-preference-hook.ts:362 — question-preference-hook.main 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 · scanner-catalog.validateQualifiedScanner (cyclomatic 48) · ×1
  • scanner-catalog.validateQualifiedScanner (cyclomatic 48) REDACTED:110 — scanner-catalog.validateQualifiedScanner has cyclomatic complexity 48 (threshold 15). Of this number, 46 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · lane-selection.selectLanes (cyclomatic 48) · ×1
  • lane-selection.selectLanes (cyclomatic 48) lib/pregate/lane-selection.ts:76 — lane-selection.selectLanes has cyclomatic complexity 48 (threshold 15). Of this number, 43 points are the body's own statements and 5 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · context-bill.contextBillMain (cyclomatic 47) · ×1
  • context-bill.contextBillMain (cyclomatic 47) lib/context-bill.ts:1235 — context-bill.contextBillMain has cyclomatic complexity 47 (threshold 15). Of this number, 28 points are the body's own statements and 19 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 47) · ×1
  • (anonymous) (cyclomatic 47) lib/dom-dump.js:1 — (anonymous) has cyclomatic complexity 47 (threshold 15). Of this number, 33 points are the body's own statements and 14 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 · design-md.convertLegacy (cyclomatic 46) · ×1
  • design-md.convertLegacy (cyclomatic 46) REDACTED:441 — design-md.convertLegacy 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 · cookie-auth-verification.verifyCookieAuthentication (cyclomatic 46) · ×1
  • cookie-auth-verification.verifyCookieAuthentication (cyclomatic 46) browse/src/cookie-auth-verification.ts:40 — cookie-auth-verification.verifyCookieAuthentication has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 12 of the 46 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 70, 95, 63). 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 · state.recoveryJson (cyclomatic 46) · ×1
  • state.recoveryJson (cyclomatic 46) lib/cso/state.ts:308 — state.recoveryJson 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 · scanners.parseSarif (cyclomatic 46) · ×1
  • scanners.parseSarif (cyclomatic 46) lib/cso/scanners.ts:670 — scanners.parseSarif has cyclomatic complexity 46 (threshold 15). Of this number, 45 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 · qa-evidence.capture (cyclomatic 46) · ×1
  • qa-evidence.capture (cyclomatic 46) REDACTED:195 — qa-evidence.capture has cyclomatic complexity 46 (threshold 15). Of this number, 45 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cso-eval.validateReceipt (cyclomatic 46) · ×1
  • cso-eval.validateReceipt (cyclomatic 46) scripts/cso-eval.ts:405 — cso-eval.validateReceipt has cyclomatic complexity 46 (threshold 15). Of this number, 40 points are the body's own statements and 6 belong to one function literal inside it that branches. 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 · state.recoverAtomicNoReplaceJson (cyclomatic 45) · ×1
  • state.recoverAtomicNoReplaceJson (cyclomatic 45) lib/cso/state.ts:471 — state.recoverAtomicNoReplaceJson has cyclomatic complexity 45 (threshold 15). Of this number, 42 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 · verification.canonicalStartPlan (cyclomatic 45) · ×1
  • verification.canonicalStartPlan (cyclomatic 45) lib/cso/verification.ts:775 — verification.canonicalStartPlan has cyclomatic complexity 45 (threshold 15). Of this number, 41 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · office-hours-review.validateOfficeHoursReview (cyclomatic 45) · ×1
  • office-hours-review.validateOfficeHoursReview (cyclomatic 45) REDACTED:57 — office-hours-review.validateOfficeHoursReview has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude-journal-records.recordEvents (cyclomatic 44) · ×1
  • claude-journal-records.recordEvents (cyclomatic 44) lib/claude-journal-records.ts:169 — claude-journal-records.recordEvents has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preparation-executor.treeManifest · ×1
  • preparation-executor.treeManifest::walk (cyclomatic 44) lib/cso/preparation-executor.ts:778 — preparation-executor.treeManifest::walk has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.ensureServer (cyclomatic 43) · ×1
  • cli.ensureServer (cyclomatic 43) browse/src/cli.ts:899 — cli.ensureServer 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 · scanners.scannerPlans (cyclomatic 43) · ×1
  • scanners.scannerPlans (cyclomatic 43) lib/cso/scanners.ts:205 — scanners.scannerPlans has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 10 of the 43 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 217, 438). 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 · cso-eval.cli (cyclomatic 43) · ×1
  • cso-eval.cli (cyclomatic 43) scripts/cso-eval.ts:921 — cso-eval.cli 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 · phase-publication-hook.closePacket (cyclomatic 42) · ×1
  • phase-publication-hook.closePacket (cyclomatic 42) autoplan/bin/phase-publication-hook.ts:342 — phase-publication-hook.closePacket has cyclomatic complexity 42 (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 · gstack-memory-ingest.ingestPassScoped (cyclomatic 42) · ×1
  • gstack-memory-ingest.ingestPassScoped (cyclomatic 42) bin/gstack-memory-ingest.ts:2091 — gstack-memory-ingest.ingestPassScoped 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 · bin-context.slugFromEnvironment (cyclomatic 42) · ×1
  • bin-context.slugFromEnvironment (cyclomatic 42) lib/bin-context.ts:237 — bin-context.slugFromEnvironment has cyclomatic complexity 42 (threshold 15). Of this number, 40 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preparation.inspectPython (cyclomatic 42) · ×1
  • preparation.inspectPython (cyclomatic 42) REDACTED:531 — preparation.inspectPython 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 · scanners.parseResults (cyclomatic 42) · ×1
  • scanners.parseResults (cyclomatic 42) lib/cso/scanners.ts:797 — scanners.parseResults 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 · paid-report.junitCensus (cyclomatic 42) · ×1
  • paid-report.junitCensus (cyclomatic 42) REDACTED:253 — paid-report.junitCensus 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 · gstack-design-detect.scan (cyclomatic 41) · ×1
  • gstack-design-detect.scan (cyclomatic 41) bin/gstack-design-detect.ts:918 — gstack-design-detect.scan 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 · model-policy-cli.modelsMain (cyclomatic 41) · ×1
  • model-policy-cli.modelsMain (cyclomatic 41) lib/model-policy-cli.ts:236 — model-policy-cli.modelsMain has cyclomatic complexity 41 (threshold 15). Of this number, 40 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 · phase-publication-hook.phaseDecision (cyclomatic 40) · ×1
  • phase-publication-hook.phaseDecision (cyclomatic 40) autoplan/bin/phase-publication-hook.ts:565 — phase-publication-hook.phaseDecision has cyclomatic complexity 40 (threshold 15). Of this number, 33 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · terminal-agent.main (cyclomatic 40) · ×1
  • terminal-agent.main (cyclomatic 40) browse/src/terminal-agent.ts:1073 — terminal-agent.main has cyclomatic complexity 40 (threshold 15). Of this number, 28 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.main (cyclomatic 40) · ×1
  • cli.main (cyclomatic 40) design/src/cli.ts:135 — cli.main 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 · memorable-user-prompt-hook.main (cyclomatic 40) · ×1
  • memorable-user-prompt-hook.main (cyclomatic 40) hosts/claude/hooks/memorable-user-prompt-hook.ts:437 — memorable-user-prompt-hook.main has cyclomatic complexity 40 (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 · question-log-hook.extractUserChoices (cyclomatic 40) · ×1
  • question-log-hook.extractUserChoices (cyclomatic 40) hosts/claude/hooks/question-log-hook.ts:154 — question-log-hook.extractUserChoices 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 · state.readOwner (cyclomatic 40) · ×1
  • state.readOwner (cyclomatic 40) lib/cso/state.ts:1110 — state.readOwner has cyclomatic complexity 40 (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 · verification.canonicalTestPlan (cyclomatic 40) · ×1
  • verification.canonicalTestPlan (cyclomatic 40) lib/cso/verification.ts:562 — verification.canonicalTestPlan has cyclomatic complexity 40 (threshold 15). Of this number, 31 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · paid-plan.buildRunManifest (cyclomatic 40) · ×1
  • paid-plan.buildRunManifest (cyclomatic 40) scripts/lib/paid-plan.ts:279 — paid-plan.buildRunManifest 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. This shape REPEATS in the file: one other method here (paid-plan.buildRunManifest::packByRecordedDuration) 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.
D1 · Cyclomatic Complexity · cso-image-matrix.imageBuildMatrix (cyclomatic 40) · ×1
  • cso-image-matrix.imageBuildMatrix (cyclomatic 40) scripts/cso-image-matrix.ts:77 — cso-image-matrix.imageBuildMatrix has cyclomatic complexity 40 (threshold 15). Of this number, 38 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · train-gate.routeDispatch (cyclomatic 40) · ×1
  • train-gate.routeDispatch (cyclomatic 40) scripts/train-gate.ts:74 — train-gate.routeDispatch has cyclomatic complexity 40 (threshold 15). Of this number, 38 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gstack-memory-ingest.parseTranscriptJsonl (cyclomatic 39) · ×1
  • gstack-memory-ingest.parseTranscriptJsonl (cyclomatic 39) bin/gstack-memory-ingest.ts:678 — gstack-memory-ingest.parseTranscriptJsonl has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · state.retention (cyclomatic 39) · ×1
  • state.retention (cyclomatic 39) lib/cso/state.ts:2481 — state.retention has cyclomatic complexity 39 (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 shape REPEATS in the file: one other method here (state.retention::retainedReport) 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.
D1 · Cyclomatic Complexity · preparation-executor.validateClosure (cyclomatic 39) · ×1
  • preparation-executor.validateClosure (cyclomatic 39) lib/cso/preparation-executor.ts:602 — preparation-executor.validateClosure has cyclomatic complexity 39 (threshold 15). Of this number, 37 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · supervise.supervise (cyclomatic 39) · ×1
  • supervise.supervise (cyclomatic 39) REDACTED:94 — supervise.supervise has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 3 of the 39 points are its own statements and the rest belongs to 6 function items inside it that branch (readNew, a function literal at line 163, a function literal at line 175, …). 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 · review-evidence.bindReview (cyclomatic 39) · ×1
  • review-evidence.bindReview (cyclomatic 39) lib/review-evidence.ts:265 — review-evidence.bindReview has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · release-cut.planRelease (cyclomatic 39) · ×1
  • release-cut.planRelease (cyclomatic 39) scripts/release-cut.ts:169 — release-cut.planRelease has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · connect (cyclomatic 39) · ×1
  • connect (cyclomatic 39) extension/sidepanel-terminal.js:545 — connect has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 10 of the 39 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 664, 639, 601, …). 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 · phase-publication-hook.autoplanReadRange (cyclomatic 38) · ×1
  • phase-publication-hook.autoplanReadRange (cyclomatic 38) autoplan/bin/phase-publication-hook.ts:312 — phase-publication-hook.autoplanReadRange has cyclomatic complexity 38 (threshold 15). Of this number, 30 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · autoplan-revise.reviseRun (cyclomatic 38) · ×1
  • autoplan-revise.reviseRun (cyclomatic 38) lib/autoplan-revise.ts:102 — autoplan-revise.reviseRun has cyclomatic complexity 38 (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 · autoplan-run.nextStep (cyclomatic 38) · ×1
  • autoplan-run.nextStep (cyclomatic 38) REDACTED:178 — autoplan-run.nextStep has cyclomatic complexity 38 (threshold 15). Of this number, 35 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 · autoplan-run.resumeRun (cyclomatic 38) · ×1
  • autoplan-run.resumeRun (cyclomatic 38) REDACTED:404 — autoplan-run.resumeRun has cyclomatic complexity 38 (threshold 15). Of this number, 37 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 · contracts.validateVerificationRequest (cyclomatic 38) · ×1
  • contracts.validateVerificationRequest (cyclomatic 38) lib/cso/contracts.ts:724 — contracts.validateVerificationRequest has cyclomatic complexity 38 (threshold 15). Of this number, 26 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · state.ensureLockProtocol (cyclomatic 38) · ×1
  • state.ensureLockProtocol (cyclomatic 38) lib/cso/state.ts:1440 — state.ensureLockProtocol has cyclomatic complexity 38 (threshold 15). Of this number, 34 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · scanner-executor.validateScannerRequest (cyclomatic 38) · ×1
  • scanner-executor.validateScannerRequest (cyclomatic 38) lib/cso/scanner-executor.ts:208 — scanner-executor.validateScannerRequest has cyclomatic complexity 38 (threshold 15). Of this number, 25 points are the body's own statements and 13 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · image-provisioning.provisionCatalogImages (cyclomatic 38) · ×1
  • image-provisioning.provisionCatalogImages (cyclomatic 38) lib/cso/image-provisioning.ts:162 — image-provisioning.provisionCatalogImages 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 · cli.doctor (cyclomatic 38) · ×1
  • cli.doctor (cyclomatic 38) REDACTED:805 — cli.doctor has cyclomatic complexity 38 (threshold 15). Of this number, 30 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gstack-post.parseArgs (cyclomatic 38) · ×1
  • gstack-post.parseArgs (cyclomatic 38) lib/gstack-post.ts:77 — gstack-post.parseArgs 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 · tree-receipt.classifyFile (cyclomatic 38) · ×1
  • tree-receipt.classifyFile (cyclomatic 38) lib/tree-receipt.ts:71 — tree-receipt.classifyFile 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 · review-evidence.sharedLibsSnapshotCoverage (cyclomatic 38) · ×1
  • review-evidence.sharedLibsSnapshotCoverage (cyclomatic 38) lib/review-evidence.ts:70 — review-evidence.sharedLibsSnapshotCoverage has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 11 of the 38 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 93, git, a function literal at line 83). 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 · eval-flake-rank.analyzePassRates (cyclomatic 38) · ×1
  • eval-flake-rank.analyzePassRates (cyclomatic 38) scripts/eval-flake-rank.ts:443 — eval-flake-rank.analyzePassRates has cyclomatic complexity 38 (threshold 15). Of this number, 35 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cso-eval-producer.runProducerCell (cyclomatic 38) · ×1
  • cso-eval-producer.runProducerCell (cyclomatic 38) scripts/cso-eval-producer.ts:553 — cso-eval-producer.runProducerCell has cyclomatic complexity 38 (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 · server.buildFetchHandler.shutdown (cyclomatic 37) · ×1
  • server.buildFetchHandler.shutdown (cyclomatic 37) REDACTED:1649 — server.buildFetchHandler.shutdown has cyclomatic complexity 37 (threshold 15). Of this number, 36 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 · state.validateLeaseDecision (cyclomatic 37) · ×1
  • state.validateLeaseDecision (cyclomatic 37) lib/cso/state.ts:1019 — state.validateLeaseDecision has cyclomatic complexity 37 (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 · restamp.runStages (cyclomatic 37) · ×1
  • restamp.runStages (cyclomatic 37) REDACTED:347 — restamp.runStages has cyclomatic complexity 37 (threshold 15). Of this number, 31 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tree-receipt.buildReceipt (cyclomatic 37) · ×1
  • tree-receipt.buildReceipt (cyclomatic 37) lib/tree-receipt.ts:132 — tree-receipt.buildReceipt has cyclomatic complexity 37 (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 · recover-receipts.collectRecovery (cyclomatic 37) · ×1
  • recover-receipts.collectRecovery (cyclomatic 37) scripts/recover-receipts.ts:188 — recover-receipts.collectRecovery has cyclomatic complexity 37 (threshold 15). Of this number, 28 points are the body's own statements and 9 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · phase-publication-hook.requirePublication (cyclomatic 36) · ×1
  • phase-publication-hook.requirePublication (cyclomatic 36) autoplan/bin/phase-publication-hook.ts:442 — phase-publication-hook.requirePublication has cyclomatic complexity 36 (threshold 15). Of this number, 20 points are the body's own statements and 16 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · cli.sendCommand (cyclomatic 36) · ×1
  • cli.sendCommand (cyclomatic 36) browse/src/cli.ts:1075 — cli.sendCommand has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cookie-import-native.importNativeCookies (cyclomatic 36) · ×1
  • cookie-import-native.importNativeCookies (cyclomatic 36) browse/src/cookie-import-native.ts:42 — cookie-import-native.importNativeCookies has cyclomatic complexity 36 (threshold 15). Of this number, 27 points are the body's own statements and 9 belong to 6 function literals 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 · claude-code.runClaudeCode (cyclomatic 36) · ×1
  • claude-code.runClaudeCode (cyclomatic 36) lib/claude-code.ts:146 — claude-code.runClaudeCode has cyclomatic complexity 36 (threshold 15). Of this number, 20 points are the body's own statements and 16 belong to 4 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 · state.activateRunLease (cyclomatic 36) · ×1
  • state.activateRunLease (cyclomatic 36) lib/cso/state.ts:1997 — state.activateRunLease has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preparation-executor.validatePlan (cyclomatic 36) · ×1
  • preparation-executor.validatePlan (cyclomatic 36) lib/cso/preparation-executor.ts:388 — preparation-executor.validatePlan has cyclomatic complexity 36 (threshold 15). Of this number, 34 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · cli.submit (cyclomatic 36) · ×1
  • cli.submit (cyclomatic 36) REDACTED:1391 — cli.submit has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 2 of the 36 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1401, 1463). 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 · qa-evidence.materialize (cyclomatic 36) · ×1
  • qa-evidence.materialize (cyclomatic 36) REDACTED:312 — qa-evidence.materialize has cyclomatic complexity 36 (threshold 15). Of this number, 30 points are the body's own statements and 6 belong to 3 function literals 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 · terminal-agent-control.reclaimPublicationLock (cyclomatic 35) · ×1
  • terminal-agent-control.reclaimPublicationLock (cyclomatic 35) browse/src/terminal-agent-control.ts:45 — terminal-agent-control.reclaimPublicationLock 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 · autoplan-reconcile.reconcile (cyclomatic 35) · ×1
  • autoplan-reconcile.reconcile (cyclomatic 35) lib/autoplan-reconcile.ts:238 — autoplan-reconcile.reconcile has cyclomatic complexity 35 (threshold 15). Of this number, 31 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · regen.validateRegistry (cyclomatic 35) · ×1
  • regen.validateRegistry (cyclomatic 35) lib/regen.ts:49 — regen.validateRegistry has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 9 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 57, 74). 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 · ship-queue-train.trainStatus (cyclomatic 35) · ×1
  • ship-queue-train.trainStatus (cyclomatic 35) lib/ship-queue-train.ts:491 — ship-queue-train.trainStatus 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 · paid-rerun.observeCases (cyclomatic 35) · ×1
  • paid-rerun.observeCases (cyclomatic 35) scripts/lib/paid-rerun.ts:133 — paid-rerun.observeCases has cyclomatic complexity 35 (threshold 15). Of this number, 31 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cso-eval.buildEvalMatrix (cyclomatic 35) · ×1
  • cso-eval.buildEvalMatrix (cyclomatic 35) scripts/cso-eval.ts:565 — cso-eval.buildEvalMatrix has cyclomatic complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs 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 · (anonymous) (cyclomatic 35) · ×1
  • (anonymous) (cyclomatic 35) extension/background.js:296 — (anonymous) has cyclomatic complexity 35 (threshold 15). Of this number, 26 points are the body's own statements and 9 belong to 17 function literals 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 · gstack-memory-ingest.preparePages (cyclomatic 34) · ×1
  • gstack-memory-ingest.preparePages (cyclomatic 34) bin/gstack-memory-ingest.ts:1537 — gstack-memory-ingest.preparePages has cyclomatic complexity 34 (threshold 15). Of this number, 29 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cookie-auth-verification.clearCookieTargetStorage (cyclomatic 34) · ×1
  • cookie-auth-verification.clearCookieTargetStorage (cyclomatic 34) browse/src/cookie-auth-verification.ts:131 — cookie-auth-verification.clearCookieTargetStorage has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 177, cancelled, a function literal at line 194, …). 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 · meta-commands.parsePdfArgs (cyclomatic 34) · ×1
  • meta-commands.parsePdfArgs (cyclomatic 34) browse/src/meta-commands.ts:80 — meta-commands.parsePdfArgs has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · scanners.parseScannerOutput (cyclomatic 34) · ×1
  • scanners.parseScannerOutput (cyclomatic 34) lib/cso/scanners.ts:958 — scanners.parseScannerOutput has cyclomatic complexity 34 (threshold 15). Of this number, 30 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · scanner-executor.createDockerScannerRunner (cyclomatic 34) · ×1
  • scanner-executor.createDockerScannerRunner (cyclomatic 34) lib/cso/scanner-executor.ts:704 — scanner-executor.createDockerScannerRunner has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 5 of the 34 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 753, capture, writePolicy, …). 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 · main.swift.parseJSONSnapshotType (cyclomatic 34) · ×1
  • main.swift.parseJSONSnapshotType (cyclomatic 34) ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift:461 — main.swift.parseJSONSnapshotType 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 · phase-publication-hook.invocation (cyclomatic 33) · ×1
  • phase-publication-hook.invocation (cyclomatic 33) autoplan/bin/phase-publication-hook.ts:267 — phase-publication-hook.invocation has cyclomatic complexity 33 (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 · phase-publication-hook.guardOutput (cyclomatic 33) · ×1
  • phase-publication-hook.guardOutput (cyclomatic 33) autoplan/bin/phase-publication-hook.ts:719 — phase-publication-hook.guardOutput 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 · gbrain-local-status.hasRemoteOnlyGbrainMcp (cyclomatic 33) · ×1
  • gbrain-local-status.hasRemoteOnlyGbrainMcp (cyclomatic 33) REDACTED:174 — gbrain-local-status.hasRemoteOnlyGbrainMcp has cyclomatic complexity 33 (threshold 15). Of this number, 17 points are the body's own statements and 16 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · autoplan-run.submitResult (cyclomatic 33) · ×1
  • autoplan-run.submitResult (cyclomatic 33) REDACTED:299 — autoplan-run.submitResult has cyclomatic complexity 33 (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 · state.readLegacyOwner (cyclomatic 33) · ×1
  • state.readLegacyOwner (cyclomatic 33) lib/cso/state.ts:1307 — state.readLegacyOwner has cyclomatic complexity 33 (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 · ship-queue.verify (cyclomatic 33) · ×1
  • ship-queue.verify (cyclomatic 33) lib/ship-queue.ts:373 — ship-queue.verify 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 · garry-output-comparison.main (cyclomatic 33) · ×1
  • garry-output-comparison.main (cyclomatic 33) REDACTED:314 — garry-output-comparison.main has cyclomatic complexity 33 (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 · review-dashboard.generatePlanFileReviewReport (cyclomatic 33) · ×1
  • review-dashboard.generatePlanFileReviewReport (cyclomatic 33) scripts/resolvers/review-dashboard.ts:104 — review-dashboard.generatePlanFileReviewReport 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 · gbrain-local-status.freshClassify (cyclomatic 32) · ×1
  • gbrain-local-status.freshClassify (cyclomatic 32) REDACTED:452 — gbrain-local-status.freshClassify has cyclomatic complexity 32 (threshold 15). Of this number, 18 points are the body's own statements and 14 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-catalog.validateScannerCatalog (cyclomatic 32) · ×1
  • scanner-catalog.validateScannerCatalog (cyclomatic 32) REDACTED:177 — scanner-catalog.validateScannerCatalog has cyclomatic complexity 32 (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 · witness.validateStoredAssertionWitnessReceipt (cyclomatic 32) · ×1
  • witness.validateStoredAssertionWitnessReceipt (cyclomatic 32) REDACTED:169 — witness.validateStoredAssertionWitnessReceipt has cyclomatic complexity 32 (threshold 15). Of this number, 19 points are the body's own statements and 13 belong to one function literal inside it that branches. 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 · DockerVerificationExecutor.observe (cyclomatic 32) · ×1
  • DockerVerificationExecutor.observe (cyclomatic 32) lib/cso/verification.ts:1586 — DockerVerificationExecutor.observe has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · scanner-executor.executeScanner (cyclomatic 32) · ×1
  • scanner-executor.executeScanner (cyclomatic 32) lib/cso/scanner-executor.ts:394 — scanner-executor.executeScanner 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 · git.sectionToFile (cyclomatic 32) · ×1
  • git.sectionToFile (cyclomatic 32) lib/gate-diff/git.ts:223 — git.sectionToFile has cyclomatic complexity 32 (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 · lanes.run (cyclomatic 32) · ×1
  • lanes.run (cyclomatic 32) lib/pregate/checks/lanes.ts:406 — lanes.run 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 · gstack-memory-ingest.parseArgs (cyclomatic 31) · ×1
  • gstack-memory-ingest.parseArgs (cyclomatic 31) bin/gstack-memory-ingest.ts:320 — gstack-memory-ingest.parseArgs has cyclomatic complexity 31 (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 · gstack-memory-ingest.verifyResumeDir (cyclomatic 31) · ×1
  • gstack-memory-ingest.verifyResumeDir (cyclomatic 31) bin/gstack-memory-ingest.ts:2948 — gstack-memory-ingest.verifyResumeDir 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 · gstack-gbrain-sync.main (cyclomatic 31) · ×1
  • gstack-gbrain-sync.main (cyclomatic 31) bin/gstack-gbrain-sync.ts:2175 — gstack-gbrain-sync.main has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · aside-render.renderWithBrowse (cyclomatic 31) · ×1
  • aside-render.renderWithBrowse (cyclomatic 31) lib/aside-render.ts:489 — aside-render.renderWithBrowse has cyclomatic complexity 31 (threshold 15). Of this number, 21 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BrowserManager.launchHeaded (cyclomatic 31) · ×1
  • BrowserManager.launchHeaded (cyclomatic 31) browse/src/browser-manager.ts:789 — BrowserManager.launchHeaded has cyclomatic complexity 31 (threshold 15). Of this number, 19 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · background.chrome.runtime.onMessage.addListener() (cyclomatic 31) · ×1
  • background.chrome.runtime.onMessage.addListener() (cyclomatic 31) extension/background.js:296 — background.chrome.runtime.onMessage.addListener() has cyclomatic complexity 31 (threshold 15). Of this number, 24 points are the body's own statements and 7 belong to 6 function literals 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 · gate-list.parseReply (cyclomatic 31) · ×1
  • gate-list.parseReply (cyclomatic 31) lib/gate-list.ts:147 — gate-list.parseReply has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ci-gate.evaluateChecks (cyclomatic 31) · ×1
  • ci-gate.evaluateChecks (cyclomatic 31) lib/ci-gate.ts:106 — ci-gate.evaluateChecks has cyclomatic complexity 31 (threshold 15). Of this number, 27 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · contracts.renderReport (cyclomatic 31) · ×1
  • contracts.renderReport (cyclomatic 31) lib/cso/contracts.ts:883 — contracts.renderReport has cyclomatic complexity 31 (threshold 15). Of this number, 22 points are the body's own statements and 9 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · process.safeMetadata (cyclomatic 31) · ×1
  • process.safeMetadata (cyclomatic 31) lib/cso/process.ts:223 — process.safeMetadata has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · state.releaseKnownLease (cyclomatic 31) · ×1
  • state.releaseKnownLease (cyclomatic 31) lib/cso/state.ts:1836 — state.releaseKnownLease has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · docker.dockerEndpoint (cyclomatic 31) · ×1
  • docker.dockerEndpoint (cyclomatic 31) REDACTED:76 — docker.dockerEndpoint 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 · eval-plan.dryRun (cyclomatic 31) · ×1
  • eval-plan.dryRun (cyclomatic 31) lib/eval-plan.ts:232 — eval-plan.dryRun has cyclomatic complexity 31 (threshold 15). Of this number, 19 points are the body's own statements and 12 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · regate.migrationReport (cyclomatic 31) · ×1
  • regate.migrationReport (cyclomatic 31) REDACTED:39 — regate.migrationReport has cyclomatic complexity 31 (threshold 15). Of this number, 22 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cso-eval.validateCollectedBatch (cyclomatic 31) · ×1
  • cso-eval.validateCollectedBatch (cyclomatic 31) scripts/cso-eval.ts:848 — cso-eval.validateCollectedBatch has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: cso-eval.assertBaselineBinding (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · gate-cost-replay.parseArgs (cyclomatic 31) · ×1
  • gate-cost-replay.parseArgs (cyclomatic 31) scripts/gate-cost-replay.ts:72 — gate-cost-replay.parseArgs has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gen-skill-docs.transformFrontmatter (cyclomatic 31) · ×1
  • gen-skill-docs.transformFrontmatter (cyclomatic 31) REDACTED:451 — gen-skill-docs.transformFrontmatter 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 · ship-measure.main (cyclomatic 31) · ×1
  • ship-measure.main (cyclomatic 31) REDACTED:769 — ship-measure.main has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gstack-memory-ingest.admitTranscriptSource (cyclomatic 30) · ×1
  • gstack-memory-ingest.admitTranscriptSource (cyclomatic 30) bin/gstack-memory-ingest.ts:2521 — gstack-memory-ingest.admitTranscriptSource has cyclomatic complexity 30 (threshold 15). Of this number, 26 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · content.captureBasicData (cyclomatic 30) · ×1
  • content.captureBasicData (cyclomatic 30) extension/content.js:153 — content.captureBasicData 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 · inspector.captureBasicData (cyclomatic 30) · ×1
  • inspector.captureBasicData (cyclomatic 30) extension/inspector.js:189 — inspector.captureBasicData 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 · eval-plan.parseEvalCalls (cyclomatic 30) · ×1
  • eval-plan.parseEvalCalls (cyclomatic 30) lib/eval-plan.ts:433 — eval-plan.parseEvalCalls 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 · eval-plan.priceGate (cyclomatic 30) · ×1
  • eval-plan.priceGate (cyclomatic 30) lib/eval-plan.ts:560 — eval-plan.priceGate 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 · diagram-prepass.inlineLocalImages (cyclomatic 30) · ×1
  • diagram-prepass.inlineLocalImages (cyclomatic 30) make-pdf/src/diagram-prepass.ts:549 — diagram-prepass.inlineLocalImages has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 2 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 563, 672, 686). 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 · cso-eval.validateReceiptIndex (cyclomatic 30) · ×1
  • cso-eval.validateReceiptIndex (cyclomatic 30) scripts/cso-eval.ts:454 — cso-eval.validateReceiptIndex has cyclomatic complexity 30 (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 is NOT this file's highest cyclomatic complexity: cso-eval.assertBaselineBinding (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · autoplan-phase-publication.autoplanPhaseCompletions (cyclomatic 29) · ×1
  • autoplan-phase-publication.autoplanPhaseCompletions (cyclomatic 29) REDACTED:65 — autoplan-phase-publication.autoplanPhaseCompletions has cyclomatic complexity 29 (threshold 15). Of this number, 28 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 · gstack-memory-ingest.walkGstackArtifacts (cyclomatic 29) · ×1
  • gstack-memory-ingest.walkGstackArtifacts (cyclomatic 29) bin/gstack-memory-ingest.ts:559 — gstack-memory-ingest.walkGstackArtifacts 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 · gen-accessors.maskSwiftSource (cyclomatic 29) · ×1
  • gen-accessors.maskSwiftSource (cyclomatic 29) ios-qa/scripts/gen-accessors.ts:180 — gen-accessors.maskSwiftSource has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · state.discardAtomicNoReplaceTemp (cyclomatic 29) · ×1
  • state.discardAtomicNoReplaceTemp (cyclomatic 29) lib/cso/state.ts:594 — state.discardAtomicNoReplaceTemp 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 · snapshot.boundPath (cyclomatic 29) · ×1
  • snapshot.boundPath (cyclomatic 29) lib/cso/snapshot.ts:105 — snapshot.boundPath has cyclomatic complexity 29 (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 · preparation.inspectRails (cyclomatic 29) · ×1
  • preparation.inspectRails (cyclomatic 29) REDACTED:932 — preparation.inspectRails 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 · preparation-container.manifest (cyclomatic 29) · ×1
  • preparation-container.manifest (cyclomatic 29) REDACTED:507 — preparation-container.manifest has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preparation-container.extractNpmArchive · ×1
  • preparation-container.extractNpmArchive::consume (cyclomatic 29) REDACTED:738 — preparation-container.extractNpmArchive::consume 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 · cli.verify (cyclomatic 29) · ×1
  • cli.verify (cyclomatic 29) REDACTED:2304 — cli.verify has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2309, 2316). 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. This is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cli.replay (cyclomatic 29) · ×1
  • cli.replay (cyclomatic 29) REDACTED:2604 — cli.replay has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2615, 2626). 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. This is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · restamp.planVersions (cyclomatic 29) · ×1
  • restamp.planVersions (cyclomatic 29) REDACTED:144 — restamp.planVersions has cyclomatic complexity 29 (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 · ship-queue.stamp (cyclomatic 29) · ×1
  • ship-queue.stamp (cyclomatic 29) lib/ship-queue.ts:264 — ship-queue.stamp has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · version-gate-train.classifyTrainHead (cyclomatic 29) · ×1
  • version-gate-train.classifyTrainHead (cyclomatic 29) lib/version-gate-train.ts:92 — version-gate-train.classifyTrainHead has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to 3 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 · openReattachWebSocket (cyclomatic 29) · ×1
  • openReattachWebSocket (cyclomatic 29) extension/sidepanel-terminal.js:309 — openReattachWebSocket has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 329, 362, 323, …). 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 · gstack-global-discover.scanGemini (cyclomatic 28) · ×1
  • gstack-global-discover.scanGemini (cyclomatic 28) bin/gstack-global-discover.ts:435 — gstack-global-discover.scanGemini has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · BrowserManager.promoteToHeaded (cyclomatic 28) · ×1
  • BrowserManager.promoteToHeaded (cyclomatic 28) browse/src/browser-manager.ts:2093 — BrowserManager.promoteToHeaded has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.handlePairAgent (cyclomatic 28) · ×1
  • cli.handlePairAgent (cyclomatic 28) browse/src/cli.ts:1581 — cli.handlePairAgent 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 · claude-code.parseClaudeCodeResult (cyclomatic 28) · ×1
  • claude-code.parseClaudeCodeResult (cyclomatic 28) lib/claude-code.ts:109 — claude-code.parseClaudeCodeResult has cyclomatic complexity 28 (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 · contracts.assertion (cyclomatic 28) · ×1
  • contracts.assertion (cyclomatic 28) lib/cso/contracts.ts:652 — contracts.assertion has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · bounded-file.readBoundedStable (cyclomatic 28) · ×1
  • bounded-file.readBoundedStable (cyclomatic 28) lib/cso/bounded-file.ts:5 — bounded-file.readBoundedStable has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · verification.directPackageTest (cyclomatic 28) · ×1
  • verification.directPackageTest (cyclomatic 28) lib/cso/verification.ts:419 — verification.directPackageTest 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 · context.buildContext (cyclomatic 28) · ×1
  • context.buildContext (cyclomatic 28) lib/pregate/context.ts:186 — context.buildContext 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 · lanes.planRuns (cyclomatic 28) · ×1
  • lanes.planRuns (cyclomatic 28) lib/pregate/checks/lanes.ts:160 — lanes.planRuns has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · qa-evidence.qaEvidenceMain (cyclomatic 28) · ×1
  • qa-evidence.qaEvidenceMain (cyclomatic 28) REDACTED:393 — qa-evidence.qaEvidenceMain has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 396, 394). 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 · eval-bg.main (cyclomatic 28) · ×1
  • eval-bg.main (cyclomatic 28) scripts/eval-bg.ts:389 — eval-bg.main has cyclomatic complexity 28 (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 · ship-queue-train-verdict.classifyGate (cyclomatic 28) · ×1
  • ship-queue-train-verdict.classifyGate (cyclomatic 28) lib/ship-queue-train-verdict.ts:52 — ship-queue-train-verdict.classifyGate has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to 2 function literals 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 · design.generateDesignOutsideVoices (cyclomatic 28) · ×1
  • design.generateDesignOutsideVoices (cyclomatic 28) scripts/resolvers/design.ts:689 — design.generateDesignOutsideVoices has cyclomatic complexity 28 (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 · gstack-autoplan-snapshot.acceptedBlocks (cyclomatic 27) · ×1
  • gstack-autoplan-snapshot.acceptedBlocks (cyclomatic 27) bin/gstack-autoplan-snapshot.ts:115 — gstack-autoplan-snapshot.acceptedBlocks 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 · gstack-design-detect.install (cyclomatic 27) · ×1
  • gstack-design-detect.install (cyclomatic 27) bin/gstack-design-detect.ts:632 — gstack-design-detect.install has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gstack-design-detect.resolveTargets (cyclomatic 27) · ×1
  • gstack-design-detect.resolveTargets (cyclomatic 27) bin/gstack-design-detect.ts:798 — gstack-design-detect.resolveTargets has cyclomatic complexity 27 (threshold 15). Of this number, 18 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gstack-gbrain-sync.runDream (cyclomatic 27) · ×1
  • gstack-gbrain-sync.runDream (cyclomatic 27) bin/gstack-gbrain-sync.ts:1762 — gstack-gbrain-sync.runDream has cyclomatic complexity 27 (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 · BrowserManager.wirePageEvents (cyclomatic 27) · ×1
  • BrowserManager.wirePageEvents (cyclomatic 27) browse/src/browser-manager.ts:2346 — BrowserManager.wirePageEvents 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 5 function literals inside it that branch (lines 2351, 2451, 2386, …). 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 · serve.serve (cyclomatic 27) · ×1
  • serve.serve (cyclomatic 27) design/src/serve.ts:55 — serve.serve has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 2 function items inside it that branch (handleFeedback, handleReload). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · host-config.validateHostConfig (cyclomatic 27) · ×1
  • host-config.validateHostConfig (cyclomatic 27) scripts/host-config.ts:151 — host-config.validateHostConfig 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 · redact-engine.scanInternal (cyclomatic 27) · ×1
  • redact-engine.scanInternal (cyclomatic 27) REDACTED:347 — redact-engine.scanInternal has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tunnel-bootstrap.bootstrapTunnel (cyclomatic 27) · ×1
  • tunnel-bootstrap.bootstrapTunnel (cyclomatic 27) ios-qa/daemon/src/tunnel-bootstrap.ts:204 — tunnel-bootstrap.bootstrapTunnel has cyclomatic complexity 27 (threshold 15). Of this number, 22 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · approval-record.importAutoplan (cyclomatic 27) · ×1
  • approval-record.importAutoplan (cyclomatic 27) lib/approval-record.ts:209 — approval-record.importAutoplan has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · autoplan-gate.buildGate (cyclomatic 27) · ×1
  • autoplan-gate.buildGate (cyclomatic 27) lib/autoplan-gate.ts:195 — autoplan-gate.buildGate 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 · preparation-executor.stagedFileHashes (cyclomatic 27) · ×1
  • preparation-executor.stagedFileHashes (cyclomatic 27) lib/cso/preparation-executor.ts:501 — preparation-executor.stagedFileHashes has cyclomatic complexity 27 (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 · preparation-container.createPreparedExport · ×1
  • preparation-container.createPreparedExport::walk (cyclomatic 27) REDACTED:273 — preparation-container.createPreparedExport::walk 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. This shape REPEATS in the file: one other method here (preparation-container.createPreparedExport) 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.
D1 · Cyclomatic Complexity · qa-deadline.runQaDeadlineCommand (cyclomatic 27) · ×1
  • qa-deadline.runQaDeadlineCommand (cyclomatic 27) lib/qa-deadline.ts:123 — qa-deadline.runQaDeadlineCommand has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 158, 138, 149, …). 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 · gstack-post.runPost (cyclomatic 27) · ×1
  • gstack-post.runPost (cyclomatic 27) lib/gstack-post.ts:340 — gstack-post.runPost 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 · django.djangoEdges (cyclomatic 27) · ×1
  • django.djangoEdges (cyclomatic 27) lib/pregate/django.ts:77 — django.djangoEdges has cyclomatic complexity 27 (threshold 15). 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 · ship-queue-train.newTrain (cyclomatic 27) · ×1
  • ship-queue-train.newTrain (cyclomatic 27) lib/ship-queue-train.ts:314 — ship-queue-train.newTrain has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals 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 · eval-history.parsePassRatesArgs (cyclomatic 27) · ×1
  • eval-history.parsePassRatesArgs (cyclomatic 27) scripts/lib/eval-history.ts:322 — eval-history.parsePassRatesArgs has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · gate-reuse.ownDiffSignature (cyclomatic 27) · ×1
  • gate-reuse.ownDiffSignature (cyclomatic 27) scripts/gate-reuse.ts:216 — gate-reuse.ownDiffSignature has cyclomatic complexity 27 (threshold 15). Of this number, 15 points are the body's own statements and 12 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.Deno.serve() (cyclomatic 27) · ×1
  • index.Deno.serve() (cyclomatic 27) supabase/functions/telemetry-ingest/index.ts:29 — index.Deno.serve() 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 · claude-journal-records.recordMeta (cyclomatic 26) · ×1
  • claude-journal-records.recordMeta (cyclomatic 26) lib/claude-journal-records.ts:272 — claude-journal-records.recordMeta has cyclomatic complexity 26 (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 · gstack-gbrain-sync.runMemoryIngest (cyclomatic 26) · ×1
  • gstack-gbrain-sync.runMemoryIngest (cyclomatic 26) bin/gstack-gbrain-sync.ts:1540 — gstack-gbrain-sync.runMemoryIngest has cyclomatic complexity 26 (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 · content-security.markHiddenElements (cyclomatic 26) · ×1
  • content-security.markHiddenElements (cyclomatic 26) browse/src/content-security.ts:88 — content-security.markHiddenElements has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to one function literal inside it that branches (line 89). 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 · process.boundedMetadataFile (cyclomatic 26) · ×1
  • process.boundedMetadataFile (cyclomatic 26) lib/cso/process.ts:341 — process.boundedMetadataFile has cyclomatic complexity 26 (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 · dx-error-capture.parseArgs (cyclomatic 26) · ×1
  • dx-error-capture.parseArgs (cyclomatic 26) lib/dx-error-capture.ts:100 — dx-error-capture.parseArgs 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 · import-graph.referencesIn (cyclomatic 26) · ×1
  • import-graph.referencesIn (cyclomatic 26) lib/pregate/import-graph.ts:403 — import-graph.referencesIn has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · import-graph.buildGraph (cyclomatic 26) · ×1
  • import-graph.buildGraph (cyclomatic 26) lib/pregate/import-graph.ts:453 — import-graph.buildGraph has cyclomatic complexity 26 (threshold 15). 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 · qa-evidence.readQaCaptureRecord (cyclomatic 26) · ×1
  • qa-evidence.readQaCaptureRecord (cyclomatic 26) REDACTED:79 — qa-evidence.readQaCaptureRecord has cyclomatic complexity 26 (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 · pr-dependencies.deriveDependencies.refs (cyclomatic 26) · ×1
  • pr-dependencies.deriveDependencies.refs (cyclomatic 26) scripts/pr-dependencies.ts:205 — pr-dependencies.deriveDependencies.refs has cyclomatic complexity 26 (threshold 15). 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 · pr-dependencies.exercisedConsumers.shellEdges (cyclomatic 26) · ×1
  • pr-dependencies.exercisedConsumers.shellEdges (cyclomatic 26) scripts/pr-dependencies.ts:495 — pr-dependencies.exercisedConsumers.shellEdges has cyclomatic complexity 26 (threshold 15). 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 · ship-queue-train.buildTrain (cyclomatic 26) · ×1
  • ship-queue-train.buildTrain (cyclomatic 26) lib/ship-queue-train.ts:443 — ship-queue-train.buildTrain 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 · ship-queue-train-verdict.trainVerdict (cyclomatic 26) · ×1
  • ship-queue-train-verdict.trainVerdict (cyclomatic 26) lib/ship-queue-train-verdict.ts:102 — ship-queue-train-verdict.trainVerdict 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 · ship-queue-train-verdict.trainBisect (cyclomatic 26) · ×1
  • ship-queue-train-verdict.trainBisect (cyclomatic 26) lib/ship-queue-train-verdict.ts:237 — ship-queue-train-verdict.trainBisect has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · orchestrator.generate (cyclomatic 26) · ×1
  • orchestrator.generate (cyclomatic 26) make-pdf/src/orchestrator.ts:87 — orchestrator.generate has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · eval-input-cache.buildEvalInputIdentity (cyclomatic 26) · ×1
  • eval-input-cache.buildEvalInputIdentity (cyclomatic 26) scripts/eval-input-cache.ts:146 — eval-input-cache.buildEvalInputIdentity has cyclomatic complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to one function literal inside it that branches. 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 · eval-input-cache.validProof (cyclomatic 26) · ×1
  • eval-input-cache.validProof (cyclomatic 26) scripts/eval-input-cache.ts:195 — eval-input-cache.validProof has cyclomatic complexity 26 (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 · cso-eval-producer.artifactIdentity (cyclomatic 26) · ×1
  • cso-eval-producer.artifactIdentity (cyclomatic 26) scripts/cso-eval-producer.ts:374 — cso-eval-producer.artifactIdentity has cyclomatic complexity 26 (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 · ObservableClassVisitor.visit (cyclomatic 26) · ×1
  • ObservableClassVisitor.visit (cyclomatic 26) ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift:336 — ObservableClassVisitor.visit 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 · gstack-autoplan-snapshot.baselineEditRecords (cyclomatic 25) · ×1
  • gstack-autoplan-snapshot.baselineEditRecords (cyclomatic 25) bin/gstack-autoplan-snapshot.ts:195 — gstack-autoplan-snapshot.baselineEditRecords 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 · phase-publication-hook.verifyCloseEdits (cyclomatic 25) · ×1
  • phase-publication-hook.verifyCloseEdits (cyclomatic 25) autoplan/bin/phase-publication-hook.ts:405 — phase-publication-hook.verifyCloseEdits has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · autoplan-export.runLog (cyclomatic 25) · ×1
  • autoplan-export.runLog (cyclomatic 25) lib/autoplan-export.ts:77 — autoplan-export.runLog has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · context-bill.walkMdFiles · ×1
  • context-bill.walkMdFiles::walk (cyclomatic 25) lib/context-bill.ts:334 — context-bill.walkMdFiles::walk 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 · DockerPreparationSandboxRunner.publishArtifacts (cyclomatic 25) · ×1
  • DockerPreparationSandboxRunner.publishArtifacts (cyclomatic 25) lib/cso/preparation-docker.ts:1198 — DockerPreparationSandboxRunner.publishArtifacts has cyclomatic complexity 25 (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 · eval-models.parseEvalModels (cyclomatic 25) · ×1
  • eval-models.parseEvalModels (cyclomatic 25) lib/eval-models.ts:56 — eval-models.parseEvalModels has cyclomatic complexity 25 (threshold 15). Of this number, 24 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 · gate-cost-history.classifyReds (cyclomatic 25) · ×1
  • gate-cost-history.classifyReds (cyclomatic 25) lib/gate-cost-history.ts:88 — gate-cost-history.classifyReds has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 101, 100, 104, …). 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 · pr-shots.pathSides (cyclomatic 25) · ×1
  • pr-shots.pathSides (cyclomatic 25) lib/pr-shots.ts:75 — pr-shots.pathSides has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · pr-shots.paneRows (cyclomatic 25) · ×1
  • pr-shots.paneRows (cyclomatic 25) lib/pr-shots.ts:159 — pr-shots.paneRows has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · restamp.restamp (cyclomatic 25) · ×1
  • restamp.restamp (cyclomatic 25) REDACTED:502 — restamp.restamp 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 · ship-queue.acceptedReceiptHeads (cyclomatic 25) · ×1
  • ship-queue.acceptedReceiptHeads (cyclomatic 25) lib/ship-queue.ts:73 — ship-queue.acceptedReceiptHeads has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · pr-dependencies.stripMessages (cyclomatic 25) · ×1
  • pr-dependencies.stripMessages (cyclomatic 25) scripts/pr-dependencies.ts:407 — pr-dependencies.stripMessages 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 · cso-eval-producer.validateSource (cyclomatic 25) · ×1
  • cso-eval-producer.validateSource (cyclomatic 25) scripts/cso-eval-producer.ts:109 — cso-eval-producer.validateSource has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cso-eval.validatePortableSkillPayload (cyclomatic 25) · ×1
  • cso-eval.validatePortableSkillPayload (cyclomatic 25) scripts/cso-eval.ts:262 — cso-eval.validatePortableSkillPayload has cyclomatic complexity 25 (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 is NOT this file's highest cyclomatic complexity: cso-eval.assertBaselineBinding (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cso-eval.validateArtifactInventory (cyclomatic 25) · ×1
  • cso-eval.validateArtifactInventory (cyclomatic 25) scripts/cso-eval.ts:439 — cso-eval.validateArtifactInventory has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 is NOT this file's highest cyclomatic complexity: cso-eval.assertBaselineBinding (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cso-runtime-promotion.validateStatement (cyclomatic 25) · ×1
  • cso-runtime-promotion.validateStatement (cyclomatic 25) scripts/cso-runtime-promotion.ts:97 — cso-runtime-promotion.validateStatement has cyclomatic complexity 25 (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 · claude-owned-journal.scan · ×1
  • claude-owned-journal.scan::record (cyclomatic 24) lib/claude-owned-journal.ts:140 — claude-owned-journal.scan::record 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 shape REPEATS in the file: one other method here (claude-owned-journal.scan) 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.
D1 · Cyclomatic Complexity · transcript-consent.readTranscriptConsent (cyclomatic 24) · ×1
  • transcript-consent.readTranscriptConsent (cyclomatic 24) lib/transcript-consent.ts:108 — transcript-consent.readTranscriptConsent 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 · gstack-memory-ingest.importBatch (cyclomatic 24) · ×1
  • gstack-memory-ingest.importBatch (cyclomatic 24) bin/gstack-memory-ingest.ts:2812 — gstack-memory-ingest.importBatch 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 · gstack-memory-ingest.runLocked (cyclomatic 24) · ×1
  • gstack-memory-ingest.runLocked (cyclomatic 24) bin/gstack-memory-ingest.ts:3189 — gstack-memory-ingest.runLocked has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · socks-bridge.startSocksBridge.server (cyclomatic 24) · ×1
  • socks-bridge.startSocksBridge.server (cyclomatic 24) browse/src/socks-bridge.ts:130 — socks-bridge.startSocksBridge.server has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 5 function items inside it that branch (onData, a function literal at line 190, killBoth, …). 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 · cookie-import-browser.listProfiles (cyclomatic 24) · ×1
  • cookie-import-browser.listProfiles (cyclomatic 24) REDACTED:171 — cookie-import-browser.listProfiles has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cookie-import-native-worker.superviseNativeCookieImport (cyclomatic 24) · ×1
  • cookie-import-native-worker.superviseNativeCookieImport (cyclomatic 24) browse/src/cookie-import-native-worker.ts:92 — cookie-import-native-worker.superviseNativeCookieImport has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · banned-terms.validateBannedTerms (cyclomatic 24) · ×1
  • banned-terms.validateBannedTerms (cyclomatic 24) REDACTED:56 — banned-terms.validateBannedTerms has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 64). 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 · autoplan-reconcile.parseFences (cyclomatic 24) · ×1
  • autoplan-reconcile.parseFences (cyclomatic 24) lib/autoplan-reconcile.ts:69 — autoplan-reconcile.parseFences has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 74). 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 · outside-review-result.classifyOutsideReview (cyclomatic 24) · ×1
  • outside-review-result.classifyOutsideReview (cyclomatic 24) lib/outside-review-result.ts:242 — outside-review-result.classifyOutsideReview has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · witness.createReceipt (cyclomatic 24) · ×1
  • witness.createReceipt (cyclomatic 24) REDACTED:505 — witness.createReceipt has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to one function literal inside it that branches. 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 · cli.start (cyclomatic 24) · ×1
  • cli.start (cyclomatic 24) REDACTED:653 — cli.start has cyclomatic complexity 24 (threshold 15). Of this number, 20 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 is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · tags.tagHunk (cyclomatic 24) · ×1
  • tags.tagHunk (cyclomatic 24) lib/gate-diff/tags.ts:226 — tags.tagHunk has cyclomatic complexity 24 (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 · ship-queue-train.mergeStep (cyclomatic 24) · ×1
  • ship-queue-train.mergeStep (cyclomatic 24) lib/ship-queue-train.ts:149 — ship-queue-train.mergeStep has cyclomatic complexity 24 (threshold 15). Of this number, 20 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 · ship-queue-train.freePhase (cyclomatic 24) · ×1
  • ship-queue-train.freePhase (cyclomatic 24) lib/ship-queue-train.ts:375 — ship-queue-train.freePhase 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 · eval-history.triageRun (cyclomatic 24) · ×1
  • eval-history.triageRun (cyclomatic 24) scripts/lib/eval-history.ts:252 — eval-history.triageRun has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gate-reuse.parseBinding (cyclomatic 24) · ×1
  • gate-reuse.parseBinding (cyclomatic 24) scripts/gate-reuse.ts:139 — gate-reuse.parseBinding has cyclomatic complexity 24 (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 · gen-skill-docs.parseGenerationArgs (cyclomatic 24) · ×1
  • gen-skill-docs.parseGenerationArgs (cyclomatic 24) REDACTED:111 — gen-skill-docs.parseGenerationArgs has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ship-measure.runSet (cyclomatic 24) · ×1
  • ship-measure.runSet (cyclomatic 24) REDACTED:393 — ship-measure.runSet has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ship-measure-sweep.planSweep (cyclomatic 24) · ×1
  • ship-measure-sweep.planSweep (cyclomatic 24) scripts/ship-measure-sweep.ts:83 — ship-measure-sweep.planSweep has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gstack-autoplan-snapshot.requireMethodology (cyclomatic 23) · ×1
  • gstack-autoplan-snapshot.requireMethodology (cyclomatic 23) bin/gstack-autoplan-snapshot.ts:600 — gstack-autoplan-snapshot.requireMethodology has cyclomatic complexity 23 (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 · design-md.tokensFlat (cyclomatic 23) · ×1
  • design-md.tokensFlat (cyclomatic 23) REDACTED:367 — design-md.tokensFlat has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · url-validation.normalizeFileUrl (cyclomatic 23) · ×1
  • url-validation.normalizeFileUrl (cyclomatic 23) REDACTED:129 — url-validation.normalizeFileUrl has cyclomatic complexity 23 (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 · proxy-config.parseProxyConfig (cyclomatic 23) · ×1
  • proxy-config.parseProxyConfig (cyclomatic 23) browse/src/proxy-config.ts:45 — proxy-config.parseProxyConfig has cyclomatic complexity 23 (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 · daemon.fetchHandler (cyclomatic 23) · ×1
  • daemon.fetchHandler (cyclomatic 23) design/src/daemon.ts:476 — daemon.fetchHandler 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 · timeline-stop-hook.repairTimeline (cyclomatic 23) · ×1
  • timeline-stop-hook.repairTimeline (cyclomatic 23) hosts/claude/hooks/timeline-stop-hook.ts:232 — timeline-stop-hook.repairTimeline has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gen-accessors.snapshotTypeIssue (cyclomatic 23) · ×1
  • gen-accessors.snapshotTypeIssue (cyclomatic 23) ios-qa/scripts/gen-accessors.ts:573 — gen-accessors.snapshotTypeIssue 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 · autoplan-checkpoint.checkpointRun (cyclomatic 23) · ×1
  • autoplan-checkpoint.checkpointRun (cyclomatic 23) lib/autoplan-checkpoint.ts:139 — autoplan-checkpoint.checkpointRun has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 148). 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 · gate-list.validateGateList (cyclomatic 23) · ×1
  • gate-list.validateGateList (cyclomatic 23) lib/gate-list.ts:60 — gate-list.validateGateList has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 69). 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 · autoplan-reconcile.parseRecordFindings (cyclomatic 23) · ×1
  • autoplan-reconcile.parseRecordFindings (cyclomatic 23) lib/autoplan-reconcile.ts:133 — autoplan-reconcile.parseRecordFindings has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ci-gate.parseCiGateArgs (cyclomatic 23) · ×1
  • ci-gate.parseCiGateArgs (cyclomatic 23) lib/ci-gate.ts:231 — ci-gate.parseCiGateArgs has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · process.runProcess (cyclomatic 23) · ×1
  • process.runProcess (cyclomatic 23) lib/cso/process.ts:563 — process.runProcess has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 650, 614, 599, …). 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 · PublicArchiveCache.materialize (cyclomatic 23) · ×1
  • PublicArchiveCache.materialize (cyclomatic 23) lib/cso/cache.ts:510 — PublicArchiveCache.materialize has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · preparation.inspectNode (cyclomatic 23) · ×1
  • preparation.inspectNode (cyclomatic 23) REDACTED:266 — preparation.inspectNode has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preparation.railsDatabaseConfiguration (cyclomatic 23) · ×1
  • preparation.railsDatabaseConfiguration (cyclomatic 23) REDACTED:1068 — preparation.railsDatabaseConfiguration has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PreparationExecutor.prepareOffline (cyclomatic 23) · ×1
  • PreparationExecutor.prepareOffline (cyclomatic 23) lib/cso/preparation-executor.ts:1372 — PreparationExecutor.prepareOffline 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 is NOT this file's highest cyclomatic complexity: preparation-executor.validateOfflineReceipt (cyclomatic 24) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · preparation-container.createPreparedExport (cyclomatic 23) · ×1
  • preparation-container.createPreparedExport (cyclomatic 23) REDACTED:245 — preparation-container.createPreparedExport 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 shape REPEATS in the file: one other method here (preparation-container.createPreparedExport::walk) 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.
D1 · Cyclomatic Complexity · preparation-docker.validateAcquisitionOutput (cyclomatic 23) · ×1
  • preparation-docker.validateAcquisitionOutput (cyclomatic 23) lib/cso/preparation-docker.ts:124 — preparation-docker.validateAcquisitionOutput has cyclomatic complexity 23 (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 · cli.finish (cyclomatic 23) · ×1
  • cli.finish (cyclomatic 23) REDACTED:1509 — cli.finish has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1512, 1546, 1527, …). 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. This is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cli.preparedVerificationExecutor.observe (cyclomatic 23) · ×1
  • cli.preparedVerificationExecutor.observe (cyclomatic 23) REDACTED:2161 — cli.preparedVerificationExecutor.observe has cyclomatic complexity 23 (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. This is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · gate-cost-history.simulateArrivalTrains (cyclomatic 23) · ×1
  • gate-cost-history.simulateArrivalTrains (cyclomatic 23) lib/gate-cost-history.ts:348 — gate-cost-history.simulateArrivalTrains 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 · regate.evaluateRegate (cyclomatic 23) · ×1
  • regate.evaluateRegate (cyclomatic 23) REDACTED:92 — regate.evaluateRegate has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · paid-plan.buildRunManifest · ×1
  • paid-plan.buildRunManifest::packByRecordedDuration (cyclomatic 23) scripts/lib/paid-plan.ts:415 — paid-plan.buildRunManifest::packByRecordedDuration 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 shape REPEATS in the file: one other method here (paid-plan.buildRunManifest) 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.
D1 · Cyclomatic Complexity · ship-queue-train-verify.verifyTrain (cyclomatic 23) · ×1
  • ship-queue-train-verify.verifyTrain (cyclomatic 23) lib/ship-queue-train-verify.ts:102 — ship-queue-train-verify.verifyTrain has cyclomatic complexity 23 (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 · cso-staging-run.verifyStagingRun (cyclomatic 23) · ×1
  • cso-staging-run.verifyStagingRun (cyclomatic 23) scripts/cso-staging-run.ts:60 — cso-staging-run.verifyStagingRun has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · gate-reuse.parseReuse (cyclomatic 23) · ×1
  • gate-reuse.parseReuse (cyclomatic 23) scripts/gate-reuse.ts:149 — gate-reuse.parseReuse has cyclomatic complexity 23 (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 · index.Deno.serve() (cyclomatic 23) · ×1
  • index.Deno.serve() (cyclomatic 23) supabase/functions/community-pulse/index.ts:23 — index.Deno.serve() 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 · phase-publication-hook.disarmedAt (cyclomatic 22) · ×1
  • phase-publication-hook.disarmedAt (cyclomatic 22) autoplan/bin/phase-publication-hook.ts:388 — phase-publication-hook.disarmedAt 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 · script-invocation.resolveWindowsBash (cyclomatic 22) · ×1
  • script-invocation.resolveWindowsBash (cyclomatic 22) lib/script-invocation.ts:87 — script-invocation.resolveWindowsBash 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 · gstack-memory-helpers.extractGbrainBlock (cyclomatic 22) · ×1
  • gstack-memory-helpers.extractGbrainBlock (cyclomatic 22) lib/gstack-memory-helpers.ts:482 — gstack-memory-helpers.extractGbrainBlock 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 · gstack-memory-ingest.importAndApply (cyclomatic 22) · ×1
  • gstack-memory-ingest.importAndApply (cyclomatic 22) bin/gstack-memory-ingest.ts:2742 — gstack-memory-ingest.importAndApply 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 · remote-identity.canonicalRemote (cyclomatic 22) · ×1
  • remote-identity.canonicalRemote (cyclomatic 22) lib/remote-identity.ts:38 — remote-identity.canonicalRemote 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 · BrowserManager.close (cyclomatic 22) · ×1
  • BrowserManager.close (cyclomatic 22) browse/src/browser-manager.ts:1086 — BrowserManager.close has cyclomatic complexity 22 (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 · cli.startServer (cyclomatic 22) · ×1
  • cli.startServer (cyclomatic 22) browse/src/cli.ts:708 — cli.startServer has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · variants.requestVariantImage (cyclomatic 22) · ×1
  • variants.requestVariantImage (cyclomatic 22) design/src/variants.ts:87 — variants.requestVariantImage 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 · variants.runBriefsBatch (cyclomatic 22) · ×1
  • variants.runBriefsBatch (cyclomatic 22) design/src/variants.ts:349 — variants.runBriefsBatch has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 4 function items inside it that branch (runOne, runOne::attempt, runOne::finish, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · redact-engine.redactJsonFindingSpans (cyclomatic 22) · ×1
  • redact-engine.redactJsonFindingSpans (cyclomatic 22) REDACTED:579 — redact-engine.redactJsonFindingSpans 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 · approval-classes.classErrors (cyclomatic 22) · ×1
  • approval-classes.classErrors (cyclomatic 22) REDACTED:70 — approval-classes.classErrors 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 · autoplan-run.initRun (cyclomatic 22) · ×1
  • autoplan-run.initRun (cyclomatic 22) REDACTED:77 — autoplan-run.initRun 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 · state.recoverLeasePublications (cyclomatic 22) · ×1
  • state.recoverLeasePublications (cyclomatic 22) lib/cso/state.ts:1230 — state.recoverLeasePublications has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PublicArchiveCache.cleanIncoming (cyclomatic 22) · ×1
  • PublicArchiveCache.cleanIncoming (cyclomatic 22) lib/cso/cache.ts:789 — PublicArchiveCache.cleanIncoming 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 · snapshot.readStableWith (cyclomatic 22) · ×1
  • snapshot.readStableWith (cyclomatic 22) lib/cso/snapshot.ts:385 — snapshot.readStableWith 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 · preparation.inspectPreparation (cyclomatic 22) · ×1
  • preparation.inspectPreparation (cyclomatic 22) REDACTED:1180 — preparation.inspectPreparation 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 · DockerPreparationSandboxRunner.prepareOffline (cyclomatic 22) · ×1
  • DockerPreparationSandboxRunner.prepareOffline (cyclomatic 22) lib/cso/preparation-docker.ts:1498 — DockerPreparationSandboxRunner.prepareOffline has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.parseStart (cyclomatic 22) · ×1
  • cli.parseStart (cyclomatic 22) REDACTED:611 — cli.parseStart 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. This is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cli.bindRecheckEvidence (cyclomatic 22) · ×1
  • cli.bindRecheckEvidence (cyclomatic 22) REDACTED:1181 — cli.bindRecheckEvidence 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 1190). 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: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · config.guardErrors (cyclomatic 22) · ×1
  • config.guardErrors (cyclomatic 22) lib/pregate/config.ts:94 — config.guardErrors 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 2 function literals inside it that branch (lines 99, 108). 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 · gbrain-supabase-provision.apiCall (cyclomatic 22) · ×1
  • gbrain-supabase-provision.apiCall (cyclomatic 22) lib/gbrain-supabase-provision.ts:216 — gbrain-supabase-provision.apiCall 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 · pr-shots.diffLines (cyclomatic 22) · ×1
  • pr-shots.diffLines (cyclomatic 22) lib/pr-shots.ts:121 — pr-shots.diffLines has cyclomatic complexity 22 (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 · regen.runRegen (cyclomatic 22) · ×1
  • regen.runRegen (cyclomatic 22) lib/regen.ts:229 — regen.runRegen has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · secrets.run (cyclomatic 22) · ×1
  • secrets.run (cyclomatic 22) lib/pregate/checks/secrets.ts:51 — secrets.run has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · init-draft.draftConfig (cyclomatic 22) · ×1
  • init-draft.draftConfig (cyclomatic 22) lib/pregate/init-draft.ts:52 — init-draft.draftConfig has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · exercised-map.readShardCommands (cyclomatic 22) · ×1
  • exercised-map.readShardCommands (cyclomatic 22) scripts/exercised-map.ts:59 — exercised-map.readShardCommands has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 65, 61). 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 · cso-eval.collectProducerReceipts (cyclomatic 22) · ×1
  • cso-eval.collectProducerReceipts (cyclomatic 22) scripts/cso-eval.ts:512 — cso-eval.collectProducerReceipts has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cso-eval.assertBaselineBinding (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · gstack-design-md.main (cyclomatic 21) · ×1
  • gstack-design-md.main (cyclomatic 21) bin/gstack-design-md.ts:43 — gstack-design-md.main 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 · transcript-consent.guardUnpublished (cyclomatic 21) · ×1
  • transcript-consent.guardUnpublished (cyclomatic 21) lib/transcript-consent.ts:354 — transcript-consent.guardUnpublished 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 · gstack-memory-ingest.transcriptPrefix (cyclomatic 21) · ×1
  • gstack-memory-ingest.transcriptPrefix (cyclomatic 21) bin/gstack-memory-ingest.ts:1280 — gstack-memory-ingest.transcriptPrefix 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 · runtime-pins.satisfiesOne (cyclomatic 21) · ×1
  • runtime-pins.satisfiesOne (cyclomatic 21) lib/runtime-pins.ts:71 — runtime-pins.satisfiesOne 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 · BrowserManager.launch (cyclomatic 21) · ×1
  • BrowserManager.launch (cyclomatic 21) browse/src/browser-manager.ts:628 — BrowserManager.launch has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 3 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 · cdp-inspector.modifyStyle (cyclomatic 21) · ×1
  • cdp-inspector.modifyStyle (cyclomatic 21) browse/src/cdp-inspector.ts:495 — cdp-inspector.modifyStyle has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · terminal-agent-control.spawnTerminalAgent (cyclomatic 21) · ×1
  • terminal-agent-control.spawnTerminalAgent (cyclomatic 21) browse/src/terminal-agent-control.ts:189 — terminal-agent-control.spawnTerminalAgent has cyclomatic complexity 21 (threshold 15). Of this number, 20 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 · meta-commands.buildPdfOptions (cyclomatic 21) · ×1
  • meta-commands.buildPdfOptions (cyclomatic 21) browse/src/meta-commands.ts:191 — meta-commands.buildPdfOptions has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · server.buildFetchHandler (cyclomatic 21) · ×1
  • server.buildFetchHandler (cyclomatic 21) REDACTED:1511 — server.buildFetchHandler has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1578, 1785, 1807). 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 · security.combineVerdict (cyclomatic 21) · ×1
  • security.combineVerdict (cyclomatic 21) browse/src/security.ts:148 — security.combineVerdict 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 · spawn-bin.runExternal (cyclomatic 21) · ×1
  • spawn-bin.runExternal (cyclomatic 21) hosts/claude/hooks/spawn-bin.ts:112 — spawn-bin.runExternal has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 145, 118, 141, …). 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 · headless-artifacts.checkSchema (cyclomatic 21) · ×1
  • headless-artifacts.checkSchema (cyclomatic 21) lib/headless-artifacts.ts:245 — headless-artifacts.checkSchema 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 · autoplan-checkpoint.restoreCheckpoint (cyclomatic 21) · ×1
  • autoplan-checkpoint.restoreCheckpoint (cyclomatic 21) lib/autoplan-checkpoint.ts:230 — autoplan-checkpoint.restoreCheckpoint has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 237, 241). 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 · plan-reality.checkRealityRows (cyclomatic 21) · ×1
  • plan-reality.checkRealityRows (cyclomatic 21) lib/plan-reality.ts:260 — plan-reality.checkRealityRows 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 · state.chooseRunLeaseTicket (cyclomatic 21) · ×1
  • state.chooseRunLeaseTicket (cyclomatic 21) lib/cso/state.ts:1940 — state.chooseRunLeaseTicket 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 · RegistryEgressBroker.openTunnel (cyclomatic 21) · ×1
  • RegistryEgressBroker.openTunnel (cyclomatic 21) lib/cso/preparation-docker.ts:606 — RegistryEgressBroker.openTunnel has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 3 function literals 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 · DockerPreparationSandboxRunner.acquire (cyclomatic 21) · ×1
  • DockerPreparationSandboxRunner.acquire (cyclomatic 21) lib/cso/preparation-docker.ts:1296 — DockerPreparationSandboxRunner.acquire has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.validateBoundRecheckClaim.evidence (cyclomatic 21) · ×1
  • cli.validateBoundRecheckClaim.evidence (cyclomatic 21) REDACTED:1290 — cli.validateBoundRecheckClaim.evidence has cyclomatic complexity 21 (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 is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · dx-error-capture.release (cyclomatic 21) · ×1
  • dx-error-capture.release (cyclomatic 21) lib/dx-error-capture.ts:311 — dx-error-capture.release 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 · sealed-guard.sealedErrors (cyclomatic 21) · ×1
  • sealed-guard.sealedErrors (cyclomatic 21) lib/sealed-guard.ts:51 — sealed-guard.sealedErrors has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 belong to 4 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 · index.scanCandidate (cyclomatic 21) · ×1
  • index.scanCandidate (cyclomatic 21) lib/gate-diff/index.ts:114 — index.scanCandidate has cyclomatic complexity 21 (threshold 15). Of this number, 20 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 · model-policy-freshness-publication.publishFreshness · ×1
  • model-policy-freshness-publication.publishFreshness::publish (cyclomatic 21) lib/model-policy-freshness-publication.ts:102 — model-policy-freshness-publication.publishFreshness::publish has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · office-hours-review.renderOfficeHoursReview (cyclomatic 21) · ×1
  • office-hours-review.renderOfficeHoursReview (cyclomatic 21) REDACTED:321 — office-hours-review.renderOfficeHoursReview has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · rust.componentMatch (cyclomatic 21) · ×1
  • rust.componentMatch (cyclomatic 21) lib/pregate/rust.ts:54 — rust.componentMatch has cyclomatic complexity 21 (threshold 15). Of this number, 17 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 · ship-queue-gate.recomputeMergeTree (cyclomatic 21) · ×1
  • ship-queue-gate.recomputeMergeTree (cyclomatic 21) lib/ship-queue-gate.ts:79 — ship-queue-gate.recomputeMergeTree has cyclomatic complexity 21 (threshold 15). Of this number, 17 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 · paid-report.runCaseDiagnosis (cyclomatic 21) · ×1
  • paid-report.runCaseDiagnosis (cyclomatic 21) REDACTED:75 — paid-report.runCaseDiagnosis has cyclomatic complexity 21 (threshold 15). Of this number, 15 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 · eval-trial-series.weeklyBacktest (cyclomatic 21) · ×1
  • eval-trial-series.weeklyBacktest (cyclomatic 21) REDACTED:125 — eval-trial-series.weeklyBacktest has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 4 function items inside it that branch (row, a function literal at line 129, a function literal at line 143, …). 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 · cso-runtime-promotion.evaluationCandidateCatalog (cyclomatic 21) · ×1
  • cso-runtime-promotion.evaluationCandidateCatalog (cyclomatic 21) scripts/cso-runtime-promotion.ts:179 — cso-runtime-promotion.evaluationCandidateCatalog 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 182). 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 · cso-runtime-promotion.collectEvidence (cyclomatic 21) · ×1
  • cso-runtime-promotion.collectEvidence (cyclomatic 21) scripts/cso-runtime-promotion.ts:317 — cso-runtime-promotion.collectEvidence has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 333, visit). 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 · testing.generateTestCoverageAuditInner (cyclomatic 21) · ×1
  • testing.generateTestCoverageAuditInner (cyclomatic 21) scripts/resolvers/testing.ts:252 — testing.generateTestCoverageAuditInner has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · claude-owned-journal.scan (cyclomatic 20) · ×1
  • claude-owned-journal.scan (cyclomatic 20) lib/claude-owned-journal.ts:133 — claude-owned-journal.scan 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 shape REPEATS in the file: one other method here (claude-owned-journal.scan::record) 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.
D1 · Cyclomatic Complexity · gstack-memory-ingest.probeMode (cyclomatic 20) · ×1
  • gstack-memory-ingest.probeMode (cyclomatic 20) bin/gstack-memory-ingest.ts:1338 — gstack-memory-ingest.probeMode has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · activity.filterArgs (cyclomatic 20) · ×1
  • activity.filterArgs (cyclomatic 20) browse/src/activity.ts:54 — activity.filterArgs has cyclomatic complexity 20 (threshold 15). Of this number, 14 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 · sanitize-echo.sanitizeEcho (cyclomatic 20) · ×1
  • sanitize-echo.sanitizeEcho (cyclomatic 20) lib/sanitize-echo.ts:14 — sanitize-echo.sanitizeEcho has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · terminal-agent-control.acquireAgentStateLock (cyclomatic 20) · ×1
  • terminal-agent-control.acquireAgentStateLock (cyclomatic 20) browse/src/terminal-agent-control.ts:88 — terminal-agent-control.acquireAgentStateLock has cyclomatic complexity 20 (threshold 15). Of this number, 16 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 · read-commands.isSingleParenOrIifeExpression (cyclomatic 20) · ×1
  • read-commands.isSingleParenOrIifeExpression (cyclomatic 20) browse/src/read-commands.ts:79 — read-commands.isSingleParenOrIifeExpression 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 · proxy.proxyToDevice (cyclomatic 20) · ×1
  • proxy.proxyToDevice (cyclomatic 20) REDACTED:35 — proxy.proxyToDevice has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 71, 83, 100, …). 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 · install-verdict.verdictProblem (cyclomatic 20) · ×1
  • install-verdict.verdictProblem (cyclomatic 20) lib/install-verdict.ts:138 — install-verdict.verdictProblem has cyclomatic complexity 20 (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 · outside-review-result.concludesNoFindings (cyclomatic 20) · ×1
  • outside-review-result.concludesNoFindings (cyclomatic 20) lib/outside-review-result.ts:161 — outside-review-result.concludesNoFindings has cyclomatic complexity 20 (threshold 15). Of this number, 14 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 · model-policy.codexSignals (cyclomatic 20) · ×1
  • model-policy.codexSignals (cyclomatic 20) lib/model-policy.ts:453 — model-policy.codexSignals 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 · state.readPrivateJson (cyclomatic 20) · ×1
  • state.readPrivateJson (cyclomatic 20) lib/cso/state.ts:817 — state.readPrivateJson 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 · state.recoverDeadLease (cyclomatic 20) · ×1
  • state.recoverDeadLease (cyclomatic 20) lib/cso/state.ts:1907 — state.recoverDeadLease 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 · state.repairBundleExpiry (cyclomatic 20) · ×1
  • state.repairBundleExpiry (cyclomatic 20) lib/cso/state.ts:2330 — state.repairBundleExpiry 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 · admission.acquireClaim (cyclomatic 20) · ×1
  • admission.acquireClaim (cyclomatic 20) lib/cso/admission.ts:154 — admission.acquireClaim has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preparation.inspectBun (cyclomatic 20) · ×1
  • preparation.inspectBun (cyclomatic 20) REDACTED:381 — preparation.inspectBun 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 · preparation-container.seed (cyclomatic 20) · ×1
  • preparation-container.seed (cyclomatic 20) REDACTED:1026 — preparation-container.seed 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 · preparation-container.main (cyclomatic 20) · ×1
  • preparation-container.main (cyclomatic 20) REDACTED:1121 — preparation-container.main 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 · preparation-docker.supervisePreparedCall (cyclomatic 20) · ×1
  • preparation-docker.supervisePreparedCall (cyclomatic 20) lib/cso/preparation-docker.ts:796 — preparation-docker.supervisePreparedCall 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 · cli.recheck (cyclomatic 20) · ×1
  • cli.recheck (cyclomatic 20) REDACTED:1916 — cli.recheck has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 1935). 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: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · qa-deadline.qaDeadlineMain (cyclomatic 20) · ×1
  • qa-deadline.qaDeadlineMain (cyclomatic 20) lib/qa-deadline.ts:272 — qa-deadline.qaDeadlineMain has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 273). 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 · eval-plan.runPreregDiagnostics (cyclomatic 20) · ×1
  • eval-plan.runPreregDiagnostics (cyclomatic 20) lib/eval-plan.ts:114 — eval-plan.runPreregDiagnostics has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · import-graph.stripJsonc (cyclomatic 20) · ×1
  • import-graph.stripJsonc (cyclomatic 20) lib/pregate/import-graph.ts:178 — import-graph.stripJsonc has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · review-evidence.checkSharedLibsReuse (cyclomatic 20) · ×1
  • review-evidence.checkSharedLibsReuse (cyclomatic 20) lib/review-evidence.ts:136 — review-evidence.checkSharedLibsReuse 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. This is NOT this file's highest cyclomatic complexity: review-evidence.canReuseSharedLibsAdvisory (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · review-evidence.reviewFreshness (cyclomatic 20) · ×1
  • review-evidence.reviewFreshness (cyclomatic 20) lib/review-evidence.ts:325 — review-evidence.reviewFreshness 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. This is NOT this file's highest cyclomatic complexity: review-evidence.canReuseSharedLibsAdvisory (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ship-queue.ready (cyclomatic 20) · ×1
  • ship-queue.ready (cyclomatic 20) lib/ship-queue.ts:148 — ship-queue.ready has cyclomatic complexity 20 (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 · pr-dependencies.exercisedConsumers.execRefs (cyclomatic 20) · ×1
  • pr-dependencies.exercisedConsumers.execRefs (cyclomatic 20) scripts/pr-dependencies.ts:523 — pr-dependencies.exercisedConsumers.execRefs has cyclomatic complexity 20 (threshold 15). 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 · ship-queue-train-ready.trainReady (cyclomatic 20) · ×1
  • ship-queue-train-ready.trainReady (cyclomatic 20) lib/ship-queue-train-ready.ts:96 — ship-queue-train-ready.trainReady 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 · analytics.formatReport (cyclomatic 20) · ×1
  • analytics.formatReport (cyclomatic 20) scripts/analytics.ts:69 — analytics.formatReport 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 · paid-report.panelReports (cyclomatic 20) · ×1
  • paid-report.panelReports (cyclomatic 20) REDACTED:351 — paid-report.panelReports 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 4 function literals inside it that branch (lines 364, 361, 357, …). 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 · cso-eval.measuredRate (cyclomatic 20) · ×1
  • cso-eval.measuredRate (cyclomatic 20) scripts/cso-eval.ts:704 — cso-eval.measuredRate has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 705). 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: cso-eval.assertBaselineBinding (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cso-scanner-matrix.assets (cyclomatic 20) · ×1
  • cso-scanner-matrix.assets (cyclomatic 20) scripts/cso-scanner-matrix.ts:70 — cso-scanner-matrix.assets 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 · outside-voice.outsideVoiceCommand (cyclomatic 20) · ×1
  • outside-voice.outsideVoiceCommand (cyclomatic 20) scripts/resolvers/outside-voice.ts:106 — outside-voice.outsideVoiceCommand 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 · owned-read.ownedAutoplanRead (cyclomatic 19) · ×1
  • owned-read.ownedAutoplanRead (cyclomatic 19) autoplan/bin/owned-read.ts:39 — owned-read.ownedAutoplanRead has cyclomatic complexity 19 (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 · gstack-memory-helpers.secretScanFile (cyclomatic 19) · ×1
  • gstack-memory-helpers.secretScanFile (cyclomatic 19) lib/gstack-memory-helpers.ts:248 — gstack-memory-helpers.secretScanFile has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · gstack-design-detect.probe · ×1
  • gstack-design-detect.probe::checkSkillDir (cyclomatic 19) bin/gstack-design-detect.ts:381 — gstack-design-detect.probe::checkSkillDir has cyclomatic complexity 19 (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. This shape REPEATS in the file: one other method here (gstack-design-detect.probe) 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.
D1 · Cyclomatic Complexity · gstack-gbrain-sync.pruneGoneWorktrees (cyclomatic 19) · ×1
  • gstack-gbrain-sync.pruneGoneWorktrees (cyclomatic 19) bin/gstack-gbrain-sync.ts:2122 — gstack-gbrain-sync.pruneGoneWorktrees has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime-pins.collectPins (cyclomatic 19) · ×1
  • runtime-pins.collectPins (cyclomatic 19) lib/runtime-pins.ts:139 — runtime-pins.collectPins has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.handleLoopback (cyclomatic 19) · ×1
  • index.handleLoopback (cyclomatic 19) ios-qa/daemon/src/index.ts:395 — index.handleLoopback 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 · index.handleTailnet (cyclomatic 19) · ×1
  • index.handleTailnet (cyclomatic 19) ios-qa/daemon/src/index.ts:481 — index.handleTailnet 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 · captain-brief.renderCaptainBrief (cyclomatic 19) · ×1
  • captain-brief.renderCaptainBrief (cyclomatic 19) lib/captain-brief.ts:63 — captain-brief.renderCaptainBrief has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals 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 · autoplan-public.exportPublic (cyclomatic 19) · ×1
  • autoplan-public.exportPublic (cyclomatic 19) lib/autoplan-public.ts:134 — autoplan-public.exportPublic 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 · contracts.legacyJson (cyclomatic 19) · ×1
  • contracts.legacyJson (cyclomatic 19) lib/cso/contracts.ts:999 — contracts.legacyJson 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 · admission.admit (cyclomatic 19) · ×1
  • admission.admit (cyclomatic 19) lib/cso/admission.ts:326 — admission.admit 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 · PublicArchiveCache.withLock (cyclomatic 19) · ×1
  • PublicArchiveCache.withLock (cyclomatic 19) lib/cso/cache.ts:964 — PublicArchiveCache.withLock has cyclomatic complexity 19 (threshold 15). Of this number, 14 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 · preparation-container.readPolicy (cyclomatic 19) · ×1
  • preparation-container.readPolicy (cyclomatic 19) REDACTED:104 — preparation-container.readPolicy has cyclomatic complexity 19 (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 · scanners.scannerLocation (cyclomatic 19) · ×1
  • scanners.scannerLocation (cyclomatic 19) lib/cso/scanners.ts:527 — scanners.scannerLocation has cyclomatic complexity 19 (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 · cli.recoveryEvents (cyclomatic 19) · ×1
  • cli.recoveryEvents (cyclomatic 19) REDACTED:1020 — cli.recoveryEvents has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · gstack-post.command (cyclomatic 19) · ×1
  • gstack-post.command (cyclomatic 19) lib/gstack-post.ts:273 — gstack-post.command has cyclomatic complexity 19 (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 · pr-shots.buildPage (cyclomatic 19) · ×1
  • pr-shots.buildPage (cyclomatic 19) lib/pr-shots.ts:183 — pr-shots.buildPage has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · workflows.commandTestFiles (cyclomatic 19) · ×1
  • workflows.commandTestFiles (cyclomatic 19) lib/pregate/workflows.ts:102 — workflows.commandTestFiles 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 · rust.depSpecs (cyclomatic 19) · ×1
  • rust.depSpecs (cyclomatic 19) lib/pregate/rust.ts:112 — rust.depSpecs has cyclomatic complexity 19 (threshold 15). Of this number, 18 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 · rust.cargoModel.membersOf (cyclomatic 19) · ×1
  • rust.cargoModel.membersOf (cyclomatic 19) lib/pregate/rust.ts:153 — rust.cargoModel.membersOf has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · timing.boundKind (cyclomatic 19) · ×1
  • timing.boundKind (cyclomatic 19) lib/pregate/checks/timing.ts:102 — timing.boundKind 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 · restamp.gateAhead (cyclomatic 19) · ×1
  • restamp.gateAhead (cyclomatic 19) REDACTED:573 — restamp.gateAhead 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 · review-evidence.fixRangeBase (cyclomatic 19) · ×1
  • review-evidence.fixRangeBase (cyclomatic 19) lib/review-evidence.ts:175 — review-evidence.fixRangeBase has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: review-evidence.canReuseSharedLibsAdvisory (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ship-queue.reproduceGateAhead (cyclomatic 19) · ×1
  • ship-queue.reproduceGateAhead (cyclomatic 19) lib/ship-queue.ts:340 — ship-queue.reproduceGateAhead has cyclomatic complexity 19 (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 · ship-queue-train-verdict.trainRebuild (cyclomatic 19) · ×1
  • ship-queue-train-verdict.trainRebuild (cyclomatic 19) lib/ship-queue-train-verdict.ts:304 — ship-queue-train-verdict.trainRebuild 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 · state-matrix.parseSpecialistOutput (cyclomatic 19) · ×1
  • state-matrix.parseSpecialistOutput (cyclomatic 19) lib/state-matrix.ts:59 — state-matrix.parseSpecialistOutput has cyclomatic complexity 19 (threshold 15). Of this number, 16 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 · diagram-prepass.extractDiagramFences (cyclomatic 19) · ×1
  • diagram-prepass.extractDiagramFences (cyclomatic 19) make-pdf/src/diagram-prepass.ts:112 — diagram-prepass.extractDiagramFences 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 · paid-report.attributeJUnitCase (cyclomatic 19) · ×1
  • paid-report.attributeJUnitCase (cyclomatic 19) REDACTED:196 — paid-report.attributeJUnitCase has cyclomatic complexity 19 (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 · eval-flake-rank.loadPassRateHistory (cyclomatic 19) · ×1
  • eval-flake-rank.loadPassRateHistory (cyclomatic 19) scripts/eval-flake-rank.ts:587 — eval-flake-rank.loadPassRateHistory has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cso-eval-producer.validateProductionProducerInstallation (cyclomatic 19) · ×1
  • cso-eval-producer.validateProductionProducerInstallation (cyclomatic 19) scripts/cso-eval-producer.ts:305 — cso-eval-producer.validateProductionProducerInstallation 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 is NOT this file's highest cyclomatic complexity: cso-eval-producer.validateInput (cyclomatic 25) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cso-scanner-matrix.scannerBuildMatrix (cyclomatic 19) · ×1
  • cso-scanner-matrix.scannerBuildMatrix (cyclomatic 19) scripts/cso-scanner-matrix.ts:94 — cso-scanner-matrix.scannerBuildMatrix 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 · replay-pr-selection.loadInput (cyclomatic 19) · ×1
  • replay-pr-selection.loadInput (cyclomatic 19) scripts/replay-pr-selection.ts:129 — replay-pr-selection.loadInput has cyclomatic complexity 19 (threshold 15). Of this number, 18 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 · claude-journal-records.signatureField (cyclomatic 18) · ×1
  • claude-journal-records.signatureField (cyclomatic 18) lib/claude-journal-records.ts:98 — claude-journal-records.signatureField has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gstack-autoplan-snapshot.snapshotIdentity (cyclomatic 18) · ×1
  • gstack-autoplan-snapshot.snapshotIdentity (cyclomatic 18) bin/gstack-autoplan-snapshot.ts:696 — gstack-autoplan-snapshot.snapshotIdentity 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 · phase-publication-hook.consumption (cyclomatic 18) · ×1
  • phase-publication-hook.consumption (cyclomatic 18) autoplan/bin/phase-publication-hook.ts:188 — phase-publication-hook.consumption 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 is NOT this file's highest cyclomatic complexity: phase-publication-hook.snapshot (cyclomatic 21) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · memory-ingest-landing.classifyImport (cyclomatic 18) · ×1
  • memory-ingest-landing.classifyImport (cyclomatic 18) lib/memory-ingest-landing.ts:292 — memory-ingest-landing.classifyImport has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gstack-global-discover.scanCodex (cyclomatic 18) · ×1
  • gstack-global-discover.scanCodex (cyclomatic 18) bin/gstack-global-discover.ts:366 — gstack-global-discover.scanCodex has cyclomatic complexity 18 (threshold 15). Of this number, 17 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 · terminal-agent-control.agentStatus (cyclomatic 18) · ×1
  • terminal-agent-control.agentStatus (cyclomatic 18) browse/src/terminal-agent-control.ts:332 — terminal-agent-control.agentStatus has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cli.proxyMismatchLines (cyclomatic 18) · ×1
  • cli.proxyMismatchLines (cyclomatic 18) browse/src/cli.ts:489 — cli.proxyMismatchLines has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · memorable-user-prompt-hook.policyVeto (cyclomatic 18) · ×1
  • memorable-user-prompt-hook.policyVeto (cyclomatic 18) hosts/claude/hooks/memorable-user-prompt-hook.ts:386 — memorable-user-prompt-hook.policyVeto has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · spend-ledger.withFileLock (cyclomatic 18) · ×1
  • spend-ledger.withFileLock (cyclomatic 18) lib/spend-ledger.ts:62 — spend-ledger.withFileLock has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · autoplan-checkpoint.verifyGeneration (cyclomatic 18) · ×1
  • autoplan-checkpoint.verifyGeneration (cyclomatic 18) lib/autoplan-checkpoint.ts:176 — autoplan-checkpoint.verifyGeneration has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · autoplan-confirm.lineDiff (cyclomatic 18) · ×1
  • autoplan-confirm.lineDiff (cyclomatic 18) lib/autoplan-confirm.ts:24 — autoplan-confirm.lineDiff has cyclomatic complexity 18 (threshold 15). 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 · autoplan-run.withRunLock (cyclomatic 18) · ×1
  • autoplan-run.withRunLock (cyclomatic 18) REDACTED:41 — autoplan-run.withRunLock 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 · autoplan-run.statusLines (cyclomatic 18) · ×1
  • autoplan-run.statusLines (cyclomatic 18) REDACTED:464 — autoplan-run.statusLines has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · changelog-check.reheadChangelog (cyclomatic 18) · ×1
  • changelog-check.reheadChangelog (cyclomatic 18) lib/changelog-check.ts:102 — changelog-check.reheadChangelog has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · process.executable (cyclomatic 18) · ×1
  • process.executable (cyclomatic 18) lib/cso/process.ts:32 — process.executable 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 · state.retention · ×1
  • state.retention::retainedReport (cyclomatic 18) lib/cso/state.ts:2515 — state.retention::retainedReport 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. This shape REPEATS in the file: one other method here (state.retention) 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.
D1 · Cyclomatic Complexity · snapshot.assertOpenedFileContained (cyclomatic 18) · ×1
  • snapshot.assertOpenedFileContained (cyclomatic 18) lib/cso/snapshot.ts:346 — snapshot.assertOpenedFileContained 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 · snapshot.rejectSpecialFiles (cyclomatic 18) · ×1
  • snapshot.rejectSpecialFiles (cyclomatic 18) lib/cso/snapshot.ts:541 — snapshot.rejectSpecialFiles has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · snapshot.capture · ×1
  • snapshot.capture::assertEntriesStable (cyclomatic 18) lib/cso/snapshot.ts:841 — snapshot.capture::assertEntriesStable 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 shape REPEATS in the file: one other method here (snapshot.capture) 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.
D1 · Cyclomatic Complexity · preparation.manifest (cyclomatic 18) · ×1
  • preparation.manifest (cyclomatic 18) REDACTED:225 — preparation.manifest has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · preparation-docker.copyPreparedBlob (cyclomatic 18) · ×1
  • preparation-docker.copyPreparedBlob (cyclomatic 18) lib/cso/preparation-docker.ts:203 — preparation-docker.copyPreparedBlob has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · verifier.main (cyclomatic 18) · ×1
  • verifier.main (cyclomatic 18) lib/cso/verifier.ts:123 — verifier.main 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 · evidence-bundle.verifyBundle (cyclomatic 18) · ×1
  • evidence-bundle.verifyBundle (cyclomatic 18) lib/evidence-bundle.ts:211 — evidence-bundle.verifyBundle has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gstack-decision.validateDecide (cyclomatic 18) · ×1
  • gstack-decision.validateDecide (cyclomatic 18) lib/gstack-decision.ts:104 — gstack-decision.validateDecide has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gstack-post.resolveRemote (cyclomatic 18) · ×1
  • gstack-post.resolveRemote (cyclomatic 18) lib/gstack-post.ts:134 — gstack-post.resolveRemote 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 · rust.rustEdges (cyclomatic 18) · ×1
  • rust.rustEdges (cyclomatic 18) lib/pregate/rust.ts:236 — rust.rustEdges has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ship-queue-train.admitSlots (cyclomatic 18) · ×1
  • ship-queue-train.admitSlots (cyclomatic 18) lib/ship-queue-train.ts:282 — ship-queue-train.admitSlots 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 is NOT this file's highest cyclomatic complexity: ship-queue-train.nextFor (cyclomatic 19) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · version-gate-train.regeneratedAtBase (cyclomatic 18) · ×1
  • version-gate-train.regeneratedAtBase (cyclomatic 18) lib/version-gate-train.ts:53 — version-gate-train.regeneratedAtBase has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ship-queue-train-cli.trainMain (cyclomatic 18) · ×1
  • ship-queue-train-cli.trainMain (cyclomatic 18) lib/ship-queue-train-cli.ts:73 — ship-queue-train-cli.trainMain has cyclomatic complexity 18 (threshold 15). Of this number, 17 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 · toc-pages.pdfDestinationPages (cyclomatic 18) · ×1
  • toc-pages.pdfDestinationPages (cyclomatic 18) REDACTED:94 — toc-pages.pdfDestinationPages has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 3 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 · cso-attestation-evidence.verifiedStatementSetDigest (cyclomatic 18) · ×1
  • cso-attestation-evidence.verifiedStatementSetDigest (cyclomatic 18) scripts/cso-attestation-evidence.ts:9 — cso-attestation-evidence.verifiedStatementSetDigest has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · cso-eval-producer.inventoryProducerArtifacts (cyclomatic 18) · ×1
  • cso-eval-producer.inventoryProducerArtifacts (cyclomatic 18) scripts/cso-eval-producer.ts:210 — cso-eval-producer.inventoryProducerArtifacts has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (visit, a function literal at line 237). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: cso-eval-producer.validateInput (cyclomatic 25) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cso-scanner-catalog.scannerCatalogProposal (cyclomatic 18) · ×1
  • cso-scanner-catalog.scannerCatalogProposal (cyclomatic 18) scripts/cso-scanner-catalog.ts:63 — cso-scanner-catalog.scannerCatalogProposal has cyclomatic complexity 18 (threshold 15). Of this number, 17 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 · gate-cost-replay.formatReport (cyclomatic 18) · ×1
  • gate-cost-replay.formatReport (cyclomatic 18) scripts/gate-cost-replay.ts:290 — gate-cost-replay.formatReport 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 · gen-llms-txt.parseSkillFrontmatter (cyclomatic 18) · ×1
  • gen-llms-txt.parseSkillFrontmatter (cyclomatic 18) scripts/gen-llms-txt.ts:45 — gen-llms-txt.parseSkillFrontmatter 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 · outside-voice.outsideVoicePreflight (cyclomatic 18) · ×1
  • outside-voice.outsideVoicePreflight (cyclomatic 18) scripts/resolvers/outside-voice.ts:50 — outside-voice.outsideVoicePreflight 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 · ship-measure.gstackRunner (cyclomatic 18) · ×1
  • ship-measure.gstackRunner (cyclomatic 18) REDACTED:644 — ship-measure.gstackRunner has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 645, 658). 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 · train-gate.stampFreeTree (cyclomatic 18) · ×1
  • train-gate.stampFreeTree (cyclomatic 18) scripts/train-gate.ts:143 — train-gate.stampFreeTree 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 · train-backstop.coveringRecord (cyclomatic 18) · ×1
  • train-backstop.coveringRecord (cyclomatic 18) scripts/train-backstop.ts:57 — train-backstop.coveringRecord has cyclomatic complexity 18 (threshold 15). Of this number, 17 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 · train-backstop.runBackstop (cyclomatic 18) · ×1
  • train-backstop.runBackstop (cyclomatic 18) scripts/train-backstop.ts:127 — train-backstop.runBackstop has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gstack-brain-context-load.parseArgs (cyclomatic 17) · ×1
  • gstack-brain-context-load.parseArgs (cyclomatic 17) bin/gstack-brain-context-load.ts:101 — gstack-brain-context-load.parseArgs 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 (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 · gbrain-repo-policy-client.repoPolicyTierBatch (cyclomatic 17) · ×1
  • gbrain-repo-policy-client.repoPolicyTierBatch (cyclomatic 17) lib/gbrain-repo-policy-client.ts:185 — gbrain-repo-policy-client.repoPolicyTierBatch has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gstack-global-discover.extractCwdFromJsonl (cyclomatic 17) · ×1
  • gstack-global-discover.extractCwdFromJsonl (cyclomatic 17) bin/gstack-global-discover.ts:281 — gstack-global-discover.extractCwdFromJsonl has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runtime-pins.evaluatePins (cyclomatic 17) · ×1
  • runtime-pins.evaluatePins (cyclomatic 17) lib/runtime-pins.ts:206 — runtime-pins.evaluatePins has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BrowserManager.restoreState (cyclomatic 17) · ×1
  • BrowserManager.restoreState (cyclomatic 17) browse/src/browser-manager.ts:1853 — BrowserManager.restoreState has cyclomatic complexity 17 (threshold 15). Of this number, 13 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 · proxy-config.noProxyToChromiumRules (cyclomatic 17) · ×1
  • proxy-config.noProxyToChromiumRules (cyclomatic 17) browse/src/proxy-config.ts:195 — proxy-config.noProxyToChromiumRules 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 · cli.tunnelRevoke (cyclomatic 17) · ×1
  • cli.tunnelRevoke (cyclomatic 17) browse/src/cli.ts:1447 — cli.tunnelRevoke 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 · cookie-import-operation.parseCookieImportArgs (cyclomatic 17) · ×1
  • cookie-import-operation.parseCookieImportArgs (cyclomatic 17) browse/src/cookie-import-operation.ts:25 — cookie-import-operation.parseCookieImportArgs 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 · variants.readBriefsFile (cyclomatic 17) · ×1
  • variants.readBriefsFile (cyclomatic 17) design/src/variants.ts:291 — variants.readBriefsFile has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 302, 304). 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 · gallery.generateGalleryHtml (cyclomatic 17) · ×1
  • gallery.generateGalleryHtml (cyclomatic 17) design/src/gallery.ts:50 — gallery.generateGalleryHtml has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals 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 · sidepanel-terminal.init (cyclomatic 17) · ×1
  • sidepanel-terminal.init (cyclomatic 17) extension/sidepanel-terminal.js:913 — sidepanel-terminal.init has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (applyFontSize, a function literal at line 941, a function literal at line 959, …). 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 · redact-patterns.isPublicIPv4 (cyclomatic 17) · ×1
  • redact-patterns.isPublicIPv4 (cyclomatic 17) lib/redact-patterns.ts:145 — redact-patterns.isPublicIPv4 has cyclomatic complexity 17 (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 · redact-engine.jsonTokens (cyclomatic 17) · ×1
  • redact-engine.jsonTokens (cyclomatic 17) REDACTED:654 — redact-engine.jsonTokens 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 · question-log-hook.main (cyclomatic 17) · ×1
  • question-log-hook.main (cyclomatic 17) hosts/claude/hooks/question-log-hook.ts:254 — question-log-hook.main has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli-mint.parseArgs (cyclomatic 17) · ×1
  • cli-mint.parseArgs (cyclomatic 17) ios-qa/daemon/src/cli-mint.ts:21 — cli-mint.parseArgs 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 (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 · headless-artifacts.validateRun (cyclomatic 17) · ×1
  • headless-artifacts.validateRun (cyclomatic 17) lib/headless-artifacts.ts:424 — headless-artifacts.validateRun 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 · autoplan-confirm.annotateConfirm (cyclomatic 17) · ×1
  • autoplan-confirm.annotateConfirm (cyclomatic 17) lib/autoplan-confirm.ts:125 — autoplan-confirm.annotateConfirm has cyclomatic complexity 17 (threshold 15). 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, 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 · CodexCliRunner.run (cyclomatic 17) · ×1
  • CodexCliRunner.run (cyclomatic 17) lib/outside-voice-runner.ts:136 — CodexCliRunner.run has cyclomatic complexity 17 (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 · context-bill.measureExactTokens (cyclomatic 17) · ×1
  • context-bill.measureExactTokens (cyclomatic 17) lib/context-bill.ts:1007 — context-bill.measureExactTokens has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · state.ensureDirectory (cyclomatic 17) · ×1
  • state.ensureDirectory (cyclomatic 17) lib/cso/state.ts:689 — state.ensureDirectory 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 · state.hasPendingWatchdogCleanup · ×1
  • state.hasPendingWatchdogCleanup::walk (cyclomatic 17) lib/cso/state.ts:2158 — state.hasPendingWatchdogCleanup::walk 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 · preparation-executor.provePreparedProjection (cyclomatic 17) · ×1
  • preparation-executor.provePreparedProjection (cyclomatic 17) lib/cso/preparation-executor.ts:965 — preparation-executor.provePreparedProjection has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: preparation-executor.validateOfflineReceipt (cyclomatic 24) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · scanners.sarifBaseDir (cyclomatic 17) · ×1
  • scanners.sarifBaseDir (cyclomatic 17) lib/cso/scanners.ts:647 — scanners.sarifBaseDir has cyclomatic complexity 17 (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 · cli.recheckOriginalDirectory (cyclomatic 17) · ×1
  • cli.recheckOriginalDirectory (cyclomatic 17) REDACTED:1852 — cli.recheckOriginalDirectory 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 is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · runtime.launchRuntime (cyclomatic 17) · ×1
  • runtime.launchRuntime (cyclomatic 17) lib/pregate/runtime.ts:159 — runtime.launchRuntime has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · guards.run (cyclomatic 17) · ×1
  • guards.run (cyclomatic 17) lib/pregate/checks/guards.ts:36 — guards.run has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · timing.scanTiming (cyclomatic 17) · ×1
  • timing.scanTiming (cyclomatic 17) lib/pregate/checks/timing.ts:156 — timing.scanTiming has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shard-engine.runShardChild (cyclomatic 17) · ×1
  • shard-engine.runShardChild (cyclomatic 17) scripts/lib/shard-engine.ts:455 — shard-engine.runShardChild has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · paid-select.resolvePaidShardBudget (cyclomatic 17) · ×1
  • paid-select.resolvePaidShardBudget (cyclomatic 17) scripts/lib/paid-select.ts:432 — paid-select.resolvePaidShardBudget has cyclomatic complexity 17 (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 · ship-queue-train-record.parseNote (cyclomatic 17) · ×1
  • ship-queue-train-record.parseNote (cyclomatic 17) lib/ship-queue-train-record.ts:217 — ship-queue-train-record.parseNote has cyclomatic complexity 17 (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 · state-matrix.checkMatrix (cyclomatic 17) · ×1
  • state-matrix.checkMatrix (cyclomatic 17) lib/state-matrix.ts:92 — state-matrix.checkMatrix has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cso-eval-producer.assertProducerArtifactPath (cyclomatic 17) · ×1
  • cso-eval-producer.assertProducerArtifactPath (cyclomatic 17) scripts/cso-eval-producer.ts:191 — cso-eval-producer.assertProducerArtifactPath has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: cso-eval-producer.validateInput (cyclomatic 25) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · cso-scanner-catalog.strictProfile (cyclomatic 17) · ×1
  • cso-scanner-catalog.strictProfile (cyclomatic 17) scripts/cso-scanner-catalog.ts:43 — cso-scanner-catalog.strictProfile 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 · cso-scanner-catalog.scannerAssetHash (cyclomatic 17) · ×1
  • cso-scanner-catalog.scannerAssetHash (cyclomatic 17) scripts/cso-scanner-catalog.ts:115 — cso-scanner-catalog.scannerAssetHash 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 · recover-receipts.negativesFromRun (cyclomatic 17) · ×1
  • recover-receipts.negativesFromRun (cyclomatic 17) scripts/recover-receipts.ts:145 — recover-receipts.negativesFromRun has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · judge-calibration.main (cyclomatic 17) · ×1
  • judge-calibration.main (cyclomatic 17) scripts/judge-calibration.ts:325 — judge-calibration.main 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 · preflight-agent-sdk.main (cyclomatic 17) · ×1
  • preflight-agent-sdk.main (cyclomatic 17) scripts/preflight-agent-sdk.ts:41 — preflight-agent-sdk.main has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GenAccessors.main (cyclomatic 17) · ×1
  • GenAccessors.main (cyclomatic 17) ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift:23 — GenAccessors.main 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 · gstack-autoplan-snapshot.methodologyContent (cyclomatic 16) · ×1
  • gstack-autoplan-snapshot.methodologyContent (cyclomatic 16) bin/gstack-autoplan-snapshot.ts:516 — gstack-autoplan-snapshot.methodologyContent 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 · autoplan-phase-publication.withResultWithdrawn (cyclomatic 16) · ×1
  • autoplan-phase-publication.withResultWithdrawn (cyclomatic 16) REDACTED:34 — autoplan-phase-publication.withResultWithdrawn 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 · gstack-brain-context-load.dispatchList (cyclomatic 16) · ×1
  • gstack-brain-context-load.dispatchList (cyclomatic 16) bin/gstack-brain-context-load.ts:292 — gstack-brain-context-load.dispatchList 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 · gbrain-sources.ensureSourceRegistered (cyclomatic 16) · ×1
  • gbrain-sources.ensureSourceRegistered (cyclomatic 16) REDACTED:171 — gbrain-sources.ensureSourceRegistered has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 180). 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 · gstack-memory-ingest.snapshotTranscriptCheckout (cyclomatic 16) · ×1
  • gstack-memory-ingest.snapshotTranscriptCheckout (cyclomatic 16) bin/gstack-memory-ingest.ts:2622 — gstack-memory-ingest.snapshotTranscriptCheckout has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BrowserManager.syncActiveTabByUrl (cyclomatic 16) · ×1
  • BrowserManager.syncActiveTabByUrl (cyclomatic 16) browse/src/browser-manager.ts:1260 — BrowserManager.syncActiveTabByUrl 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 · cdp-inspector.formatInspectorResult (cyclomatic 16) · ×1
  • cdp-inspector.formatInspectorResult (cyclomatic 16) browse/src/cdp-inspector.ts:722 — cdp-inspector.formatInspectorResult has cyclomatic complexity 16 (threshold 15). Of this number, 15 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 · cookie-import-browser.normalizeCookieDomain (cyclomatic 16) · ×1
  • cookie-import-browser.normalizeCookieDomain (cyclomatic 16) REDACTED:237 — cookie-import-browser.normalizeCookieDomain has cyclomatic complexity 16 (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 · cookie-import-native-job.createNativeCookieJob (cyclomatic 16) · ×1
  • cookie-import-native-job.createNativeCookieJob (cyclomatic 16) browse/src/cookie-import-native-job.ts:57 — cookie-import-native-job.createNativeCookieJob has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · terminal-agent.maybeSpawnPty (cyclomatic 16) · ×1
  • terminal-agent.maybeSpawnPty (cyclomatic 16) browse/src/terminal-agent.ts:526 — terminal-agent.maybeSpawnPty has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · redact-engine.inStructuralToken (cyclomatic 16) · ×1
  • redact-engine.inStructuralToken (cyclomatic 16) REDACTED:691 — redact-engine.inStructuralToken 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 · session-cache.readSession (cyclomatic 16) · ×1
  • session-cache.readSession (cyclomatic 16) ios-qa/daemon/src/session-cache.ts:34 — session-cache.readSession has cyclomatic complexity 16 (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 · headless-artifacts.findCycle (cyclomatic 16) · ×1
  • headless-artifacts.findCycle (cyclomatic 16) lib/headless-artifacts.ts:327 — headless-artifacts.findCycle has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · autoplan-prompts.detectScope (cyclomatic 16) · ×1
  • autoplan-prompts.detectScope (cyclomatic 16) lib/autoplan-prompts.ts:55 — autoplan-prompts.detectScope 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 · outside-review-result.execution (cyclomatic 16) · ×1
  • outside-review-result.execution (cyclomatic 16) lib/outside-review-result.ts:88 — outside-review-result.execution 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 · changelog-check.mergeChangelogs (cyclomatic 16) · ×1
  • changelog-check.mergeChangelogs (cyclomatic 16) lib/changelog-check.ts:221 — changelog-check.mergeChangelogs has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · claude-code.claudeCodeMain (cyclomatic 16) · ×1
  • claude-code.claudeCodeMain (cyclomatic 16) lib/claude-code.ts:277 — claude-code.claudeCodeMain has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · contracts.validateFinding (cyclomatic 16) · ×1
  • contracts.validateFinding (cyclomatic 16) lib/cso/contracts.ts:476 — contracts.validateFinding has cyclomatic complexity 16 (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 · PublicArchiveCache.promote (cyclomatic 16) · ×1
  • PublicArchiveCache.promote (cyclomatic 16) lib/cso/cache.ts:384 — PublicArchiveCache.promote has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 389). 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: cache.readMetadata (cyclomatic 17) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · PublicArchiveCache.recoverMetadataTemp (cyclomatic 16) · ×1
  • PublicArchiveCache.recoverMetadataTemp (cyclomatic 16) lib/cso/cache.ts:927 — PublicArchiveCache.recoverMetadataTemp has cyclomatic complexity 16 (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 is NOT this file's highest cyclomatic complexity: cache.readMetadata (cyclomatic 17) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DockerGroup.admitLocalImage (cyclomatic 16) · ×1
  • DockerGroup.admitLocalImage (cyclomatic 16) REDACTED:585 — DockerGroup.admitLocalImage 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 · preparation-container.download (cyclomatic 16) · ×1
  • preparation-container.download (cyclomatic 16) REDACTED:424 — preparation-container.download 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 · preparation-container.forwarder (cyclomatic 16) · ×1
  • preparation-container.forwarder (cyclomatic 16) REDACTED:639 — preparation-container.forwarder has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (copyMetadata). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · cli.scanner (cyclomatic 16) · ×1
  • cli.scanner (cyclomatic 16) REDACTED:1746 — cli.scanner has cyclomatic complexity 16 (threshold 15). Of this number, 8 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. This is NOT this file's highest cyclomatic complexity: cli.dispatchCsoCommand (cyclomatic 31) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · dx-error-capture.dxErrorCaptureMain (cyclomatic 16) · ×1
  • dx-error-capture.dxErrorCaptureMain (cyclomatic 16) lib/dx-error-capture.ts:483 — dx-error-capture.dxErrorCaptureMain has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sealed-guard.textFindings (cyclomatic 16) · ×1
  • sealed-guard.textFindings (cyclomatic 16) lib/sealed-guard.ts:151 — sealed-guard.textFindings 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 · evidence-bundle.buildBundle (cyclomatic 16) · ×1
  • evidence-bundle.buildBundle (cyclomatic 16) lib/evidence-bundle.ts:130 — evidence-bundle.buildBundle 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 · gate-cost.simulateTrains (cyclomatic 16) · ×1
  • gate-cost.simulateTrains (cyclomatic 16) lib/gate-cost.ts:573 — gate-cost.simulateTrains has cyclomatic complexity 16 (threshold 15). Of this number, 13 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 · gbrain-supabase-provision.cmdPoolerUrl (cyclomatic 16) · ×1
  • gbrain-supabase-provision.cmdPoolerUrl (cyclomatic 16) lib/gbrain-supabase-provision.ts:462 — gbrain-supabase-provision.cmdPoolerUrl has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gstack-post.targetNumber (cyclomatic 16) · ×1
  • gstack-post.targetNumber (cyclomatic 16) lib/gstack-post.ts:154 — gstack-post.targetNumber 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 · office-hours-review.officeHoursDesignChanges (cyclomatic 16) · ×1
  • office-hours-review.officeHoursDesignChanges (cyclomatic 16) REDACTED:158 — office-hours-review.officeHoursDesignChanges has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · runtime.resolveBun (cyclomatic 16) · ×1
  • runtime.resolveBun (cyclomatic 16) lib/pregate/runtime.ts:80 — runtime.resolveBun 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 · import-graph.blankDartComments (cyclomatic 16) · ×1
  • import-graph.blankDartComments (cyclomatic 16) lib/pregate/import-graph.ts:138 — import-graph.blankDartComments 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 · import-graph.effectiveOptions (cyclomatic 16) · ×1
  • import-graph.effectiveOptions (cyclomatic 16) lib/pregate/import-graph.ts:205 — import-graph.effectiveOptions 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 · timing.addedTestLines (cyclomatic 16) · ×1
  • timing.addedTestLines (cyclomatic 16) lib/pregate/checks/timing.ts:186 — timing.addedTestLines has cyclomatic complexity 16 (threshold 15). Of this number, 15 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 · restamp.parseUnifiedDiff (cyclomatic 16) · ×1
  • restamp.parseUnifiedDiff (cyclomatic 16) REDACTED:220 — restamp.parseUnifiedDiff 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 · restamp.applyToBranch (cyclomatic 16) · ×1
  • restamp.applyToBranch (cyclomatic 16) REDACTED:438 — restamp.applyToBranch has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ship-queue.stampPreflight (cyclomatic 16) · ×1
  • ship-queue.stampPreflight (cyclomatic 16) lib/ship-queue.ts:216 — ship-queue.stampPreflight has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · pr-dependencies.exercisedConsumers.binsInCommand (cyclomatic 16) · ×1
  • pr-dependencies.exercisedConsumers.binsInCommand (cyclomatic 16) scripts/pr-dependencies.ts:551 — pr-dependencies.exercisedConsumers.binsInCommand 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 · pr-dependencies.exercisedConsumers.closure (cyclomatic 16) · ×1
  • pr-dependencies.exercisedConsumers.closure (cyclomatic 16) scripts/pr-dependencies.ts:570 — pr-dependencies.exercisedConsumers.closure has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · eval-flake-rank.backfillEvalFiles (cyclomatic 16) · ×1
  • eval-flake-rank.backfillEvalFiles (cyclomatic 16) scripts/eval-flake-rank.ts:221 — eval-flake-rank.backfillEvalFiles 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 · eval-flake-rank.quarantinePolicyProblems (cyclomatic 16) · ×1
  • eval-flake-rank.quarantinePolicyProblems (cyclomatic 16) scripts/eval-flake-rank.ts:413 — eval-flake-rank.quarantinePolicyProblems 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 · cso-eval.validatePortableSkillFiles (cyclomatic 16) · ×1
  • cso-eval.validatePortableSkillFiles (cyclomatic 16) scripts/cso-eval.ts:232 — cso-eval.validatePortableSkillFiles has cyclomatic complexity 16 (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 is NOT this file's highest cyclomatic complexity: cso-eval.assertBaselineBinding (cyclomatic 33) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · gate-cost-replay.readGateRecord (cyclomatic 16) · ×1
  • gate-cost-replay.readGateRecord (cyclomatic 16) scripts/gate-cost-replay.ts:138 — gate-cost-replay.readGateRecord 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 · judge-calibration.analyze (cyclomatic 16) · ×1
  • judge-calibration.analyze (cyclomatic 16) scripts/judge-calibration.ts:252 — judge-calibration.analyze has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 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 · measure-journal-read.main (cyclomatic 16) · ×1
  • measure-journal-read.main (cyclomatic 16) scripts/measure-journal-read.ts:135 — measure-journal-read.main 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 · ship-measure.formatReport (cyclomatic 16) · ×1
  • ship-measure.formatReport (cyclomatic 16) REDACTED:478 — ship-measure.formatReport has cyclomatic complexity 16 (threshold 15). Of this number, 15 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 · ship-measure-sweep.runSweep (cyclomatic 16) · ×1
  • ship-measure-sweep.runSweep (cyclomatic 16) scripts/ship-measure-sweep.ts:246 — ship-measure-sweep.runSweep 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 · startReattachLoop (cyclomatic 16) · ×1
  • startReattachLoop (cyclomatic 16) extension/sidepanel-terminal.js:224 — startReattachLoop has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (tick, scheduleNextAttempt). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D17 · Explicit Debt · HackComment · ×1
  • HackComment browse/test/sidepanel-restart-dispose.test.ts:38 — // hack that nudged the lazy-binary-spawn. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D2 · Cognitive Complexity · write-commands.handleWriteCommand (cognitive 753) · ×1
  • write-commands.handleWriteCommand (cognitive 753) browse/src/write-commands.ts:134 — write-commands.handleWriteCommand has cognitive complexity 753 (threshold 15). Drivers by points: if/else 203 (508 pts), boolean chains 77, ternaries 26 (67 pts), loops 21 (52 pts), error handling 15 (45 pts), match/switch 2 (4 pts) (nesting depth added 409). Of this number, 587 points are the body's own statements and 166 belong to 18 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · meta-commands.handleMetaCommand (cognitive 390) · ×1
  • meta-commands.handleMetaCommand (cognitive 390) browse/src/meta-commands.ts:253 — meta-commands.handleMetaCommand has cognitive complexity 390 (threshold 15). Drivers by points: if/else 90 (216 pts), ternaries 23 (61 pts), boolean chains 44, error handling 11 (35 pts), loops 14 (33 pts), match/switch 1 (nesting depth added 207). Of this number, 357 points are the body's own statements and 33 belong to 11 function items inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · snapshot.handleSnapshot (cognitive 284) · ×1
  • snapshot.handleSnapshot (cognitive 284) browse/src/snapshot.ts:103 — snapshot.handleSnapshot has cognitive complexity 284 (threshold 15). Drivers by points: if/else 68 (164 pts), boolean chains 39, error handling 14 (36 pts), loops 14 (30 pts), ternaries 5 (15 pts) (nesting depth added 144). Of this number, 203 points are the body's own statements and 81 belong to 7 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · read-commands.handleReadCommand (cognitive 218) · ×1
  • read-commands.handleReadCommand (cognitive 218) browse/src/read-commands.ts:300 — read-commands.handleReadCommand has cognitive complexity 218 (threshold 15). Drivers by points: if/else 54 (127 pts), boolean chains 39, ternaries 14 (34 pts), loops 5 (12 pts), error handling 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 103). Of this number, 140 points are the body's own statements and 78 belong to 17 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · paid-report.runPaidReport (cognitive 207) · ×1
  • paid-report.runPaidReport (cognitive 207) REDACTED:540 — paid-report.runPaidReport has cognitive complexity 207 (threshold 15). Drivers by points: ternaries 34 (76 pts), if/else 32 (58 pts), boolean chains 40, loops 20 (31 pts), error handling 1 (2 pts) (nesting depth added 80). Of this number, 161 points are the body's own statements and 46 belong to 21 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 · gstack-design-detect.probe (cognitive 173) · ×1
  • gstack-design-detect.probe (cognitive 173) bin/gstack-design-detect.ts:344 — gstack-design-detect.probe has cognitive complexity 173 (threshold 15). Drivers by points: if/else 51 (107 pts), ternaries 12 (29 pts), boolean chains 25, loops 13 (25 pts), error handling 4 (9 pts) (nesting depth added 90). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the 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 shape REPEATS in the file: one other method here (gstack-design-detect.probe::checkSkillDir) 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 · claude-public-transcript.readPlanCountTranscript (cognitive 171) · ×1
  • claude-public-transcript.readPlanCountTranscript (cognitive 171) lib/claude-public-transcript.ts:75 — claude-public-transcript.readPlanCountTranscript has cognitive complexity 171 (threshold 15). Drivers by points: if/else 29 (114 pts), boolean chains 24, loops 5 (14 pts), ternaries 5 (14 pts), error handling 2 (5 pts) (nesting depth added 106). Of this number, 154 points are the body's own statements and 17 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.scanRunLeases (cognitive 157) · ×1
  • state.scanRunLeases (cognitive 157) lib/cso/state.ts:1570 — state.scanRunLeases has cognitive complexity 157 (threshold 15). Drivers by points: if/else 27 (98 pts), error handling 5 (19 pts), ternaries 6 (19 pts), boolean chains 16, loops 3 (5 pts) (nesting depth added 100). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the 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 · paid-plan.parseRunManifest (cognitive 145) · ×1
  • paid-plan.parseRunManifest (cognitive 145) scripts/lib/paid-plan.ts:486 — paid-plan.parseRunManifest has cognitive complexity 145 (threshold 15). Drivers by points: if/else 43 (75 pts), boolean chains 46, loops 9 (12 pts), ternaries 4 (12 pts) (nesting depth added 43). Of this number, 134 points are the body's own statements and 11 belong to 10 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.main (cognitive 135) · ×1
  • cli.main (cognitive 135) browse/src/cli.ts:1794 — cli.main has cognitive complexity 135 (threshold 15). Drivers by points: if/else 47 (89 pts), boolean chains 21, error handling 6 (14 pts), ternaries 2 (9 pts), loops 1 (2 pts) (nesting depth added 58). Of this number, 130 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · paid-plan.verifySliceResults (cognitive 134) · ×1
  • paid-plan.verifySliceResults (cognitive 134) scripts/lib/paid-plan.ts:713 — paid-plan.verifySliceResults has cognitive complexity 134 (threshold 15). Drivers by points: if/else 29 (79 pts), ternaries 7 (23 pts), boolean chains 21, loops 5 (6 pts), error handling 2 (5 pts) (nesting depth added 70). Of this number, 133 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gen-accessors.parseFields (cognitive 132) · ×1
  • gen-accessors.parseFields (cognitive 132) ios-qa/scripts/gen-accessors.ts:264 — gen-accessors.parseFields has cognitive complexity 132 (threshold 15). Drivers by points: if/else 45 (99 pts), boolean chains 17, loops 8 (13 pts), ternaries 2 (3 pts) (nesting depth added 60). Of this number, 120 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.validateConfig (cognitive 132) · ×1
  • config.validateConfig (cognitive 132) lib/pregate/config.ts:116 — config.validateConfig has cognitive complexity 132 (threshold 15). Drivers by points: if/else 49 (98 pts), boolean chains 17, loops 6 (15 pts), ternaries 1 (2 pts) (nesting depth added 59). Of this number, 114 points are the body's own statements and 18 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal-agent.buildServer (cognitive 116) · ×1
  • terminal-agent.buildServer (cognitive 116) browse/src/terminal-agent.ts:594 — terminal-agent.buildServer has cognitive complexity 116 (threshold 15). Drivers by points: if/else 42 (70 pts), boolean chains 20, error handling 6 (14 pts), ternaries 4 (10 pts), loops 1 (2 pts) (nesting depth added 43). Of this number, 93 points are the body's own statements and 23 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · snapshot.capture (cognitive 115) · ×1
  • snapshot.capture (cognitive 115) lib/cso/snapshot.ts:633 — snapshot.capture has cognitive complexity 115 (threshold 15). Drivers by points: if/else 43 (84 pts), ternaries 11 (24 pts), boolean chains 20, error handling 8 (14 pts), loops 7 (10 pts) (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (snapshot.capture::assertEntriesStable) 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 · paid-report.junitCensus (cognitive 115) · ×1
  • paid-report.junitCensus (cognitive 115) REDACTED:253 — paid-report.junitCensus has cognitive complexity 115 (threshold 15). Drivers by points: ternaries 18 (76 pts), if/else 6 (17 pts), boolean chains 10, loops 4 (9 pts), error handling 1 (3 pts) (nesting depth added 76). Of this number, 114 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cdp-inspector.inspectElement (cognitive 110) · ×1
  • cdp-inspector.inspectElement (cognitive 110) browse/src/cdp-inspector.ts:229 — cdp-inspector.inspectElement has cognitive complexity 110 (threshold 15). Drivers by points: if/else 24 (68 pts), boolean chains 20, loops 9 (19 pts), error handling 2, ternaries 1 (nesting depth added 54). Of this number, 109 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preparation.inspectPython (cognitive 108) · ×1
  • preparation.inspectPython (cognitive 108) REDACTED:531 — preparation.inspectPython has cognitive complexity 108 (threshold 15). Drivers by points: if/else 24 (74 pts), loops 4 (14 pts), boolean chains 10, ternaries 2 (10 pts) (nesting depth added 68). Of this number, 107 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · server.handleCommandInternalImpl (cognitive 104) · ×1
  • server.handleCommandInternalImpl (cognitive 104) REDACTED:970 — server.handleCommandInternalImpl has cognitive complexity 104 (threshold 15). Drivers by points: if/else 39 (68 pts), boolean chains 19, error handling 5 (11 pts), ternaries 4 (6 pts) (nesting depth added 37). Of this number, 96 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-eval.validateResult (cognitive 98) · ×1
  • cso-eval.validateResult (cognitive 98) scripts/cso-eval.ts:644 — cso-eval.validateResult has cognitive complexity 98 (threshold 15). Drivers by points: if/else 28 (57 pts), boolean chains 38, loops 3 (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 · gen-skill-docs.runGeneration (cognitive 98) · ×1
  • gen-skill-docs.runGeneration (cognitive 98) REDACTED:920 — gen-skill-docs.runGeneration has cognitive complexity 98 (threshold 15). Drivers by points: if/else 27 (79 pts), error handling 9 (19 pts), loops 8 (18 pts), boolean chains 8, ternaries 5 (8 pts) (nesting depth added 75). To reduce it, split the body into named stages: move each independent 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 (gen-skill-docs.runGeneration::emit) 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 · scanners.parseSarif (cognitive 97) · ×1
  • scanners.parseSarif (cognitive 97) lib/cso/scanners.ts:670 — scanners.parseSarif has cognitive complexity 97 (threshold 15). Drivers by points: if/else 13 (41 pts), ternaries 10 (34 pts), boolean chains 13, loops 4 (6 pts), error handling 1 (3 pts) (nesting depth added 56). Of this number, 96 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-journal-records.ownedCausalOrder (cognitive 95) · ×1
  • claude-journal-records.ownedCausalOrder (cognitive 95) lib/claude-journal-records.ts:303 — claude-journal-records.ownedCausalOrder has cognitive complexity 95 (threshold 15). Drivers by points: if/else 26 (55 pts), loops 12 (15 pts), ternaries 6 (15 pts), boolean chains 10 (nesting depth added 41). Of this number, 63 points are the body's own statements and 32 belong to 8 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · scanners.parseResults (cognitive 83) · ×1
  • scanners.parseResults (cognitive 83) lib/cso/scanners.ts:797 — scanners.parseResults has cognitive complexity 83 (threshold 15). Drivers by points: loops 10 (27 pts), ternaries 6 (27 pts), if/else 11 (20 pts), boolean chains 8, match/switch 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 · gate-reuse.findReusableGate (cognitive 83) · ×1
  • gate-reuse.findReusableGate (cognitive 83) scripts/gate-reuse.ts:350 — gate-reuse.findReusableGate has cognitive complexity 83 (threshold 15). Drivers by points: if/else 37 (57 pts), ternaries 8 (14 pts), boolean chains 9, error handling 1 (2 pts), loops 1 (nesting depth added 27). Of this number, 80 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.start (cognitive 81) · ×1
  • server.start (cognitive 81) REDACTED:1877 — server.start has cognitive complexity 81 (threshold 15). Drivers by points: if/else 26 (41 pts), ternaries 8 (17 pts), error handling 7 (13 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 31). Of this number, 68 points are the body's own statements and 13 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · verification.verifyRepair (cognitive 81) · ×1
  • verification.verifyRepair (cognitive 81) lib/cso/verification.ts:1836 — verification.verifyRepair has cognitive complexity 81 (threshold 15). Drivers by points: if/else 25 (35 pts), ternaries 10 (32 pts), boolean chains 10, error handling 2, loops 2 (nesting depth added 32). Of this number, 80 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preparation-docker.materializePreparedExport (cognitive 80) · ×1
  • preparation-docker.materializePreparedExport (cognitive 80) lib/cso/preparation-docker.ts:258 — preparation-docker.materializePreparedExport has cognitive complexity 80 (threshold 15). Drivers by points: if/else 24 (45 pts), boolean chains 19, loops 7, ternaries 2 (5 pts), error handling 2 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cookie-picker-routes.handleCookiePickerRoute (cognitive 79) · ×1
  • cookie-picker-routes.handleCookiePickerRoute (cognitive 79) browse/src/cookie-picker-routes.ts:118 — cookie-picker-routes.handleCookiePickerRoute has cognitive complexity 79 (threshold 15). Drivers by points: if/else 22 (36 pts), boolean chains 22, error handling 6 (14 pts), loops 3 (6 pts), ternaries 1 (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 · claude-owned-journal.readOwnedClaudePublicTranscript (cognitive 78) · ×1
  • claude-owned-journal.readOwnedClaudePublicTranscript (cognitive 78) lib/claude-owned-journal.ts:244 — claude-owned-journal.readOwnedClaudePublicTranscript has cognitive complexity 78 (threshold 15). Drivers by points: if/else 19 (35 pts), ternaries 10 (19 pts), boolean chains 12, loops 4 (8 pts), error handling 2 (4 pts) (nesting depth added 31). Of this number, 50 points are the body's own statements and 28 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-policy.validatePolicy (cognitive 78) · ×1
  • ship-policy.validatePolicy (cognitive 78) REDACTED:297 — ship-policy.validatePolicy has cognitive complexity 78 (threshold 15). Drivers by points: if/else 32 (47 pts), boolean chains 17, ternaries 5 (9 pts), loops 3 (5 pts) (nesting depth added 21). Of this number, 69 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · image-provisioning.provisionCatalogImages (cognitive 78) · ×1
  • image-provisioning.provisionCatalogImages (cognitive 78) lib/cso/image-provisioning.ts:162 — image-provisioning.provisionCatalogImages has cognitive complexity 78 (threshold 15). Drivers by points: if/else 13 (29 pts), ternaries 10 (22 pts), loops 5 (17 pts), boolean chains 5, error handling 3 (5 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · design-md.convertLegacy (cognitive 77) · ×1
  • design-md.convertLegacy (cognitive 77) REDACTED:441 — design-md.convertLegacy has cognitive complexity 77 (threshold 15). Drivers by points: if/else 28 (53 pts), loops 8 (16 pts), boolean chains 5, ternaries 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 · question-preference-hook.main (cognitive 77) · ×1
  • question-preference-hook.main (cognitive 77) hosts/claude/hooks/question-preference-hook.ts:362 — question-preference-hook.main has cognitive complexity 77 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 14, error handling 3 (9 pts), loops 5 (9 pts), ternaries 3 (8 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 · runtime-catalog.validateRuntimeCatalog (cognitive 77) · ×1
  • runtime-catalog.validateRuntimeCatalog (cognitive 77) REDACTED:171 — runtime-catalog.validateRuntimeCatalog has cognitive complexity 77 (threshold 15). Drivers by points: if/else 29 (51 pts), boolean chains 17, loops 5 (7 pts), ternaries 1 (2 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 · lane-selection.selectLanes (cognitive 77) · ×1
  • lane-selection.selectLanes (cognitive 77) lib/pregate/lane-selection.ts:76 — lane-selection.selectLanes has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 9 (14 pts), boolean chains 12, ternaries 5 (11 pts) (nesting depth added 31). Of this number, 73 points are the body's own statements and 4 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DockerGroup.createContainer (cognitive 74) · ×1
  • DockerGroup.createContainer (cognitive 74) REDACTED:627 — DockerGroup.createContainer has cognitive complexity 74 (threshold 15). Drivers by points: if/else 30 (38 pts), boolean chains 23, ternaries 8, loops 3, error handling 2 (nesting depth added 8). Of this number, 70 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · verification.validateRepairBundle (cognitive 74) · ×1
  • verification.validateRepairBundle (cognitive 74) lib/cso/verification.ts:1310 — verification.validateRepairBundle has cognitive complexity 74 (threshold 15). Drivers by points: if/else 26 (42 pts), boolean chains 22, loops 4 (8 pts), ternaries 1 (2 pts) (nesting depth added 21). Of this number, 72 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · verification.canonicalStartPlan (cognitive 73) · ×1
  • verification.canonicalStartPlan (cognitive 73) lib/cso/verification.ts:775 — verification.canonicalStartPlan has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (46 pts), boolean chains 12, loops 3 (7 pts), ternaries 2 (6 pts), error handling 1 (2 pts) (nesting depth added 35). Of this number, 70 points are the body's own statements and 3 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 · guard-journal.select (cognitive 72) · ×1
  • guard-journal.select (cognitive 72) autoplan/bin/guard-journal.ts:49 — guard-journal.select has cognitive complexity 72 (threshold 15). Drivers by points: if/else 14 (39 pts), loops 8 (12 pts), boolean chains 11, ternaries 3 (8 pts), error handling 1 (2 pts) (nesting depth added 35). None of this is in the body itself: all 72 points belong to 5 function literals inside it that branch (lines 50, 53, 64, …). 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 · gstack-design-detect.scan (cognitive 69) · ×1
  • gstack-design-detect.scan (cognitive 69) bin/gstack-design-detect.ts:918 — gstack-design-detect.scan has cognitive complexity 69 (threshold 15). Drivers by points: if/else 22 (39 pts), ternaries 8 (15 pts), loops 7 (10 pts), boolean chains 3, error handling 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 · model-policy-freshness.assessFreshness (cognitive 67) · ×1
  • model-policy-freshness.assessFreshness (cognitive 67) lib/model-policy-freshness.ts:121 — model-policy-freshness.assessFreshness has cognitive complexity 67 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 18, ternaries 7 (16 pts), loops 4 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-journal-records.recordEvents (cognitive 66) · ×1
  • claude-journal-records.recordEvents (cognitive 66) lib/claude-journal-records.ts:169 — claude-journal-records.recordEvents has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (46 pts), boolean chains 10, ternaries 3 (8 pts), loops 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-memory-ingest.walkGstackArtifacts (cognitive 66) · ×1
  • gstack-memory-ingest.walkGstackArtifacts (cognitive 66) bin/gstack-memory-ingest.ts:559 — gstack-memory-ingest.walkGstackArtifacts has cognitive complexity 66 (threshold 15). Drivers by points: if/else 14 (35 pts), error handling 5 (14 pts), loops 4 (12 pts), boolean chains 5 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.ensureLockProtocol (cognitive 66) · ×1
  • state.ensureLockProtocol (cognitive 66) lib/cso/state.ts:1440 — state.ensureLockProtocol has cognitive complexity 66 (threshold 15). Drivers by points: if/else 16 (36 pts), error handling 7 (21 pts), boolean chains 9 (nesting depth added 34). Of this number, 63 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-eval.scoreEval (cognitive 66) · ×1
  • cso-eval.scoreEval (cognitive 66) scripts/cso-eval.ts:767 — cso-eval.scoreEval has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 22 (38 pts), boolean chains 20, if/else 4 (5 pts), loops 2 (3 pts) (nesting depth added 18). Of this number, 47 points are the body's own statements and 19 belong to 12 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 · cookie-auth-verification.verifyCookieAuthentication (cognitive 64) · ×1
  • cookie-auth-verification.verifyCookieAuthentication (cognitive 64) browse/src/cookie-auth-verification.ts:40 — cookie-auth-verification.verifyCookieAuthentication has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (33 pts), ternaries 8 (17 pts), boolean chains 10, error handling 2, loops 2 (nesting depth added 21). Of this number, 17 points are the body's own statements and 47 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 · state.recoverAtomicNoReplaceJson (cognitive 64) · ×1
  • state.recoverAtomicNoReplaceJson (cognitive 64) lib/cso/state.ts:471 — state.recoverAtomicNoReplaceJson has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (40 pts), error handling 8 (12 pts), boolean chains 9, loops 1 (2 pts), ternaries 1 (nesting depth added 24). Of this number, 61 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.sendCommand (cognitive 63) · ×1
  • cli.sendCommand (cognitive 63) browse/src/cli.ts:1075 — cli.sendCommand has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 9, ternaries 4 (8 pts), error handling 2 (3 pts), loops 1 (3 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 · restamp.runStages (cognitive 63) · ×1
  • restamp.runStages (cognitive 63) REDACTED:347 — restamp.runStages has cognitive complexity 63 (threshold 15). Drivers by points: if/else 21 (37 pts), loops 4 (11 pts), ternaries 5 (10 pts), boolean chains 5 (nesting depth added 28). Of this number, 50 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · forceRestart (cognitive 63) · ×1
  • forceRestart (cognitive 63) extension/sidepanel-terminal.js:724 — forceRestart has cognitive complexity 63 (threshold 15). Drivers by points: error handling 14 (23 pts), if/else 19 (21 pts), boolean chains 14, ternaries 3 (4 pts), other 1 (nesting depth added 12). Of this number, 29 points are the body's own statements and 34 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-memory-ingest.preparePages (cognitive 62) · ×1
  • gstack-memory-ingest.preparePages (cognitive 62) bin/gstack-memory-ingest.ts:1537 — gstack-memory-ingest.preparePages has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (33 pts), ternaries 4 (17 pts), boolean chains 9, error handling 1 (2 pts), loops 1 (nesting depth added 32). Of this number, 60 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · gstack-memory-ingest.verifyResumeDir (cognitive 61) · ×1
  • gstack-memory-ingest.verifyResumeDir (cognitive 61) bin/gstack-memory-ingest.ts:2948 — gstack-memory-ingest.verifyResumeDir has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (35 pts), ternaries 5 (14 pts), boolean chains 8, loops 2 (3 pts), error handling 1 (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 · preparation-container.extractNpmArchive · ×1
  • preparation-container.extractNpmArchive::consume (cognitive 61) REDACTED:738 — preparation-container.extractNpmArchive::consume has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (47 pts), loops 2 (5 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preparation-executor.treeManifest · ×1
  • preparation-executor.treeManifest::walk (cognitive 60) lib/cso/preparation-executor.ts:778 — preparation-executor.treeManifest::walk has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (41 pts), boolean chains 9, error handling 2 (5 pts), loops 2 (3 pts), ternaries 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 · PreparationExecutor.acquire (cognitive 58) · ×1
  • PreparationExecutor.acquire (cognitive 58) lib/cso/preparation-executor.ts:1139 — PreparationExecutor.acquire has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 12, error handling 3 (7 pts), loops 4 (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 · model-policy-cli.modelsMain (cognitive 58) · ×1
  • model-policy-cli.modelsMain (cognitive 58) lib/model-policy-cli.ts:236 — model-policy-cli.modelsMain has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 11 (21 pts), boolean chains 9, loops 4 (6 pts), error handling 1 (nesting depth added 20). Of this number, 55 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eval-plan.parseEvalCalls (cognitive 58) · ×1
  • eval-plan.parseEvalCalls (cognitive 58) lib/eval-plan.ts:433 — eval-plan.parseEvalCalls has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (51 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (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 · gate-cost-history.classifyReds (cognitive 58) · ×1
  • gate-cost-history.classifyReds (cognitive 58) lib/gate-cost-history.ts:88 — gate-cost-history.classifyReds has cognitive complexity 58 (threshold 15). Drivers by points: if/else 10 (29 pts), ternaries 7 (22 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 35). Of this number, 16 points are the body's own statements and 42 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bin-context.slugFromEnvironment (cognitive 56) · ×1
  • bin-context.slugFromEnvironment (cognitive 56) lib/bin-context.ts:237 — bin-context.slugFromEnvironment has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 11, error handling 3 (6 pts), ternaries 2 (5 pts), loops 1 (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 · ship-queue-train.trainStatus (cognitive 56) · ×1
  • ship-queue-train.trainStatus (cognitive 56) lib/ship-queue-train.ts:491 — ship-queue-train.trainStatus has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 12 (28 pts), if/else 8 (18 pts), boolean chains 7, loops 2 (3 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 · gen-accessors.maskSwiftSource (cognitive 55) · ×1
  • gen-accessors.maskSwiftSource (cognitive 55) ios-qa/scripts/gen-accessors.ts:180 — gen-accessors.maskSwiftSource has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 7 (17 pts), boolean chains 10, ternaries 1 (3 pts) (nesting depth added 27). Of this number, 51 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-reconcile.reconcile (cognitive 55) · ×1
  • autoplan-reconcile.reconcile (cognitive 55) lib/autoplan-reconcile.ts:238 — autoplan-reconcile.reconcile has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (33 pts), ternaries 4 (10 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 25). Of this number, 54 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.recoveryJson (cognitive 55) · ×1
  • state.recoveryJson (cognitive 55) lib/cso/state.ts:308 — state.recoveryJson has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 15, error handling 5 (7 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 · state.retention (cognitive 55) · ×1
  • state.retention (cognitive 55) lib/cso/state.ts:2481 — state.retention has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 8 (12 pts), boolean chains 11, error handling 2 (nesting depth added 19). Of this number, 39 points are the body's own statements and 16 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · paid-plan.buildRunManifest (cognitive 55) · ×1
  • paid-plan.buildRunManifest (cognitive 55) scripts/lib/paid-plan.ts:279 — paid-plan.buildRunManifest has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (56 pts), ternaries 19 (32 pts), loops 13 (26 pts), boolean chains 15 (nesting depth added 60). To reduce it, split the body into named stages: move each independent 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 (paid-plan.buildRunManifest::packByRecordedDuration) 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 · paid-rerun.observeCases (cognitive 55) · ×1
  • paid-rerun.observeCases (cognitive 55) scripts/lib/paid-rerun.ts:133 — paid-rerun.observeCases has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 12 (31 pts), if/else 5 (10 pts), boolean chains 9, loops 4 (5 pts) (nesting depth added 25). Of this number, 51 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · gstack-gbrain-sync.runCodeImport (cognitive 54) · ×1
  • gstack-gbrain-sync.runCodeImport (cognitive 54) bin/gstack-gbrain-sync.ts:1154 — gstack-gbrain-sync.runCodeImport has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (29 pts), ternaries 9 (13 pts), boolean chains 9, error handling 2 (3 pts) (nesting depth added 9). 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 · cli.ensureServer (cognitive 54) · ×1
  • cli.ensureServer (cognitive 54) browse/src/cli.ts:899 — cli.ensureServer has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (30 pts), boolean chains 16, loops 2 (6 pts), ternaries 1 (2 pts) (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 · cookie-import-browser.listProfiles (cognitive 54) · ×1
  • cookie-import-browser.listProfiles (cognitive 54) REDACTED:171 — cookie-import-browser.listProfiles has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (34 pts), error handling 3 (7 pts), ternaries 3 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 30). Of this number, 48 points are the body's own statements and 6 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 · question-log-hook.extractUserChoices (cognitive 54) · ×1
  • question-log-hook.extractUserChoices (cognitive 54) hosts/claude/hooks/question-log-hook.ts:154 — question-log-hook.extractUserChoices has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 7 (21 pts), loops 7 (13 pts), boolean chains 10, if/else 6 (10 pts) (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 · scanner-executor.createDockerScannerRunner (cognitive 54) · ×1
  • scanner-executor.createDockerScannerRunner (cognitive 54) lib/cso/scanner-executor.ts:704 — scanner-executor.createDockerScannerRunner has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (34 pts), ternaries 5 (8 pts), boolean chains 5, loops 2 (4 pts), error handling 2 (3 pts) (nesting depth added 23). Most of this is not in the body itself: 5 of the 54 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 753, capture, writePolicy, …). 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 · gstack-autoplan-snapshot.acceptedBlocks (cognitive 53) · ×1
  • gstack-autoplan-snapshot.acceptedBlocks (cognitive 53) bin/gstack-autoplan-snapshot.ts:115 — gstack-autoplan-snapshot.acceptedBlocks has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (41 pts), boolean chains 11, 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 · variants.requestVariantImage (cognitive 53) · ×1
  • variants.requestVariantImage (cognitive 53) design/src/variants.ts:87 — variants.requestVariantImage has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (38 pts), ternaries 2 (7 pts), error handling 3 (5 pts), boolean chains 2, loops 1 (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 · preparation-docker.superviseRegistrySocket (cognitive 53) · ×1
  • preparation-docker.superviseRegistrySocket (cognitive 53) lib/cso/preparation-docker.ts:942 — preparation-docker.superviseRegistrySocket has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (25 pts), error handling 9 (13 pts), boolean chains 9, loops 3, ternaries 2 (3 pts) (nesting depth added 13). Of this number, 35 points are the body's own statements and 18 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 · office-hours-review.validateOfficeHoursReview (cognitive 53) · ×1
  • office-hours-review.validateOfficeHoursReview (cognitive 53) REDACTED:57 — office-hours-review.validateOfficeHoursReview has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 11, loops 4, ternaries 1 (2 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 · gen-skill-docs.transformFrontmatter (cognitive 53) · ×1
  • gen-skill-docs.transformFrontmatter (cognitive 53) REDACTED:451 — gen-skill-docs.transformFrontmatter has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 6 (14 pts), boolean chains 5, ternaries 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 · train-gate.routeDispatch (cognitive 53) · ×1
  • train-gate.routeDispatch (cognitive 53) scripts/train-gate.ts:74 — train-gate.routeDispatch has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 12, ternaries 2 (nesting depth added 18). Of this number, 51 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.swift.parseJSONSnapshotType (cognitive 53) · ×1
  • main.swift.parseJSONSnapshotType (cognitive 53) ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift:461 — main.swift.parseJSONSnapshotType has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 6 (16 pts), ternaries 3 (8 pts), boolean chains 5 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-phase-publication.autoplanPhaseCompletions (cognitive 52) · ×1
  • autoplan-phase-publication.autoplanPhaseCompletions (cognitive 52) REDACTED:65 — autoplan-phase-publication.autoplanPhaseCompletions has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (34 pts), boolean chains 11, loops 3 (7 pts) (nesting depth added 26). Of this number, 51 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preparation-container.manifest (cognitive 52) · ×1
  • preparation-container.manifest (cognitive 52) REDACTED:507 — preparation-container.manifest has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 4 (8 pts), error handling 2 (7 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 23). Of this number, 48 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gate-cost-history.simulateArrivalTrains (cognitive 52) · ×1
  • gate-cost-history.simulateArrivalTrains (cognitive 52) lib/gate-cost-history.ts:348 — gate-cost-history.simulateArrivalTrains has cognitive complexity 52 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 7 (21 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 31). Of this number, 50 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qa-evidence.capture (cognitive 52) · ×1
  • qa-evidence.capture (cognitive 52) REDACTED:195 — qa-evidence.capture has cognitive complexity 52 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 10 (13 pts), boolean chains 10, error handling 3 (6 pts), loops 1 (nesting depth added 11). Of this number, 51 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · paid-plan.buildRunManifest · ×1
  • paid-plan.buildRunManifest::packByRecordedDuration (cognitive 52) scripts/lib/paid-plan.ts:415 — paid-plan.buildRunManifest::packByRecordedDuration has cognitive complexity 52 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 4 (10 pts), ternaries 3 (10 pts), boolean chains 6 (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 shape REPEATS in the file: one other method here (paid-plan.buildRunManifest) 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 · cso-eval.buildEvalMatrix (cognitive 52) · ×1
  • cso-eval.buildEvalMatrix (cognitive 52) scripts/cso-eval.ts:565 — cso-eval.buildEvalMatrix has cognitive complexity 52 (threshold 15). Drivers by points: loops 8 (26 pts), ternaries 7 (11 pts), if/else 7 (8 pts), boolean chains 7 (nesting depth added 23). 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 · cso-image-matrix.imageBuildMatrix (cognitive 52) · ×1
  • cso-image-matrix.imageBuildMatrix (cognitive 52) scripts/cso-image-matrix.ts:77 — cso-image-matrix.imageBuildMatrix has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (23 pts), ternaries 5 (15 pts), boolean chains 11, loops 2 (3 pts) (nesting depth added 18). Of this number, 51 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · phase-publication-hook.phaseDecision (cognitive 51) · ×1
  • phase-publication-hook.phaseDecision (cognitive 51) autoplan/bin/phase-publication-hook.ts:565 — phase-publication-hook.phaseDecision has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 12, error handling 3 (9 pts), loops 1 (nesting depth added 18). Of this number, 49 points are the body's own statements and 2 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-gate.buildGate (cognitive 51) · ×1
  • autoplan-gate.buildGate (cognitive 51) lib/autoplan-gate.ts:195 — autoplan-gate.buildGate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 8 (22 pts), ternaries 5 (17 pts), boolean chains 7, loops 3 (5 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 · autoplan-gate.answerGate (cognitive 51) · ×1
  • autoplan-gate.answerGate (cognitive 51) lib/autoplan-gate.ts:359 — autoplan-gate.answerGate has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 14 (19 pts), if/else 16 (18 pts), boolean chains 13, loops 1 (nesting depth added 7). Of this number, 45 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · autoplan-run.resumeRun (cognitive 51) · ×1
  • autoplan-run.resumeRun (cognitive 51) REDACTED:404 — autoplan-run.resumeRun has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 10, ternaries 2 (9 pts), loops 4 (nesting depth added 20). Of this number, 50 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 · scanners.scannerPlans (cognitive 51) · ×1
  • scanners.scannerPlans (cognitive 51) lib/cso/scanners.ts:205 — scanners.scannerPlans has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (31 pts), ternaries 6 (10 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (nesting depth added 17). Most of this is not in the body itself: 8 of the 51 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 217, 438). 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 · gstack-post.parseArgs (cognitive 51) · ×1
  • gstack-post.parseArgs (cognitive 51) lib/gstack-post.ts:77 — gstack-post.parseArgs has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (23 pts), ternaries 8 (17 pts), boolean chains 10, loops 1 (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 · lanes.planRuns (cognitive 51) · ×1
  • lanes.planRuns (cognitive 51) lib/pregate/checks/lanes.ts:160 — lanes.planRuns has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (36 pts), ternaries 4 (8 pts), loops 4, boolean chains 3 (nesting depth added 22). Of this number, 44 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 51) · ×1
  • (anonymous) (cognitive 51) lib/dom-dump.js:1 — (anonymous) has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 17, loops 6 (7 pts), error handling 1 (nesting depth added 7). Of this number, 36 points are the body's own statements and 15 belong to 7 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · gstack-design-detect.resolveTargets (cognitive 50) · ×1
  • gstack-design-detect.resolveTargets (cognitive 50) bin/gstack-design-detect.ts:798 — gstack-design-detect.resolveTargets has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (34 pts), error handling 2 (6 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (nesting depth added 24). Of this number, 37 points are the body's own statements and 13 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-global-discover.scanGemini (cognitive 50) · ×1
  • gstack-global-discover.scanGemini (cognitive 50) bin/gstack-global-discover.ts:435 — gstack-global-discover.scanGemini has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 6 (15 pts), boolean chains 8, loops 3 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · snapshot.assertSnapshot (cognitive 50) · ×1
  • snapshot.assertSnapshot (cognitive 50) lib/cso/snapshot.ts:1074 — snapshot.assertSnapshot has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 22, loops 2, ternaries 1 (2 pts) (nesting depth added 6). Of this number, 25 points are the body's own statements and 25 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.doctor (cognitive 50) · ×1
  • cli.doctor (cognitive 50) REDACTED:805 — cli.doctor has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 12 (20 pts), if/else 13 (16 pts), boolean chains 7, error handling 5 (6 pts), loops 1 (nesting depth added 12). Of this number, 41 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-eval.cli (cognitive 50) · ×1
  • cso-eval.cli (cognitive 50) scripts/cso-eval.ts:921 — cso-eval.cli has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 10, ternaries 3 (5 pts), loops 2 (4 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 · recover-receipts.collectRecovery (cognitive 50) · ×1
  • recover-receipts.collectRecovery (cognitive 50) scripts/recover-receipts.ts:188 — recover-receipts.collectRecovery has cognitive complexity 50 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 11, ternaries 4 (7 pts), error handling 3 (6 pts), loops 4 (6 pts) (nesting depth added 17). Of this number, 43 points are the body's own statements and 7 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · review-dashboard.generatePlanFileReviewReport (cognitive 50) · ×1
  • review-dashboard.generatePlanFileReviewReport (cognitive 50) scripts/resolvers/review-dashboard.ts:104 — review-dashboard.generatePlanFileReviewReport has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 30 (48 pts), boolean chains 2 (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 · gstack-memory-ingest.parseTranscriptJsonl (cognitive 49) · ×1
  • gstack-memory-ingest.parseTranscriptJsonl (cognitive 49) bin/gstack-memory-ingest.ts:678 — gstack-memory-ingest.parseTranscriptJsonl has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 12, loops 3 (4 pts), error handling 2 (3 pts), ternaries 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 · gstack-memory-ingest.ingestPassScoped (cognitive 49) · ×1
  • gstack-memory-ingest.ingestPassScoped (cognitive 49) bin/gstack-memory-ingest.ts:2091 — gstack-memory-ingest.ingestPassScoped has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (27 pts), ternaries 8 (13 pts), boolean chains 7, error handling 1, loops 1 (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 · gstack-global-discover.scanCodex (cognitive 49) · ×1
  • gstack-global-discover.scanCodex (cognitive 49) bin/gstack-global-discover.ts:366 — gstack-global-discover.scanCodex has cognitive complexity 49 (threshold 15). Drivers by points: if/else 7 (25 pts), error handling 3 (11 pts), loops 4 (10 pts), boolean chains 3 (nesting depth added 32). Of this number, 48 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cookie-import-operation.runCookieImport (cognitive 49) · ×1
  • cookie-import-operation.runCookieImport (cognitive 49) browse/src/cookie-import-operation.ts:122 — cookie-import-operation.runCookieImport has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 14, error handling 3 (5 pts), ternaries 4, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · media-extract.extractMedia (cognitive 49) · ×1
  • media-extract.extractMedia (cognitive 49) browse/src/media-extract.ts:71 — media-extract.extractMedia has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 31, if/else 6 (11 pts), ternaries 3 (5 pts), loops 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 49 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 75, 88, 110, …). 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 · state.discardAtomicNoReplaceTemp (cognitive 49) · ×1
  • state.discardAtomicNoReplaceTemp (cognitive 49) lib/cso/state.ts:594 — state.discardAtomicNoReplaceTemp has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (36 pts), error handling 5 (9 pts), boolean chains 4 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · django.djangoEdges (cognitive 49) · ×1
  • django.djangoEdges (cognitive 49) lib/pregate/django.ts:77 — django.djangoEdges has cognitive complexity 49 (threshold 15). Drivers by points: loops 11 (25 pts), if/else 8 (17 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 24). 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 · review-evidence.bindReview (cognitive 49) · ×1
  • review-evidence.bindReview (cognitive 49) lib/review-evidence.ts:265 — review-evidence.bindReview has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 11, ternaries 4 (7 pts), loops 2 (3 pts), error handling 1 (2 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 · exercised-map.readShardCommands (cognitive 49) · ×1
  • exercised-map.readShardCommands (cognitive 49) scripts/exercised-map.ts:59 — exercised-map.readShardCommands has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 6 (15 pts), error handling 2 (7 pts), boolean chains 3, ternaries 1 (nesting depth added 27). Most of this is not in the body itself: 1 of the 49 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 65, 61). 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 · gstack-autoplan-snapshot.initializePlan (cognitive 48) · ×1
  • gstack-autoplan-snapshot.initializePlan (cognitive 48) bin/gstack-autoplan-snapshot.ts:396 — gstack-autoplan-snapshot.initializePlan has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 16, error handling 2 (4 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 7). Of this number, 32 points are the body's own statements and 16 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · server.buildFetchHandler.shutdown (cognitive 48) · ×1
  • server.buildFetchHandler.shutdown (cognitive 48) REDACTED:1649 — server.buildFetchHandler.shutdown has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 16, error handling 5 (8 pts) (nesting depth added 12). Of this number, 47 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redact-engine.scanInternal (cognitive 48) · ×1
  • redact-engine.scanInternal (cognitive 48) REDACTED:347 — redact-engine.scanInternal has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 7, ternaries 3 (5 pts), loops 3 (4 pts) (nesting depth added 24). Of this number, 47 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memorable-user-prompt-hook.main (cognitive 48) · ×1
  • memorable-user-prompt-hook.main (cognitive 48) hosts/claude/hooks/memorable-user-prompt-hook.ts:437 — memorable-user-prompt-hook.main has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26 (29 pts), ternaries 4 (7 pts), error handling 4 (6 pts), boolean chains 5, loops 1 (nesting depth added 8). 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 · state.activateRunLease (cognitive 48) · ×1
  • state.activateRunLease (cognitive 48) lib/cso/state.ts:1997 — state.activateRunLease has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 3 (6 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tree-receipt.classifyFile (cognitive 48) · ×1
  • tree-receipt.classifyFile (cognitive 48) lib/tree-receipt.ts:71 — tree-receipt.classifyFile has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 9 (19 pts), boolean chains 8, error handling 1 (2 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 · ship-queue.verify (cognitive 48) · ×1
  • ship-queue.verify (cognitive 48) lib/ship-queue.ts:373 — ship-queue.verify has cognitive complexity 48 (threshold 15). Drivers by points: if/else 24 (39 pts), boolean chains 7, error handling 1 (2 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 · pr-dependencies.exercisedConsumers.execRefs (cognitive 48) · ×1
  • pr-dependencies.exercisedConsumers.execRefs (cognitive 48) scripts/pr-dependencies.ts:523 — pr-dependencies.exercisedConsumers.execRefs has cognitive complexity 48 (threshold 15). Drivers by points: loops 7 (25 pts), if/else 8 (17 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 29). 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 · eval-flake-rank.analyzePassRates (cognitive 48) · ×1
  • eval-flake-rank.analyzePassRates (cognitive 48) scripts/eval-flake-rank.ts:443 — eval-flake-rank.analyzePassRates has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 9, loops 7 (8 pts), ternaries 4 (8 pts) (nesting depth added 15). Of this number, 45 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · content-security.markHiddenElements (cognitive 47) · ×1
  • content-security.markHiddenElements (cognitive 47) browse/src/content-security.ts:88 — content-security.markHiddenElements has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 7, loops 2 (5 pts) (nesting depth added 24). None of this is in the body itself: all 47 points belong to one function literal inside it that branches (line 89). 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 · content.captureBasicData (cognitive 47) · ×1
  • content.captureBasicData (cognitive 47) extension/content.js:153 — content.captureBasicData has cognitive complexity 47 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 16, loops 4 (8 pts), error handling 3 (6 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 · inspector.captureBasicData (cognitive 47) · ×1
  • inspector.captureBasicData (cognitive 47) extension/inspector.js:189 — inspector.captureBasicData has cognitive complexity 47 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 16, loops 4 (8 pts), error handling 3 (6 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 · state.recoverLeasePublications (cognitive 47) · ×1
  • state.recoverLeasePublications (cognitive 47) lib/cso/state.ts:1230 — state.recoverLeasePublications has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (27 pts), error handling 3 (8 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 27). Of this number, 39 points are the body's own statements and 8 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 · verification.certify (cognitive 47) · ×1
  • verification.certify (cognitive 47) lib/cso/verification.ts:1043 — verification.certify has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 13, ternaries 9 (10 pts), loops 1 (2 pts) (nesting depth added 10). Of this number, 45 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · import-graph.buildGraph (cognitive 47) · ×1
  • import-graph.buildGraph (cognitive 47) lib/pregate/import-graph.ts:453 — import-graph.buildGraph has cognitive complexity 47 (threshold 15). Drivers by points: loops 13 (22 pts), if/else 7 (17 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 22). 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 · pr-dependencies.deriveDependencies.refs (cognitive 47) · ×1
  • pr-dependencies.deriveDependencies.refs (cognitive 47) scripts/pr-dependencies.ts:205 — pr-dependencies.deriveDependencies.refs has cognitive complexity 47 (threshold 15). Drivers by points: loops 12 (25 pts), if/else 12 (21 pts), ternaries 1 (nesting depth added 22). 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 · gbrain-local-status.freshClassify (cognitive 46) · ×1
  • gbrain-local-status.freshClassify (cognitive 46) REDACTED:452 — gbrain-local-status.freshClassify has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 5 (13 pts), boolean chains 6, error handling 3 (4 pts) (nesting depth added 19). Of this number, 17 points are the body's own statements and 29 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 · BrowserManager.launchHeaded (cognitive 46) · ×1
  • BrowserManager.launchHeaded (cognitive 46) browse/src/browser-manager.ts:789 — BrowserManager.launchHeaded has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (25 pts), error handling 5 (11 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 16). Of this number, 29 points are the body's own statements and 17 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.main (cognitive 46) · ×1
  • cli.main (cognitive 46) design/src/cli.ts:135 — cli.main has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 10, ternaries 2 (5 pts), 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 · preparation.inspectRails (cognitive 46) · ×1
  • preparation.inspectRails (cognitive 46) REDACTED:932 — preparation.inspectRails has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (35 pts), ternaries 3 (5 pts), boolean chains 3, loops 3 (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 · eval-plan.priceGate (cognitive 46) · ×1
  • eval-plan.priceGate (cognitive 46) lib/eval-plan.ts:560 — eval-plan.priceGate has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 9 (14 pts), boolean chains 5, loops 1 (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 · autoplan-run.nextStep (cognitive 45) · ×1
  • autoplan-run.nextStep (cognitive 45) REDACTED:178 — autoplan-run.nextStep has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (22 pts), ternaries 5 (10 pts), boolean chains 8, loops 3, error handling 1 (2 pts) (nesting depth added 12). Of this number, 42 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · admission.admit (cognitive 45) · ×1
  • admission.admit (cognitive 45) lib/cso/admission.ts:326 — admission.admit has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (30 pts), error handling 4 (11 pts), boolean chains 3, loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preparation-container.createPreparedExport · ×1
  • preparation-container.createPreparedExport::walk (cognitive 45) REDACTED:273 — preparation-container.createPreparedExport::walk has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 8, error handling 1 (3 pts), ternaries 1 (2 pts), 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 · pr-dependencies.exercisedConsumers.shellEdges (cognitive 45) · ×1
  • pr-dependencies.exercisedConsumers.shellEdges (cognitive 45) scripts/pr-dependencies.ts:495 — pr-dependencies.exercisedConsumers.shellEdges has cognitive complexity 45 (threshold 15). Drivers by points: loops 13 (26 pts), if/else 9 (16 pts), boolean chains 3 (nesting depth added 20). 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 · release-cut.planRelease (cognitive 45) · ×1
  • release-cut.planRelease (cognitive 45) scripts/release-cut.ts:169 — release-cut.planRelease has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 9, ternaries 5 (7 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 · gstack-memory-helpers.extractGbrainBlock (cognitive 44) · ×1
  • gstack-memory-helpers.extractGbrainBlock (cognitive 44) lib/gstack-memory-helpers.ts:482 — gstack-memory-helpers.extractGbrainBlock has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (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 · cli.submit (cognitive 44) · ×1
  • cli.submit (cognitive 44) REDACTED:1391 — cli.submit has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 11, loops 2 (nesting depth added 10). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1401, 1463). 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 · regen.validateRegistry (cognitive 44) · ×1
  • regen.validateRegistry (cognitive 44) lib/regen.ts:49 — regen.validateRegistry has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 10, loops 3, ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 11). Most of this is not in the body itself: 8 of the 44 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 57, 74). 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 · tree-receipt.buildReceipt (cognitive 44) · ×1
  • tree-receipt.buildReceipt (cognitive 44) lib/tree-receipt.ts:132 — tree-receipt.buildReceipt has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 9 (10 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 9). 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 · (anonymous) (cognitive 44) · ×1
  • (anonymous) (cognitive 44) extension/background.js:296 — (anonymous) has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (27 pts), error handling 4 (10 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 12). Of this number, 27 points are the body's own statements and 17 belong to 17 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · connect (cognitive 44) · ×1
  • connect (cognitive 44) extension/sidepanel-terminal.js:545 — connect has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (17 pts), error handling 9 (15 pts), boolean chains 10, other 1, ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 10 of the 44 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 639, 664, 601, …). 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 · cli.handlePairAgent (cognitive 43) · ×1
  • cli.handlePairAgent (cognitive 43) browse/src/cli.ts:1581 — cli.handlePairAgent has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 10, error handling 4 (9 pts), ternaries 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 · terminal-agent.main (cognitive 43) · ×1
  • terminal-agent.main (cognitive 43) browse/src/terminal-agent.ts:1073 — terminal-agent.main has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 10, loops 6 (8 pts), error handling 2 (3 pts), ternaries 1 (nesting depth added 9). Of this number, 31 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · spend-ledger.withFileLock (cognitive 43) · ×1
  • spend-ledger.withFileLock (cognitive 43) lib/spend-ledger.ts:62 — spend-ledger.withFileLock has cognitive complexity 43 (threshold 15). Drivers by points: error handling 7 (22 pts), if/else 5 (16 pts), boolean chains 4, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · regate.evaluateRegate (cognitive 43) · ×1
  • regate.evaluateRegate (cognitive 43) REDACTED:92 — regate.evaluateRegate has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (23 pts), ternaries 5 (11 pts), loops 2 (6 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 · gbrain-local-status.hasRemoteOnlyGbrainMcp (cognitive 42) · ×1
  • gbrain-local-status.hasRemoteOnlyGbrainMcp (cognitive 42) REDACTED:174 — gbrain-local-status.hasRemoteOnlyGbrainMcp has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 11, loops 3 (4 pts), error handling 1 (nesting depth added 13). Of this number, 26 points are the body's own statements and 16 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redact-engine.redactJsonFindingSpans (cognitive 42) · ×1
  • redact-engine.redactJsonFindingSpans (cognitive 42) REDACTED:579 — redact-engine.redactJsonFindingSpans has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 4 (9 pts), boolean chains 5 (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 · witness.testExecutionSummary (cognitive 42) · ×1
  • witness.testExecutionSummary (cognitive 42) REDACTED:354 — witness.testExecutionSummary has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 24, if/else 13 (14 pts), error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 2). Of this number, 34 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · gbrain-supabase-provision.apiCall (cognitive 42) · ×1
  • gbrain-supabase-provision.apiCall (cognitive 42) lib/gbrain-supabase-provision.ts:216 — gbrain-supabase-provision.apiCall has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (23 pts), error handling 5 (11 pts), ternaries 2 (4 pts), boolean chains 3, 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 · supervise.supervise (cognitive 42) · ×1
  • supervise.supervise (cognitive 42) REDACTED:94 — supervise.supervise has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 7, ternaries 6 (7 pts), error handling 4, loops 1 (nesting depth added 5). Most of this is not in the body itself: 2 of the 42 points are its own statements and the rest belongs to 6 function items inside it that branch (readNew, a function literal at line 163, a function literal at line 175, …). 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 · lanes.run (cognitive 42) · ×1
  • lanes.run (cognitive 42) lib/pregate/checks/lanes.ts:406 — lanes.run has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 13 (25 pts), if/else 12, 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 · DockerVerificationExecutor.observe (cognitive 41) · ×1
  • DockerVerificationExecutor.observe (cognitive 41) lib/cso/verification.ts:1586 — DockerVerificationExecutor.observe has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 7, loops 3 (4 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 9). Of this number, 40 points are the body's own statements and 1 belongs to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pr-shots.paneRows (cognitive 41) · ×1
  • pr-shots.paneRows (cognitive 41) lib/pr-shots.ts:159 — pr-shots.paneRows has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 9 (24 pts), if/else 6 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 20). Of this number, 40 points are the body's own statements and 1 belongs 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 · restamp.gateAhead (cognitive 41) · ×1
  • restamp.gateAhead (cognitive 41) REDACTED:573 — restamp.gateAhead has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 3 (13 pts), boolean chains 4, loops 1 (3 pts) (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 · ship-measure.runSet (cognitive 41) · ×1
  • ship-measure.runSet (cognitive 41) REDACTED:393 — ship-measure.runSet has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 5 (11 pts), boolean chains 7, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 18). Of this number, 38 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-gbrain-sync.main (cognitive 40) · ×1
  • gstack-gbrain-sync.main (cognitive 40) bin/gstack-gbrain-sync.ts:2175 — gstack-gbrain-sync.main has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (27 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 12). Of this number, 37 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context-bill.contextBillMain (cognitive 40) · ×1
  • context-bill.contextBillMain (cognitive 40) lib/context-bill.ts:1235 — context-bill.contextBillMain has cognitive complexity 40 (threshold 15). Drivers by points: if/else 28 (38 pts), loops 5 (13 pts), ternaries 8 (11 pts), boolean chains 3, error handling 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (context-bill.contextBillMain::exactFor) 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 · state.recoverDeadLease (cognitive 40) · ×1
  • state.recoverDeadLease (cognitive 40) lib/cso/state.ts:1907 — state.recoverDeadLease has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (27 pts), error handling 3 (7 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · import-graph.referencesIn (cognitive 40) · ×1
  • import-graph.referencesIn (cognitive 40) lib/pregate/import-graph.ts:403 — import-graph.referencesIn has cognitive complexity 40 (threshold 15). Drivers by points: loops 12 (24 pts), if/else 7 (9 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 17). Of this number, 37 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · phase-publication-hook.guardOutput (cognitive 39) · ×1
  • phase-publication-hook.guardOutput (cognitive 39) autoplan/bin/phase-publication-hook.ts:719 — phase-publication-hook.guardOutput has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 7, ternaries 1 (3 pts), error handling 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 · aside-render.renderWithBrowse (cognitive 39) · ×1
  • aside-render.renderWithBrowse (cognitive 39) lib/aside-render.ts:489 — aside-render.renderWithBrowse has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (32 pts), error handling 3, boolean chains 2, loops 2 (nesting depth added 11). Of this number, 29 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tunnel-bootstrap.bootstrapTunnel (cognitive 39) · ×1
  • tunnel-bootstrap.bootstrapTunnel (cognitive 39) ios-qa/daemon/src/tunnel-bootstrap.ts:204 — tunnel-bootstrap.bootstrapTunnel has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 4, error handling 2 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 13). Of this number, 30 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-reconcile.parseFences (cognitive 39) · ×1
  • autoplan-reconcile.parseFences (cognitive 39) lib/autoplan-reconcile.ts:69 — autoplan-reconcile.parseFences has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 17). Most of this is not in the body itself: 1 of the 39 points is its own statement and the rest belongs to one function literal inside it that branches (line 74). 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 · autoplan-run.withRunLock (cognitive 39) · ×1
  • autoplan-run.withRunLock (cognitive 39) REDACTED:41 — autoplan-run.withRunLock has cognitive complexity 39 (threshold 15). Drivers by points: error handling 6 (17 pts), if/else 7 (15 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.chooseRunLeaseTicket (cognitive 39) · ×1
  • state.chooseRunLeaseTicket (cognitive 39) lib/cso/state.ts:1940 — state.chooseRunLeaseTicket has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (32 pts), boolean chains 4, 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 · scanner-executor.executeScanner (cognitive 39) · ×1
  • scanner-executor.executeScanner (cognitive 39) lib/cso/scanner-executor.ts:394 — scanner-executor.executeScanner has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (23 pts), error handling 4 (7 pts), boolean chains 4, loops 2 (4 pts), ternaries 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 · cli.start (cognitive 39) · ×1
  • cli.start (cognitive 39) REDACTED:653 — cli.start has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 9 (21 pts), if/else 6 (8 pts), boolean chains 5, error handling 3 (5 pts) (nesting depth added 16). Of this number, 35 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dx-error-capture.parseArgs (cognitive 39) · ×1
  • dx-error-capture.parseArgs (cognitive 39) lib/dx-error-capture.ts:100 — dx-error-capture.parseArgs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 4 (8 pts), boolean chains 6, 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 · workflows.commandTestFiles (cognitive 39) · ×1
  • workflows.commandTestFiles (cognitive 39) lib/pregate/workflows.ts:102 — workflows.commandTestFiles has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (10 pts), ternaries 2 (7 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pr-dependencies.stripMessages (cognitive 39) · ×1
  • pr-dependencies.stripMessages (cognitive 39) scripts/pr-dependencies.ts:407 — pr-dependencies.stripMessages has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 6, ternaries 2 (4 pts), loops 2 (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 · gstack-gbrain-read-capability.readCapability (cognitive 38) · ×1
  • gstack-gbrain-read-capability.readCapability (cognitive 38) bin/gstack-gbrain-read-capability.ts:11 — gstack-gbrain-read-capability.readCapability has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 12, error handling 4, ternaries 2 (3 pts) (nesting depth added 2). Of this number, 36 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BrowserManager.wirePageEvents (cognitive 38) · ×1
  • BrowserManager.wirePageEvents (cognitive 38) browse/src/browser-manager.ts:2346 — BrowserManager.wirePageEvents has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 4 (5 pts), ternaries 3 (5 pts), boolean chains 4, error handling 2 (nesting depth added 13). None of this is in the body itself: all 38 points belong to 5 function literals inside it that branch (lines 2351, 2373, 2386, …). 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 · approval-record.importAutoplan (cognitive 38) · ×1
  • approval-record.importAutoplan (cognitive 38) lib/approval-record.ts:209 — approval-record.importAutoplan has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 8 (21 pts), if/else 4 (6 pts), boolean chains 5, error handling 2 (3 pts), loops 3 (nesting depth added 16). Of this number, 33 points are the body's own statements and 5 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ci-gate.evaluateChecks (cognitive 38) · ×1
  • ci-gate.evaluateChecks (cognitive 38) lib/ci-gate.ts:106 — ci-gate.evaluateChecks has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 8 (14 pts), boolean chains 6, loops 4 (nesting depth added 9). Of this number, 33 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scanners.parseScannerOutput (cognitive 38) · ×1
  • scanners.parseScannerOutput (cognitive 38) lib/cso/scanners.ts:958 — scanners.parseScannerOutput has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 9, ternaries 3 (4 pts), loops 1 (2 pts), error handling 1 (nesting depth added 5). Of this number, 34 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · regate.migrationReport (cognitive 38) · ×1
  • regate.migrationReport (cognitive 38) REDACTED:39 — regate.migrationReport has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 5 (7 pts), loops 4 (5 pts), boolean chains 4, error handling 1 (nesting depth added 10). Of this number, 30 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagram-prepass.inlineLocalImages (cognitive 38) · ×1
  • diagram-prepass.inlineLocalImages (cognitive 38) make-pdf/src/diagram-prepass.ts:549 — diagram-prepass.inlineLocalImages has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (29 pts), ternaries 3 (4 pts), boolean chains 3, error handling 2 (nesting depth added 10). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 563, 672, 686). 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 · cso-eval-producer.runProducerCell (cognitive 38) · ×1
  • cso-eval-producer.runProducerCell (cognitive 38) scripts/cso-eval-producer.ts:553 — cso-eval-producer.runProducerCell has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (20 pts), ternaries 11, boolean chains 5, error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · train-gate.stampFreeTree (cognitive 38) · ×1
  • train-gate.stampFreeTree (cognitive 38) scripts/train-gate.ts:143 — train-gate.stampFreeTree has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 7 (22 pts), if/else 8 (12 pts), error handling 1 (3 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.
D2 · Cognitive Complexity · openReattachWebSocket (cognitive 38) · ×1
  • openReattachWebSocket (cognitive 38) extension/sidepanel-terminal.js:309 — openReattachWebSocket has cognitive complexity 38 (threshold 15). Drivers by points: error handling 7 (14 pts), if/else 10 (13 pts), boolean chains 7, ternaries 2 (3 pts), other 1 (nesting depth added 11). Most of this is not in the body itself: 2 of the 38 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 329, 362, 323, …). 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 · transcript-consent.readTranscriptConsent (cognitive 37) · ×1
  • transcript-consent.readTranscriptConsent (cognitive 37) lib/transcript-consent.ts:108 — transcript-consent.readTranscriptConsent has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 6 (10 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 · BrowserManager.restoreState (cognitive 37) · ×1
  • BrowserManager.restoreState (cognitive 37) browse/src/browser-manager.ts:1853 — BrowserManager.restoreState has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 3 (9 pts), loops 3 (9 pts) (nesting depth added 20). Of this number, 23 points are the body's own statements and 14 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 · meta-commands.parsePdfArgs (cognitive 37) · ×1
  • meta-commands.parsePdfArgs (cognitive 37) browse/src/meta-commands.ts:80 — meta-commands.parsePdfArgs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26 (31 pts), boolean chains 4, loops 2 (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 · autoplan-reconcile.parseRecordFindings (cognitive 37) · ×1
  • autoplan-reconcile.parseRecordFindings (cognitive 37) lib/autoplan-reconcile.ts:133 — autoplan-reconcile.parseRecordFindings has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 15). Of this number, 35 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-export.runLog (cognitive 37) · ×1
  • autoplan-export.runLog (cognitive 37) lib/autoplan-export.ts:77 — autoplan-export.runLog has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 15 (25 pts), if/else 5 (8 pts), boolean chains 2, loops 2 (nesting depth added 13). Of this number, 29 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context-bill.walkMdFiles · ×1
  • context-bill.walkMdFiles::walk (cognitive 37) lib/context-bill.ts:334 — context-bill.walkMdFiles::walk has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 8, error handling 3 (6 pts), 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 · preparation.inspectNode (cognitive 37) · ×1
  • preparation.inspectNode (cognitive 37) REDACTED:266 — preparation.inspectNode has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 4 (7 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 16). Of this number, 29 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · regen.runRegen (cognitive 37) · ×1
  • regen.runRegen (cognitive 37) lib/regen.ts:229 — regen.runRegen has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 8 (13 pts), boolean chains 5, loops 1 (nesting depth added 14). Of this number, 32 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue.stamp (cognitive 37) · ×1
  • ship-queue.stamp (cognitive 37) lib/ship-queue.ts:264 — ship-queue.stamp has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 7, ternaries 3 (4 pts) (nesting depth added 9). Of this number, 34 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.Deno.serve() (cognitive 37) · ×1
  • index.Deno.serve() (cognitive 37) supabase/functions/telemetry-ingest/index.ts:29 — index.Deno.serve() has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 9 (13 pts), boolean chains 2, loops 2, error handling 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 · ObservableClassVisitor.visit (cognitive 37) · ×1
  • ObservableClassVisitor.visit (cognitive 37) ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift:336 — ObservableClassVisitor.visit has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (3 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 · claude-owned-journal.scan (cognitive 36) · ×1
  • claude-owned-journal.scan (cognitive 36) lib/claude-owned-journal.ts:133 — claude-owned-journal.scan has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 10, ternaries 3 (10 pts), loops 4 (7 pts), error handling 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (claude-owned-journal.scan::record) 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 · gstack-memory-ingest.admitTranscriptSource (cognitive 36) · ×1
  • gstack-memory-ingest.admitTranscriptSource (cognitive 36) bin/gstack-memory-ingest.ts:2521 — gstack-memory-ingest.admitTranscriptSource has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 8, ternaries 3 (7 pts), loops 1 (2 pts) (nesting depth added 12). Of this number, 34 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cookie-import-native.importNativeCookies (cognitive 36) · ×1
  • cookie-import-native.importNativeCookies (cognitive 36) browse/src/cookie-import-native.ts:42 — cookie-import-native.importNativeCookies has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15, boolean chains 9, error handling 6, ternaries 3 (6 pts) (nesting depth added 3). Of this number, 27 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · redact-engine.jsonTokens (cognitive 36) · ×1
  • redact-engine.jsonTokens (cognitive 36) REDACTED:654 — redact-engine.jsonTokens has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model-policy.readModelPolicyConfig (cognitive 36) · ×1
  • model-policy.readModelPolicyConfig (cognitive 36) lib/model-policy.ts:253 — model-policy.readModelPolicyConfig has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (18 pts), ternaries 3 (9 pts), error handling 2 (5 pts), loops 1 (3 pts), boolean chains 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 · contracts.renderReport (cognitive 36) · ×1
  • contracts.renderReport (cognitive 36) lib/cso/contracts.ts:883 — contracts.renderReport has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 24 (32 pts), boolean chains 4 (nesting depth added 8). Of this number, 27 points are the body's own statements and 9 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 · verification.canonicalTestPlan (cognitive 36) · ×1
  • verification.canonicalTestPlan (cognitive 36) lib/cso/verification.ts:562 — verification.canonicalTestPlan has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (12 pts), ternaries 4 (8 pts), error handling 1 (2 pts) (nesting depth added 8). Of this number, 26 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-post.runPost (cognitive 36) · ×1
  • gstack-post.runPost (cognitive 36) lib/gstack-post.ts:340 — gstack-post.runPost has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 8 (10 pts), loops 3 (6 pts), boolean chains 5, error handling 1 (nesting depth added 10). Of this number, 35 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rust.depSpecs (cognitive 36) · ×1
  • rust.depSpecs (cognitive 36) lib/pregate/rust.ts:112 — rust.depSpecs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 4 (11 pts), loops 5 (10 pts), boolean chains 4 (nesting depth added 19). Of this number, 35 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · review-evidence.sharedLibsSnapshotCoverage (cognitive 36) · ×1
  • review-evidence.sharedLibsSnapshotCoverage (cognitive 36) lib/review-evidence.ts:70 — review-evidence.sharedLibsSnapshotCoverage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 11, error handling 2, loops 2, ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 36 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 93, git, a function literal at line 83). 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 · gate-cost-replay.parseArgs (cognitive 36) · ×1
  • gate-cost-replay.parseArgs (cognitive 36) scripts/gate-cost-replay.ts:72 — gate-cost-replay.parseArgs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (29 pts), boolean chains 6, loops 1 (nesting depth added 5). Of this number, 34 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ship-measure.formatReport (cognitive 36) · ×1
  • ship-measure.formatReport (cognitive 36) REDACTED:478 — ship-measure.formatReport has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 8 (21 pts), if/else 4 (11 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). Of this number, 32 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-memory-ingest.probeMode (cognitive 35) · ×1
  • gstack-memory-ingest.probeMode (cognitive 35) bin/gstack-memory-ingest.ts:1338 — gstack-memory-ingest.probeMode has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (5 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 16). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrowserManager.promoteToHeaded (cognitive 35) · ×1
  • BrowserManager.promoteToHeaded (cognitive 35) browse/src/browser-manager.ts:2093 — BrowserManager.promoteToHeaded has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 3 (5 pts), error handling 4, boolean chains 2 (nesting depth added 9). Of this number, 33 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · banned-terms.validateBannedTerms (cognitive 35) · ×1
  • banned-terms.validateBannedTerms (cognitive 35) REDACTED:56 — banned-terms.validateBannedTerms has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 5, ternaries 2 (5 pts), loops 2 (4 pts) (nesting depth added 14). Most of this is not in the body itself: 11 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 64). 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 · gate-list.parseReply (cognitive 35) · ×1
  • gate-list.parseReply (cognitive 35) lib/gate-list.ts:147 — gate-list.parseReply has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 6, ternaries 4 (6 pts), loops 2 (nesting depth added 6). Of this number, 34 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · autoplan-revise.reviseRun (cognitive 35) · ×1
  • autoplan-revise.reviseRun (cognitive 35) lib/autoplan-revise.ts:102 — autoplan-revise.reviseRun has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, loops 6 (8 pts), ternaries 7 (8 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · autoplan-run.submitResult (cognitive 35) · ×1
  • autoplan-run.submitResult (cognitive 35) REDACTED:299 — autoplan-run.submitResult has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 6, ternaries 5 (6 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · docker.dockerEndpoint (cognitive 35) · ×1
  • docker.dockerEndpoint (cognitive 35) REDACTED:76 — docker.dockerEndpoint has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 8, error handling 3 (4 pts), ternaries 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 · eval-models.parseEvalModels (cognitive 35) · ×1
  • eval-models.parseEvalModels (cognitive 35) lib/eval-models.ts:56 — eval-models.parseEvalModels has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 4 (7 pts), loops 5 (6 pts), boolean chains 3, error handling 1 (nesting depth added 11). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · git.sectionToFile (cognitive 35) · ×1
  • git.sectionToFile (cognitive 35) lib/gate-diff/git.ts:223 — git.sectionToFile has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 9, ternaries 3, loops 1 (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.
D2 · Cognitive Complexity · index.scanCandidate (cognitive 35) · ×1
  • index.scanCandidate (cognitive 35) lib/gate-diff/index.ts:114 — index.scanCandidate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 6 (9 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 15). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue-train.mergeStep (cognitive 35) · ×1
  • ship-queue-train.mergeStep (cognitive 35) lib/ship-queue-train.ts:149 — ship-queue-train.mergeStep has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 4 (6 pts), boolean chains 5, loops 3 (nesting depth added 10). Of this number, 30 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 · design.generateDesignOutsideVoices (cognitive 35) · ×1
  • design.generateDesignOutsideVoices (cognitive 35) scripts/resolvers/design.ts:689 — design.generateDesignOutsideVoices has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 24 (31 pts), if/else 4 (nesting depth added 7). 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 · background.chrome.runtime.onMessage.addListener() (cognitive 34) · ×1
  • background.chrome.runtime.onMessage.addListener() (cognitive 34) extension/background.js:296 — background.chrome.runtime.onMessage.addListener() has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 6). Of this number, 22 points are the body's own statements and 12 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · host-config.validateHostConfig (cognitive 34) · ×1
  • host-config.validateHostConfig (cognitive 34) scripts/host-config.ts:151 — host-config.validateHostConfig has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (27 pts), loops 2 (4 pts), boolean chains 3 (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 · process.git (cognitive 34) · ×1
  • process.git (cognitive 34) lib/cso/process.ts:695 — process.git has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 9 (30 pts), boolean chains 3, if/else 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.
D2 · Cognitive Complexity · admission.acquireClaim (cognitive 34) · ×1
  • admission.acquireClaim (cognitive 34) lib/cso/admission.ts:154 — admission.acquireClaim has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 4 (9 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 16). Of this number, 26 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.launchRuntime (cognitive 34) · ×1
  • runtime.launchRuntime (cognitive 34) lib/pregate/runtime.ts:159 — runtime.launchRuntime has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 8 (21 pts), if/else 6 (10 pts), boolean chains 2, error handling 1 (nesting depth added 17). Of this number, 31 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · init-draft.draftConfig (cognitive 34) · ×1
  • init-draft.draftConfig (cognitive 34) lib/pregate/init-draft.ts:52 — init-draft.draftConfig has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 5 (10 pts), boolean chains 5, loops 2 (nesting depth added 15). Of this number, 33 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 · paid-report.runCaseDiagnosis (cognitive 34) · ×1
  • paid-report.runCaseDiagnosis (cognitive 34) REDACTED:75 — paid-report.runCaseDiagnosis has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 12 (25 pts), if/else 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). Of this number, 24 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 · preflight-agent-sdk.main (cognitive 34) · ×1
  • preflight-agent-sdk.main (cognitive 34) scripts/preflight-agent-sdk.ts:41 — preflight-agent-sdk.main has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (25 pts), error handling 2 (3 pts), ternaries 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-memory-ingest.importBatch (cognitive 33) · ×1
  • gstack-memory-ingest.importBatch (cognitive 33) bin/gstack-memory-ingest.ts:2812 — gstack-memory-ingest.importBatch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7, loops 1 (3 pts), ternaries 1 (3 pts), error handling 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 · timeline-stop-hook.repairTimeline (cognitive 33) · ×1
  • timeline-stop-hook.repairTimeline (cognitive 33) hosts/claude/hooks/timeline-stop-hook.ts:232 — timeline-stop-hook.repairTimeline has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (6 pts), error handling 4 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 11). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · headless-artifacts.checkPhases (cognitive 33) · ×1
  • headless-artifacts.checkPhases (cognitive 33) lib/headless-artifacts.ts:357 — headless-artifacts.checkPhases has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (24 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 2 (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 · claude-code.runClaudeCode (cognitive 33) · ×1
  • claude-code.runClaudeCode (cognitive 33) lib/claude-code.ts:146 — claude-code.runClaudeCode has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 10, error handling 2 (3 pts), ternaries 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 16 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cli.replay (cognitive 33) · ×1
  • cli.replay (cognitive 33) REDACTED:2604 — cli.replay has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 7, ternaries 2 (3 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 3 of the 33 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2615, 2626). 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 · context.buildContext (cognitive 33) · ×1
  • context.buildContext (cognitive 33) lib/pregate/context.ts:186 — context.buildContext has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 8 (12 pts), boolean chains 6, 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 · eval-bg.main (cognitive 33) · ×1
  • eval-bg.main (cognitive 33) scripts/eval-bg.ts:389 — eval-bg.main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 6 (8 pts), boolean chains 7, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · eval-flake-rank.aggregate (cognitive 33) · ×1
  • eval-flake-rank.aggregate (cognitive 33) scripts/eval-flake-rank.ts:77 — eval-flake-rank.aggregate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (8 pts), boolean chains 3, error handling 1 (2 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 · gate-reuse.ownDiffSignature (cognitive 33) · ×1
  • gate-reuse.ownDiffSignature (cognitive 33) scripts/gate-reuse.ts:216 — gate-reuse.ownDiffSignature has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 4 (5 pts), boolean chains 4, loops 2 (4 pts), error handling 2 (nesting depth added 9). Of this number, 22 points are the body's own statements and 11 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gen-skill-docs.runGeneration · ×1
  • gen-skill-docs.runGeneration::emit (cognitive 33) REDACTED:940 — gen-skill-docs.runGeneration::emit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (22 pts), error handling 3 (7 pts), loops 1 (3 pts), ternaries 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. This shape REPEATS in the file: one other method here (gen-skill-docs.runGeneration) 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 · index.Deno.serve() (cognitive 33) · ×1
  • index.Deno.serve() (cognitive 33) supabase/functions/community-pulse/index.ts:23 — index.Deno.serve() has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 3, error handling 2, ternaries 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 · gstack-gbrain-sync.runDream (cognitive 32) · ×1
  • gstack-gbrain-sync.runDream (cognitive 32) bin/gstack-gbrain-sync.ts:1762 — gstack-gbrain-sync.runDream has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 10 (17 pts), if/else 11, boolean chains 3, error handling 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 · runtime-pins.collectPins (cognitive 32) · ×1
  • runtime-pins.collectPins (cognitive 32) lib/runtime-pins.ts:139 — runtime-pins.collectPins has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (4 pts), ternaries 2 (4 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 14). Of this number, 21 points are the body's own statements and 11 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 · gate-cost.simulateTrains (cognitive 32) · ×1
  • gate-cost.simulateTrains (cognitive 32) lib/gate-cost.ts:573 — gate-cost.simulateTrains has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (6 pts), boolean chains 3, ternaries 2 (nesting depth added 17). Of this number, 29 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rust.rustEdges (cognitive 32) · ×1
  • rust.rustEdges (cognitive 32) lib/pregate/rust.ts:236 — rust.rustEdges has cognitive complexity 32 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 5 (11 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 16). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qa-evidence.qaEvidenceMain (cognitive 32) · ×1
  • qa-evidence.qaEvidenceMain (cognitive 32) REDACTED:393 — qa-evidence.qaEvidenceMain has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, ternaries 6 (9 pts), error handling 1 (nesting depth added 6). None of this is in the body itself: all 32 points belong to 2 function literals inside it that branch (lines 396, 394). 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 · ship-queue-gate.recomputeMergeTree (cognitive 32) · ×1
  • ship-queue-gate.recomputeMergeTree (cognitive 32) lib/ship-queue-gate.ts:79 — ship-queue-gate.recomputeMergeTree has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, ternaries 2 (4 pts), loops 3 (nesting depth added 11). Of this number, 27 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 · version-gate-train.classifyTrainHead (cognitive 32) · ×1
  • version-gate-train.classifyTrainHead (cognitive 32) lib/version-gate-train.ts:92 — version-gate-train.classifyTrainHead has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 6 (9 pts), boolean chains 6, error handling 2 (nesting depth added 5). Of this number, 29 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · eval-flake-rank.backfillEvalFiles (cognitive 32) · ×1
  • eval-flake-rank.backfillEvalFiles (cognitive 32) scripts/eval-flake-rank.ts:221 — eval-flake-rank.backfillEvalFiles has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 4 (11 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (2 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 · gate-cost-replay.readGateRecord (cognitive 32) · ×1
  • gate-cost-replay.readGateRecord (cognitive 32) scripts/gate-cost-replay.ts:138 — gate-cost-replay.readGateRecord has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (7 pts), ternaries 2 (5 pts), error handling 1 (4 pts), boolean chains 2 (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 · gstack-autoplan-snapshot.baselineEditRecords (cognitive 31) · ×1
  • gstack-autoplan-snapshot.baselineEditRecords (cognitive 31) bin/gstack-autoplan-snapshot.ts:195 — gstack-autoplan-snapshot.baselineEditRecords has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 6, loops 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 · gstack-design-md.main (cognitive 31) · ×1
  • gstack-design-md.main (cognitive 31) bin/gstack-design-md.ts:43 — gstack-design-md.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (2 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.
D2 · Cognitive Complexity · terminal-agent-control.reclaimPublicationLock (cognitive 31) · ×1
  • terminal-agent-control.reclaimPublicationLock (cognitive 31) browse/src/terminal-agent-control.ts:45 — terminal-agent-control.reclaimPublicationLock has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 7, error handling 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 · autoplan-run.statusLines (cognitive 31) · ×1
  • autoplan-run.statusLines (cognitive 31) REDACTED:464 — autoplan-run.statusLines has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 7 (16 pts), if/else 4 (8 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 14). Of this number, 27 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.boundedRemoveTree (cognitive 31) · ×1
  • state.boundedRemoveTree (cognitive 31) lib/cso/state.ts:2259 — state.boundedRemoveTree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (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 · PublicArchiveCache.cleanIncoming (cognitive 31) · ×1
  • PublicArchiveCache.cleanIncoming (cognitive 31) lib/cso/cache.ts:789 — PublicArchiveCache.cleanIncoming has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (5 pts), boolean chains 4, error handling 1 (2 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 · DockerPreparationSandboxRunner.prepareOffline (cognitive 31) · ×1
  • DockerPreparationSandboxRunner.prepareOffline (cognitive 31) lib/cso/preparation-docker.ts:1498 — DockerPreparationSandboxRunner.prepareOffline has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 2 (5 pts), loops 4, boolean chains 1, ternaries 1 (nesting depth added 10). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.sarifCheckoutRoot (cognitive 31) · ×1
  • cli.sarifCheckoutRoot (cognitive 31) REDACTED:1715 — cli.sarifCheckoutRoot has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (13 pts), error handling 3 (8 pts), loops 3 (6 pts), boolean chains 2, ternaries 1 (2 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 · qa-deadline.runQaDeadlineCommand (cognitive 31) · ×1
  • qa-deadline.runQaDeadlineCommand (cognitive 31) lib/qa-deadline.ts:123 — qa-deadline.runQaDeadlineCommand has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (19 pts), error handling 3 (6 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 7). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 149, 138, 158, …). 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 · import-graph.blankDartComments (cognitive 31) · ×1
  • import-graph.blankDartComments (cognitive 31) lib/pregate/import-graph.ts:138 — import-graph.blankDartComments has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (4 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 · timing.clockVariables (cognitive 31) · ×1
  • timing.clockVariables (cognitive 31) lib/pregate/checks/timing.ts:54 — timing.clockVariables has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 18). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qa-evidence.materialize (cognitive 31) · ×1
  • qa-evidence.materialize (cognitive 31) REDACTED:312 — qa-evidence.materialize has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 10, if/else 8 (9 pts), loops 1 (nesting depth added 4). Of this number, 27 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · orchestrator.generate (cognitive 31) · ×1
  • orchestrator.generate (cognitive 31) make-pdf/src/orchestrator.ts:87 — orchestrator.generate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 5 (7 pts), boolean chains 3 (nesting depth added 9). Of this number, 29 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-measure.main (cognitive 31) · ×1
  • ship-measure.main (cognitive 31) REDACTED:769 — ship-measure.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (20 pts), ternaries 5 (6 pts), boolean chains 5 (nesting depth added 3). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · gstack-memory-ingest.runLocked (cognitive 30) · ×1
  • gstack-memory-ingest.runLocked (cognitive 30) bin/gstack-memory-ingest.ts:3189 — gstack-memory-ingest.runLocked has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 5, ternaries 2 (3 pts), error handling 1 (nesting depth added 8). Of this number, 29 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime-pins.evaluatePins (cognitive 30) · ×1
  • runtime-pins.evaluatePins (cognitive 30) lib/runtime-pins.ts:206 — runtime-pins.evaluatePins has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 5 (9 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.startServer (cognitive 30) · ×1
  • cli.startServer (cognitive 30) browse/src/cli.ts:708 — cli.startServer has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, loops 2 (4 pts), error handling 1, ternaries 1 (nesting depth added 8). Of this number, 29 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · process.safeMetadata (cognitive 30) · ×1
  • process.safeMetadata (cognitive 30) lib/cso/process.ts:223 — process.safeMetadata has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 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.
D2 · Cognitive Complexity · PublicArchiveCache.materialize (cognitive 30) · ×1
  • PublicArchiveCache.materialize (cognitive 30) lib/cso/cache.ts:510 — PublicArchiveCache.materialize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 4 (10 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 12). Most of this is not in the body itself: 8 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 541). 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 · preparation-executor.validatePlan (cognitive 30) · ×1
  • preparation-executor.validatePlan (cognitive 30) lib/cso/preparation-executor.ts:388 — preparation-executor.validatePlan has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 16, if/else 10 (12 pts), loops 2 (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 · evidence-bundle.verifyBundle (cognitive 30) · ×1
  • evidence-bundle.verifyBundle (cognitive 30) lib/evidence-bundle.ts:211 — evidence-bundle.verifyBundle has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 4 (9 pts), boolean chains 3, loops 1 (nesting depth added 14). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · timing.boundKind (cognitive 30) · ×1
  • timing.boundKind (cognitive 30) lib/pregate/checks/timing.ts:102 — timing.boundKind has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 5 (6 pts), boolean chains 4 (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 · timing.scanTiming (cognitive 30) · ×1
  • timing.scanTiming (cognitive 30) lib/pregate/checks/timing.ts:156 — timing.scanTiming has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 14). Of this number, 26 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · restamp.restamp (cognitive 30) · ×1
  • restamp.restamp (cognitive 30) REDACTED:502 — restamp.restamp has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 2 (6 pts), boolean chains 4, error handling 2 (3 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 · state-matrix.checkMatrix (cognitive 30) · ×1
  • state-matrix.checkMatrix (cognitive 30) lib/state-matrix.ts:92 — state-matrix.checkMatrix has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 15). Of this number, 28 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · replay-pr-selection.loadInput (cognitive 30) · ×1
  • replay-pr-selection.loadInput (cognitive 30) scripts/replay-pr-selection.ts:129 — replay-pr-selection.loadInput has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (7 pts), error handling 1 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 13). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · skill-check.ignoredGeneratedPaths (cognitive 30) · ×1
  • skill-check.ignoredGeneratedPaths (cognitive 30) scripts/skill-check.ts:84 — skill-check.ignoredGeneratedPaths has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 2 (6 pts), loops 3 (4 pts), ternaries 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 · phase-publication-hook.invocation (cognitive 29) · ×1
  • phase-publication-hook.invocation (cognitive 29) autoplan/bin/phase-publication-hook.ts:267 — phase-publication-hook.invocation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 8, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · design-md.tokensFlat (cognitive 29) · ×1
  • design-md.tokensFlat (cognitive 29) REDACTED:367 — design-md.tokensFlat has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 10). Of this number, 20 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transcript-consent.guardUnpublished (cognitive 29) · ×1
  • transcript-consent.guardUnpublished (cognitive 29) lib/transcript-consent.ts:354 — transcript-consent.guardUnpublished has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aside-render.buildRenderScript (cognitive 29) · ×1
  • aside-render.buildRenderScript (cognitive 29) lib/aside-render.ts:203 — aside-render.buildRenderScript has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 1 (2 pts) (nesting depth added 12). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 220). 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 · activity.filterArgs (cognitive 29) · ×1
  • activity.filterArgs (cognitive 29) browse/src/activity.ts:54 — activity.filterArgs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). Of this number, 18 points are the body's own statements and 11 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 · daemon.fetchHandler (cognitive 29) · ×1
  • daemon.fetchHandler (cognitive 29) design/src/daemon.ts:476 — daemon.fetchHandler has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 10 (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 · gen-accessors.snapshotTypeIssue (cognitive 29) · ×1
  • gen-accessors.snapshotTypeIssue (cognitive 29) ios-qa/scripts/gen-accessors.ts:573 — gen-accessors.snapshotTypeIssue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 3, ternaries 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 · headless-artifacts.findCycle (cognitive 29) · ×1
  • headless-artifacts.findCycle (cognitive 29) lib/headless-artifacts.ts:327 — headless-artifacts.findCycle has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 3 (7 pts), loops 4 (nesting depth added 14). Of this number, 16 points are the body's own statements and 13 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.releaseKnownLease (cognitive 29) · ×1
  • state.releaseKnownLease (cognitive 29) lib/cso/state.ts:1836 — state.releaseKnownLease has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 12, error handling 3, ternaries 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.
D2 · Cognitive Complexity · verification.directPackageTest (cognitive 29) · ×1
  • verification.directPackageTest (cognitive 29) lib/cso/verification.ts:419 — verification.directPackageTest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (9 pts), boolean chains 6, 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 · ship-queue-train-verdict.trainVerdict (cognitive 29) · ×1
  • ship-queue-train-verdict.trainVerdict (cognitive 29) lib/ship-queue-train-verdict.ts:102 — ship-queue-train-verdict.trainVerdict has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 6 (11 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 · ship-queue-train-verdict.trainBisect (cognitive 29) · ×1
  • ship-queue-train-verdict.trainBisect (cognitive 29) lib/ship-queue-train-verdict.ts:237 — ship-queue-train-verdict.trainBisect has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 4, loops 3, ternaries 1 (nesting depth added 5). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · phase-publication-hook.requirePublication (cognitive 28) · ×1
  • phase-publication-hook.requirePublication (cognitive 28) autoplan/bin/phase-publication-hook.ts:442 — phase-publication-hook.requirePublication has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 10, loops 2 (3 pts), ternaries 3 (nesting depth added 3). Of this number, 22 points are the body's own statements and 6 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · chromium-profiles.runProfilesCommand (cognitive 28) · ×1
  • chromium-profiles.runProfilesCommand (cognitive 28) browse/src/chromium-profiles.ts:170 — chromium-profiles.runProfilesCommand has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 3 (7 pts), loops 2 (4 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 · cdp-inspector.formatInspectorResult (cognitive 28) · ×1
  • cdp-inspector.formatInspectorResult (cognitive 28) browse/src/cdp-inspector.ts:722 — cdp-inspector.formatInspectorResult has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 5 (9 pts), ternaries 5 (9 pts) (nesting depth added 11). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serve.serve (cognitive 28) · ×1
  • serve.serve (cognitive 28) design/src/serve.ts:55 — serve.serve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 8, error handling 2, ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to 2 function items inside it that branch (handleFeedback, handleReload). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · claude-code.parseClaudeCodeResult (cognitive 28) · ×1
  • claude-code.parseClaudeCodeResult (cognitive 28) lib/claude-code.ts:109 — claude-code.parseClaudeCodeResult has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6, ternaries 3 (4 pts), error handling 1 (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 · preparation.inspectBun (cognitive 28) · ×1
  • preparation.inspectBun (cognitive 28) REDACTED:381 — preparation.inspectBun has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (6 pts), boolean chains 4, ternaries 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 · preparation-container.download (cognitive 28) · ×1
  • preparation-container.download (cognitive 28) REDACTED:424 — preparation-container.download has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (6 pts), boolean chains 5 (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 · scanner-catalog.validateScannerCatalog (cognitive 28) · ×1
  • scanner-catalog.validateScannerCatalog (cognitive 28) REDACTED:177 — scanner-catalog.validateScannerCatalog has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7, loops 3 (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.
D2 · Cognitive Complexity · cli.finish (cognitive 28) · ×1
  • cli.finish (cognitive 28) REDACTED:1509 — cli.finish has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 7, loops 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 1512, 1546, 1527, …). 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 · dx-error-capture.release (cognitive 28) · ×1
  • dx-error-capture.release (cognitive 28) lib/dx-error-capture.ts:311 — dx-error-capture.release has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 4, ternaries 2 (4 pts), boolean chains 3 (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 · restamp.applyToBranch (cognitive 28) · ×1
  • restamp.applyToBranch (cognitive 28) REDACTED:438 — restamp.applyToBranch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 2 (4 pts), loops 3, boolean chains 1 (nesting depth added 11). Of this number, 18 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue-train.admitSlots (cognitive 28) · ×1
  • ship-queue-train.admitSlots (cognitive 28) lib/ship-queue-train.ts:282 — ship-queue-train.admitSlots has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3 (8 pts), boolean chains 3, 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 · ship-queue-train.freePhase (cognitive 28) · ×1
  • ship-queue-train.freePhase (cognitive 28) lib/ship-queue-train.ts:375 — ship-queue-train.freePhase has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 7, if/else 5 (6 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue-train-ready.trainReady (cognitive 28) · ×1
  • ship-queue-train-ready.trainReady (cognitive 28) lib/ship-queue-train-ready.ts:96 — ship-queue-train-ready.trainReady has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 4 (8 pts), boolean chains 4 (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 · analytics.formatReport (cognitive 28) · ×1
  • analytics.formatReport (cognitive 28) scripts/analytics.ts:69 — analytics.formatReport has cognitive complexity 28 (threshold 15). Drivers by points: loops 6 (9 pts), ternaries 5 (9 pts), if/else 5 (7 pts), boolean chains 3 (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 · cso-scanner-matrix.scannerBuildMatrix (cognitive 28) · ×1
  • cso-scanner-matrix.scannerBuildMatrix (cognitive 28) scripts/cso-scanner-matrix.ts:94 — cso-scanner-matrix.scannerBuildMatrix has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (8 pts), boolean chains 6, 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 · claude-journal-records.signatureField (cognitive 27) · ×1
  • claude-journal-records.signatureField (cognitive 27) lib/claude-journal-records.ts:98 — claude-journal-records.signatureField has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). Of this number, 20 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-owned-journal.scan · ×1
  • claude-owned-journal.scan::record (cognitive 27) lib/claude-owned-journal.ts:140 — claude-owned-journal.scan::record has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7, loops 2 (5 pts), error handling 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. This shape REPEATS in the file: one other method here (claude-owned-journal.scan) 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 · gstack-design-detect.install (cognitive 27) · ×1
  • gstack-design-detect.install (cognitive 27) bin/gstack-design-detect.ts:632 — gstack-design-detect.install has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 5, boolean chains 4, ternaries 2, loops 1 (nesting depth added 2). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · gstack-memory-ingest.transcriptPrefix (cognitive 27) · ×1
  • gstack-memory-ingest.transcriptPrefix (cognitive 27) bin/gstack-memory-ingest.ts:1280 — gstack-memory-ingest.transcriptPrefix has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, error handling 2 (3 pts), loops 2, ternaries 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 · gstack-gbrain-sync.runMemoryIngest (cognitive 27) · ×1
  • gstack-gbrain-sync.runMemoryIngest (cognitive 27) bin/gstack-gbrain-sync.ts:1540 — gstack-gbrain-sync.runMemoryIngest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 4 (7 pts), boolean chains 4 (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 · path-security.validateOutputPath (cognitive 27) · ×1
  • path-security.validateOutputPath (cognitive 27) browse/src/path-security.ts:69 — path-security.validateOutputPath has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 2 (6 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 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 · BrowserManager.close (cognitive 27) · ×1
  • BrowserManager.close (cognitive 27) browse/src/browser-manager.ts:1086 — BrowserManager.close has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, error handling 2 (7 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · browser-skills.listBrowserSkills (cognitive 27) · ×1
  • browser-skills.listBrowserSkills (cognitive 27) browse/src/browser-skills.ts:322 — browser-skills.listBrowserSkills has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 3 (8 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 · cookie-import-operation.parseCookieImportArgs (cognitive 27) · ×1
  • cookie-import-operation.parseCookieImportArgs (cognitive 27) browse/src/cookie-import-operation.ts:25 — cookie-import-operation.parseCookieImportArgs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, 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 · security.combineVerdict (cognitive 27) · ×1
  • security.combineVerdict (cognitive 27) browse/src/security.ts:148 — security.combineVerdict has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 3, loops 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 · variants.runBriefsBatch (cognitive 27) · ×1
  • variants.runBriefsBatch (cognitive 27) design/src/variants.ts:349 — variants.runBriefsBatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 4 (6 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 5). None of this is in the body itself: all 27 points belong to 4 function items inside it that branch (runOne, runOne::attempt, runOne::check, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · gate-list.validateGateList (cognitive 27) · ×1
  • gate-list.validateGateList (cognitive 27) lib/gate-list.ts:60 — gate-list.validateGateList has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 9 (nesting depth added 3). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 69). 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 · contracts.validateVerificationRequest (cognitive 27) · ×1
  • contracts.validateVerificationRequest (cognitive 27) lib/cso/contracts.ts:724 — contracts.validateVerificationRequest has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 11, ternaries 4, loops 1. Of this number, 20 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · cli.verify (cognitive 27) · ×1
  • cli.verify (cognitive 27) REDACTED:2304 — cli.verify has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 3 (7 pts), boolean chains 5, error handling 2 (nesting depth added 5). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 2309, 2316). 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 · pr-shots.pathSides (cognitive 27) · ×1
  • pr-shots.pathSides (cognitive 27) lib/pr-shots.ts:75 — pr-shots.pathSides has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 8 (9 pts), boolean chains 5, loops 1 (nesting depth added 5). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · import-graph.stripJsonc (cognitive 27) · ×1
  • import-graph.stripJsonc (cognitive 27) lib/pregate/import-graph.ts:178 — import-graph.stripJsonc has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 3 (5 pts), ternaries 1 (3 pts) (nesting depth added 11). Of this number, 20 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · restamp.planVersions (cognitive 27) · ×1
  • restamp.planVersions (cognitive 27) REDACTED:144 — restamp.planVersions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (7 pts), boolean chains 5, error handling 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 · ship-queue-train.newTrain (cognitive 27) · ×1
  • ship-queue-train.newTrain (cognitive 27) lib/ship-queue-train.ts:314 — ship-queue-train.newTrain has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 8, if/else 8 (nesting depth added 3). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, 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 · ship-queue-train.buildTrain (cognitive 27) · ×1
  • ship-queue-train.buildTrain (cognitive 27) lib/ship-queue-train.ts:443 — ship-queue-train.buildTrain has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diagram-prepass.extractDiagramFences (cognitive 27) · ×1
  • diagram-prepass.extractDiagramFences (cognitive 27) make-pdf/src/diagram-prepass.ts:112 — diagram-prepass.extractDiagramFences has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, loops 2 (4 pts) (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 · eval-flake-rank.loadPassRateHistory (cognitive 27) · ×1
  • eval-flake-rank.loadPassRateHistory (cognitive 27) scripts/eval-flake-rank.ts:587 — eval-flake-rank.loadPassRateHistory has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (8 pts), loops 3 (7 pts), boolean chains 6, if/else 3 (4 pts), error handling 1 (2 pts) (nesting depth added 10). Of this number, 24 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · script-invocation.resolveWindowsBash (cognitive 26) · ×1
  • script-invocation.resolveWindowsBash (cognitive 26) lib/script-invocation.ts:87 — script-invocation.resolveWindowsBash has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 3 (4 pts), boolean chains 3, 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 · remote-identity.canonicalRemote (cognitive 26) · ×1
  • remote-identity.canonicalRemote (cognitive 26) lib/remote-identity.ts:38 — remote-identity.canonicalRemote has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proxy-config.noProxyToChromiumRules (cognitive 26) · ×1
  • proxy-config.noProxyToChromiumRules (cognitive 26) browse/src/proxy-config.ts:195 — proxy-config.noProxyToChromiumRules has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, 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 · cli.acquireServerLock (cognitive 26) · ×1
  • cli.acquireServerLock (cognitive 26) browse/src/cli.ts:856 — cli.acquireServerLock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · outside-review-result.classifyOutsideReview (cognitive 26) · ×1
  • outside-review-result.classifyOutsideReview (cognitive 26) lib/outside-review-result.ts:242 — outside-review-result.classifyOutsideReview has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 8 (9 pts), boolean chains 7 (nesting depth added 4). Of this number, 24 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · preparation-executor.validateClosure (cognitive 26) · ×1
  • preparation-executor.validateClosure (cognitive 26) lib/cso/preparation-executor.ts:602 — preparation-executor.validateClosure has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, error handling 2 (3 pts), loops 2 (nesting depth added 6). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eval-plan.resolveArms (cognitive 26) · ×1
  • eval-plan.resolveArms (cognitive 26) lib/eval-plan.ts:173 — eval-plan.resolveArms has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (5 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 11). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-post.resolveRemote (cognitive 26) · ×1
  • gstack-post.resolveRemote (cognitive 26) lib/gstack-post.ts:134 — gstack-post.resolveRemote has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 5 (7 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · django.settingsModules (cognitive 26) · ×1
  • django.settingsModules (cognitive 26) lib/pregate/django.ts:50 — django.settingsModules has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts), ternaries 2 (4 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 · rust.componentMatch (cognitive 26) · ×1
  • rust.componentMatch (cognitive 26) lib/pregate/rust.ts:54 — rust.componentMatch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 5 (8 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 8). Of this number, 16 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 · pr-dependencies.deriveDependencies.consumers (cognitive 26) · ×1
  • pr-dependencies.deriveDependencies.consumers (cognitive 26) scripts/pr-dependencies.ts:246 — pr-dependencies.deriveDependencies.consumers has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 4 (10 pts), loops 4 (9 pts), if/else 2 (6 pts), boolean chains 1 (nesting depth added 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pr-dependencies.exercisedConsumers.closure (cognitive 26) · ×1
  • pr-dependencies.exercisedConsumers.closure (cognitive 26) scripts/pr-dependencies.ts:570 — pr-dependencies.exercisedConsumers.closure has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (7 pts), ternaries 3 (6 pts), boolean chains 3 (nesting depth added 11). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-eval-producer.inventoryProducerArtifacts (cognitive 26) · ×1
  • cso-eval-producer.inventoryProducerArtifacts (cognitive 26) scripts/cso-eval-producer.ts:210 — cso-eval-producer.inventoryProducerArtifacts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, ternaries 2 (3 pts), error handling 1 (2 pts), loops 2 (nesting depth added 10). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 2 function items inside it that branch (visit, a function literal at line 237). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · cso-eval.collectProducerReceipts (cognitive 26) · ×1
  • cso-eval.collectProducerReceipts (cognitive 26) scripts/cso-eval.ts:512 — cso-eval.collectProducerReceipts has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 5 (6 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 6). Of this number, 17 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · plan-gates.generateExitPlanModeGate (cognitive 26) · ×1
  • plan-gates.generateExitPlanModeGate (cognitive 26) scripts/resolvers/plan-gates.ts:62 — plan-gates.generateExitPlanModeGate has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (23 pts), if/else 3 (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 · gstack-design-detect.pluginCacheImpeccableSkillDirs (cognitive 25) · ×1
  • gstack-design-detect.pluginCacheImpeccableSkillDirs (cognitive 25) bin/gstack-design-detect.ts:296 — gstack-design-detect.pluginCacheImpeccableSkillDirs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), error handling 2 (5 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 13). Of this number, 20 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-gbrain-sync.pruneGoneWorktrees (cognitive 25) · ×1
  • gstack-gbrain-sync.pruneGoneWorktrees (cognitive 25) bin/gstack-gbrain-sync.ts:2122 — gstack-gbrain-sync.pruneGoneWorktrees has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (9 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 7). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-global-discover.extractCwdFromJsonl (cognitive 25) · ×1
  • gstack-global-discover.extractCwdFromJsonl (cognitive 25) bin/gstack-global-discover.ts:281 — gstack-global-discover.extractCwdFromJsonl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (5 pts), error handling 3, loops 2 (3 pts), boolean chains 2 (nesting depth added 8). Of this number, 17 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrowserManager.syncActiveTabByUrl (cognitive 25) · ×1
  • BrowserManager.syncActiveTabByUrl (cognitive 25) browse/src/browser-manager.ts:1260 — BrowserManager.syncActiveTabByUrl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cdp-inspector.modifyStyle (cognitive 25) · ×1
  • cdp-inspector.modifyStyle (cognitive 25) browse/src/cdp-inspector.ts:495 — cdp-inspector.modifyStyle has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.handleTailnet (cognitive 25) · ×1
  • index.handleTailnet (cognitive 25) ios-qa/daemon/src/index.ts:481 — index.handleTailnet has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4 (8 pts), boolean chains 3, error handling 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 · headless-artifacts.checkSchema (cognitive 25) · ×1
  • headless-artifacts.checkSchema (cognitive 25) lib/headless-artifacts.ts:245 — headless-artifacts.checkSchema has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 2 (4 pts), ternaries 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 · autoplan-checkpoint.exclusive (cognitive 25) · ×1
  • autoplan-checkpoint.exclusive (cognitive 25) lib/autoplan-checkpoint.ts:60 — autoplan-checkpoint.exclusive has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 4 (10 pts), boolean chains 3, 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 · plan-reality.checkRealityRows (cognitive 25) · ×1
  • plan-reality.checkRealityRows (cognitive 25) lib/plan-reality.ts:260 — plan-reality.checkRealityRows has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, loops 3, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-gate.capItems (cognitive 25) · ×1
  • autoplan-gate.capItems (cognitive 25) lib/autoplan-gate.ts:125 — autoplan-gate.capItems has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 2 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 13). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · contracts.assertion (cognitive 25) · ×1
  • contracts.assertion (cognitive 25) lib/cso/contracts.ts:652 — contracts.assertion has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, ternaries 6, loops 1 (2 pts) (nesting depth added 4). Of this number, 13 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · process.executable (cognitive 25) · ×1
  • process.executable (cognitive 25) lib/cso/process.ts:32 — process.executable has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 2 (5 pts), loops 2 (3 pts), ternaries 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 · scanner-executor.validateScannerRequest (cognitive 25) · ×1
  • scanner-executor.validateScannerRequest (cognitive 25) lib/cso/scanner-executor.ts:208 — scanner-executor.validateScannerRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 12, loops 3 (4 pts), ternaries 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. This shape REPEATS in the file: one other method here (scanner-executor.validateScannerRequest::inspect) 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 · sealed-guard.textFindings (cognitive 25) · ×1
  • sealed-guard.textFindings (cognitive 25) lib/sealed-guard.ts:151 — sealed-guard.textFindings has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (3 pts), boolean chains 1, ternaries 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 · gbrain-supabase-provision.cmdWait (cognitive 25) · ×1
  • gbrain-supabase-provision.cmdWait (cognitive 25) lib/gbrain-supabase-provision.ts:403 — gbrain-supabase-provision.cmdWait has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 2, 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 · gbrain-supabase-provision.cmdListOrphans (cognitive 25) · ×1
  • gbrain-supabase-provision.cmdListOrphans (cognitive 25) lib/gbrain-supabase-provision.ts:530 — gbrain-supabase-provision.cmdListOrphans has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 10). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lane-ownership.laneCheck (cognitive 25) · ×1
  • lane-ownership.laneCheck (cognitive 25) lib/lane-ownership.ts:68 — lane-ownership.laneCheck has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (8 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context.touchedFiles (cognitive 25) · ×1
  • context.touchedFiles (cognitive 25) lib/pregate/context.ts:108 — context.touchedFiles has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 3 (6 pts), boolean chains 3, loops 2 (nesting depth added 12). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · secrets.run (cognitive 25) · ×1
  • secrets.run (cognitive 25) lib/pregate/checks/secrets.ts:51 — secrets.run has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts), ternaries 3 (5 pts), error handling 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 19 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · garry-output-comparison.main (cognitive 25) · ×1
  • garry-output-comparison.main (cognitive 25) REDACTED:314 — garry-output-comparison.main has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, ternaries 9, if/else 6 (7 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · judge-calibration.main (cognitive 25) · ×1
  • judge-calibration.main (cognitive 25) scripts/judge-calibration.ts:325 — judge-calibration.main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 3 (6 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-phase-publication.withResultWithdrawn (cognitive 24) · ×1
  • autoplan-phase-publication.withResultWithdrawn (cognitive 24) REDACTED:34 — autoplan-phase-publication.withResultWithdrawn has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, 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 · browser-skills.parseFrontmatterFields (cognitive 24) · ×1
  • browser-skills.parseFrontmatterFields (cognitive 24) browse/src/browser-skills.ts:188 — browser-skills.parseFrontmatterFields has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 3, loops 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 · cdp-inspector.undoModification (cognitive 24) · ×1
  • cdp-inspector.undoModification (cognitive 24) browse/src/cdp-inspector.ts:612 — cdp-inspector.undoModification has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). Of this number, 12 points are the body's own statements and 12 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 · terminal-agent-control.acquireAgentStateLock (cognitive 24) · ×1
  • terminal-agent-control.acquireAgentStateLock (cognitive 24) browse/src/terminal-agent-control.ts:88 — terminal-agent-control.acquireAgentStateLock has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (nesting depth added 8). 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 · terminal-agent-control.spawnTerminalAgent (cognitive 24) · ×1
  • terminal-agent-control.spawnTerminalAgent (cognitive 24) browse/src/terminal-agent-control.ts:189 — terminal-agent-control.spawnTerminalAgent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, error handling 4 (5 pts), ternaries 1 (nesting depth added 4). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · read-commands.parseOutArgs (cognitive 24) · ×1
  • read-commands.parseOutArgs (cognitive 24) browse/src/read-commands.ts:154 — read-commands.parseOutArgs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · daemon-client.ensureDaemon (cognitive 24) · ×1
  • daemon-client.ensureDaemon (cognitive 24) REDACTED:89 — daemon-client.ensureDaemon has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 1 (2 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 · content.basicBuildSelector (cognitive 24) · ×1
  • content.basicBuildSelector (cognitive 24) extension/content.js:219 — content.basicBuildSelector has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · headless-artifacts.validateRun (cognitive 24) · ×1
  • headless-artifacts.validateRun (cognitive 24) lib/headless-artifacts.ts:424 — headless-artifacts.validateRun has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (4 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-checkpoint.checkpointRun (cognitive 24) · ×1
  • autoplan-checkpoint.checkpointRun (cognitive 24) lib/autoplan-checkpoint.ts:139 — autoplan-checkpoint.checkpointRun has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (6 pts), boolean chains 4, loops 3, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 148). 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 · autoplan-confirm.lineDiff (cognitive 24) · ×1
  • autoplan-confirm.lineDiff (cognitive 24) lib/autoplan-confirm.ts:24 — autoplan-confirm.lineDiff has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 8). 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 · autoplan-run.initRun (cognitive 24) · ×1
  • autoplan-run.initRun (cognitive 24) REDACTED:77 — autoplan-run.initRun has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 8, boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ci-gate.parseCiGateArgs (cognitive 24) · ×1
  • ci-gate.parseCiGateArgs (cognitive 24) lib/ci-gate.ts:231 — ci-gate.parseCiGateArgs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, match/switch 1 (2 pts), loops 1, ternaries 1 (nesting depth added 8). Of this number, 20 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.readOwner (cognitive 24) · ×1
  • state.readOwner (cognitive 24) lib/cso/state.ts:1110 — state.readOwner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, error handling 3 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · preparation.railsDatabaseConfiguration (cognitive 24) · ×1
  • preparation.railsDatabaseConfiguration (cognitive 24) REDACTED:1068 — preparation.railsDatabaseConfiguration has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 6). Of this number, 21 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PreparationExecutor.prepareOffline (cognitive 24) · ×1
  • PreparationExecutor.prepareOffline (cognitive 24) lib/cso/preparation-executor.ts:1372 — PreparationExecutor.prepareOffline has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 2 (4 pts), boolean chains 3 (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 · scanner-catalog.validateQualifiedScanner (cognitive 24) · ×1
  • scanner-catalog.validateQualifiedScanner (cognitive 24) REDACTED:110 — scanner-catalog.validateQualifiedScanner has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 10, ternaries 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.
D2 · Cognitive Complexity · cli.bindRecheckEvidence (cognitive 24) · ×1
  • cli.bindRecheckEvidence (cognitive 24) REDACTED:1181 — cli.bindRecheckEvidence has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8, error handling 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 1190). 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 · eval-plan.runPreregDiagnostics (cognitive 24) · ×1
  • eval-plan.runPreregDiagnostics (cognitive 24) lib/eval-plan.ts:114 — eval-plan.runPreregDiagnostics has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 6 (7 pts), boolean chains 3, loops 2, error handling 1 (nesting depth added 7). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tags.tagHunk (cognitive 24) · ×1
  • tags.tagHunk (cognitive 24) lib/gate-diff/tags.ts:226 — tags.tagHunk has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 8, loops 1 (2 pts), ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ship-queue-train-verdict.classifyGate (cognitive 24) · ×1
  • ship-queue-train-verdict.classifyGate (cognitive 24) lib/ship-queue-train-verdict.ts:52 — ship-queue-train-verdict.classifyGate has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (12 pts), if/else 7, boolean chains 5 (nesting depth added 1). Of this number, 22 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · toc-pages.pdfDestinationPages (cognitive 24) · ×1
  • toc-pages.pdfDestinationPages (cognitive 24) REDACTED:94 — toc-pages.pdfDestinationPages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 4 (6 pts), ternaries 2, boolean chains 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · eval-history.headroom (cognitive 24) · ×1
  • eval-history.headroom (cognitive 24) scripts/lib/eval-history.ts:58 — eval-history.headroom has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 4 (8 pts), boolean chains 3, loops 2 (nesting depth added 10). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 61, 79). 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 · eval-flake-rank.quarantinePolicyProblems (cognitive 24) · ×1
  • eval-flake-rank.quarantinePolicyProblems (cognitive 24) scripts/eval-flake-rank.ts:413 — eval-flake-rank.quarantinePolicyProblems has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-scanner-catalog.scannerCatalogProposal (cognitive 24) · ×1
  • cso-scanner-catalog.scannerCatalogProposal (cognitive 24) scripts/cso-scanner-catalog.ts:63 — cso-scanner-catalog.scannerCatalogProposal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 7). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-scanner-catalog.scannerAssetHash (cognitive 24) · ×1
  • cso-scanner-catalog.scannerAssetHash (cognitive 24) scripts/cso-scanner-catalog.ts:115 — cso-scanner-catalog.scannerAssetHash has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, 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 · outside-voice.outsideVoiceCommand (cognitive 24) · ×1
  • outside-voice.outsideVoiceCommand (cognitive 24) scripts/resolvers/outside-voice.ts:106 — outside-voice.outsideVoiceCommand has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 15 (20 pts), boolean chains 4 (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 · ship-measure-sweep.planSweep (cognitive 24) · ×1
  • ship-measure-sweep.planSweep (cognitive 24) scripts/ship-measure-sweep.ts:83 — ship-measure-sweep.planSweep has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (7 pts), if/else 3 (6 pts), loops 2 (nesting depth added 5). Of this number, 16 points are the body's own statements and 8 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 · GenAccessors.main (cognitive 24) · ×1
  • GenAccessors.main (cognitive 24) ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift:23 — GenAccessors.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (4 pts), loops 3 (4 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 · phase-publication-hook.consumption (cognitive 23) · ×1
  • phase-publication-hook.consumption (cognitive 23) autoplan/bin/phase-publication-hook.ts:188 — phase-publication-hook.consumption has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-memory-ingest.parseArgs (cognitive 23) · ×1
  • gstack-memory-ingest.parseArgs (cognitive 23) bin/gstack-memory-ingest.ts:320 — gstack-memory-ingest.parseArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, ternaries 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-memory-ingest.importAndApply (cognitive 23) · ×1
  • gstack-memory-ingest.importAndApply (cognitive 23) bin/gstack-memory-ingest.ts:2742 — gstack-memory-ingest.importAndApply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, ternaries 1 (3 pts), loops 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 · url-validation.normalizeFileUrl (cognitive 23) · ×1
  • url-validation.normalizeFileUrl (cognitive 23) REDACTED:129 — url-validation.normalizeFileUrl has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 5, ternaries 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · xvfb.awaitXvfbReady (cognitive 23) · ×1
  • xvfb.awaitXvfbReady (cognitive 23) browse/src/xvfb.ts:217 — xvfb.awaitXvfbReady has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (7 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · browser-skill-commands.buildSpawnEnv (cognitive 23) · ×1
  • browser-skill-commands.buildSpawnEnv (cognitive 23) browse/src/browser-skill-commands.ts:416 — browser-skill-commands.buildSpawnEnv has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (6 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 · meta-commands.buildPdfOptions (cognitive 23) · ×1
  • meta-commands.buildPdfOptions (cognitive 23) browse/src/meta-commands.ts:191 — meta-commands.buildPdfOptions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 3 (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 · generate.generate (cognitive 23) · ×1
  • generate.generate (cognitive 23) design/src/generate.ts:101 — generate.generate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (7 pts), boolean chains 3, error handling 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 · sidepanel.tryConnect (cognitive 23) · ×1
  • sidepanel.tryConnect (cognitive 23) extension/sidepanel.js:1250 — sidepanel.tryConnect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (6 pts), boolean chains 4, error handling 1 (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · spawn-bin.runExternal (cognitive 23) · ×1
  • spawn-bin.runExternal (cognitive 23) hosts/claude/hooks/spawn-bin.ts:112 — spawn-bin.runExternal has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (14 pts), error handling 5 (6 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 145, 118, 141, …). 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 · proxy.proxyToDevice (cognitive 23) · ×1
  • proxy.proxyToDevice (cognitive 23) REDACTED:35 — proxy.proxyToDevice has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 71, 83, 100, …). 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 · index.handleLoopback (cognitive 23) · ×1
  • index.handleLoopback (cognitive 23) ios-qa/daemon/src/index.ts:395 — index.handleLoopback has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 1 (3 pts), error handling 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 · autoplan-export.buildTasks (cognitive 23) · ×1
  • autoplan-export.buildTasks (cognitive 23) lib/autoplan-export.ts:23 — autoplan-export.buildTasks has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-public.exportPublic (cognitive 23) · ×1
  • autoplan-public.exportPublic (cognitive 23) lib/autoplan-public.ts:134 — autoplan-public.exportPublic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 pts), boolean chains 4, error handling 1 (2 pts), loops 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 · outside-review-result.execution (cognitive 23) · ×1
  • outside-review-result.execution (cognitive 23) lib/outside-review-result.ts:88 — outside-review-result.execution has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 4 (7 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 · model-policy.codexSignals (cognitive 23) · ×1
  • model-policy.codexSignals (cognitive 23) lib/model-policy.ts:453 — model-policy.codexSignals has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, ternaries 2 (3 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 · PublicArchiveCache.withLock (cognitive 23) · ×1
  • PublicArchiveCache.withLock (cognitive 23) lib/cso/cache.ts:964 — PublicArchiveCache.withLock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 8). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · snapshot.rejectSpecialFiles (cognitive 23) · ×1
  • snapshot.rejectSpecialFiles (cognitive 23) lib/cso/snapshot.ts:541 — snapshot.rejectSpecialFiles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3, ternaries 2 (3 pts), boolean chains 2 (nesting depth added 7). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, ignoredDirectory). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · guards.run (cognitive 23) · ×1
  • guards.run (cognitive 23) lib/pregate/checks/guards.ts:36 — guards.run has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 7 (8 pts), loops 2, boolean chains 1 (nesting depth added 7). Of this number, 19 points are the body's own statements and 4 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 · ship-receipt.computeCensus (cognitive 23) · ×1
  • ship-receipt.computeCensus (cognitive 23) lib/ship-receipt.ts:139 — ship-receipt.computeCensus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 3, boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue-train-verdict.trainRebuild (cognitive 23) · ×1
  • ship-queue-train-verdict.trainRebuild (cognitive 23) lib/ship-queue-train-verdict.ts:304 — ship-queue-train-verdict.trainRebuild has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue-train-verify.verifyTrain (cognitive 23) · ×1
  • ship-queue-train-verify.verifyTrain (cognitive 23) lib/ship-queue-train-verify.ts:102 — ship-queue-train-verify.verifyTrain has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, ternaries 7 (8 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · eval-history.triageRun (cognitive 23) · ×1
  • eval-history.triageRun (cognitive 23) scripts/lib/eval-history.ts:252 — eval-history.triageRun has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (18 pts), if/else 5 (14 pts), loops 4 (8 pts), boolean chains 4, error handling 1 (3 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 shape REPEATS in the file: one other method here (eval-history.triageRun::planFor) 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 · cso-eval-producer.validateSource (cognitive 23) · ×1
  • cso-eval-producer.validateSource (cognitive 23) scripts/cso-eval-producer.ts:109 — cso-eval-producer.validateSource has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (8 pts), boolean chains 3, loops 2 (nesting depth added 8). Of this number, 15 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gen-llms-txt.parseSkillFrontmatter (cognitive 23) · ×1
  • gen-llms-txt.parseSkillFrontmatter (cognitive 23) scripts/gen-llms-txt.ts:45 — gen-llms-txt.parseSkillFrontmatter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 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 · outside-voice.outsideVoicePreflight (cognitive 23) · ×1
  • outside-voice.outsideVoicePreflight (cognitive 23) scripts/resolvers/outside-voice.ts:50 — outside-voice.outsideVoicePreflight has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 4, if/else 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gen-skill-docs.parseGenerationArgs (cognitive 23) · ×1
  • gen-skill-docs.parseGenerationArgs (cognitive 23) REDACTED:111 — gen-skill-docs.parseGenerationArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8, ternaries 7 (8 pts), boolean chains 7 (nesting depth added 1). Of this number, 18 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ship-measure.gstackRunner (cognitive 23) · ×1
  • ship-measure.gstackRunner (cognitive 23) REDACTED:644 — ship-measure.gstackRunner has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 4, if/else 1 (nesting depth added 7). None of this is in the body itself: all 23 points belong to 2 function literals inside it that branch (lines 645, 658). 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 · skill-check.validateGeneratedArtifact (cognitive 23) · ×1
  • skill-check.validateGeneratedArtifact (cognitive 23) scripts/skill-check.ts:42 — skill-check.validateGeneratedArtifact has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (8 pts), boolean chains 2, error handling 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 · memory-ingest-landing.reconcile (cognitive 22) · ×1
  • memory-ingest-landing.reconcile (cognitive 22) lib/memory-ingest-landing.ts:458 — memory-ingest-landing.reconcile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 9). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proxy-config.parseProxyConfig (cognitive 22) · ×1
  • proxy-config.parseProxyConfig (cognitive 22) browse/src/proxy-config.ts:45 — proxy-config.parseProxyConfig has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 6, if/else 6, error handling 1 (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 · cookie-import-native-worker.startMember (cognitive 22) · ×1
  • cookie-import-native-worker.startMember (cognitive 22) browse/src/cookie-import-native-worker.ts:134 — cookie-import-native-worker.startMember has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (8 pts), error handling 2 (4 pts), loops 1 (nesting depth added 10). None of this is in the body itself: all 22 points belong to 2 function literals inside it that branch (lines 166, 146). 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 · read-commands.isSingleParenOrIifeExpression (cognitive 22) · ×1
  • read-commands.isSingleParenOrIifeExpression (cognitive 22) browse/src/read-commands.ts:79 — read-commands.isSingleParenOrIifeExpression has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, 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.
D2 · Cognitive Complexity · gallery.generateGalleryHtml (cognitive 22) · ×1
  • gallery.generateGalleryHtml (cognitive 22) design/src/gallery.ts:50 — gallery.generateGalleryHtml has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (7 pts), error handling 3 (6 pts), if/else 4 (6 pts), boolean chains 2, loops 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · bin-context.gitCommonDir (cognitive 22) · ×1
  • bin-context.gitCommonDir (cognitive 22) lib/bin-context.ts:167 — bin-context.gitCommonDir has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (5 pts), ternaries 1 (3 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 · autoplan-prompts.detectScope (cognitive 22) · ×1
  • autoplan-prompts.detectScope (cognitive 22) lib/autoplan-prompts.ts:55 — autoplan-prompts.detectScope has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (16 pts), boolean chains 6 (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 · autoplan-state.readState (cognitive 22) · ×1
  • autoplan-state.readState (cognitive 22) lib/autoplan-state.ts:99 — autoplan-state.readState has cognitive complexity 22 (threshold 15). Drivers by points: loops 4 (13 pts), if/else 3 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 12). Of this number, 19 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · context-bill.contextBillMain · ×1
  • context-bill.contextBillMain::exactFor (cognitive 22) lib/context-bill.ts:1264 — context-bill.contextBillMain::exactFor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (5 pts), error handling 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 shape REPEATS in the file: one other method here (context-bill.contextBillMain) 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 · process.boundedMetadataFile (cognitive 22) · ×1
  • process.boundedMetadataFile (cognitive 22) lib/cso/process.ts:341 — process.boundedMetadataFile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, error handling 3 (4 pts), ternaries 1 (2 pts), 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 · process.runProcess (cognitive 22) · ×1
  • process.runProcess (cognitive 22) lib/cso/process.ts:563 — process.runProcess has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 5, error handling 2. Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 650, 614, 599, …). 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 · state.ensureDirectory (cognitive 22) · ×1
  • state.ensureDirectory (cognitive 22) lib/cso/state.ts:689 — state.ensureDirectory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DockerPreparationSandboxRunner.acquire (cognitive 22) · ×1
  • DockerPreparationSandboxRunner.acquire (cognitive 22) lib/cso/preparation-docker.ts:1296 — DockerPreparationSandboxRunner.acquire has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 4, loops 3, 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 · scanner-executor.prepareDockerScannerApplication (cognitive 22) · ×1
  • scanner-executor.prepareDockerScannerApplication (cognitive 22) lib/cso/scanner-executor.ts:576 — scanner-executor.prepareDockerScannerApplication has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 4 (9 pts), boolean chains 2, ternaries 1 (nesting depth added 9). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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.recheckOriginalDirectory (cognitive 22) · ×1
  • cli.recheckOriginalDirectory (cognitive 22) REDACTED:1852 — cli.recheckOriginalDirectory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 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 · cli.preparedVerificationExecutor.observe (cognitive 22) · ×1
  • cli.preparedVerificationExecutor.observe (cognitive 22) REDACTED:2161 — cli.preparedVerificationExecutor.observe has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, ternaries 4 (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.
D2 · Cognitive Complexity · config.guardErrors (cognitive 22) · ×1
  • config.guardErrors (cognitive 22) lib/pregate/config.ts:94 — config.guardErrors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6, loops 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 99, 108). 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 · import-graph.effectiveOptions (cognitive 22) · ×1
  • import-graph.effectiveOptions (cognitive 22) lib/pregate/import-graph.ts:205 — import-graph.effectiveOptions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · import-graph.testsFor (cognitive 22) · ×1
  • import-graph.testsFor (cognitive 22) lib/pregate/import-graph.ts:500 — import-graph.testsFor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 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.
D2 · Cognitive Complexity · ship-queue-train-cli.trainMain (cognitive 22) · ×1
  • ship-queue-train-cli.trainMain (cognitive 22) lib/ship-queue-train-cli.ts:73 — ship-queue-train-cli.trainMain has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5 (nesting depth added 5). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-eval.validateCollectedBatch (cognitive 22) · ×1
  • cso-eval.validateCollectedBatch (cognitive 22) scripts/cso-eval.ts:848 — cso-eval.validateCollectedBatch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, loops 3 (4 pts), ternaries 1 (nesting depth added 4). Of this number, 21 points are the body's own statements and 1 belongs 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 · gen-llms-txt.generateLlmsTxt (cognitive 22) · ×1
  • gen-llms-txt.generateLlmsTxt (cognitive 22) scripts/gen-llms-txt.ts:138 — gen-llms-txt.generateLlmsTxt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 6 (8 pts), ternaries 1 (3 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 · ship-measure-sweep.runSweep (cognitive 22) · ×1
  • ship-measure-sweep.runSweep (cognitive 22) scripts/ship-measure-sweep.ts:246 — ship-measure-sweep.runSweep has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (8 pts), error handling 1 (2 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 · phase-publication-hook.verifyCloseEdits (cognitive 21) · ×1
  • phase-publication-hook.verifyCloseEdits (cognitive 21) autoplan/bin/phase-publication-hook.ts:405 — phase-publication-hook.verifyCloseEdits has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, loops 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · browser-skills.collectArgsList (cognitive 21) · ×1
  • browser-skills.collectArgsList (cognitive 21) browse/src/browser-skills.ts:266 — browser-skills.collectArgsList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (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.
D2 · Cognitive Complexity · cli.tunnelRevoke (cognitive 21) · ×1
  • cli.tunnelRevoke (cognitive 21) browse/src/cli.ts:1447 — cli.tunnelRevoke has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3 (5 pts), error handling 3 (4 pts), boolean chains 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 · cookie-import-native-worker.superviseNativeCookieImport (cognitive 21) · ×1
  • cookie-import-native-worker.superviseNativeCookieImport (cognitive 21) browse/src/cookie-import-native-worker.ts:92 — cookie-import-native-worker.superviseNativeCookieImport has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 4, ternaries 2 (4 pts), error handling 3, loops 3 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · read-commands.findBalancedClose (cognitive 21) · ×1
  • read-commands.findBalancedClose (cognitive 21) browse/src/read-commands.ts:36 — read-commands.findBalancedClose has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, loops 1, ternaries 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 · inspector.buildSelector (cognitive 21) · ×1
  • inspector.buildSelector (cognitive 21) extension/inspector.js:100 — inspector.buildSelector has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · redact-engine.inStructuralToken (cognitive 21) · ×1
  • redact-engine.inStructuralToken (cognitive 21) REDACTED:691 — redact-engine.inStructuralToken has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, 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 · approval-classes.classErrors (cognitive 21) · ×1
  • approval-classes.classErrors (cognitive 21) REDACTED:70 — approval-classes.classErrors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 8, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · captain-brief.renderCaptainBrief (cognitive 21) · ×1
  • captain-brief.renderCaptainBrief (cognitive 21) lib/captain-brief.ts:63 — captain-brief.renderCaptainBrief has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (7 pts), boolean chains 4 (nesting depth added 5). Of this number, 18 points are the body's own statements and 3 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 · outside-voice-api.callModel (cognitive 21) · ×1
  • outside-voice-api.callModel (cognitive 21) lib/outside-voice-api.ts:52 — outside-voice-api.callModel has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 4 (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 · ci-gate.parseChecks (cognitive 21) · ×1
  • ci-gate.parseChecks (cognitive 21) lib/ci-gate.ts:75 — ci-gate.parseChecks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (2 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 · contracts.legacyJson (cognitive 21) · ×1
  • contracts.legacyJson (cognitive 21) lib/cso/contracts.ts:999 — contracts.legacyJson has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.readLegacyOwner (cognitive 21) · ×1
  • state.readLegacyOwner (cognitive 21) lib/cso/state.ts:1307 — state.readLegacyOwner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, error handling 3 (4 pts), ternaries 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 · state.acquireMigrationClaim (cognitive 21) · ×1
  • state.acquireMigrationClaim (cognitive 21) lib/cso/state.ts:1404 — state.acquireMigrationClaim has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 2 (5 pts), loops 1 (nesting depth added 13). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PublicArchiveCache.recoverInterruptedOperations (cognitive 21) · ×1
  • PublicArchiveCache.recoverInterruptedOperations (cognitive 21) lib/cso/cache.ts:846 — PublicArchiveCache.recoverInterruptedOperations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 7 (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 · snapshot.capture · ×1
  • snapshot.capture::assertEntriesStable (cognitive 21) lib/cso/snapshot.ts:841 — snapshot.capture::assertEntriesStable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 4, 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. This shape REPEATS in the file: one other method here (snapshot.capture) 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 · preparation.manifest (cognitive 21) · ×1
  • preparation.manifest (cognitive 21) REDACTED:225 — preparation.manifest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (4 pts), boolean chains 3, ternaries 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 · DockerPreparationSandboxRunner.publishArtifacts (cognitive 21) · ×1
  • DockerPreparationSandboxRunner.publishArtifacts (cognitive 21) lib/cso/preparation-docker.ts:1198 — DockerPreparationSandboxRunner.publishArtifacts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, error handling 2 (4 pts), loops 2 (3 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 · scanners.decodedDocument (cognitive 21) · ×1
  • scanners.decodedDocument (cognitive 21) lib/cso/scanners.ts:554 — scanners.decodedDocument has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 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 · cli.planned (cognitive 21) · ×1
  • cli.planned (cognitive 21) REDACTED:448 — cli.planned has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (21 pts) (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 · eval-plan.dryRun (cognitive 21) · ×1
  • eval-plan.dryRun (cognitive 21) lib/eval-plan.ts:232 — eval-plan.dryRun has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 4, loops 2 (3 pts), error handling 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · evidence-bundle.compareIdentity (cognitive 21) · ×1
  • evidence-bundle.compareIdentity (cognitive 21) lib/evidence-bundle.ts:111 — evidence-bundle.compareIdentity has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (7 pts), boolean chains 3, loops 3 (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 · tags.detectRelaxation (cognitive 21) · ×1
  • tags.detectRelaxation (cognitive 21) lib/gate-diff/tags.ts:168 — tags.detectRelaxation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (6 pts), loops 3, boolean chains 1 (nesting depth added 8). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime.resolveBun (cognitive 21) · ×1
  • runtime.resolveBun (cognitive 21) lib/pregate/runtime.ts:80 — runtime.resolveBun has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · version-gate-train.regeneratedAtBase (cognitive 21) · ×1
  • version-gate-train.regeneratedAtBase (cognitive 21) lib/version-gate-train.ts:53 — version-gate-train.regeneratedAtBase has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (5 pts), boolean chains 3, error handling 3, loops 2 (nesting depth added 5). Of this number, 18 points are the body's own statements and 3 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 · state-matrix.parseSpecialistOutput (cognitive 21) · ×1
  • state-matrix.parseSpecialistOutput (cognitive 21) lib/state-matrix.ts:59 — state-matrix.parseSpecialistOutput has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 14 points are the body's own statements and 7 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 · exercised-map.attributeCommands (cognitive 21) · ×1
  • exercised-map.attributeCommands (cognitive 21) scripts/exercised-map.ts:102 — exercised-map.attributeCommands has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (9 pts), ternaries 3 (9 pts), if/else 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · paid-rerun.shardRecords (cognitive 21) · ×1
  • paid-rerun.shardRecords (cognitive 21) scripts/lib/paid-rerun.ts:93 — paid-rerun.shardRecords has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 pts), error handling 1 (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 · ci-history.listWorkflowRuns (cognitive 21) · ×1
  • ci-history.listWorkflowRuns (cognitive 21) scripts/lib/ci-history.ts:103 — ci-history.listWorkflowRuns has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 4 (7 pts), boolean chains 3, 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 · cso-eval.validatePortableSkillPayload (cognitive 21) · ×1
  • cso-eval.validatePortableSkillPayload (cognitive 21) scripts/cso-eval.ts:262 — cso-eval.validatePortableSkillPayload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-eval.validateReceipt (cognitive 21) · ×1
  • cso-eval.validateReceipt (cognitive 21) scripts/cso-eval.ts:405 — cso-eval.validateReceipt has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, if/else 6, ternaries 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.
D2 · Cognitive Complexity · testing.generateTestCoverageAuditInner (cognitive 21) · ×1
  • testing.generateTestCoverageAuditInner (cognitive 21) scripts/resolvers/testing.ts:252 — testing.generateTestCoverageAuditInner has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 16, if/else 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · gen-skill-docs.splitCatalogDescription (cognitive 21) · ×1
  • gen-skill-docs.splitCatalogDescription (cognitive 21) REDACTED:274 — gen-skill-docs.splitCatalogDescription has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4, boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · phase-publication-hook.autoplanReadRange (cognitive 20) · ×1
  • phase-publication-hook.autoplanReadRange (cognitive 20) autoplan/bin/phase-publication-hook.ts:312 — phase-publication-hook.autoplanReadRange has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (9 pts), loops 1 (nesting depth added 4). Of this number, 17 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · cli.proxyMismatchLines (cognitive 20) · ×1
  • cli.proxyMismatchLines (cognitive 20) browse/src/cli.ts:489 — cli.proxyMismatchLines has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 4, if/else 4 (nesting depth added 5). Of this number, 16 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cookie-import-browser.withCookieReadRetry (cognitive 20) · ×1
  • cookie-import-browser.withCookieReadRetry (cognitive 20) REDACTED:260 — cookie-import-browser.withCookieReadRetry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal-agent.maybeSpawnPty (cognitive 20) · ×1
  • terminal-agent.maybeSpawnPty (cognitive 20) browse/src/terminal-agent.ts:526 — terminal-agent.maybeSpawnPty has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memory.updateDesignMd (cognitive 20) · ×1
  • memory.updateDesignMd (cognitive 20) design/src/memory.ts:124 — memory.updateDesignMd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 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 · sidepanel.chrome.runtime.onMessage.addListener() (cognitive 20) · ×1
  • sidepanel.chrome.runtime.onMessage.addListener() (cognitive 20) extension/sidepanel.js:1348 — sidepanel.chrome.runtime.onMessage.addListener() has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 4). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · question-log-hook.main (cognitive 20) · ×1
  • question-log-hook.main (cognitive 20) hosts/claude/hooks/question-log-hook.ts:254 — question-log-hook.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 4). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · banned-terms.scanBannedTerms (cognitive 20) · ×1
  • banned-terms.scanBannedTerms (cognitive 20) REDACTED:137 — banned-terms.scanBannedTerms has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), ternaries 1 (5 pts) (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 · approval-classes.classHits (cognitive 20) · ×1
  • approval-classes.classHits (cognitive 20) REDACTED:193 — approval-classes.classHits has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), boolean chains 3, ternaries 1 (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 · autoplan-checkpoint.restoreCheckpoint (cognitive 20) · ×1
  • autoplan-checkpoint.restoreCheckpoint (cognitive 20) lib/autoplan-checkpoint.ts:230 — autoplan-checkpoint.restoreCheckpoint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 2, error handling 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 237, 241). 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 · autoplan-export.aggregateFindings (cognitive 20) · ×1
  • autoplan-export.aggregateFindings (cognitive 20) lib/autoplan-export.ts:46 — autoplan-export.aggregateFindings has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (8 pts), loops 3 (5 pts), if/else 2 (4 pts), boolean chains 3 (nesting depth added 9). Of this number, 17 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · changelog-check.checkChangelog (cognitive 20) · ×1
  • changelog-check.checkChangelog (cognitive 20) lib/changelog-check.ts:58 — changelog-check.checkChangelog has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 4 (6 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context-bill.findSkillDirs · ×1
  • context-bill.findSkillDirs::walk (cognitive 20) lib/context-bill.ts:519 — context-bill.findSkillDirs::walk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (3 pts), boolean chains 2, 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 · context-bill.measureExactTokens (cognitive 20) · ×1
  • context-bill.measureExactTokens (cognitive 20) lib/context-bill.ts:1007 — context-bill.measureExactTokens has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (4 pts), loops 3, error handling 2 (nesting depth added 4). Of this number, 13 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preparation.inspectPreparation (cognitive 20) · ×1
  • preparation.inspectPreparation (cognitive 20) REDACTED:1180 — preparation.inspectPreparation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 7, ternaries 1 (2 pts), error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · preparation-executor.provePreparedProjection (cognitive 20) · ×1
  • preparation-executor.provePreparedProjection (cognitive 20) lib/cso/preparation-executor.ts:965 — preparation-executor.provePreparedProjection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 3 (nesting depth added 6). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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.parseStart (cognitive 20) · ×1
  • cli.parseStart (cognitive 20) REDACTED:611 — cli.parseStart has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 4, boolean chains 3, loops 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.
D2 · Cognitive Complexity · cli.recoveryEvents · ×1
  • cli.recoveryEvents::walk (cognitive 20) REDACTED:1023 — cli.recoveryEvents::walk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 3 (5 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 · cli.recheck (cognitive 20) · ×1
  • cli.recheck (cognitive 20) REDACTED:1916 — cli.recheck has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 7, boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 1935). 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 · model-policy-freshness-publication.publishFreshness · ×1
  • model-policy-freshness-publication.publishFreshness::publish (cognitive 20) lib/model-policy-freshness-publication.ts:102 — model-policy-freshness-publication.publishFreshness::publish has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5, ternaries 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.
D2 · Cognitive Complexity · pr-shots.diffLines (cognitive 20) · ×1
  • pr-shots.diffLines (cognitive 20) lib/pr-shots.ts:121 — pr-shots.diffLines has cognitive complexity 20 (threshold 15). Drivers by points: loops 7 (8 pts), boolean chains 7, if/else 4 (5 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rust.cargoModel.membersOf (cognitive 20) · ×1
  • rust.cargoModel.membersOf (cognitive 20) lib/pregate/rust.ts:153 — rust.cargoModel.membersOf has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, loops 3 (5 pts) (nesting depth added 6). Of this number, 15 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · timing.addedTestLines (cognitive 20) · ×1
  • timing.addedTestLines (cognitive 20) lib/pregate/checks/timing.ts:186 — timing.addedTestLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 7). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pr-dependencies.exercisedConsumers.binsInCommand (cognitive 20) · ×1
  • pr-dependencies.exercisedConsumers.binsInCommand (cognitive 20) scripts/pr-dependencies.ts:551 — pr-dependencies.exercisedConsumers.binsInCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-eval-producer.validateProductionProducerInstallation (cognitive 20) · ×1
  • cso-eval-producer.validateProductionProducerInstallation (cognitive 20) scripts/cso-eval-producer.ts:305 — cso-eval-producer.validateProductionProducerInstallation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (5 pts), boolean chains 4 (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 · cso-staging-run.verifyStagingRun (cognitive 20) · ×1
  • cso-staging-run.verifyStagingRun (cognitive 20) scripts/cso-staging-run.ts:60 — cso-staging-run.verifyStagingRun has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 9. Of this number, 19 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · outside-voice.outsideVoiceInvocation (cognitive 20) · ×1
  • outside-voice.outsideVoiceInvocation (cognitive 20) scripts/resolvers/outside-voice.ts:166 — outside-voice.outsideVoiceInvocation has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (18 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 · train-backstop.runBackstop (cognitive 20) · ×1
  • train-backstop.runBackstop (cognitive 20) scripts/train-backstop.ts:127 — train-backstop.runBackstop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 4). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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.swift.optionalWrappedType (cognitive 20) · ×1
  • main.swift.optionalWrappedType (cognitive 20) ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift:635 — main.swift.optionalWrappedType has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (6 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 · (anonymous) (cognitive 20) · ×1
  • (anonymous) (cognitive 20) extension/sidepanel.js:1348 — (anonymous) has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 4). Of this number, 19 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · claude-journal-records.recordMeta (cognitive 19) · ×1
  • claude-journal-records.recordMeta (cognitive 19) lib/claude-journal-records.ts:272 — claude-journal-records.recordMeta has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 7, if/else 2 (3 pts) (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.
D2 · Cognitive Complexity · gstack-design-detect.probe · ×1
  • gstack-design-detect.probe::checkSkillDir (cognitive 19) bin/gstack-design-detect.ts:381 — gstack-design-detect.probe::checkSkillDir has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 2 (3 pts), loops 1, ternaries 1 (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. This shape REPEATS in the file: one other method here (gstack-design-detect.probe) 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 · gbrain-repo-policy-client.repoPolicyTierBatch (cognitive 19) · ×1
  • gbrain-repo-policy-client.repoPolicyTierBatch (cognitive 19) lib/gbrain-repo-policy-client.ts:185 — gbrain-repo-policy-client.repoPolicyTierBatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 4 (5 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · memory-ingest-landing.classifyImport (cognitive 19) · ×1
  • memory-ingest-landing.classifyImport (cognitive 19) lib/memory-ingest-landing.ts:292 — memory-ingest-landing.classifyImport has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3, ternaries 3, boolean chains 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-memory-ingest.walkClaudeCodeProjects (cognitive 19) · ×1
  • gstack-memory-ingest.walkClaudeCodeProjects (cognitive 19) bin/gstack-memory-ingest.ts:494 — gstack-memory-ingest.walkClaudeCodeProjects has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 3 (6 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 · gstack-memory-ingest.disambiguateSlugs (cognitive 19) · ×1
  • gstack-memory-ingest.disambiguateSlugs (cognitive 19) bin/gstack-memory-ingest.ts:1474 — gstack-memory-ingest.disambiguateSlugs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (5 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 7). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime-pins.satisfiesOne (cognitive 19) · ×1
  • runtime-pins.satisfiesOne (cognitive 19) lib/runtime-pins.ts:71 — runtime-pins.satisfiesOne has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 4, if/else 2, 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 · file-permissions.restrictDirectoryPermissions (cognitive 19) · ×1
  • file-permissions.restrictDirectoryPermissions (cognitive 19) browse/src/file-permissions.ts:166 — file-permissions.restrictDirectoryPermissions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 4 (7 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 · sanitize-echo.sanitizeEcho (cognitive 19) · ×1
  • sanitize-echo.sanitizeEcho (cognitive 19) lib/sanitize-echo.ts:14 — sanitize-echo.sanitizeEcho has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runHeadedSupervisor (cognitive 19) · ×1
  • cli.runHeadedSupervisor (cognitive 19) browse/src/cli.ts:592 — cli.runHeadedSupervisor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, error handling 2 (4 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 · cookie-auth-verification.clearCookieTargetStorage (cognitive 19) · ×1
  • cookie-auth-verification.clearCookieTargetStorage (cognitive 19) browse/src/cookie-auth-verification.ts:131 — cookie-auth-verification.clearCookieTargetStorage has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 6, ternaries 2 (3 pts), error handling 2 (nesting depth added 1). Of this number, 13 points are the body's own statements and 6 belong to 5 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · auq-error-fallback-hook.isErrorResponse (cognitive 19) · ×1
  • auq-error-fallback-hook.isErrorResponse (cognitive 19) hosts/claude/hooks/auq-error-fallback-hook.ts:80 — auq-error-fallback-hook.isErrorResponse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memorable-user-prompt-hook.policyVeto (cognitive 19) · ×1
  • memorable-user-prompt-hook.policyVeto (cognitive 19) hosts/claude/hooks/memorable-user-prompt-hook.ts:386 — memorable-user-prompt-hook.policyVeto has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, loops 1 (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 · gen-accessors.optionalWrappedType (cognitive 19) · ×1
  • gen-accessors.optionalWrappedType (cognitive 19) ios-qa/scripts/gen-accessors.ts:506 — gen-accessors.optionalWrappedType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (6 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 · outside-consent.readStoredCodexReviews (cognitive 19) · ×1
  • outside-consent.readStoredCodexReviews (cognitive 19) lib/outside-consent.ts:28 — outside-consent.readStoredCodexReviews has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), error handling 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 · changelog-check.reheadChangelog (cognitive 19) · ×1
  • changelog-check.reheadChangelog (cognitive 19) lib/changelog-check.ts:102 — changelog-check.reheadChangelog has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 4, if/else 3, loops 2 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · context-bill.parseSkill (cognitive 19) · ×1
  • context-bill.parseSkill (cognitive 19) lib/context-bill.ts:404 — context-bill.parseSkill has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (7 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 · context-bill.checkBudget (cognitive 19) · ×1
  • context-bill.checkBudget (cognitive 19) lib/context-bill.ts:682 — context-bill.checkBudget has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (7 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.repairBundleExpiry (cognitive 19) · ×1
  • state.repairBundleExpiry (cognitive 19) lib/cso/state.ts:2330 — state.repairBundleExpiry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 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 · preparation-executor.stagedFileHashes (cognitive 19) · ×1
  • preparation-executor.stagedFileHashes (cognitive 19) lib/cso/preparation-executor.ts:501 — preparation-executor.stagedFileHashes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, error handling 2 (3 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegistryEgressBroker.openTunnel (cognitive 19) · ×1
  • RegistryEgressBroker.openTunnel (cognitive 19) lib/cso/preparation-docker.ts:606 — RegistryEgressBroker.openTunnel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, error handling 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · cli.scanner (cognitive 19) · ×1
  • cli.scanner (cognitive 19) REDACTED:1746 — cli.scanner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (5 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 1763). 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 · cli.withReplayBundle (cognitive 19) · ×1
  • cli.withReplayBundle (cognitive 19) REDACTED:2522 — cli.withReplayBundle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qa-deadline.checkedPath (cognitive 19) · ×1
  • qa-deadline.checkedPath (cognitive 19) lib/qa-deadline.ts:31 — qa-deadline.checkedPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, error handling 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 · qa-deadline.qaDeadlineMain (cognitive 19) · ×1
  • qa-deadline.qaDeadlineMain (cognitive 19) lib/qa-deadline.ts:272 — qa-deadline.qaDeadlineMain has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 3 (6 pts), error handling 1 (nesting depth added 4). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 273). 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 · sealed-guard.sealedErrors (cognitive 19) · ×1
  • sealed-guard.sealedErrors (cognitive 19) lib/sealed-guard.ts:51 — sealed-guard.sealedErrors has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, error handling 2, loops 1 (nesting depth added 1). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (list, regex, glob, …). 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 · git.untrackedAsAdded (cognitive 19) · ×1
  • git.untrackedAsAdded (cognitive 19) lib/gate-diff/git.ts:297 — git.untrackedAsAdded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (6 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 · strays.run (cognitive 19) · ×1
  • strays.run (cognitive 19) lib/pregate/checks/strays.ts:17 — strays.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 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 · ship-queue.acceptedReceiptHeads (cognitive 19) · ×1
  • ship-queue.acceptedReceiptHeads (cognitive 19) lib/ship-queue.ts:73 — ship-queue.acceptedReceiptHeads has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 6, ternaries 4 (5 pts) (nesting depth added 1). Of this number, 15 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ship-queue.ciAtHead (cognitive 19) · ×1
  • ship-queue.ciAtHead (cognitive 19) lib/ship-queue.ts:116 — ship-queue.ciAtHead has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 2, if/else 2 (nesting depth added 7). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 123, 124). 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 · ship-queue.reproduceGateAhead (cognitive 19) · ×1
  • ship-queue.reproduceGateAhead (cognitive 19) lib/ship-queue.ts:340 — ship-queue.reproduceGateAhead has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · eval-input-cache.sourceDependencyClosure (cognitive 19) · ×1
  • eval-input-cache.sourceDependencyClosure (cognitive 19) scripts/eval-input-cache.ts:30 — eval-input-cache.sourceDependencyClosure has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (visit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · paid-report.panelReports (cognitive 19) · ×1
  • paid-report.panelReports (cognitive 19) REDACTED:351 — paid-report.panelReports has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9, boolean chains 4, loops 3 (4 pts), if/else 2 (nesting depth added 1). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 364, 361, 357, …). 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 · cso-eval-producer.assertProducerArtifactPath (cognitive 19) · ×1
  • cso-eval-producer.assertProducerArtifactPath (cognitive 19) scripts/cso-eval-producer.ts:191 — cso-eval-producer.assertProducerArtifactPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cso-staging-run.stagingRunId (cognitive 19) · ×1
  • cso-staging-run.stagingRunId (cognitive 19) scripts/cso-staging-run.ts:29 — cso-staging-run.stagingRunId has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 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 · dev-skill.regenerateAndValidate (cognitive 19) · ×1
  • dev-skill.regenerateAndValidate (cognitive 19) scripts/dev-skill.ts:22 — dev-skill.regenerateAndValidate has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 4 (6 pts), boolean chains 3, error handling 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 · gate-cost-replay.formatReport (cognitive 19) · ×1
  • gate-cost-replay.formatReport (cognitive 19) scripts/gate-cost-replay.ts:290 — gate-cost-replay.formatReport has cognitive complexity 19 (threshold 15). Drivers by points: loops 9 (10 pts), ternaries 3 (6 pts), if/else 3 (nesting depth added 4). 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 · ship-measure-sweep.weeklySpent (cognitive 19) · ×1
  • ship-measure-sweep.weeklySpent (cognitive 19) scripts/ship-measure-sweep.ts:180 — ship-measure-sweep.weeklySpent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 1 (3 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 · phase-publication-hook.closePacket (cognitive 18) · ×1
  • phase-publication-hook.closePacket (cognitive 18) autoplan/bin/phase-publication-hook.ts:342 — phase-publication-hook.closePacket has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 7, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · gstack-brain-context-load.dispatchList (cognitive 18) · ×1
  • gstack-brain-context-load.dispatchList (cognitive 18) bin/gstack-brain-context-load.ts:292 — gstack-brain-context-load.dispatchList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · egress-receipt.withLedgerLock (cognitive 18) · ×1
  • egress-receipt.withLedgerLock (cognitive 18) lib/egress-receipt.ts:160 — egress-receipt.withLedgerLock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), error handling 3 (7 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · design-md.renderDesignMd (cognitive 18) · ×1
  • design-md.renderDesignMd (cognitive 18) REDACTED:267 — design-md.renderDesignMd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (4 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-memory-ingest.snapshotTranscriptCheckout (cognitive 18) · ×1
  • gstack-memory-ingest.snapshotTranscriptCheckout (cognitive 18) bin/gstack-memory-ingest.ts:2622 — gstack-memory-ingest.snapshotTranscriptCheckout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, error handling 1, loops 1, ternaries 1 (nesting depth added 3). Of this number, 12 points are the body's own statements and 6 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 · xprotect-heal.launchWithXProtectHeal (cognitive 18) · ×1
  • xprotect-heal.launchWithXProtectHeal (cognitive 18) browse/src/xprotect-heal.ts:409 — xprotect-heal.launchWithXProtectHeal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (6 pts), error handling 2 (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 · terminal-agent-control.agentStatus (cognitive 18) · ×1
  • terminal-agent-control.agentStatus (cognitive 18) browse/src/terminal-agent-control.ts:332 — terminal-agent-control.agentStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, ternaries 2 (3 pts), error handling 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.
D2 · Cognitive Complexity · snapshot.parseSnapshotArgs (cognitive 18) · ×1
  • snapshot.parseSnapshotArgs (cognitive 18) browse/src/snapshot.ts:51 — snapshot.parseSnapshotArgs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memory-command.formatSnapshotText (cognitive 18) · ×1
  • memory-command.formatSnapshotText (cognitive 18) browse/src/memory-command.ts:37 — memory-command.formatSnapshotText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 3 (6 pts), ternaries 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.
D2 · Cognitive Complexity · autoplan-gate.challengeDefault (cognitive 18) · ×1
  • autoplan-gate.challengeDefault (cognitive 18) lib/autoplan-gate.ts:173 — autoplan-gate.challengeDefault has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 7, boolean chains 3 (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 · autoplan-public.validatePublic (cognitive 18) · ×1
  • autoplan-public.validatePublic (cognitive 18) lib/autoplan-public.ts:105 — autoplan-public.validatePublic has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), ternaries 1 (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 · changelog-check.changelogDamage (cognitive 18) · ×1
  • changelog-check.changelogDamage (cognitive 18) lib/changelog-check.ts:186 — changelog-check.changelogDamage has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (7 pts), ternaries 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · claude-code-windows-job.initializeWindowsReviewJob (cognitive 18) · ×1
  • claude-code-windows-job.initializeWindowsReviewJob (cognitive 18) lib/claude-code-windows-job.ts:25 — claude-code-windows-job.initializeWindowsReviewJob has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, ternaries 1 (2 pts), error handling 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 · PublicArchiveCache.promote (cognitive 18) · ×1
  • PublicArchiveCache.promote (cognitive 18) lib/cso/cache.ts:384 — PublicArchiveCache.promote has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 4 (5 pts), boolean chains 2 (nesting depth added 3). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 389). 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 · snapshot.boundPath (cognitive 18) · ×1
  • snapshot.boundPath (cognitive 18) lib/cso/snapshot.ts:105 — snapshot.boundPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, error handling 2, loops 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.
D2 · Cognitive Complexity · preparation-container.forwarder (cognitive 18) · ×1
  • preparation-container.forwarder (cognitive 18) REDACTED:639 — preparation-container.forwarder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (copyMetadata). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · preparation-container.seed (cognitive 18) · ×1
  • preparation-container.seed (cognitive 18) REDACTED:1026 — preparation-container.seed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 2 (3 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 · preparation-docker.validateAcquisitionOutput (cognitive 18) · ×1
  • preparation-docker.validateAcquisitionOutput (cognitive 18) lib/cso/preparation-docker.ts:124 — preparation-docker.validateAcquisitionOutput has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 2 (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 · verification.preparePatchedSource (cognitive 18) · ×1
  • verification.preparePatchedSource (cognitive 18) lib/cso/verification.ts:1007 — verification.preparePatchedSource has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eval-plan.parsePreregDiagnostics (cognitive 18) · ×1
  • eval-plan.parsePreregDiagnostics (cognitive 18) lib/eval-plan.ts:85 — eval-plan.parsePreregDiagnostics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, 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 · eval-plan.parseCallRow (cognitive 18) · ×1
  • eval-plan.parseCallRow (cognitive 18) lib/eval-plan.ts:413 — eval-plan.parseCallRow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3, boolean chains 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 · evidence-bundle.buildBundle (cognitive 18) · ×1
  • evidence-bundle.buildBundle (cognitive 18) lib/evidence-bundle.ts:130 — evidence-bundle.buildBundle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, ternaries 3 (5 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gbrain-supabase-provision.cmdCreate (cognitive 18) · ×1
  • gbrain-supabase-provision.cmdCreate (cognitive 18) lib/gbrain-supabase-provision.ts:350 — gbrain-supabase-provision.cmdCreate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · workflows.outline (cognitive 18) · ×1
  • workflows.outline (cognitive 18) lib/pregate/workflows.ts:48 — workflows.outline has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (6 pts), boolean chains 4, if/else 2 (4 pts), ternaries 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.
D2 · Cognitive Complexity · import-graph.dartDirectiveUris (cognitive 18) · ×1
  • import-graph.dartDirectiveUris (cognitive 18) lib/pregate/import-graph.ts:120 — import-graph.dartDirectiveUris has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.clearDecision (cognitive 18) · ×1
  • index.clearDecision (cognitive 18) lib/pregate/index.ts:176 — index.clearDecision has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · ship-queue.ready (cognitive 18) · ×1
  • ship-queue.ready (cognitive 18) lib/ship-queue.ts:148 — ship-queue.ready has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, ternaries 2, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · pr-dependencies.substitutions (cognitive 18) · ×1
  • pr-dependencies.substitutions (cognitive 18) scripts/pr-dependencies.ts:392 — pr-dependencies.substitutions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · eval-trial-series.weeklyBacktest · ×1
  • eval-trial-series.weeklyBacktest::row (cognitive 18) REDACTED:155 — eval-trial-series.weeklyBacktest::row has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), boolean chains 2, ternaries 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 · cso-runtime-promotion.collectEvidence (cognitive 18) · ×1
  • cso-runtime-promotion.collectEvidence (cognitive 18) scripts/cso-runtime-promotion.ts:317 — cso-runtime-promotion.collectEvidence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (visit, a function literal at line 333). 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 · cso-scanner-catalog.strictProfile (cognitive 18) · ×1
  • cso-scanner-catalog.strictProfile (cognitive 18) scripts/cso-scanner-catalog.ts:43 — cso-scanner-catalog.strictProfile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 1 (3 pts), 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 · cso-scanner-matrix.assets (cognitive 18) · ×1
  • cso-scanner-matrix.assets (cognitive 18) scripts/cso-scanner-matrix.ts:70 — cso-scanner-matrix.assets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5 (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 · recover-receipts.negativesFromRun (cognitive 18) · ×1
  • recover-receipts.negativesFromRun (cognitive 18) scripts/recover-receipts.ts:145 — recover-receipts.negativesFromRun has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (5 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (3 pts), error handling 1 (nesting depth added 7). Of this number, 13 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-journal-records.compactionCycle (cognitive 17) · ×1
  • claude-journal-records.compactionCycle (cognitive 17) lib/claude-journal-records.ts:423 — claude-journal-records.compactionCycle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-autoplan-snapshot.sectionHeadings (cognitive 17) · ×1
  • gstack-autoplan-snapshot.sectionHeadings (cognitive 17) bin/gstack-autoplan-snapshot.ts:73 — gstack-autoplan-snapshot.sectionHeadings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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.
D2 · Cognitive Complexity · gstack-autoplan-snapshot.methodologyContent (cognitive 17) · ×1
  • gstack-autoplan-snapshot.methodologyContent (cognitive 17) bin/gstack-autoplan-snapshot.ts:516 — gstack-autoplan-snapshot.methodologyContent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · phase-publication-hook.linkedWorktrees (cognitive 17) · ×1
  • phase-publication-hook.linkedWorktrees (cognitive 17) autoplan/bin/phase-publication-hook.ts:634 — phase-publication-hook.linkedWorktrees has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, error handling 2, loops 1, ternaries 1 (nesting depth added 4). Of this number, 10 points are the body's own statements and 7 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 · gstack-memory-helpers.freshDetectEngineTier (cognitive 17) · ×1
  • gstack-memory-helpers.freshDetectEngineTier (cognitive 17) lib/gstack-memory-helpers.ts:398 — gstack-memory-helpers.freshDetectEngineTier has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), error handling 3 (5 pts), ternaries 3 (5 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.
D2 · Cognitive Complexity · gstack-design-detect.writeTop (cognitive 17) · ×1
  • gstack-design-detect.writeTop (cognitive 17) bin/gstack-design-detect.ts:1014 — gstack-design-detect.writeTop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (5 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-global-discover.resolveAndDeduplicate (cognitive 17) · ×1
  • gstack-global-discover.resolveAndDeduplicate (cognitive 17) bin/gstack-global-discover.ts:526 — gstack-global-discover.resolveAndDeduplicate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (4 pts), error handling 1 (3 pts), ternaries 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 · url-validation.classifyAddress (cognitive 17) · ×1
  • url-validation.classifyAddress (cognitive 17) REDACTED:33 — url-validation.classifyAddress has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 2 (3 pts), ternaries 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 · xprotect-heal.runBoundedChromiumReinstall (cognitive 17) · ×1
  • xprotect-heal.runBoundedChromiumReinstall (cognitive 17) browse/src/xprotect-heal.ts:247 — xprotect-heal.runBoundedChromiumReinstall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 3 (5 pts), ternaries 2 (4 pts) (nesting depth added 5). None of this is in the body itself: all 17 points belong to 4 function literals inside it that branch (lines 269, 287, 251, …). 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 · cookie-import-native-job.createNativeCookieJob (cognitive 17) · ×1
  • cookie-import-native-job.createNativeCookieJob (cognitive 17) browse/src/cookie-import-native-job.ts:57 — cookie-import-native-job.createNativeCookieJob has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 3, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 2). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · cookie-import-operation.getCookieProfiles (cognitive 17) · ×1
  • cookie-import-operation.getCookieProfiles (cognitive 17) browse/src/cookie-import-operation.ts:54 — cookie-import-operation.getCookieProfiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (5 pts), boolean chains 4, error handling 1 (3 pts), ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (check, a function literal at line 64). 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 · image-args.resolveImagePaths (cognitive 17) · ×1
  • image-args.resolveImagePaths (cognitive 17) design/src/image-args.ts:19 — image-args.resolveImagePaths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, error handling 1 (2 pts), 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 · banned-terms.addedLines (cognitive 17) · ×1
  • banned-terms.addedLines (cognitive 17) REDACTED:121 — banned-terms.addedLines has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, 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 · install-verdict.verdictProblem (cognitive 17) · ×1
  • install-verdict.verdictProblem (cognitive 17) lib/install-verdict.ts:138 — install-verdict.verdictProblem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ApiRunner.run (cognitive 17) · ×1
  • ApiRunner.run (cognitive 17) lib/outside-voice-runner.ts:193 — ApiRunner.run has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 1, error handling 1, if/else 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 · state.readPrivateJson (cognitive 17) · ×1
  • state.readPrivateJson (cognitive 17) lib/cso/state.ts:817 — state.readPrivateJson has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, error handling 3 (4 pts) (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 · state.cleanupRun (cognitive 17) · ×1
  • state.cleanupRun (cognitive 17) lib/cso/state.ts:2404 — state.cleanupRun has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · history.token (cognitive 17) · ×1
  • history.token (cognitive 17) lib/cso/history.ts:2 — history.token has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (2 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 · preparation.dependencySpecs (cognitive 17) · ×1
  • preparation.dependencySpecs (cognitive 17) REDACTED:181 — preparation.dependencySpecs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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 · verifier.judgeSecurity (cognitive 17) · ×1
  • verifier.judgeSecurity (cognitive 17) lib/cso/verifier.ts:76 — verifier.judgeSecurity has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (13 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · classify.globToRegExp (cognitive 17) · ×1
  • classify.globToRegExp (cognitive 17) REDACTED:70 — classify.globToRegExp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · greptile-early.detect (cognitive 17) · ×1
  • greptile-early.detect (cognitive 17) lib/greptile-early.ts:124 — greptile-early.detect has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 6 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · gstack-post.targetNumber (cognitive 17) · ×1
  • gstack-post.targetNumber (cognitive 17) lib/gstack-post.ts:154 — gstack-post.targetNumber has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4, boolean chains 3, error handling 1 (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 · gstack-post.send (cognitive 17) · ×1
  • gstack-post.send (cognitive 17) lib/gstack-post.ts:312 — gstack-post.send has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (3 pts), boolean chains 2, 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 · office-hours-review.officeHoursDesignChanges (cognitive 17) · ×1
  • office-hours-review.officeHoursDesignChanges (cognitive 17) REDACTED:158 — office-hours-review.officeHoursDesignChanges has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (4 pts), loops 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 3). Of this number, 13 points are the body's own statements and 4 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 · pr-shots.buildPage (cognitive 17) · ×1
  • pr-shots.buildPage (cognitive 17) lib/pr-shots.ts:183 — pr-shots.buildPage has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 12, boolean chains 3, if/else 2. Of this number, 15 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · regate.renderRegate (cognitive 17) · ×1
  • regate.renderRegate (cognitive 17) REDACTED:119 — regate.renderRegate has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (13 pts), loops 2 (3 pts), if/else 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 · ship-queue.stampPreflight (cognitive 17) · ×1
  • ship-queue.stampPreflight (cognitive 17) lib/ship-queue.ts:216 — ship-queue.stampPreflight has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 2). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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 · shard-engine.runShardChild (cognitive 17) · ×1
  • shard-engine.runShardChild (cognitive 17) scripts/lib/shard-engine.ts:455 — shard-engine.runShardChild has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 3 (4 pts), boolean chains 3 (nesting depth added 2). Of this number, 15 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · image-size.jpegDims (cognitive 17) · ×1
  • image-size.jpegDims (cognitive 17) make-pdf/src/image-size.ts:32 — image-size.jpegDims has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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 · eval-input-cache.buildEvalInputIdentity (cognitive 17) · ×1
  • eval-input-cache.buildEvalInputIdentity (cognitive 17) scripts/eval-input-cache.ts:146 — eval-input-cache.buildEvalInputIdentity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 1 (2 pts), error handling 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · paid-report.attributeJUnitCase (cognitive 17) · ×1
  • paid-report.attributeJUnitCase (cognitive 17) REDACTED:196 — paid-report.attributeJUnitCase has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 3 (5 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · eval-history.triageRun · ×1
  • eval-history.triageRun::planFor (cognitive 17) scripts/lib/eval-history.ts:260 — eval-history.triageRun::planFor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (5 pts), loops 2 (5 pts), error handling 1 (3 pts), boolean chains 2, ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (eval-history.triageRun) 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 · resolve-codex-generation-model.resolveCodexRuntimeModel (cognitive 17) · ×1
  • resolve-codex-generation-model.resolveCodexRuntimeModel (cognitive 17) scripts/resolve-codex-generation-model.ts:131 — resolve-codex-generation-model.resolveCodexRuntimeModel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3, error handling 2, boolean chains 1, loops 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · train-backstop.coveringRecord (cognitive 17) · ×1
  • train-backstop.coveringRecord (cognitive 17) scripts/train-backstop.ts:57 — train-backstop.coveringRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init (cognitive 17) · ×1
  • init (cognitive 17) extension/sidepanel-terminal.js:913 — init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, error handling 4 (5 pts), boolean chains 4, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 8 function items inside it that branch (applyFontSize, a function literal at line 941, a function literal at line 959, …). 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 · design-md.emitYamlBlock (cognitive 16) · ×1
  • design-md.emitYamlBlock (cognitive 16) REDACTED:239 — design-md.emitYamlBlock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gbrain-sources.ensureSourceRegistered (cognitive 16) · ×1
  • gbrain-sources.ensureSourceRegistered (cognitive 16) REDACTED:171 — gbrain-sources.ensureSourceRegistered has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 180). 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 · gstack-global-discover.parseArgs (cognitive 16) · ×1
  • gstack-global-discover.parseArgs (cognitive 16) bin/gstack-global-discover.ts:76 — gstack-global-discover.parseArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-global-discover.main (cognitive 16) · ×1
  • gstack-global-discover.main (cognitive 16) bin/gstack-global-discover.ts:584 — gstack-global-discover.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.ensureStateDir (cognitive 16) · ×1
  • config.ensureStateDir (cognitive 16) REDACTED:107 — config.ensureStateDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 4 (6 pts), ternaries 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 · BrowserManager.launch (cognitive 16) · ×1
  • BrowserManager.launch (cognitive 16) browse/src/browser-manager.ts:628 — BrowserManager.launch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 2 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BrowserManager.recreateContext (cognitive 16) · ×1
  • BrowserManager.recreateContext (cognitive 16) browse/src/browser-manager.ts:1942 — BrowserManager.recreateContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 2 (3 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · socks-bridge.startSocksBridge.server · ×1
  • socks-bridge.startSocksBridge.server::onData (cognitive 16) browse/src/socks-bridge.ts:154 — socks-bridge.startSocksBridge.server::onData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cookie-import-browser.openDbFromCopy (cognitive 16) · ×1
  • cookie-import-browser.openDbFromCopy (cognitive 16) REDACTED:530 — cookie-import-browser.openDbFromCopy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (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.
D2 · Cognitive Complexity · persist.persistImage (cognitive 16) · ×1
  • persist.persistImage (cognitive 16) design/src/persist.ts:126 — persist.persistImage has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (9 pts), if/else 3 (4 pts), ternaries 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 · inspector.onClick (cognitive 16) · ×1
  • inspector.onClick (cognitive 16) extension/inspector.js:269 — inspector.onClick has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, error handling 1 (2 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · sidepanel.renderRule (cognitive 16) · ×1
  • sidepanel.renderRule (cognitive 16) extension/sidepanel.js:832 — sidepanel.renderRule has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hook-log.logHookError (cognitive 16) · ×1
  • hook-log.logHookError (cognitive 16) hosts/claude/hooks/hook-log.ts:33 — hook-log.logHookError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 3 (5 pts), loops 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 · redact-engine.normalizeOriginal (cognitive 16) · ×1
  • redact-engine.normalizeOriginal (cognitive 16) REDACTED:133 — redact-engine.normalizeOriginal has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (7 pts) (nesting depth added 9). 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 · devicectl.parseLaunchEnv (cognitive 16) · ×1
  • devicectl.parseLaunchEnv (cognitive 16) ios-qa/daemon/src/devicectl.ts:279 — devicectl.parseLaunchEnv has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 2, error handling 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 · tunnel-bootstrap.recoverTunnel (cognitive 16) · ×1
  • tunnel-bootstrap.recoverTunnel (cognitive 16) ios-qa/daemon/src/tunnel-bootstrap.ts:416 — tunnel-bootstrap.recoverTunnel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 3, ternaries 2 (3 pts), error handling 2 (nesting depth added 2). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · version-source.resolveVersionSource (cognitive 16) · ×1
  • version-source.resolveVersionSource (cognitive 16) lib/version-source.ts:243 — version-source.resolveVersionSource has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (5 pts), error handling 2, boolean chains 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 · headless-artifacts.checkGateSettled (cognitive 16) · ×1
  • headless-artifacts.checkGateSettled (cognitive 16) lib/headless-artifacts.ts:480 — headless-artifacts.checkGateSettled has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (4 pts), loops 3, boolean chains 2 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · approval-record.buildRow (cognitive 16) · ×1
  • approval-record.buildRow (cognitive 16) lib/approval-record.ts:119 — approval-record.buildRow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, ternaries 1 (3 pts), loops 2 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-budget.applyCapChoices (cognitive 16) · ×1
  • autoplan-budget.applyCapChoices (cognitive 16) lib/autoplan-budget.ts:141 — autoplan-budget.applyCapChoices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · autoplan-gate.planReopen (cognitive 16) · ×1
  • autoplan-gate.planReopen (cognitive 16) lib/autoplan-gate.ts:478 — autoplan-gate.planReopen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 8). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · outside-review-result.concludesNoFindings (cognitive 16) · ×1
  • outside-review-result.concludesNoFindings (cognitive 16) lib/outside-review-result.ts:161 — outside-review-result.concludesNoFindings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · state.hasPendingWatchdogCleanup · ×1
  • state.hasPendingWatchdogCleanup::walk (cognitive 16) lib/cso/state.ts:2158 — state.hasPendingWatchdogCleanup::walk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · admission.reclaimSlot (cognitive 16) · ×1
  • admission.reclaimSlot (cognitive 16) lib/cso/admission.ts:238 — admission.reclaimSlot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · admission.release (cognitive 16) · ×1
  • admission.release (cognitive 16) lib/cso/admission.ts:407 — admission.release has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (4 pts), boolean chains 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bounded-file.readBoundedStable (cognitive 16) · ×1
  • bounded-file.readBoundedStable (cognitive 16) lib/cso/bounded-file.ts:5 — bounded-file.readBoundedStable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, error handling 2, loops 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.
D2 · Cognitive Complexity · PublicArchiveCache.copyAndHash (cognitive 16) · ×1
  • PublicArchiveCache.copyAndHash (cognitive 16) lib/cso/cache.ts:668 — PublicArchiveCache.copyAndHash has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (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.
D2 · Cognitive Complexity · history.historyForPath (cognitive 16) · ×1
  • history.historyForPath (cognitive 16) lib/cso/history.ts:84 — history.historyForPath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2, ternaries 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runtime-catalog.assertRuntimeCompatible (cognitive 16) · ×1
  • runtime-catalog.assertRuntimeCompatible (cognitive 16) REDACTED:367 — runtime-catalog.assertRuntimeCompatible has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (2 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 · preparation-container.main (cognitive 16) · ×1
  • preparation-container.main (cognitive 16) REDACTED:1121 — preparation-container.main has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. 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 · preparation-docker.copyPreparedBlob (cognitive 16) · ×1
  • preparation-docker.copyPreparedBlob (cognitive 16) lib/cso/preparation-docker.ts:203 — preparation-docker.copyPreparedBlob has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · preparation-docker.supervisePreparedCall.dispose (cognitive 16) · ×1
  • preparation-docker.supervisePreparedCall.dispose (cognitive 16) lib/cso/preparation-docker.ts:865 — preparation-docker.supervisePreparedCall.dispose has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scanners.sarifBaseDir (cognitive 16) · ×1
  • scanners.sarifBaseDir (cognitive 16) lib/cso/scanners.ts:647 — scanners.sarifBaseDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, ternaries 3, loops 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.
D2 · Cognitive Complexity · scanner-executor.validateScannerRequest · ×1
  • scanner-executor.validateScannerRequest::inspect (cognitive 16) lib/cso/scanner-executor.ts:246 — scanner-executor.validateScannerRequest::inspect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (scanner-executor.validateScannerRequest) 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 · cli.validateBoundRecheckClaim.evidence (cognitive 16) · ×1
  • cli.validateBoundRecheckClaim.evidence (cognitive 16) REDACTED:1290 — cli.validateBoundRecheckClaim.evidence has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · dx-error-capture.dxErrorCaptureMain (cognitive 16) · ×1
  • dx-error-capture.dxErrorCaptureMain (cognitive 16) lib/dx-error-capture.ts:483 — dx-error-capture.dxErrorCaptureMain has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 2, error handling 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · sealed-guard.pathFindings (cognitive 16) · ×1
  • sealed-guard.pathFindings (cognitive 16) lib/sealed-guard.ts:130 — sealed-guard.pathFindings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, ternaries 1 (2 pts), 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 · gstack-decision.validateDecide (cognitive 16) · ×1
  • gstack-decision.validateDecide (cognitive 16) lib/gstack-decision.ts:104 — gstack-decision.validateDecide has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · issue-links.relatedPrs (cognitive 16) · ×1
  • issue-links.relatedPrs (cognitive 16) lib/issue-links.ts:140 — issue-links.relatedPrs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · office-hours-review.renderOfficeHoursReview (cognitive 16) · ×1
  • office-hours-review.renderOfficeHoursReview (cognitive 16) REDACTED:321 — office-hours-review.renderOfficeHoursReview has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5, ternaries 4 (5 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · rust.cargoModel (cognitive 16) · ×1
  • rust.cargoModel (cognitive 16) lib/pregate/rust.ts:131 — rust.cargoModel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 2 (4 pts), loops 3, error handling 1 (2 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.
D2 · Cognitive Complexity · rust.hasCfgTest (cognitive 16) · ×1
  • rust.hasCfgTest (cognitive 16) lib/pregate/rust.ts:204 — rust.hasCfgTest 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 · lane-selection.laneFileSet (cognitive 16) · ×1
  • lane-selection.laneFileSet (cognitive 16) lib/pregate/lane-selection.ts:57 — lane-selection.laneFileSet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 2, 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 · restamp.queueOrderCheck (cognitive 16) · ×1
  • restamp.queueOrderCheck (cognitive 16) REDACTED:113 — restamp.queueOrderCheck has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 3 (4 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · restamp.parseUnifiedDiff (cognitive 16) · ×1
  • restamp.parseUnifiedDiff (cognitive 16) REDACTED:220 — restamp.parseUnifiedDiff has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · pr-dependencies.deriveDependencies (cognitive 16) · ×1
  • pr-dependencies.deriveDependencies (cognitive 16) scripts/pr-dependencies.ts:174 — pr-dependencies.deriveDependencies has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (6 pts), boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · paid-cases.expandTrialShards (cognitive 16) · ×1
  • paid-cases.expandTrialShards (cognitive 16) scripts/lib/paid-cases.ts:176 — paid-cases.expandTrialShards has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.main (cognitive 16) · ×1
  • cli.main (cognitive 16) make-pdf/src/cli.ts:209 — cli.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · psychographic-signals.resolveOptionKey (cognitive 16) · ×1
  • psychographic-signals.resolveOptionKey (cognitive 16) scripts/psychographic-signals.ts:284 — psychographic-signals.resolveOptionKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), boolean chains 2, ternaries 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 · eval-history.parsePassRatesArgs (cognitive 16) · ×1
  • eval-history.parsePassRatesArgs (cognitive 16) scripts/lib/eval-history.ts:322 — eval-history.parsePassRatesArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 3, error handling 1 (2 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 4). Of this number, 11 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · external-skill-names.extractNameAndDescription (cognitive 16) · ×1
  • external-skill-names.extractNameAndDescription (cognitive 16) scripts/external-skill-names.ts:8 — external-skill-names.extractNameAndDescription has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 1, loops 1, ternaries 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 · garry-output-comparison.analyzeCommit (cognitive 16) · ×1
  • garry-output-comparison.analyzeCommit (cognitive 16) REDACTED:181 — garry-output-comparison.analyzeCommit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · garry-output-comparison.analyzeRepo (cognitive 16) · ×1
  • garry-output-comparison.analyzeRepo (cognitive 16) REDACTED:246 — garry-output-comparison.analyzeRepo has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (6 pts), if/else 2 (5 pts), loops 2 (3 pts), error handling 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 · gate-cost-replay.listRunsByDay (cognitive 16) · ×1
  • gate-cost-replay.listRunsByDay (cognitive 16) scripts/gate-cost-replay.ts:392 — gate-cost-replay.listRunsByDay has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). Of this number, 12 points are the body's own statements and 4 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 · judge-calibration.analyze (cognitive 16) · ×1
  • judge-calibration.analyze (cognitive 16) scripts/judge-calibration.ts:252 — judge-calibration.analyze has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 3 (4 pts) (nesting depth added 1). Of this number, 13 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · measure-journal-read.main (cognitive 16) · ×1
  • measure-journal-read.main (cognitive 16) scripts/measure-journal-read.ts:135 — measure-journal-read.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, loops 3 (5 pts), boolean chains 3, ternaries 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · model-policy-freshness.runModelPolicyFreshness (cognitive 16) · ×1
  • model-policy-freshness.runModelPolicyFreshness (cognitive 16) scripts/model-policy-freshness.ts:7 — model-policy-freshness.runModelPolicyFreshness has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, ternaries 1 (3 pts), error handling 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 · release-cut.cutRelease (cognitive 16) · ×1
  • release-cut.cutRelease (cognitive 16) scripts/release-cut.ts:249 — release-cut.cutRelease has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · train-gate.plannedCases (cognitive 16) · ×1
  • train-gate.plannedCases (cognitive 16) scripts/train-gate.ts:114 — train-gate.plannedCases has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), boolean chains 3 (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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyMethods · ×1
  • TooManyMethods: BrowserManager browse/src/browser-manager.ts:357 — TooManyMethods — 83 methods. The bar is 30 methods; this is 53 over it, 2.77× 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: BrowserManager (LCOM4 4) browse/src/browser-manager.ts:357 — BrowserManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
IC1 · Incompleteness & stubs · Guard cannot change the result · ×1
  • Guard cannot change the result — returns what the code already falls through to extension/inspector.js:153 — The guard above `return selector;` also returns `selector`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
IC1 · Incompleteness & stubs · Both branches are identical · ×1
  • Both branches are identical — the condition decides nothing extension/sidepanel-terminal.js:376 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
P2 · Observability · No structured logging · ×1
  • No structured logging — No logging call was found in the 368 JavaScript/TypeScript production file(s) this check read across 2 module(s). Each was searched for its ecosystem's logging libraries (JavaScript/TypeScript: pino, winston, bunyan, log4js, loglevel, consola, the NestJS Logger) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.
P3 · Security & performance tooling · SAST runs, but gates no merge · ×1
  • SAST runs, but gates no merge — `cso-scanner-images.yml`, `scorecard.yml` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.
R10 · Code Duplication · Duplication concentrated across 9 sibling directories (20 clone groups) · ×1
  • Duplication concentrated across 9 sibling directories (20 clone groups) browse/src/browse-client.ts:34 — 20 duplicated blocks under the repository root have copies in at least two of the sibling directories browse, browser-skills, design, extension, hosts, ios-qa (+3 more sibling(s) not listed) — 11 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 20 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 20 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 20 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Wholesale file copy (136 identical lines × 2 files) · ×1
  • Wholesale file copy (136 identical lines × 2 files) browse/src/browse-client.ts:34 — browse/src/browse-client.ts:34 · browser-skills/hackernews-frontpage/_lib/browse-client.ts:34 — these 2 files are line-for-line copies of one another — 136 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication · Duplicated block (79 lines × 2 locations) · ×1
  • Duplicated block (79 lines × 2 locations) extension/sidepanel-terminal.js:571 — extension/sidepanel-terminal.js:571 · extension/sidepanel-terminal.js:805 — 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 (59 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (59 matched lines × 2 locations) browse/src/snapshot.ts:332 — browse/src/snapshot.ts:332 · browse/src/snapshot.ts:462 — the two spans are one implementation copied and then locally edited — 485 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (45 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (45 matched lines × 2 locations) lib/cso/bounded-file.ts:13 — lib/cso/bounded-file.ts:13 · lib/cso/snapshot.ts:132 — the two spans are one implementation copied and then locally edited — 365 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 (41 lines × 2 locations) · ×1
  • Duplicated block (41 lines × 2 locations) extension/content.js:176 — extension/content.js:176 · extension/inspector.js:214 — 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 with local edits (39 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (39 matched lines × 2 locations) design/src/evolve.ts:14 — design/src/evolve.ts:14 · design/src/iterate.ts:15 — the two spans are one implementation copied and then locally edited — 315 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (26 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (26 matched lines × 2 locations) REDACTED:272 — REDACTED:272 · lib/cso/preparation-executor.ts:777 — the two spans are one implementation copied and then locally edited — 238 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (25 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (25 matched lines × 2 locations) design/src/daemon.ts:429 — design/src/daemon.ts:429 · design/src/serve.ts:184 — the two spans are one implementation copied and then locally edited — 187 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (21 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (21 matched lines × 2 locations) design/src/serve.ts:124 — design/src/serve.ts:124 · design/src/serve.ts:184 — the two spans are one implementation copied and then locally edited — 144 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (20 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (20 matched lines × 2 locations) design/src/check.ts:29 — design/src/check.ts:29 · design/src/design-to-code.ts:28 — the two spans are one implementation copied and then locally edited — 107 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (19 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (19 matched lines × 2 locations) lib/gate-cost-history.ts:378 — lib/gate-cost-history.ts:378 · lib/gate-cost.ts:592 — the two spans are one implementation copied and then locally edited — 109 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 (18 lines × 2 locations) · ×1
  • Duplicated block (18 lines × 2 locations) lib/cso/verification.ts:2005 — lib/cso/verification.ts:2005 · lib/cso/verification.ts:2030 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (18 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (18 matched lines × 2 locations) make-pdf/src/orchestrator.ts:82 — make-pdf/src/orchestrator.ts:82 · make-pdf/src/orchestrator.ts:264 — the two spans are one implementation copied and then locally edited — 127 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 (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) lib/ship-queue-gate.ts:79 — lib/ship-queue-gate.ts:79 · lib/ship-queue-train.ts:149 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (15 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (15 matched lines × 2 locations) design/src/daemon-state.ts:136 — design/src/daemon-state.ts:136 · lib/memory-ingest-landing.ts:184 — the two spans are one implementation copied and then locally edited — 53 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 (15 lines × 4 locations) · ×1
  • Duplicated block (15 lines × 4 locations) REDACTED:539 — REDACTED:539 · lib/cso/preparation-docker.ts:841 · lib/cso/preparation-docker.ts:1023 · lib/cso/verification.ts:117 — the 4 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) make-pdf/src/cli.ts:126 — make-pdf/src/cli.ts:126 · make-pdf/src/cli.ts:177 — 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 (14 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (14 matched lines × 2 locations) browse/src/routes/pairing.ts:39 — browse/src/routes/pairing.ts:39 · browse/src/routes/tokens.ts:26 — the two spans are one implementation copied and then locally edited — 51 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 (13 lines × 3 locations) · ×1
  • Duplicated block (13 lines × 3 locations) browse/src/cdp-inspector.ts:634 — browse/src/cdp-inspector.ts:634 · browse/src/cdp-inspector.ts:649 · browse/src/cdp-inspector.ts:698 — 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 (13 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (13 matched lines × 2 locations) REDACTED:33 — REDACTED:33 · browse/src/find-browse.ts:14 — the two spans are one implementation copied and then locally edited — 74 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 (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) browse/src/routes/pty.ts:39 — browse/src/routes/pty.ts:39 · browse/src/routes/pty.ts:114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R2 · Cyclomatic Complexity · Complex function handleWriteCommand (cyclomatic 316, cognitive 601) · ×1
  • Complex function handleWriteCommand (cyclomatic 316, cognitive 601) browse/src/write-commands.ts:134 — handleWriteCommand has cyclomatic complexity 316 and cognitive complexity 601; 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 handleMetaCommand (cyclomatic 193, cognitive 362) · ×1
  • Complex function handleMetaCommand (cyclomatic 193, cognitive 362) browse/src/meta-commands.ts:253 — handleMetaCommand has cyclomatic complexity 193 and cognitive complexity 362; 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 hasStructuredStaleFillFinding (cyclomatic 178, cognitive 285) · ×1
  • Complex function hasStructuredStaleFillFinding (cyclomatic 178, cognitive 285) test/helpers/ceo-section-loading-fixture.ts:440 — hasStructuredStaleFillFinding has cyclomatic complexity 178 and cognitive complexity 285; 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 readPlanSkillQuestions (cyclomatic 165, cognitive 265) · ×1
  • Complex function readPlanSkillQuestions (cyclomatic 165, cognitive 265) test/helpers/plan-skill-questions.ts:148 — readPlanSkillQuestions has cyclomatic complexity 165 and cognitive complexity 265; 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 parseRunManifest (cyclomatic 136, cognitive 137) · ×1
  • Complex function parseRunManifest (cyclomatic 136, cognitive 137) scripts/lib/paid-plan.ts:486 — parseRunManifest has cyclomatic complexity 136 and cognitive complexity 137; 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 runSkillTest (cyclomatic 123, cognitive 186) · ×1
  • Complex function runSkillTest (cyclomatic 123, cognitive 186) test/helpers/session-runner.ts:232 — runSkillTest has cyclomatic complexity 123 and cognitive complexity 186; 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 runPaidReport (cyclomatic 121, cognitive 181) · ×1
  • Complex function runPaidReport (cyclomatic 121, cognitive 181) REDACTED:540 — runPaidReport has cyclomatic complexity 121 and cognitive complexity 181; 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 validatePlanReviewDecisionResponse (cyclomatic 120, cognitive 196) · ×1
  • Complex function validatePlanReviewDecisionResponse (cyclomatic 120, cognitive 196) test/helpers/plan-review-decisions.ts:224 — validatePlanReviewDecisionResponse has cyclomatic complexity 120 and cognitive complexity 196; 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 validateCallerEvidence (cyclomatic 114, cognitive 142) · ×1
  • Complex function validateCallerEvidence (cyclomatic 114, cognitive 142) test/helpers/qa-callers-fixture.ts:271 — validateCallerEvidence has cyclomatic complexity 114 and cognitive complexity 142; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleSnapshot (cyclomatic 113, cognitive 209) · ×1
  • Complex function handleSnapshot (cyclomatic 113, cognitive 209) browse/src/snapshot.ts:103 — handleSnapshot has cyclomatic complexity 113 and cognitive complexity 209; 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 validateRepairBundle (cyclomatic 110, cognitive 85) · ×1
  • Complex function validateRepairBundle (cyclomatic 110, cognitive 85) lib/cso/verification.ts:1310 — validateRepairBundle has cyclomatic complexity 110 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function recordedBatchingIssue (cyclomatic 98, cognitive 96) · ×1
  • Complex function recordedBatchingIssue (cyclomatic 98, cognitive 96) test/helpers/eng-seeded-coverage.ts:126 — recordedBatchingIssue has cyclomatic complexity 98 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 95, cognitive 144) · ×1
  • Complex function main (cyclomatic 95, cognitive 144) scripts/test-paid-shards.ts:855 — main has cyclomatic complexity 95 and cognitive complexity 144; 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 docsAtomicSources (cyclomatic 95, cognitive 123) · ×1
  • Complex function docsAtomicSources (cyclomatic 95, cognitive 123) test/helpers/docsync-observer.ts:26 — docsAtomicSources has cyclomatic complexity 95 and cognitive complexity 123; 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 engCacheWriterDecision (cyclomatic 95, cognitive 75) · ×1
  • Complex function engCacheWriterDecision (cyclomatic 95, cognitive 75) test/helpers/eng-cache-writer-decision.ts:5 — engCacheWriterDecision has cyclomatic complexity 95 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function autoplanDualVoiceEvidence (cyclomatic 94, cognitive 149) · ×1
  • Complex function autoplanDualVoiceEvidence (cyclomatic 94, cognitive 149) test/helpers/autoplan-dual-voice-evidence.ts:63 — autoplanDualVoiceEvidence has cyclomatic complexity 94 and cognitive complexity 149; 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 validateResult (cyclomatic 94, cognitive 106) · ×1
  • Complex function validateResult (cyclomatic 94, cognitive 106) scripts/cso-eval.ts:644 — validateResult has cyclomatic complexity 94 and cognitive complexity 106; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function readPlanCountTranscript (cyclomatic 90, cognitive 178) · ×1
  • Complex function readPlanCountTranscript (cyclomatic 90, cognitive 178) lib/claude-public-transcript.ts:75 — readPlanCountTranscript has cyclomatic complexity 90 and cognitive complexity 178; 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 validateQACheckpoints (cyclomatic 90, cognitive 124) · ×1
  • Complex function validateQACheckpoints (cyclomatic 90, cognitive 124) test/helpers/qa-checkpoint-evidence.ts:88 — validateQACheckpoints has cyclomatic complexity 90 and cognitive complexity 124; 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 handleReadCommand (cyclomatic 89, cognitive 137) · ×1
  • Complex function handleReadCommand (cyclomatic 89, cognitive 137) browse/src/read-commands.ts:300 — handleReadCommand has cyclomatic complexity 89 and cognitive complexity 137; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 2957 lines of code REDACTED:1 — REDACTED has 2957 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/cso/state.ts · ×1
  • lib/cso/state.ts: 2607 lines of code lib/cso/state.ts:1 — lib/cso/state.ts has 2607 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 · browse/src/browser-manager.ts · ×1
  • browse/src/browser-manager.ts: 2263 lines of code browse/src/browser-manager.ts:1 — browse/src/browser-manager.ts has 2263 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/cso/verification.ts · ×1
  • lib/cso/verification.ts: 2179 lines of code lib/cso/verification.ts:1 — lib/cso/verification.ts has 2179 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 · browse/src/cli.ts · ×1
  • browse/src/cli.ts: 2121 lines of code browse/src/cli.ts:1 — browse/src/cli.ts has 2121 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 · REDACTED · ×1
  • REDACTED: 2081 lines of code REDACTED:1 — REDACTED has 2081 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 · scripts/test-free-shards.ts · ×1
  • scripts/test-free-shards.ts: 2004 lines of code scripts/test-free-shards.ts:1 — scripts/test-free-shards.ts has 2004 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/cso/preparation-docker.ts · ×1
  • lib/cso/preparation-docker.ts: 1687 lines of code lib/cso/preparation-docker.ts:1 — lib/cso/preparation-docker.ts has 1687 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/cso/preparation-executor.ts · ×1
  • lib/cso/preparation-executor.ts: 1495 lines of code lib/cso/preparation-executor.ts:1 — lib/cso/preparation-executor.ts has 1495 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/context-bill.ts · ×1
  • lib/context-bill.ts: 1340 lines of code lib/context-bill.ts:1 — lib/context-bill.ts has 1340 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 · browse/src/write-commands.ts · ×1
  • browse/src/write-commands.ts: 1334 lines of code browse/src/write-commands.ts:1 — browse/src/write-commands.ts has 1334 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 · scripts/resolvers/design.ts · ×1
  • scripts/resolvers/design.ts: 1318 lines of code scripts/resolvers/design.ts:1 — scripts/resolvers/design.ts has 1318 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 · extension/sidepanel.js · ×1
  • extension/sidepanel.js: 1282 lines of code extension/sidepanel.js:1 — extension/sidepanel.js has 1282 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 · REDACTED · ×1
  • REDACTED: 1251 lines of code REDACTED:1 — REDACTED has 1251 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/cso/snapshot.ts · ×1
  • lib/cso/snapshot.ts: 1189 lines of code lib/cso/snapshot.ts:1 — lib/cso/snapshot.ts has 1189 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 · browse/src/terminal-agent.ts · ×1
  • browse/src/terminal-agent.ts: 1149 lines of code browse/src/terminal-agent.ts:1 — browse/src/terminal-agent.ts has 1149 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 · REDACTED · ×1
  • REDACTED: 1133 lines of code REDACTED:1 — REDACTED has 1133 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 · REDACTED · ×1
  • REDACTED: 1127 lines of code REDACTED:1 — REDACTED has 1127 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 · scripts/test-paid-shards.ts · ×1
  • scripts/test-paid-shards.ts: 1119 lines of code scripts/test-paid-shards.ts:1 — scripts/test-paid-shards.ts has 1119 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/cso/contracts.ts · ×1
  • lib/cso/contracts.ts: 1072 lines of code lib/cso/contracts.ts:1 — lib/cso/contracts.ts has 1072 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/cso/scanners.ts · ×1
  • lib/cso/scanners.ts: 1045 lines of code lib/cso/scanners.ts:1 — lib/cso/scanners.ts has 1045 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 · REDACTED · ×1
  • REDACTED: 1036 lines of code REDACTED:1 — REDACTED has 1036 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 · browse/src/meta-commands.ts · ×1
  • browse/src/meta-commands.ts: 1031 lines of code browse/src/meta-commands.ts:1 — browse/src/meta-commands.ts has 1031 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/redact-patterns.ts · ×1
  • lib/redact-patterns.ts: 1024 lines of code lib/redact-patterns.ts:1 — lib/redact-patterns.ts has 1024 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 · extension/sidepanel-terminal.js · ×1
  • extension/sidepanel-terminal.js: 984 lines of code extension/sidepanel-terminal.js:1 — extension/sidepanel-terminal.js has 984 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/cso/cache.ts · ×1
  • lib/cso/cache.ts: 969 lines of code lib/cso/cache.ts:1 — lib/cso/cache.ts has 969 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 · scripts/cso-eval.ts · ×1
  • scripts/cso-eval.ts: 946 lines of code scripts/cso-eval.ts:1 — scripts/cso-eval.ts has 946 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/cso/scanner-executor.ts · ×1
  • lib/cso/scanner-executor.ts: 883 lines of code lib/cso/scanner-executor.ts:1 — lib/cso/scanner-executor.ts has 883 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 · scripts/lib/paid-plan.ts · ×1
  • scripts/lib/paid-plan.ts: 854 lines of code scripts/lib/paid-plan.ts:1 — scripts/lib/paid-plan.ts has 854 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 · REDACTED · ×1
  • REDACTED: 822 lines of code REDACTED:1 — REDACTED has 822 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 · ios-qa/scripts/gen-accessors.ts · ×1
  • ios-qa/scripts/gen-accessors.ts: 815 lines of code ios-qa/scripts/gen-accessors.ts:1 — ios-qa/scripts/gen-accessors.ts has 815 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/result-codes.ts · ×1
  • lib/result-codes.ts: 790 lines of code lib/result-codes.ts:1 — lib/result-codes.ts has 790 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 · REDACTED · ×1
  • REDACTED: 776 lines of code REDACTED:1 — REDACTED has 776 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 · REDACTED · ×1
  • REDACTED: 775 lines of code REDACTED:1 — REDACTED has 775 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 · make-pdf/src/diagram-prepass.ts · ×1
  • make-pdf/src/diagram-prepass.ts: 759 lines of code make-pdf/src/diagram-prepass.ts:1 — make-pdf/src/diagram-prepass.ts has 759 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/cso/process.ts · ×1
  • lib/cso/process.ts: 745 lines of code lib/cso/process.ts:1 — lib/cso/process.ts has 745 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 · browse/src/cdp-inspector.ts · ×1
  • browse/src/cdp-inspector.ts: 736 lines of code browse/src/cdp-inspector.ts:1 — browse/src/cdp-inspector.ts has 736 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 · REDACTED · ×1
  • REDACTED: 731 lines of code REDACTED:1 — REDACTED has 731 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/design-catalog.ts · ×1
  • lib/design-catalog.ts: 713 lines of code lib/design-catalog.ts:1 — lib/design-catalog.ts has 713 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 · browse/src/read-commands.ts · ×1
  • browse/src/read-commands.ts: 695 lines of code browse/src/read-commands.ts:1 — browse/src/read-commands.ts has 695 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~485 LoC) · ×1
  • Dead file (~485 LoC) REDACTED — no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~216 LoC) · ×1
  • Dead file (~216 LoC) lib/autoplan-revise.ts — no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (REDACTED) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~161 LoC) · ×1
  • Dead file (~161 LoC) scripts/preflight-agent-sdk.ts — no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~149 LoC) · ×1
  • Dead file (~149 LoC) ios-qa/daemon/src/cli-mint.ts — no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~146 LoC) · ×1
  • Dead file (~146 LoC) design/prototype.ts — no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~134 LoC) · ×1
  • Dead file (~134 LoC) REDACTED — no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~121 LoC) · ×1
  • Dead file (~121 LoC) design/scripts/live-model-check.ts — no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~76 LoC) · ×1
  • Dead file (~76 LoC) test-setup.ts — no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~66 LoC) · ×1
  • Dead file (~66 LoC) lib/autoplan-migrate.ts — no import path from any entry point (604 application, 68 tooling, 1713 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (REDACTED) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~40 LoC) · ×1
  • Dead file (~40 LoC) lib/autoplan-admission.ts — no import path from any entry point (604 application, 68 tooling, 1713 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 'xterm-addon-fit' · ×1
  • Unused dependency 'xterm-addon-fit' — Declared in the root package.json 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 'react' · ×1
  • Unused dependency 'react' — Declared in lib/diagram-render/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Minor — 120 finding(s)
X7 · Silent fallback defaults · Silent fallback default in catch · ×40
  • Silent fallback default in catch autoplan/bin/phase-publication-hook.ts:644 — `linkedWorktrees` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch lib/script-invocation.ts:197 — `readShebang` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch lib/jsonl-store.ts:94 — `readJsonl` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch bin/gstack-brain-context-load.ts:422 — `simpleGlob` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch bin/gstack-brain-context-load.ts:432 — `tryStatMtime` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch bin/gstack-design-detect.ts:229 — `safeReaddir` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch bin/gstack-memory-ingest.ts:425 — `fileSha256` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch bin/gstack-memory-ingest.ts:839 — `resolveGitRemoteUncached` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/xvfb.ts:136 — `readPidCmdline` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/xvfb.ts:150 — `readPidArgv0` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/chromium-profiles.ts:43 — `readParentPid` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/chromium-profiles.ts:87 — `readRegistry` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/browser-manager.ts:623 — `getRefMap` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/browser-manager.ts:1530 — `getCurrentUrl` swallows every exception into `return 'about:blank'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/browser-manager.ts:1561 — `getMemorySnapshot` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/bun-child-config.ts:58 — `findWindowsBunExe` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/terminal-agent.ts:284 — `ownedGroupMembers` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch browse/src/terminal-agent.ts:1069 — `readBrowseToken` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch design/src/gallery.ts:118 — `generateGalleryHtml` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch ios-qa/daemon/src/devicectl.ts:97 — `listDevices` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch ios-qa/scripts/gen-accessors.ts:759 — `detectToolGitRev` swallows every exception into `return 'dev'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch lib/version-source.ts:119 — `extractVersion` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch REDACTED:69 — `readJsonl` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch lib/autoplan-state.ts:89 — `readJournal` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch lib/autoplan-checkpoint.ts:102 — `newestRevision` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate lib/model-policy-freshness-github.ts:4 — `!!value && typeof value === 'object' && !Array.isArray(value)` appears character-identically in 2 files — lib/model-policy-freshness-github.ts, scripts/cso-image-matrix.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.
  • Duplicated predicate extension/content.js:210 — `!(e instanceof TypeError) && !(e instanceof DOMException)` appears character-identically in 2 files — extension/content.js, extension/inspector.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 browse/src/meta-commands.ts:938 — `!Array.isArray(data.cookies) || !Array.isArray(data.pages)` appears character-identically in 2 files — browse/src/meta-commands.ts, browse/src/session-persist.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.
  • Duplicated predicate lib/code-intelligence/gbrain-adapter.ts:73 — `!Number.isFinite(score) || score < minScore` appears character-identically in 2 files — lib/code-intelligence/gbrain-adapter.ts, lib/gstack-decision-semantic.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.
  • Duplicated predicate .github/scripts/qualify-dia-macos.ts:620 — `!Number.isFinite(timeout) || timeout < 1` appears character-identically in 2 files — .github/scripts/qualify-dia-macos.ts, 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:2072 — `!Number.isInteger(port) || port < 1024 || port > 65535` appears character-identically in 2 files — REDACTED, lib/cso/verification.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.
  • Duplicated predicate REDACTED:49 — `!Number.isNaN(t) && new Date(t).toISOString().slice(0, 10) === d` appears character-identically in 2 files — REDACTED, lib/approval-record.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.
  • Duplicated predicate design/src/daemon.ts:437 — `!newHtmlPath || !fs.existsSync(newHtmlPath)` appears character-identically in 2 files — design/src/daemon.ts, design/src/serve.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.
  • Duplicated predicate REDACTED:89 — `!raw || typeof raw !== 'object' || Array.isArray(raw)` appears character-identically in 6 files — REDACTED, REDACTED, lib/regen.ts, lib/sealed-guard.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.
  • Duplicated predicate lib/cso/cache.ts:231 — `!stat.isDirectory() || stat.isSymbolicLink()` appears character-identically in 2 files — lib/cso/cache.ts, 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:500 — `!stat.isFile() || stat.isSymbolicLink() || stat.nlink !== 1` appears character-identically in 2 files — REDACTED, lib/cso/verification.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.
  • Duplicated predicate REDACTED:643 — `!stat.isSocket() || stat.isSymbolicLink()` appears character-identically in 2 files — REDACTED, lib/cso/preparation-docker.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.
  • Duplicated predicate ios-qa/daemon/src/devicectl.ts:283 — `!value || typeof value !== 'object' || Array.isArray(value)` appears character-identically in 10 files — ios-qa/daemon/src/devicectl.ts, lib/cso/admission.ts, lib/cso/cache.ts, lib/cso/contracts.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.
  • Duplicated predicate scripts/eval-input-cache.ts:128 — `Number.isSafeInteger(value) && Number(value) > 0` appears character-identically in 2 files — scripts/eval-input-cache.ts, scripts/lib/paid-plan.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.
  • Duplicated predicate scripts/resolvers/preamble/generate-brain-sync-block.ts:20 — `ctx.host === 'gbrain' || ctx.host === 'hermes'` appears character-identically in 2 files — scripts/resolvers/preamble/generate-brain-sync-block.ts, scripts/resolvers/preamble/generate-preamble-bash.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.
  • Duplicated predicate scripts/resolvers/learnings.ts:45 — `ctx.skillName === 'qa' || ctx.skillName === 'qa-only'` appears character-identically in 2 files — scripts/resolvers/learnings.ts, scripts/resolvers/sections.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.
  • Duplicated predicate extension/content.js:226 — `current && current !== document.body && current !== document.documentElement` appears character-identically in 2 files — extension/content.js, extension/inspector.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 extension/content.js:232 — `current.className && typeof current.className === 'string'` appears character-identically in 2 files — extension/content.js, extension/inspector.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 design/src/check.ts:84 — `data.choices?.[0]?.message?.content?.trim() || ""` appears character-identically in 4 files — design/src/check.ts, design/src/design-to-code.ts, design/src/diff.ts, design/src/memory.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.
  • Duplicated predicate browse/src/media-extract.ts:161 — `el.className && typeof el.className === 'string'` appears character-identically in 3 files — browse/src/media-extract.ts, extension/content.js, extension/inspector.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 lib/cso/verification.ts:153 — `entry.isSymbolicLink() || (!entry.isDirectory() && !entry.isFile())` appears character-identically in 2 files — lib/cso/verification.ts, scripts/cso-runtime-promotion.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.
  • Duplicated predicate browse/src/routes/pairing.ts:151 — `err instanceof InvalidScopeError || err instanceof ReservedClientIdError` appears character-identically in 2 files — browse/src/routes/pairing.ts, browse/src/routes/tokens.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.
  • Duplicated predicate browse/src/browse-client.ts:168 — `err.name === 'TimeoutError' || err.name === 'AbortError'` appears character-identically in 2 files — browse/src/browse-client.ts, browser-skills/hackernews-frontpage/_lib/browse-client.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.
  • Duplicated predicate lib/cso/admission.ts:249 — `error instanceof CsoError && error.code === 'INSUFFICIENT_CAPACITY'` appears character-identically in 2 files — lib/cso/admission.ts, lib/cso/state.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.
  • Duplicated predicate lib/approval-record.ts:132 — `f.severity === 'HIGH' || f.severity === 'MEDIUM'` appears character-identically in 2 files — lib/approval-record.ts, lib/pr-shots.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.
IC1 · Incompleteness & stubs · Disabled test · ×5
  • Disabled test test/fixtures/shard-equivalence/skip.fixture.ts:3 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test test/helpers/overlay-case.ts:63 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test test/skill-e2e-design.test.ts:604 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test test/skill-e2e-safety-design-risk.test.ts:89 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test test/skill-routing-e2e.test.ts:172 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
GD1 · Unfinished & placeholder code · Placeholder literal left in code · ×4
  • Placeholder literal left in code lib/redact-patterns.ts:529 — A placeholder string ("CHANGEME") is still in shipped code — typical of generated boilerplate that was never filled in.
  • Placeholder literal left in code lib/redact-patterns.ts:530 — A placeholder string ("CHANGE_ME") is still in shipped code — typical of generated boilerplate that was never filled in.
  • Placeholder literal left in code scripts/resolvers/design.ts:301 — A placeholder string (", ...) → flag `[overused-font]`; as body…") is still in shipped code — typical of generated boilerplate that was never filled in.
  • Placeholder literal left in code scripts/resolvers/design.ts:594 — A placeholder string ("## Visual Sketch (UI ideas only) If the…") is still in shipped code — typical of generated boilerplate that was never filled in.
D20 · ADR Quality · ADR declares no status · ×3
  • ADR declares no status docs/designs/CONDUCTOR_SESSION_API.md:1 — `docs/designs/CONDUCTOR_SESSION_API.md` declares no status, while 5 of the 7 other records in `docs/designs` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
  • ADR declares no status docs/designs/GCOMPACTION.md:1 — `docs/designs/GCOMPACTION.md` declares no status, while 5 of the 7 other records in `docs/designs` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
  • ADR declares no status docs/designs/v2_PLAN.md:1 — `docs/designs/v2_PLAN.md` declares no status, while 5 of the 7 other records in `docs/designs` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×3
  • No app-layer HTTPS enforcement detected REDACTED:94 — `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
  • No app-layer HTTPS enforcement detected browse/src/port-allocator.ts:103 — `srv.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
  • No app-layer HTTPS enforcement detected ios-qa/daemon/src/index.ts:230 — `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×3
  • Hand-rolled JSON/XML parsing via regex lib/gate-cost-history.ts:51 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/gbrain-guards.ts:139 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex lib/redact-patterns.ts:745 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 3.3/10. The most over is `(repository root)` (143994 LoC, 1795 module-visible types across 30 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
M2 · Architecture documentation · ADRs not easily discoverable · ×1
  • ADRs not easily discoverable — 10 ADR-shaped document(s) detected by content — `docs/designs/CODE_INTELLIGENCE_PROVIDER_CONTRACT.md`, `docs/designs/CONDUCTOR_SESSION_API.md`, `docs/designs/GCOMPACTION.md`, `docs/designs/ML_PROMPT_INJECTION_KILLER.md`, `docs/designs/PLAN_TUNING_V0.md`, `docs/designs/PLAN_TUNING_V1.md`, `docs/designs/SYNC_GBRAIN_BATCH_INGEST.md`, `docs/designs/multi-agent-wave-2026-10-10/ceo-native.md`, `docs/designs/v2_PLAN.md`, `document-generate/SKILL.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
R7 · Dead Code · Unused export 'installApp' · ×1
  • Unused export 'installApp' ios-qa/daemon/src/devicectl.ts:364 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ProxyError' · ×1
  • Unused export 'ProxyError' REDACTED:26 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'spawnAndWaitReady' · ×1
  • Unused export 'spawnAndWaitReady' ios-qa/daemon/src/single-instance.ts:133 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'approvalForReceipt' · ×1
  • Unused export 'approvalForReceipt' REDACTED:207 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'exampleApprovalClassesJson' · ×1
  • Unused export 'exampleApprovalClassesJson' REDACTED:43 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'loadWorkingApprovalClasses' · ×1
  • Unused export 'loadWorkingApprovalClasses' REDACTED:135 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'renderApprovalScan' · ×1
  • Unused export 'renderApprovalScan' REDACTED:253 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'locate' · ×1
  • Unused export 'locate' lib/approval-record.ts:61 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'appendRows' · ×1
  • Unused export 'appendRows' lib/approval-record.ts:153 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'syncRecord' · ×1
  • Unused export 'syncRecord' lib/approval-record.ts:165 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'changeBudget' · ×1
  • Unused export 'changeBudget' lib/autoplan-budget.ts:99 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'checkpointRun' · ×1
  • Unused export 'checkpointRun' lib/autoplan-checkpoint.ts:139 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'checkpointLines' · ×1
  • Unused export 'checkpointLines' lib/autoplan-checkpoint.ts:207 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'restoreCheckpoint' · ×1
  • Unused export 'restoreCheckpoint' lib/autoplan-checkpoint.ts:230 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'recommendGate' · ×1
  • Unused export 'recommendGate' lib/autoplan-gate.ts:262 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'answerGate' · ×1
  • Unused export 'answerGate' lib/autoplan-gate.ts:359 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'exportPublic' · ×1
  • Unused export 'exportPublic' lib/autoplan-public.ts:134 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'loadBannedTerms' · ×1
  • Unused export 'loadBannedTerms' REDACTED:94 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'wholeFiles' · ×1
  • Unused export 'wholeFiles' REDACTED:151 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'gitBranch' · ×1
  • Unused export 'gitBranch' lib/bin-context.ts:387 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'flagValue' · ×1
  • Unused export 'flagValue' lib/bin-context.ts:394 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'OPTIONAL_CAPABILITIES' · ×1
  • Unused export 'OPTIONAL_CAPABILITIES' lib/code-intelligence/contract.ts:48 — Nothing ultimately consumes this binding: its only referrer is the re-export in lib/code-intelligence/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in lib/code-intelligence/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'SCAN_UNTRUSTED_PATHS' · ×1
  • Unused export 'SCAN_UNTRUSTED_PATHS' REDACTED:223 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'TOKEN_REF_MAX_HOPS' · ×1
  • Unused export 'TOKEN_REF_MAX_HOPS' REDACTED:65 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'dxErrorCaptureMain' · ×1
  • Unused export 'dxErrorCaptureMain' lib/dx-error-capture.ts:483 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'checkModelRules' · ×1
  • Unused export 'checkModelRules' lib/eval-models.ts:145 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'runPreregDiagnostics' · ×1
  • Unused export 'runPreregDiagnostics' lib/eval-plan.ts:114 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'renderPreregDiagnostics' · ×1
  • Unused export 'renderPreregDiagnostics' lib/eval-plan.ts:139 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'releasePilot' · ×1
  • Unused export 'releasePilot' lib/eval-plan.ts:330 — Nothing imports this binding — it is safe to review for removal.
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 27/39 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Null assertions (`!`) reduce the strict null checking score · ×1
  • Null assertions (`!`) reduce the strict null checking score — ~8.7 `!` null assertions per 1k TypeScript source lines — 1272 assertion(s) across the 146456 source line(s) of the 510 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: scripts/pr-dependencies.ts (53), scripts/lib/paid-plan.ts (48), lib/eval-plan.ts (39). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Minor — 374 finding(s)
D10 · Test Quality · Skipped (documented) · ×368
  • Skipped (documented): (unnamed test) test/aside-render.test.ts:146 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/aside-render.test.ts:147 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/aside-render.test.ts:248 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/aside-render.test.ts:249 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/auq-native-capture.test.ts:491 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-admission.test.ts:62 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-init.test.ts:245 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-owned-state.test.ts:34 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-owned-state.test.ts:81 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-pending-artifact.test.ts:8 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-phase-observer.test.ts:206 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1532 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1537 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1542 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1550 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1555 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1564 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1572 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1577 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1584 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-guard.test.ts:1592 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-hook.test.ts:210 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-hook.test.ts:219 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/autoplan-publication-hook.test.ts:229 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/bun-subprocess-fd-lifetime.test.ts:66 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • + 343 more in this group — see findings.md.
D12 · Dependency Hygiene · Outdated (npm) · ×6
  • Outdated (npm): @anthropic-ai/sdk — @anthropic-ai/sdk is pinned at 0.78.0; registry.npmjs.org publishes 1.3.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): @excalidraw/mermaid-to-excalidraw — @excalidraw/mermaid-to-excalidraw is pinned at 2.2.2; registry.npmjs.org publishes 2.3.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): mermaid — mermaid is pinned at 11.16.1; registry.npmjs.org publishes 12.2.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): playwright — playwright is pinned at 1.62.1; registry.npmjs.org publishes 1.64.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): react — react is pinned at 18.3.1; registry.npmjs.org publishes 19.3.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): react-dom — react-dom is pinned at 18.3.1; registry.npmjs.org publishes 19.3.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-037c40202bd544b994ff20711226f349/history.json --exit-code 0 --source .70artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-037c40202bd544b994ff20711226f349/tree.json --exit-code 0 --source .13artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude test/fixtures/ios-qa/FixtureApp/Sources/DebugBridgeCore --exclude test/fixtures/ios-qa/FixtureApp/Sources/DebugBridgeUI .91artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update1artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .8artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 25 file(s) — `autoplan/bin/guard-reasons.ts`, `browse/src/browser-manager.ts`, `browse/src/routes/table.ts`, `hosts/define-host.ts`, `ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift`, … (+20 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a17803-901a-77d7-a9ba-22072db44286 · 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