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

garrytan/gstack

Measured 14 November 2026, 09:48 UTC, at code version 3b65035

CAI score 41out of 100 Weak
CriticalWeakAdequateStrongExemplary
Down 2 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: 195,727 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 3.9 person-years · Weakest lens: Accessibility, 25

Findings by how serious they are

48 critical 2499 serious 626 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 09:48 UTC

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

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

81of 81 dimensions measured by tools.
3156of 3173 findings point to an exact file and line, so you can open each one in the code. The other 17 concern the repository as a whole, such as missing documentation.
81dimensions across 7 lenses, read from 195,727 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 41 out of 100 and is rated Weak, and 24 of its 48 critical findings are security problems.

Accessibility, at 25, 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 54.

Sixteen places in the code run text as code, which an attacker could use. Two secrets can leak from the build pipeline, and two weaknesses in the code could be used by an attacker. Replacing text run as code with direct calls, limiting each secret to its own step and fixing the weaknesses the scanner points to would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once, and loading the key from a secret store instead of the code would deal with the encryption key written into the code. The seven loops of files that import each other need breaking.

The product code is 195,727 lines, about €570,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 25 · counts for 46%Security and Compliance 52 · counts for 25%Code Health 52 · counts for 14%Production Readiness 55 · counts for 8%Performance 60 · counts for 4%Architecture 60 · counts for 2%Maturity 87 · counts for 1%

If Accessibility rose from 25 to 70, the lowest score rated Strong, the score would rise from 41 to about 54.

Code composition: what the lines of code are
Product code 29%Tests 71%
New since the last survey: 985 findings

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

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

Fixed since the last survey: 1861 findings

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

  • Cyclomatic Complexity · paid-plan.parseRunManifest (cyclomatic 154) scripts/lib/paid-plan.ts
  • Cyclomatic Complexity · paid-report.runPaidReport (cyclomatic 143) scripts/lib/paid-report.ts
  • Cyclomatic Complexity · cso-eval.validateResult (cyclomatic 95) scripts/cso-eval.ts
  • Cyclomatic Complexity · paid-plan.verifySliceResults (cyclomatic 81) scripts/lib/paid-plan.ts
  • Cyclomatic Complexity · gate-reuse.findReusableGate (cyclomatic 60) scripts/gate-reuse.ts
  • Cyclomatic Complexity · gen-skill-docs.runGeneration (cyclomatic 60) scripts/gen-skill-docs.ts
  • Cyclomatic Complexity · cso-eval.scoreEval (cyclomatic 55) scripts/cso-eval.ts
  • Cyclomatic Complexity · guard-journal.select (cyclomatic 48) autoplan/bin/guard-journal.ts
  • Cyclomatic Complexity · cso-eval.validateReceipt (cyclomatic 46) scripts/cso-eval.ts
  • Cyclomatic Complexity · cso-eval.cli (cyclomatic 43) scripts/cso-eval.ts
  • Cyclomatic Complexity · paid-report.junitCensus (cyclomatic 42) scripts/lib/paid-report.ts
  • Cyclomatic Complexity · paid-plan.buildRunManifest (cyclomatic 40) scripts/lib/paid-plan.ts
  • Cyclomatic Complexity · cso-image-matrix.imageBuildMatrix (cyclomatic 40) scripts/cso-image-matrix.ts
  • Cyclomatic Complexity · train-gate.routeDispatch (cyclomatic 40) scripts/train-gate.ts
  • Cyclomatic Complexity · release-cut.planRelease (cyclomatic 39) REDACTED
  • Cyclomatic Complexity · eval-flake-rank.analyzePassRates (cyclomatic 38) scripts/eval-flake-rank.ts
  • Cyclomatic Complexity · cso-eval-producer.runProducerCell (cyclomatic 38) scripts/cso-eval-producer.ts
  • Cyclomatic Complexity · recover-receipts.collectRecovery (cyclomatic 37) scripts/recover-receipts.ts
  • Cyclomatic Complexity · ship-queue-train.trainStatus (cyclomatic 35) lib/ship-queue-train.ts
  • Cyclomatic Complexity · paid-rerun.observeCases (cyclomatic 35) scripts/lib/paid-rerun.ts
  • Cyclomatic Complexity · cso-eval.buildEvalMatrix (cyclomatic 35) scripts/cso-eval.ts
  • Cyclomatic Complexity · garry-output-comparison.main (cyclomatic 33) REDACTED
  • Cyclomatic Complexity · review-dashboard.generatePlanFileReviewReport (cyclomatic 33) scripts/resolvers/review-dashboard.ts
  • Cyclomatic Complexity · cso-eval.validateCollectedBatch (cyclomatic 31) scripts/cso-eval.ts
  • Cyclomatic Complexity · gate-cost-replay.parseArgs (cyclomatic 31) scripts/gate-cost-replay.ts
  • Cyclomatic Complexity · gen-skill-docs.transformFrontmatter (cyclomatic 31) scripts/gen-skill-docs.ts
  • Cyclomatic Complexity · ship-measure.main (cyclomatic 31) scripts/ship-measure.ts
  • Cyclomatic Complexity · cso-eval.validateReceiptIndex (cyclomatic 30) scripts/cso-eval.ts
  • Cyclomatic Complexity · version-gate-train.classifyTrainHead (cyclomatic 29) lib/version-gate-train.ts
  • Cyclomatic Complexity · eval-bg.main (cyclomatic 28) scripts/eval-bg.ts
  • Cyclomatic Complexity · ship-queue-train-verdict.classifyGate (cyclomatic 28) lib/ship-queue-train-verdict.ts
  • Cyclomatic Complexity · design.generateDesignOutsideVoices (cyclomatic 28) scripts/resolvers/design.ts
  • Cyclomatic Complexity · host-config.validateHostConfig (cyclomatic 27) scripts/host-config.ts
  • Cyclomatic Complexity · ship-queue-train.newTrain (cyclomatic 27) lib/ship-queue-train.ts
  • Cyclomatic Complexity · eval-history.parsePassRatesArgs (cyclomatic 27) scripts/lib/eval-history.ts
  • Cyclomatic Complexity · gate-reuse.ownDiffSignature (cyclomatic 27) scripts/gate-reuse.ts
  • Cyclomatic Complexity · pr-dependencies.deriveDependencies.refs (cyclomatic 26) scripts/pr-dependencies.ts
  • Cyclomatic Complexity · pr-dependencies.exercisedConsumers.shellEdges (cyclomatic 26) scripts/pr-dependencies.ts
  • Cyclomatic Complexity · ship-queue-train.buildTrain (cyclomatic 26) lib/ship-queue-train.ts
  • Cyclomatic Complexity · ship-queue-train-verdict.trainVerdict (cyclomatic 26) lib/ship-queue-train-verdict.ts
  • Cyclomatic Complexity · ship-queue-train-verdict.trainBisect (cyclomatic 26) lib/ship-queue-train-verdict.ts
  • Cyclomatic Complexity · eval-input-cache.buildEvalInputIdentity (cyclomatic 26) scripts/eval-input-cache.ts
  • Cyclomatic Complexity · eval-input-cache.validProof (cyclomatic 26) scripts/eval-input-cache.ts
  • Cyclomatic Complexity · cso-eval-producer.artifactIdentity (cyclomatic 26) scripts/cso-eval-producer.ts
  • Cyclomatic Complexity · gate-cost-history.classifyReds (cyclomatic 25) lib/gate-cost-history.ts
  • Cyclomatic Complexity · pr-dependencies.stripMessages (cyclomatic 25) scripts/pr-dependencies.ts
  • Cyclomatic Complexity · cso-eval-producer.validateSource (cyclomatic 25) scripts/cso-eval-producer.ts
  • Cyclomatic Complexity · cso-eval.validatePortableSkillPayload (cyclomatic 25) scripts/cso-eval.ts
  • Cyclomatic Complexity · cso-eval.validateArtifactInventory (cyclomatic 25) scripts/cso-eval.ts
  • Cyclomatic Complexity · cso-runtime-promotion.validateStatement (cyclomatic 25) scripts/cso-runtime-promotion.ts
  • Cyclomatic Complexity · ship-queue-train.mergeStep (cyclomatic 24) lib/ship-queue-train.ts
  • Cyclomatic Complexity · ship-queue-train.freePhase (cyclomatic 24) lib/ship-queue-train.ts
  • Cyclomatic Complexity · eval-history.triageRun (cyclomatic 24) scripts/lib/eval-history.ts
  • Cyclomatic Complexity · gate-reuse.parseBinding (cyclomatic 24) scripts/gate-reuse.ts
  • Cyclomatic Complexity · gen-skill-docs.parseGenerationArgs (cyclomatic 24) scripts/gen-skill-docs.ts
  • Cyclomatic Complexity · ship-measure.runSet (cyclomatic 24) scripts/ship-measure.ts
  • Cyclomatic Complexity · ship-measure-sweep.planSweep (cyclomatic 24) scripts/ship-measure-sweep.ts
  • Cyclomatic Complexity · gate-cost-history.simulateArrivalTrains (cyclomatic 23) lib/gate-cost-history.ts
  • Cyclomatic Complexity · paid-plan.buildRunManifest::packByRecordedDuration (cyclomatic 23) scripts/lib/paid-plan.ts
  • Cyclomatic Complexity · ship-queue-train-verify.verifyTrain (cyclomatic 23) lib/ship-queue-train-verify.ts
  • Cyclomatic Complexity · cso-staging-run.verifyStagingRun (cyclomatic 23) scripts/cso-staging-run.ts
  • Cyclomatic Complexity · gate-reuse.parseReuse (cyclomatic 23) scripts/gate-reuse.ts
  • Cyclomatic Complexity · cli.bindRecheckEvidence (cyclomatic 22) REDACTED
  • Cyclomatic Complexity · exercised-map.readShardCommands (cyclomatic 22) scripts/exercised-map.ts
  • Cyclomatic Complexity · cso-eval.collectProducerReceipts (cyclomatic 22) scripts/cso-eval.ts
  • Cyclomatic Complexity · ship-queue-gate.recomputeMergeTree (cyclomatic 21) lib/ship-queue-gate.ts
  • Cyclomatic Complexity · paid-report.runCaseDiagnosis (cyclomatic 21) scripts/lib/paid-report.ts
  • Cyclomatic Complexity · eval-trial-series.weeklyBacktest (cyclomatic 21) scripts/eval-trial-series.ts
  • Cyclomatic Complexity · cso-runtime-promotion.evaluationCandidateCatalog (cyclomatic 21) scripts/cso-runtime-promotion.ts
  • Cyclomatic Complexity · cso-runtime-promotion.collectEvidence (cyclomatic 21) scripts/cso-runtime-promotion.ts
  • Cyclomatic Complexity · testing.generateTestCoverageAuditInner (cyclomatic 21) scripts/resolvers/testing.ts
  • Cyclomatic Complexity · install-verdict.verdictProblem (cyclomatic 20) lib/install-verdict.ts
  • Cyclomatic Complexity · outside-review-result.concludesNoFindings (cyclomatic 20) lib/outside-review-result.ts
  • Cyclomatic Complexity · pr-dependencies.exercisedConsumers.execRefs (cyclomatic 20) scripts/pr-dependencies.ts
  • Cyclomatic Complexity · ship-queue-train-ready.trainReady (cyclomatic 20) lib/ship-queue-train-ready.ts
  • Cyclomatic Complexity · analytics.formatReport (cyclomatic 20) scripts/analytics.ts
  • Cyclomatic Complexity · paid-report.panelReports (cyclomatic 20) scripts/lib/paid-report.ts
  • Cyclomatic Complexity · cso-eval.measuredRate (cyclomatic 20) scripts/cso-eval.ts
  • Cyclomatic Complexity · cso-scanner-matrix.assets (cyclomatic 20) scripts/cso-scanner-matrix.ts
  • Cyclomatic Complexity · outside-voice.outsideVoiceCommand (cyclomatic 20) scripts/resolvers/outside-voice.ts
  • Cyclomatic Complexity · ship-queue-train-verdict.trainRebuild (cyclomatic 19) lib/ship-queue-train-verdict.ts
  • Cyclomatic Complexity · paid-report.attributeJUnitCase (cyclomatic 19) scripts/lib/paid-report.ts
  • Cyclomatic Complexity · eval-flake-rank.loadPassRateHistory (cyclomatic 19) scripts/eval-flake-rank.ts
  • Cyclomatic Complexity · cso-eval-producer.validateProductionProducerInstallation (cyclomatic 19) scripts/cso-eval-producer.ts
  • Cyclomatic Complexity · cso-scanner-matrix.scannerBuildMatrix (cyclomatic 19) scripts/cso-scanner-matrix.ts
  • Cyclomatic Complexity · replay-pr-selection.loadInput (cyclomatic 19) scripts/replay-pr-selection.ts
  • Cyclomatic Complexity · ship-queue-train.admitSlots (cyclomatic 18) lib/ship-queue-train.ts
  • Cyclomatic Complexity · version-gate-train.regeneratedAtBase (cyclomatic 18) lib/version-gate-train.ts
  • Cyclomatic Complexity · ship-queue-train-cli.trainMain (cyclomatic 18) lib/ship-queue-train-cli.ts
  • Cyclomatic Complexity · cso-attestation-evidence.verifiedStatementSetDigest (cyclomatic 18) scripts/cso-attestation-evidence.ts
  • Cyclomatic Complexity · cso-eval-producer.inventoryProducerArtifacts (cyclomatic 18) scripts/cso-eval-producer.ts
  • Cyclomatic Complexity · cso-scanner-catalog.scannerCatalogProposal (cyclomatic 18) scripts/cso-scanner-catalog.ts
  • Cyclomatic Complexity · gate-cost-replay.formatReport (cyclomatic 18) scripts/gate-cost-replay.ts
  • Cyclomatic Complexity · gen-llms-txt.parseSkillFrontmatter (cyclomatic 18) scripts/gen-llms-txt.ts
  • Cyclomatic Complexity · outside-voice.outsideVoicePreflight (cyclomatic 18) scripts/resolvers/outside-voice.ts
  • Cyclomatic Complexity · ship-measure.gstackRunner (cyclomatic 18) scripts/ship-measure.ts
  • Cyclomatic Complexity · train-gate.stampFreeTree (cyclomatic 18) scripts/train-gate.ts
  • Cyclomatic Complexity · train-backstop.coveringRecord (cyclomatic 18) scripts/train-backstop.ts
  • Cyclomatic Complexity · train-backstop.runBackstop (cyclomatic 18) scripts/train-backstop.ts
  • Cyclomatic Complexity · shard-engine.runShardChild (cyclomatic 17) scripts/lib/shard-engine.ts
Rebuild cost: about €570,000 · Estimate
Cost to rebuild€190,000 to €940,000, for 3,127 to 9,921 hours of work, about 3.9 person-years for 2 to 8 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 41. 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: 195,727 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
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 €570,000 to build again, about 3.9 person-years of work. Its weakest lens is Accessibility, at 25 (Critical). 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.6 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 9% to 19% on every change. The history of the code shows how much it changes: about 870,497 lines over the last 90 days, which is about 3,530,349 lines a year. At that pace, the extra work comes to an estimated 760.7 to 4564.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

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

548 modules, with 735 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 508 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.security3 browse.src.security-sidecar-entry4 crew.lib.gate-cost5 ios-qa.daemon.src6 lib.autoplan-state7 lib.cso.runtime-catalog8 lib.design-lint.html9 lib.pregate.config10 lib.redact-engine11 lib.ship-policy12 lib.skill-contract13 scripts.lib.paid-plan14 bin15 crew.lib.ship-queue-gate16 crew.scripts17 hosts.claude.hooks18 lib.autoplan-shadow19 lib.cso.contracts20 lib.design-lint21 lib.design-lint.rules22 lib.headless-artifacts23 lib.pregate.types24 scripts.lib.paid-rerun25 scripts.resolvers26 autoplan.bin27 browse.src.browser-manager28 crew.lib.ship-queue-train29 design.src30 lib.checks31 lib.cso.scanner-executor32 lib.pregate.checks33 make-pdf.src34 scripts.lib35 browse.src36 lib.cso37 lib.pregate38 crew.lib39 lib40 scripts
1 bin.gstack-memory-ingest
2 browse.src.security
3 browse.src.security-sidecar-entry
4 crew.lib.gate-cost
5 ios-qa.daemon.src
6 lib.autoplan-state
7 lib.cso.runtime-catalog
8 lib.design-lint.html
9 lib.pregate.config
10 lib.redact-engine
11 lib.ship-policy
12 lib.skill-contract
13 scripts.lib.paid-plan
14 bin141
15 crew.lib.ship-queue-gate1
16 crew.scripts1332
17 hosts.claude.hooks2
18 lib.autoplan-shadow1
19 lib.cso.contracts1
20 lib.design-lint91
21 lib.design-lint.rules6
22 lib.headless-artifacts11
23 lib.pregate.types1
24 scripts.lib.paid-rerun1
25 scripts.resolvers1
26 autoplan.bin1
27 browse.src.browser-manager1
28 crew.lib.ship-queue-train211
29 design.src11
30 lib.checks111
31 lib.cso.scanner-executor33
32 lib.pregate.checks117
33 make-pdf.src1
34 scripts.lib34
35 browse.src58511
36 lib.cso7327
37 lib.pregate4191
38 crew.lib1878211
39 lib3112127111636177467
40 scripts1411111
Uses a module listed above itPart of a loopThe module itself
1 bin.gstack-memory-ingest2 browse.src.security3 browse.src.security-sidecar-entry4 crew.lib.gate-cost5 ios-qa.daemon.src6 lib.autoplan-state7 lib.cso.runtime-catalog8 lib.design-lint.html9 lib.pregate.config10 lib.redact-engine11 lib.ship-policy12 lib.skill-contract13 scripts.lib.paid-plan14 bin15 crew.lib.ship-queue-gate16 crew.scripts17 hosts.claude.hooks18 lib.autoplan-shadow19 lib.cso.contracts20 lib.design-lint21 lib.design-lint.rules22 lib.headless-artifacts23 lib.pregate.types24 scripts.lib.paid-rerun25 scripts.resolvers26 autoplan.bin27 browse.src.browser-manager28 crew.lib.ship-queue-train29 design.src30 lib.checks31 lib.cso.scanner-executor32 lib.pregate.checks33 make-pdf.src34 scripts.lib35 browse.src36 lib.cso37 lib.pregate38 crew.lib39 lib40 scriptsbin.gstack-memory-ingest1browse.src.security2browse.src.security-sidecar-entry3crew.lib.gate-cost4ios-qa.daemon.src5lib.autoplan-state6lib.cso.runtime-catalog7lib.design-lint.html8lib.pregate.config9lib.redact-engine10lib.ship-policy11lib.skill-contract12scripts.lib.paid-plan13bin14crew.lib.ship-queue-gate15crew.scripts16hosts.claude.hooks17lib.autoplan-shadow18lib.cso.contracts19lib.design-lint20lib.design-lint.rules21lib.headless-artifacts22lib.pregate.types23scripts.lib.paid-rerun24scripts.resolvers25autoplan.bin26browse.src.browser-manager27crew.lib.ship-queue-train28design.src29lib.checks30lib.cso.scanner-executor31lib.pregate.checks32make-pdf.src33scripts.lib34browse.src35lib.cso36lib.pregate37crew.lib38lib39scripts4014111332211916111111121111111331171345851173274191187821131121271116361774671411111+508 more modules (most-connected shown)

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

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

At a glance — Maturity · 87% · Strong ·

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

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

At a glance — Accessibility · 25% · Critical · gated by AC1, 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 — Injection113High / Critical
A02:2025 — Security Misconfiguration8High / Critical
A03:2025 — Software Supply Chain Failures4Medium

Roadmap

Top priorities: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; 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; Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.

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.2 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.2 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.+3.7 ptsMediumPage structure
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+3.5 ptsMediumText alternatives
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 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED.+0.4 ptsLowStatic Analysis (SAST)
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.+1.5 ptsMediumWeb-Security Posture
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.+0.7 ptsLowTest Quality

File quality

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

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

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

Serious — 2499

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

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

Could not be resolved — 10

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

Methodology & how to trust this report

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

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

What we checked — 81 dimensions across the health lenses
D1D2D3D5D6D7D10D12D13D14D15D17D19D20D21D24D26D27D29D30D31D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX4AX6AX9C2GD1IC1M1M2M3M4P1P2P3P4P6P7P8PF3R1R10R11R2R3R4R6R7R8R9S1X1X12X13X14X16X17X18X19X2X21X24X25X28X29X3X30X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1d975-897d-7451-b631-79f9bd7f39fe.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the 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.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.ts, .js, .tsx, .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/.tsx/.cjs runner and not a finding about this repository.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares 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 1183 commit(s) sampled, automation and bot accounts excluded). One of them holds 97% of the history; the other 14 hold 0.2% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D28 Secrets (history) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `gitleaks` TIMED OUT after 180s against a 180s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. Nothing about this repository is asserted by the absence of a result; the budget is ours to raise, and raising it is our backlog item, not an action for this repository's owner.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `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`, … (+36 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads 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.
  • AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The dev server exited, and its output does not match a cause we recognise. (rule: unrecognised-exit). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (not identified): the dev server exited, and its output does not match a cause we recognise. Last output: "Server: status | cookie <n>=<v> | header <n>:<v> / useragent <str> | stop | restart / profiles [list] | profiles prune [--days N] (per-project headed profiles) / tunnel revoke <name> | tunnel agents (paired-agent tokens) / --force-restart: replace a live-but-busy daemon (any command; / LOSES tabs/cookies/logins — never done automatically) / Dialogs: dialog-accept [text] | dialog-dismiss / Refs: After 'snapshot', use @e1, @e2... as selectors: / click @e3 | fill @e4 "value" | hover @e1 / @c refs from -C: click @c1" No runtime evidence was gathered.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (not identified): the dev server exited, and its output does not match a cause we recognise. Last output: "Server: status | cookie <n>=<v> | header <n>:<v> / useragent <str> | stop | restart / profiles [list] | profiles prune [--days N] (per-project headed profiles) / tunnel revoke <name> | tunnel agents (paired-agent tokens) / --force-restart: replace a live-but-busy daemon (any command; / LOSES tabs/cookies/logins — never done automatically) / Dialogs: dialog-accept [text] | dialog-dismiss / Refs: After 'snapshot', use @e1, @e2... as selectors: / click @e3 | fill @e4 "value" | hover @e1 / @c refs from -C: click @c1" No runtime evidence was gathered.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • PF3 Async & latency hygiene — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 497 further occurrence(s) are not listed individually; the score already reflects all 537.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 284 further occurrence(s) are not listed individually; the score already reflects all 324.
  • R11 Import Boundaries — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 48 further occurrence(s) are not listed individually; the score already reflects all 88.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 2165 further occurrence(s) are not listed individually; the score already reflects all 2205.
  • R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 93 further occurrence(s) are not listed individually; the score already reflects all 133.
  • R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 185 further occurrence(s) are not listed individually; the score already reflects all 225.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 43 further occurrence(s) are not listed individually; the score already reflects all 83.
  • X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 511 further occurrence(s) are not listed individually; the score already reflects all 551.
  • X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 63 further occurrence(s) are not listed individually; the score already reflects all 103.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • 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.
  • 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 checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • 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.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • 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.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

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

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

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

759 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was write-commands.handleWriteCommand at 386. A further 18 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. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: REDACTED (capy-review-pass.modelOf at 17). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

write-commands.handleWriteCommand (cyclomatic 386)browse/src/write-commands.ts:136
meta-commands.handleMetaCommand (cyclomatic 192)browse/src/meta-commands.ts:323
review-ledger.parseLabelled (cyclomatic 177)lib/review-ledger.ts:195
snapshot.handleSnapshot (cyclomatic 156)browse/src/snapshot.ts:104
read-commands.handleReadCommand (cyclomatic 140)browse/src/read-commands.ts:300

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

What to do

  1. Bring the 36 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with write-commands.handleWriteCommand (cyclomatic 386), meta-commands.handleMetaCommand (cyclomatic 192), review-ledger.parseLabelled (cyclomatic 177). — 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 36 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.

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

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

BrowseClient.command (cognitive 18) · ×2browse/src/browse-client.ts:153
write-commands.handleWriteCommand (cognitive 758)browse/src/write-commands.ts:136
meta-commands.handleMetaCommand (cognitive 349)browse/src/meta-commands.ts:323
snapshot.handleSnapshot (cognitive 284)browse/src/snapshot.ts:104
read-commands.handleReadCommand (cognitive 218)browse/src/read-commands.ts:300

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

What to do

  1. Bring the 93 bodies over 60 down to 60 or less in Cognitive Complexity — start with write-commands.handleWriteCommand (cognitive 758), meta-commands.handleMetaCommand (cognitive 349), 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 93 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.

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

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

101 god class(es) detected.

FunctionTooLong: write-commands.handleWriteCommand · ×53browse/src/write-commands.ts:136
FileTooLong: REDACTED · ×36REDACTED
MethodTooLong: DockerGroup.createContainer · ×7REDACTED:627
ClassTooLong: TabScope · ×4browse/src/browser-manager.ts:338
TooManyMethods: BrowserManagerbrowse/src/browser-manager.ts:340

What to do

  1. Resolve the 53 FunctionTooLong finding(s) in God Classes — start with REDACTED (9), verification.ts (6), scanners.ts (3). — One of this dimension's main actionable groups (53 warning-level).
  2. Resolve the 36 FileTooLong finding(s) in God Classes — start with REDACTED (2), state.ts, verification.ts. — One of this dimension's main actionable groups (36 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).

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.7 / 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.7 / 10 · rule-coverage 100% · ceiling Verified

1 of 35 classes have LCOM4 above 3.

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

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

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

Detailed fixes: d7_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

446 skipped (442 with a documented reason), 90 zero-assertion, 12 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 23731 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:138
Fixed-sleep synchronisation: a call in flight when the process died is charged its reservation on the next run, which dispatches a fresh attempt · ×12test/autoplan-run-api.test.ts:178
Skipped test: needs Aside · ×4test/skill-e2e-design.test.ts:604
Skipped (documented): (unnamed test) · ×442test/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), touchfiles.test.ts (5), skill-budget-regression.test.ts (4). — One of this dimension's main actionable groups (86 warning-level).
  3. Resolve the 12 Fixed-sleep synchronisation finding(s) in Test Quality — start with ceo-review-gate.test.ts (2), skill-contract-stop-hook.test.ts (2), autoplan-run-api.test.ts. — One of this dimension's main actionable groups (12 warning-level).

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

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

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

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

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

8 outdated direct production npm dependency(ies) of 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 · ×8

✓ On the Gold path — maintain.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 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.8 / 10Stronggated by 181 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.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: lib/review-ledger.ts (22×177=3894); browse/src/write-commands.ts (8×386=3088); lib/ship-release.ts (32×88=2816) Repeated repair below the complexity floor: lib/ship-bin-common.ts (11 of 15 changes were fixes); scripts/resolvers/qa.ts (10 of 14 changes were fixes); scripts/resolvers/constants.ts (9 of 16 changes were fixes)

Hotspot: lib/review-ledger.ts · ×151lib/review-ledger.ts:195
Repeated repair: lib/ship-bin-common.ts · ×30lib/ship-bin-common.ts:128

What to do

  1. Resolve the 151 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (3), REDACTED (2), snapshot.ts (2). — One of this dimension's main actionable groups (151 warning-level).
  2. Resolve the 30 Repeated repair finding(s) in Churn × Complexity Hotspots — start with ship-bin-common.ts, qa.ts, constants.ts. — One of this dimension's main actionable groups (30 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 191092 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).

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

Maturity: Documented → Verified → Prevented · effective 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, a date that is no calendar day). 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.

D21 · Naming Consistency7.8 / 10Strong✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

2 naming inconsistencies among 92 declarations measured against a convention their peers follow.

`getCookiePickerHTML` spells `HTML` where 19 names in the project spell it `Html`browse/src/cookie-picker-ui.ts:10
`costUSD` spells `USD` where 71 names in the project spell it `Usd`crew/lib/gate-cost.ts:46

What to do

  1. Resolve the 1 `getCookiePickerHTML` spells `HTML` where 19 names in the project spell… finding(s) in Naming Consistency — start with cookie-picker-ui.ts. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `costUSD` spells `USD` where 71 names in the project spell it `Usd` finding(s) in Naming Consistency — start with gate-cost.ts. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

Maturity: Documented → Verified → Prevented · effective 9.5 / 10 · rule-coverage 97% · ceiling Documented

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

redundant comment · ×32browse/src/cdp-inspector.ts:312
doc comments repeat the namesmake-pdf/src/types.ts:66

✓ On the Gold path — maintain.

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

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.

D27 · Navigability9.9 / 10Exemplary✓ Tool-verified

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d27_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

117 finding(s): 0 critical, 22 high, 90 medium, 2 low. semgrep hit a parse error in 139 file(s) — `autoplan/bin/guard-reasons.ts` (line 74), `autoplan/bin/phase-publication-hook` (line 4), `bin/gstack-analytics` (line 133), `bin/gstack-brain-lock.sh` (lines 48–49, line 69), `bin/gstack-brain-restore` (lines 220–261), … (+134 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 15 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

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

What to do

  1. Resolve the 16 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (8), REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (16 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  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.8 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

  1. Resolve the 2 Low CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 recommendation-level).
  2. Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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 / 10Adequategated by 1 critical finding✓ 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

1 of 665 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift. Counted over 665 of the 747 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledgeios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift:1

What to do

  1. Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with main.swift. — One of this dimension's main actionable groups (1 issue-level).

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

D35 · Change Coupling9.9 / 10Stronggated by 4 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 56%; REDACTED↔review-pass.ts 55%

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

What to do

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

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

D36 · Supply-chain Provenance & Signing10.0 / 10Stronggated by 1 serious finding✓ 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.

REDACTED

What to do

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

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

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

AC1 · Text alternatives2.7 / 10Weak✓ Tool-verified

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

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

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

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×2) — lib/design-lint/rules/ids.ts:127, lib/design-lint/rules/ids.ts:168

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & 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:151, 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:151, 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:151, 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
  • `footer` sets color: #52525B on background-color: #141414 — 2.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — extension/sidepanel.css:866
  • `.mem-toast-btn.primary` sets color: #fff on background-color: #ef4444 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — extension/sidepanel.css:988
  • `.inspector-specificity` sets color: #A1A1AA on background-color: #52525B — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — extension/sidepanel.css:1414
  • `#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.
AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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

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

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

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 ("Lorem ipsum") is still in shipped code — typical of generated boilerplate that was never filled in. — lib/design-catalog.ts:485
  • A placeholder string ("Lorem ipsum where a visitor can read it.…") is still in shipped code — typical of generated boilerplate that was never filled in. — lib/design-catalog.ts:486
  • A placeholder string ("Grep visible copy for "lorem ipsum".") is still in shipped code — typical of generated boilerplate that was never filled in. — lib/design-catalog.ts:488
  • A placeholder string ("lorem ipsum placeholder text") is still in shipped code — typical of generated boilerplate that was never filled in. — lib/design-lint/rules/ids.ts:160
  • A placeholder string ("CHANGEME") is still in shipped code — typical of generated boilerplate that was never filled in. — lib/redact-patterns.ts:689
  • A placeholder string ("CHANGE_ME") is still in shipped code — typical of generated boilerplate that was never filled in. — lib/redact-patterns.ts:690

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:657
  • `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:208
  • 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)9.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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

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 558 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.
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.
  • `.github/workflows/platform-qualification.yml` runs a secret scanner, but none of its triggers fires before a merge (no pull request, merge queue or unfiltered push), and no other workflow runs one that does. A change that commits a credential merges unscanned, and the scan reports it afterwards, when the secret is already in the default branch's history and must be rotated. Add the pull-request trigger to this workflow. — .github/workflows/platform-qualification.yml:9

What to do

  • Trigger your SAST workflow on pull requests — a scan that only runs on a cron reports history, it does not gate.
  • Trigger your secret scanner on pull requests: a scan that only runs on a cron or after the merge reports a leaked secret, it does not stop one.
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. (×7) — REDACTED:79, browse/src/security-classifier.ts:82, browse/src/terminal-agent.ts:1051, …
  • `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:69
  • `got(` 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. — lib/review-risk.ts:91

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

  • `fs.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:657
  • `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:702
  • `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: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. — 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. — bin/gstack-design-detect.ts:706
  • `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:1423
  • `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:2114
  • `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:2858
  • `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:2858
  • `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:688
  • `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:854
  • `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:909
  • `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:2210
  • `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:272
  • `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:784
  • `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:847
  • `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:1751
  • `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:2216
  • `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:626
  • `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:87
  • `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:92, browse/src/cookie-import-native.ts:93
  • `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:94
  • `fs.writeFileSync` in `screenshotTab` 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/device-emulation.ts:210
  • `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:807, browse/src/meta-commands.ts:871
  • `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:879, browse/src/meta-commands.ts:959
  • `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:881
  • `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. — browse/src/meta-commands.ts:891
  • `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:921

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

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

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

  • 39 duplicated blocks under the repository root have copies in at least two of the sibling directories browse, browser-skills, crew, design, design-review, extension (+5 more sibling(s) not listed) — 27 of them are reported below, and 12 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 39 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 39 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 39 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 — 139 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:333 · browse/src/snapshot.ts:464 — the two spans are one implementation copied and then locally edited — 491 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:333
  • 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:25 · design/src/iterate.ts:23 — the two spans are one implementation copied and then locally edited — 302 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — design/src/evolve.ts:25
  • hosts/claude/hooks/question-log-hook.ts:44 · hosts/claude/hooks/question-preference-hook.ts:56 — the two spans are one implementation copied and then locally edited — 207 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. — hosts/claude/hooks/question-log-hook.ts:44
  • 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:438 · 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:438
  • 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
  • crew/lib/gate-cost-history.ts:372 · crew/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. — crew/lib/gate-cost-history.ts:372
  • design/src/evolve.ts:86 · design/src/generate.ts:52 — 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. — design/src/evolve.ts:86
  • 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
  • crew/lib/ship-queue-gate.ts:79 · crew/lib/ship-queue-train.ts:160 — 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. — crew/lib/ship-queue-gate.ts:79
  • lib/ruled-notes.ts:21 · lib/test-lane-exception.ts:24 — the two spans are one implementation copied and then locally edited — 248 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/ruled-notes.ts:21
  • 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:409 · 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:409
  • hosts/claude/hooks/auq-error-fallback-hook.ts:40 · hosts/claude/hooks/question-log-hook.ts:79 — 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. — hosts/claude/hooks/auq-error-fallback-hook.ts:40
  • REDACTED:47 · lib/spend-ledger.ts:62 — the two spans are one implementation copied and then locally edited — 142 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:47
  • 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
  • lib/pregate/flaky-exception.ts:191 · lib/run-evidence.ts:168 — the two spans are one implementation copied and then locally edited — 353 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/pregate/flaky-exception.ts:191
  • 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:137 · 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:137
  • 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
  • REDACTED:1255 · REDACTED:1287 — 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:1255
  • 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
  • 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

What to do

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

  • crew/lib/ship-queue-train-ready.ts:68 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. — crew/lib/ship-queue-train-ready.ts:68
  • crew/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. — crew/scripts/gate-cost-replay.ts:43
  • crew/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. — crew/scripts/judge-calibration-configs.ts:7
  • crew/scripts/measure-journal-read.ts:71 imports test/helpers/autoplan-guard-fixture.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. — crew/scripts/measure-journal-read.ts:71
  • crew/scripts/replay-pr-selection.ts:26 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. — crew/scripts/replay-pr-selection.ts:26
  • crew/scripts/replay-pr-selection.ts:27 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. — crew/scripts/replay-pr-selection.ts:27
  • crew/scripts/train-backstop.ts:26 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. — crew/scripts/train-backstop.ts:26
  • crew/scripts/train-gate.ts:33 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. — crew/scripts/train-gate.ts:33
  • crew/scripts/train-gate.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. — crew/scripts/train-gate.ts:34
  • lib/pregate/flaky-exception.ts:373 imports test/helpers/paid-test-set.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/pregate/flaky-exception.ts:373
  • 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:32 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:32
  • 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
  • scripts/eval-trial-series.ts: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. — scripts/eval-trial-series.ts:26
  • 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/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

What to do

  • Fix the listed violations: move the shared test helper into a source directory production code may depend on (88 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 321 and cognitive complexity 607; 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:136
  • 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
  • handleMetaCommand has cyclomatic complexity 173 and cognitive complexity 323; 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:323
  • 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
  • parseLabelled has cyclomatic complexity 134 and cognitive complexity 160; 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/review-ledger.ts:195
  • runSkillTest has cyclomatic complexity 124 and cognitive complexity 187; 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:275
  • 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
  • runPaidReport has cyclomatic complexity 114 and cognitive complexity 166; 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-report.ts:566
  • 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:290
  • 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:104
  • 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
  • verify has cyclomatic complexity 102 and cognitive complexity 182; 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/review-ledger.ts:566
  • 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:45
  • 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
  • land has cyclomatic complexity 93 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. — lib/ship-queue-land.ts:320
  • register has cyclomatic complexity 92 and cognitive complexity 115; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:583
  • version has cyclomatic complexity 91 and cognitive complexity 97; 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/ship-release.ts:95
  • 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
  • validateRuntimeCatalog has cyclomatic complexity 89 and cognitive complexity 92; 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:171
  • scanBash32CaseInSubstitution has cyclomatic complexity 88 and cognitive complexity 143; 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/bash32-case-scan.ts:18
  • verifySliceResults has cyclomatic complexity 86 and cognitive complexity 148; 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:713
  • engLibraryHooksFinding has cyclomatic complexity 86 and cognitive complexity 79; 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/pty/boundaries.ts:336
  • readCapturedEvents has cyclomatic complexity 86 and cognitive complexity 58; 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/plan-skill-question-events.ts:392
  • assertQaBrowserDeadline has cyclomatic complexity 85 and cognitive complexity 98; 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-browser-deadline-evidence.ts:208
  • verifyRun has cyclomatic complexity 84 and cognitive complexity 110; 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/run-evidence.ts:163
  • validatePolicy has cyclomatic complexity 83 and cognitive complexity 101; 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:454
  • route has cyclomatic complexity 79 and cognitive complexity 103; 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/ship-release.ts:378
  • runPaidShard has cyclomatic complexity 79 and cognitive complexity 86; 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:303
  • materializePreparedExport has cyclomatic complexity 79 and cognitive complexity 83; 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/cso/preparation-docker.ts:258
  • (anonymous) has cyclomatic complexity 79 and cognitive complexity 58; 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/ceo-section-loading-fixture.ts:886
  • createContainer has cyclomatic complexity 78 and cognitive complexity 69; 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. — REDACTED:627
  • main has cyclomatic complexity 77 and cognitive complexity 130; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — browse/src/cli.ts:1820
  • validateConfig has cyclomatic complexity 77 and cognitive complexity 128; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — lib/pregate/config.ts:190
R3 · Large Files2.8 / 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 2333 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 2153 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
  • scripts/test-free-shards.ts has 2147 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
  • REDACTED has 2065 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/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/redact-patterns.ts has 1678 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
  • 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
  • browse/src/write-commands.ts has 1343 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
  • 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
  • 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
  • scripts/resolvers/design.ts has 1265 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
  • 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 1150 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
  • scripts/gen-skill-docs.ts has 1105 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/gen-skill-docs.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
  • browse/src/meta-commands.ts has 1052 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/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
  • 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
  • lib/design-catalog.ts has 835 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
  • REDACTED has 821 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/ship-release.ts has 805 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/ship-release.ts:1
  • lib/result-codes.ts has 792 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
  • make-pdf/src/diagram-prepass.ts has 788 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
  • scripts/lib/paid-report.ts has 787 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-report.ts:1
  • scripts/ship-measure.ts 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. — scripts/ship-measure.ts:1
  • lib/restamp.ts has 758 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/restamp.ts:1
  • REDACTED has 747 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/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

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.

  • test/fixtures/design-lint/tailwind-fail/Hero.tsx:4 imports './cn', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — test/fixtures/design-lint/tailwind-fail/Hero.tsx:4
  • 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. (×16) — lib/runaway.ts:1, lib/ship-queue-land-direct.ts:1, REDACTED: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.

  • This repository declares test tooling, and the ✓ above records that declaration — but test/fixtures/design-lint/tailwind-fail/Hero.tsx cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — test/fixtures/design-lint/tailwind-fail/Hero.tsx:4
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 999 application, 82 tooling and 2110 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 (999 application, 82 tooling, 2110 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 (×13) — lib/ship-release.ts, lib/runaway.ts, lib/ship-queue-land-direct.ts, …
  • Nothing imports this binding — it is safe to review for removal. (×25) — ios-qa/daemon/src/devicectl.ts:364, REDACTED:26, ios-qa/daemon/src/single-instance.ts:133, …
  • Nothing imports THIS copy of 'nextStep' — but lib/review-depth.ts:409 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep lib/review-depth.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other. — REDACTED:211

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 — while test/fixtures/design-lint/tailwind-pass/Hero.tsx DOES import it and no package.json above that file declares it, so the import resolves through the copy this declaration installs. The declaration is misplaced rather than dead: removing it breaks that import. Move it to the package.json that owns the importing file (or, if the two packages are meant to share it, hoist it to the workspace root) rather than deleting it.

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports0.0 / 10Critical✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

  • crew/lib/ship-queue-train-gate.ts → crew/lib/ship-queue-train.ts → crew/lib/ship-queue-train-gate.ts (one verified cycle inside a mutually-dependent group of 4 files) — crew/lib/ship-queue-train-gate.ts:38
  • crew/lib/version-gate-train.ts → lib/release-stamp.ts → crew/lib/version-gate-train.ts (one verified cycle inside a mutually-dependent group of 3 files) — crew/lib/version-gate-train.ts:17
  • lib/autoplan-state.ts → lib/autoplan-carry.ts → lib/autoplan-budget.ts → lib/autoplan-confirm.ts → lib/autoplan-state.ts (one verified cycle inside a mutually-dependent group of 18 files) — lib/autoplan-state.ts:76
  • lib/gbrain-guards.ts → REDACTED → lib/gbrain-guards.ts — lib/gbrain-guards.ts:39
  • lib/pregate/checks/lanes.ts → lib/pregate/starter.ts → lib/pregate/init-draft.ts → lib/pregate/checks/lanes.ts — lib/pregate/checks/lanes.ts:37
  • lib/ship-policy-bookkeeping.ts → REDACTED → lib/ship-policy-bookkeeping.ts (one verified cycle inside a mutually-dependent group of 3 files) — lib/ship-policy-bookkeeping.ts:7
  • scripts/exercised-map.ts → scripts/test-paid-shards.ts → scripts/lib/paid-report.ts → 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 Posture0.5 / 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. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository. 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:577
  • 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. (×5) — hosts/claude/hooks/question-log-hook.ts:101, 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:231
  • `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
  • The `gstack_picker` cookie (`Set-Cookie` header) carries who is signed in, and it is set without Secure. Without Secure the browser also sends it over plain http://, where anyone on the same network can read it. (−1.5 on this card.) — browse/src/cookie-picker-routes.ts:161

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 5 sites, not one: `hosts/claude/hooks/question-log-hook.ts:101` (createHash("sha1")), `REDACTED:381` (createHash("sha1")), `REDACTED:386` (createHash("sha1")), `lib/pr-wait.ts:211` (createHash("sha1")), `lib/ship-receipt-depth.ts:382` (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`.
  • Lock down every session and sign-in cookie: set `HttpOnly` (page scripts cannot read it), `Secure` (only sent over HTTPS) and `SameSite=Lax` or `Strict` (not sent along with other sites' requests) — `res.cookie(name, value, { httpOnly: true, secure: true, sameSite: 'lax' })` in Express, the same keys in Fastify, Hono, Next.js and `cookie.serialize`, `cookie: { secure: true, sameSite: 'lax' }` in express-session, or `; HttpOnly; Secure; SameSite=Lax` at the end of a raw `Set-Cookie` header.
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.

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 document2.2 / 10Critical✓ 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.

  • `dropOwnerFields` is exported, takes a document from its caller (line 230) and hands it to `walk`, which calls itself at line 233 (`walk`) with a piece of `v` (and at line 239) — 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. — lib/autoplan-owner-words.ts:233
  • `emitYamlBlock` is exported and takes `obj: Record<string, unknown>` from its caller, and it calls itself at line 246 (`emitYamlBlock`) with a piece of `obj` — and nowhere in `emitYamlBlock` 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 `emitYamlBlock` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:246
  • `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 340 (`checkSchema`) with a piece of `value` (and at line 347) — 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:340
  • `detectRunner` is exported, takes a document from its caller (line 121) and hands it to `allNodes`, which calls itself at line 116 (`allNodes`) with a piece of `node` — and nowhere in `allNodes` 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 `allNodes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/junit.ts:116
  • `receiptCounters` is exported, takes a document from its caller (line 20) and hands it to `walk`, which calls itself at line 26 (`walk`) with a piece of `value` — 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. — lib/ship-receipt-prose.ts:26
  • `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 state4.8 / 10Weak✓ Tool-verified

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.

  • `runSetup` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GSTACK_DESIGN_PROVIDER` environment variable (set at line 146, put back at line 162) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between — or by a promise that rejects at an `await`, and while this function is suspended at one every other callback the event loop runs sees the moved value too: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or config read in ANY module resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the directory. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — the `cwd` and `env` options of `child_process.spawn`/`exec`/`execSync` (or `Deno.Command`) scope both to the CHILD — or build absolute paths with `path.resolve`. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — design/src/cli.ts:111

What to do

  • Each finding names the statement that changes the process-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a working directory or an environment variable passed to the operation that needs it (the `cwd` and `env` options of `child_process`, or of `Deno.Command`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, a `try`/`finally` is the least that makes the restore unconditional.
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 33/47 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `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
  • `proxyToDevice` awaits `http.request(…)` 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: `http.request(url, { signal })`. — REDACTED:35
  • `whoIs` awaits `http.request(…)` 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: `http.request(url, { signal })`. — ios-qa/daemon/src/tailscale-localapi.ts:51
  • `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:197
  • `superviseNativeCookieImport` holds an AbortSignal but calls `sleep(…)` without it, so its caller's cancellation never reaches that call and it runs to its end after whatever wanted it has given up. Hand the signal on: `sleep(…, { 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:136

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.

X24 · Document value interpolated into markup unescaped7.2 / 10Strong✓ 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.

  • `ROUTE_PREFIX` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through the HTML `Response` this server sends 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — design/src/daemon.ts:264
  • `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.

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. (×38) — make-pdf/src/diagram-prepass.ts:594, make-pdf/src/orchestrator.ts:335, make-pdf/src/setup.ts:99, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. (×2) — REDACTED:92, lib/autoplan-timing.ts:113

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

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

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

  • ~13.0 `!` null assertions per 1k TypeScript source lines — 2153 assertion(s) across the 165782 source line(s) of the 569 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: crew/lib/ship-queue-train-gate.ts (61), lib/ship-release.ts (54), lib/eval-plan.ts (49). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

What to do

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

WCAG coverage — what static analysis assessed

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

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
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

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.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.
Architecture60%Adequate — gated by D26, R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity87%StrongStrongest area.
Readiness55%Adequate — gated by P2, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security52%Adequate — gated by D29, S1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility25%Critical — gated by AC1, 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 — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 7 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.

  • 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 (`npm run dev`) exited before it served a page. Likely cause (not identified): the dev server exited, and its output does not match a cause we recognise. Last output: "Server: status | cookie <n>=<v> | header <n>:<v> / useragent <str> | stop | restart / profiles [list] | profiles prune [--days N] (per-project headed profiles) / tunnel revoke <name> | tunnel agents (paired-agent tokens) / --force-restart: replace a live-but-busy daemon (any command; / LOSES tabs/cookies/logins — never done automatically) / Dialogs: dialog-accept [text] | dialog-dismiss / Refs: After 'snapshot', use @e1, @e2... as selectors: / click @e3 | fill @e4 "value" | hover @e1 / @c refs from -C: click @c1" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
  • 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.
  • 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+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — 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.
  • D28 Secrets (history) — gitleaks killed before it finished — this repository's git history not scanned
  • D32 Data Compliance (PII/GDPR) — 41 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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.4% 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R5 Dependency Freshness — uses a 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.
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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 — 48 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • 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:1716 — Test method has an empty body — it asserts nothing and exercises no code.
R9 · Circular Imports · Import cycle (2 files) · ×4
  • Import cycle (2 files) crew/lib/ship-queue-train-gate.ts:38 — crew/lib/ship-queue-train-gate.ts → crew/lib/ship-queue-train.ts → crew/lib/ship-queue-train-gate.ts (one verified cycle inside a mutually-dependent group of 4 files)
  • Import cycle (2 files) crew/lib/version-gate-train.ts:17 — crew/lib/version-gate-train.ts → lib/release-stamp.ts → crew/lib/version-gate-train.ts (one verified cycle inside a mutually-dependent group of 3 files)
  • Import cycle (2 files) lib/gbrain-guards.ts:39 — lib/gbrain-guards.ts → REDACTED → lib/gbrain-guards.ts
  • Import cycle (2 files) lib/ship-policy-bookkeeping.ts:7 — lib/ship-policy-bookkeeping.ts → REDACTED → lib/ship-policy-bookkeeping.ts (one verified cycle inside a mutually-dependent group of 3 files)
AC3 · Page structure · <html> without a lang · ×3
  • <html> without a lang browse/src/commands.ts:151 — 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:151 — 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>.
AC1 · Text alternatives · <img> without a text alternative · ×2
  • <img> without a text alternative lib/design-lint/rules/ids.ts:127 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative lib/design-lint/rules/ids.ts:168 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (3 files) · ×2
  • Import cycle (3 files) lib/pregate/checks/lanes.ts:37 — lib/pregate/checks/lanes.ts → lib/pregate/starter.ts → lib/pregate/init-draft.ts → lib/pregate/checks/lanes.ts
  • Import cycle (3 files) scripts/exercised-map.ts:38 — scripts/exercised-map.ts → scripts/test-paid-shards.ts → scripts/lib/paid-report.ts → scripts/exercised-map.ts (one verified cycle inside a mutually-dependent group of 4 files)
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
D31 · IaC & Container Security · High IaC · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge ios-qa/scripts/gen-accessors-tool/Sources/GenAccessors/main.swift:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
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 (4 files) · ×1
  • Import cycle (4 files) lib/autoplan-state.ts:76 — lib/autoplan-state.ts → lib/autoplan-carry.ts → lib/autoplan-budget.ts → lib/autoplan-confirm.ts → lib/autoplan-state.ts (one verified cycle inside a mutually-dependent group of 18 files)
S1 · Web-Security Posture · Cryptographic key material is a compile-time constant · ×1
  • Cryptographic key material is a compile-time constant REDACTED:577 — 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 — 2499 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×151
  • Hotspot: lib/review-ledger.ts lib/review-ledger.ts:195 — lib/review-ledger.ts changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 177 in review-ledger.parseLabelled at line 195. 13 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/review-ledger.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/write-commands.ts browse/src/write-commands.ts:136 — browse/src/write-commands.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 386 in write-commands.handleWriteCommand at line 136. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: lib/ship-release.ts lib/ship-release.ts:293 — lib/ship-release.ts changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in ship-release.fixChecked at line 293. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/ship-release.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:454 — REDACTED changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in ship-policy.validatePolicy at line 454. 7 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: scripts/test-pr-profile.ts scripts/test-pr-profile.ts:401 — scripts/test-pr-profile.ts changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in test-pr-profile.selectPrProfile at line 401. 10 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: lib/ship-receipt-depth.ts lib/ship-receipt-depth.ts:346 — lib/ship-receipt-depth.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in ship-receipt-depth.writeExcludeBinds at line 346. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/ship-receipt-depth.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/gen-skill-docs.ts scripts/gen-skill-docs.ts:982 — scripts/gen-skill-docs.ts changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in gen-skill-docs.runGeneration at line 982. 9 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- scripts/gen-skill-docs.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 19 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. 6 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: lib/review-scope.ts lib/review-scope.ts:399 — lib/review-scope.ts changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in review-scope.summarizeReviewLoop at line 399. 8 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/review-scope.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:2029 — scripts/test-free-shards.ts changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in test-free-shards.main at line 2029. 9 of those changes were fix/bug commits, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: lib/review-depth.ts lib/review-depth.ts:572 — lib/review-depth.ts changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in review-depth.planReview at line 572. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/review-depth.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:1820 — browse/src/cli.ts changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in cli.main at line 1820. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: REDACTED REDACTED:402 — REDACTED changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in index.clearByRuns at line 402. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: scripts/lib/paid-report.ts scripts/lib/paid-report.ts:566 — scripts/lib/paid-report.ts changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 138 in paid-report.runPaidReport at line 566. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- scripts/lib/paid-report.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:323 — browse/src/meta-commands.ts changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 192 in meta-commands.handleMetaCommand at line 323. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: REDACTED REDACTED:975 — REDACTED changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in server.handleCommandInternalImpl at line 975. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: lib/pregate/checks/lanes.ts lib/pregate/checks/lanes.ts:538 — lib/pregate/checks/lanes.ts changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in lanes.runSelected at line 538. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/pregate/checks/lanes.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/pregate/config.ts lib/pregate/config.ts:190 — lib/pregate/config.ts changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in config.validateConfig at line 190. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/pregate/config.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/ship-queue-land.ts lib/ship-queue-land.ts:320 — lib/ship-queue-land.ts changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in ship-queue-land.land at line 320. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/ship-queue-land.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/ship-queue-land-direct.ts lib/ship-queue-land-direct.ts:151 — lib/ship-queue-land-direct.ts changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 99 in ship-queue-land-direct.landDirect at line 151. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/ship-queue-land-direct.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/ship-queue.ts lib/ship-queue.ts:296 — lib/ship-queue.ts changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in ship-queue.ready at line 296. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/ship-queue.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/ship-receipt.ts lib/ship-receipt.ts:479 — lib/ship-receipt.ts changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in ship-receipt.parseReviewLoop at line 479. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/ship-receipt.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:403 — REDACTED changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in autoplan-gate.answerGate at line 403. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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:583 — REDACTED changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in harness-register.register at line 583. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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.
  • + 126 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:138 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: ${skill}: full AUQ format spec present in always-loaded SKILL.md test/auq-format-always-loaded.test.ts:151 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: ${skill}: per-skill AUQ rules survive in skeleton+sections union test/auq-format-always-loaded.test.ts:191 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: templates with parameterized resolvers pass unresolved check test/gen-skill-docs.test.ts:2247 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: no generated SKILL.md contains find with -delete flag test/gen-skill-docs.test.ts:4126 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: every DEFAULTS key is read by code or listed as prose-only test/gstack-config-defaults.test.ts:223 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: (unnamed test) test/plan-tune-cathedral.test.ts:106 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • + 61 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×53
  • FunctionTooLong: write-commands.handleWriteCommand browse/src/write-commands.ts:136 — FunctionTooLong — handleWriteCommand runs 873 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 773 over it, 8.73× 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:323 — FunctionTooLong — handleMetaCommand runs 521 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 421 over it, 5.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: 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:1820 — FunctionTooLong — main runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.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: 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: 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:1493 — 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: server.start REDACTED:1859 — FunctionTooLong — start 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: terminal-agent.buildServer browse/src/terminal-agent.ts:595 — 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: 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: 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.
  • FunctionTooLong: cli.main design/src/cli.ts:172 — FunctionTooLong — main runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.Deno.serve() supabase/functions/community-pulse/index.ts:23 — FunctionTooLong — Deno.serve() runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 28 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×49
  • 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
  • + 24 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:657 — `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:702 — `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:704 — `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:705 — `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:706 — `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:1423 — `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:2114 — `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:2858 — `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:2858 — `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:688 — `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:854 — `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:909 — `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:2210 — `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:272 — `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:784 — `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:847 — `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:1751 — `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:2216 — `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:626 — `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:87 — `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:92 — `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] crew/lib/ship-queue-train-ready.ts:68 — crew/lib/ship-queue-train-ready.ts:68 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] crew/scripts/gate-cost-replay.ts:43 — crew/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] crew/scripts/judge-calibration-configs.ts:7 — crew/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] crew/scripts/measure-journal-read.ts:71 — crew/scripts/measure-journal-read.ts:71 imports test/helpers/autoplan-guard-fixture.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] crew/scripts/replay-pr-selection.ts:26 — crew/scripts/replay-pr-selection.ts:26 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] crew/scripts/replay-pr-selection.ts:27 — crew/scripts/replay-pr-selection.ts:27 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] crew/scripts/train-backstop.ts:26 — crew/scripts/train-backstop.ts:26 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] crew/scripts/train-gate.ts:33 — crew/scripts/train-gate.ts:33 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] crew/scripts/train-gate.ts:34 — crew/scripts/train-gate.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] lib/pregate/flaky-exception.ts:373 — lib/pregate/flaky-exception.ts:373 imports test/helpers/paid-test-set.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:32 — scripts/eval-bg.ts:32 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.
  • + 15 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×38
  • Swallowed exception (empty catch) make-pdf/src/diagram-prepass.ts:594 — 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) make-pdf/src/orchestrator.ts:335 — 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) make-pdf/src/setup.ts:99 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/approval-record.ts:128 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/aside-render.ts:338 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/aside-render.ts:341 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/aside-render.ts:431 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/aside-render.ts:451 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-admission.ts:30 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-budget.ts:44 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-checkpoint.ts:67 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-checkpoint.ts:75 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-checkpoint.ts:166 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-checkpoint.ts:214 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-migrate.ts:20 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-public.ts:167 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-revise.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) REDACTED:66 — 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:72 — 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:76 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-shadow.ts:223 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-shadow.ts:379 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-shadow.ts:425 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/autoplan-stop-gate.ts:67 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/bin-context.ts:186 — 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.
  • + 13 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×36
  • 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/browser-manager.ts browse/src/browser-manager.ts — FileTooLong — 1273 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: TabScope (338-2549). The bar is 500 significant lines; this is 773 over it, 2.55× 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: src/cli.ts browse/src/cli.ts — FileTooLong — 1267 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 767 over it, 2.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1070 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 570 over it, 2.14× 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 — 971 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: handleWriteCommand (136-1434). The bar is 500 significant lines; this is 471 over it, 1.94× 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/redact-patterns.ts lib/redact-patterns.ts — FileTooLong — 897 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 397 over it, 1.79× 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: 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 — 739 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: handleMetaCommand (323-1177). The bar is 500 significant lines; this is 239 over it, 1.48× 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: lib/ship-release.ts lib/ship-release.ts — FileTooLong — 672 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 172 over it, 1.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 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 — 610 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 110 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.
  • + 11 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×30
  • Repeated repair: lib/ship-bin-common.ts lib/ship-bin-common.ts:128 — lib/ship-bin-common.ts changed 15 times in last 90 days and 11 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 ship-bin-common.stampedFiles at line 128), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ship): record-ci reuses its own CI row at the same tree, run and selection (GST-1795) (#4127)”; “fix: gstack's GitHub waits poll REST at most once a minute and wait out rate limits (GST-1713) (#4109)”; “fix(ship): a cleared remote gate for HEAD's exact tree satisfies a lane whose inventory refuses that tree (GST-1688) (#4098)”; “fix(ship): finish takes a landed stack parent as the reviewed base, fail-closed (GST-1399) (#4021)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/ship-bin-common.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 14 times in last 90 days and 10 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 qa.generateQAExploratory at line 46), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.93.40.0 fix(ship): Step 9.2.1 QA reports go to a git-excluded run dir, not the product tree (GST-969) (#3898)”; “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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 16 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 constants.codexPreflight at line 158), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ship): make the five judge-flagged workflow spots match the code (GST-1346) (#4004)”; “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: REDACTED REDACTED:121 — REDACTED changed 11 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 capy-review-pass.familyStop at line 121), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “review-plan: a granted fix round after the targeted read plans one targeted-only reader (GST-1607) (#4064)”; “fix(review): Step 11 on its own --out renders only the voices (GST-1368) (#4003)”; “v1.93.39.0 fix(ship): stop a hung outside voice and record it unavailable as the host subagent (GST-1104) (#3895)”; “v1.93.38.0 fix(review): one record per native finding at its stated severity; blocker count keys on Blocks; fix-check is never a pass (GST-1031) (#3894)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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/gbrain.ts scripts/resolvers/gbrain.ts:135 — scripts/resolvers/gbrain.ts changed 7 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 135), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: browse/src/commands.ts browse/src/commands.ts:241 — browse/src/commands.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 commands.levenshtein at line 241), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: hosts/define-host.ts hosts/define-host.ts:120 — hosts/define-host.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 7 (its worst body is define-host.defineHost at line 120), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: REDACTED REDACTED:122 — 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 13 (its worst body is config.ensureStateDir at line 122), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.303.0 fix(browse): pr-shots no longer edits the tracked .gitignore mid-/ship (#3560) (#3562)”; “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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 7 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 question-tuning.binDir at line 13), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: scripts/resolvers/preamble/generate-preamble-bash.ts scripts/resolvers/preamble/generate-preamble-bash.ts:42 — scripts/resolvers/preamble/generate-preamble-bash.ts changed 7 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 7 (its worst body is generate-preamble-bash.generatePreambleBash at line 42), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.92.57.0 fix(hermes): plain skill-start fence that Tirith can resolve, so Hermes can start gstack skills (GST-882) (#3825)”; “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: test-setup.ts test-setup.ts:64 — test-setup.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 4 (its worst body is test-setup.markedAncestor at line 64), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: test fixtures stop tripping /ship's fetch sweep (GST-1695) (#4105)”; “v1.93.13.0 fix(test): never hand an exported live-brain URL to gbrain in tests (#3466) (#3876)”; “v1.91.243.0 fix(capy): source the launch environment from a 0600 file; no skill fence may print the environment (GSTA-104) (#3449)”; “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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- test-setup.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), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: REDACTED REDACTED:126 — REDACTED 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 12 (its worst body is gbrain-exec.buildGbrainEnv at line 126), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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/redact-doc.ts scripts/resolvers/redact-doc.ts:36 — scripts/resolvers/redact-doc.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 7 (its worst body is redact-doc.generateRedactInvocationBlock at line 36), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: scripts/resolvers/plan-reality.ts scripts/resolvers/plan-reality.ts:29 — scripts/resolvers/plan-reality.ts 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 8 (its worst body is plan-reality.phaseFor at line 29), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.247.0 fix(plan-eng-review): define the three references its judged text left dangling (GSTA-91) (#3421)”; “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.107.0 fix: the GBRA-40 field list (one Bun for install and check, `rec` gate approval, pregate never silent) (#3190)”; “v1.91.82.0 fix(plan-reality): name the review input and the PLAN_REALITY line in the reality-rows prose (#3126)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- scripts/resolvers/plan-reality.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 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 13 (its worst body is xvfb.awaitXvfbReady at line 217), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: scripts/psychographic-signals.ts scripts/psychographic-signals.ts:284 — scripts/psychographic-signals.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 12 (its worst body is psychographic-signals.resolveOptionKey at line 284), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.92.69.0 fix: lock developer-profile writers so overlapping derives keep every session (#3437, #3435) (#3738)”; “fix(plan-tune): map the clicked AskUserQuestion label to the registered option key at capture (#2623) (#3394)”; “v1.91.12.0 v1.91.12.0: audit fix wave, ~11-minute paid eval lanes, eval reliability policy (#2999)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- scripts/psychographic-signals.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: lib/owner-brief.ts lib/owner-brief.ts:45 — lib/owner-brief.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 9 (its worst body is owner-brief.plainSummary at line 45), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.93.36.0 autoplan: R65 defaults: no review for bug fixes, one lean reviewer with the draft code for features (#3897)”; “v1.91.101.0 fix: close the field wave's residual gaps (#3173)”; “fix(autoplan): decision ids stay unique across reopened gate revisions (#3160)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- lib/owner-brief.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:85 — design/src/evolve.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 5 (its worst body is evolve.requestEvolvedImage at line 85), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: design/src/generate.ts design/src/generate.ts:94 — design/src/generate.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 15 (its worst body is generate.generate at line 94), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- design/src/generate.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: make-pdf/src/cli.ts make-pdf/src/cli.ts:209 — make-pdf/src/cli.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 15 (its worst body is cli.main at line 209), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.60.0 fix(windows): setup degrades instead of dying on a CSO failure, detects Smart App Control, Consolas terminal font (#3079)”; “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- make-pdf/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.
  • Repeated repair: browse/src/file-permissions.ts browse/src/file-permissions.ts:166 — browse/src/file-permissions.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 file-permissions.restrictDirectoryPermissions at line 166), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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/preamble/generate-context-recovery.ts scripts/resolvers/preamble/generate-context-recovery.ts:3 — scripts/resolvers/preamble/generate-context-recovery.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 1 (its worst body is generate-context-recovery.generateContextRecovery at line 3), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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: design/src/iterate.ts design/src/iterate.ts:155 — design/src/iterate.ts changed 4 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 13 (its worst body is iterate.iterateOnGemini at line 155), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “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)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +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/preamble/generate-voice-directive.ts scripts/resolvers/preamble/generate-voice-directive.ts:4 — scripts/resolvers/preamble/generate-voice-directive.ts changed 4 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 2 (its worst body is generate-voice-directive.generateVoiceDirective at line 4), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “v1.91.309.0 fix(flaky): one rule each in the judged review and Eng prose; a cancelled judge names what it was waiting on (GSTA-139 S3) (#3544)”; “v1.91.66.0 fix: /autoplan without permission prompts after background reviewers, 34 contributor PRs from the backlog triage (#3087)”; “v1.87.6.0 fix: make checks reliable and everyday validation faster (#2898)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 07:31:35 +00:00' --until='2026-11-14 07:31:35 +00:00' --full-history --no-merges -- scripts/resolvers/preamble/generate-voice-directive.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.
  • + 5 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×20
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R4 · Test Coverage · No test reaches this file · ×16
  • No test reaches this file lib/runaway.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/ship-queue-land-direct.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 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 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 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 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 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 lib/ship-docs-result.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 lib/review-targeted-delta.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/remote-gate-stand-in.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.
X2 · Cancellation propagation · Async function without AbortSignal · ×14
  • 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: proxyToDevice REDACTED:35 — `proxyToDevice` awaits `http.request(…)` 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: `http.request(url, { signal })`.
  • Async function without AbortSignal: whoIs ios-qa/daemon/src/tailscale-localapi.ts:51 — `whoIs` awaits `http.request(…)` 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: `http.request(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:197 — `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` holds an AbortSignal but calls `sleep(…)` without it, so its caller's cancellation never reaches that call and it runs to its end after whatever wanted it has given up. Hand the signal on: `sleep(…, { 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:136 — `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 })`.
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.
D10 · Test Quality · Fixed-sleep synchronisation · ×12
  • Fixed-sleep synchronisation: a call in flight when the process died is charged its reservation on the next run, which dispatches a fresh attempt test/autoplan-run-api.test.ts:178 — This test starts work it did not wait for (`proc`, 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.
  • Fixed-sleep synchronisation: a cap changed during the call admits the retry against the new cap and is not written back over test/autoplan-shadow.test.ts:231 — 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(150)` — 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: a Stop that fires before the CLI flushes the turn waits for the final message instead of judging a stale transcript test/autoplan-stop-gate.test.ts:180 — This test starts work it did not wait for (`proc`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(300)` — 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: a Stop that fires before the CLI flushes the turn waits for the final message: a review written outside the repo is released, not held test/ceo-review-gate.test.ts:223 — This test starts work it did not wait for (`proc`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(300)` — 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: a Stop that fires before the CLI flushes the load itself still judges the run once the final message lands test/ceo-review-gate.test.ts:236 — This test starts work it did not wait for (`proc`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(300)` — 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: 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:166 — 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: the bin dies on SIGTERM at once (no JS handler swallows it) and the next watcher takes over its lock test/pr-wait.test.ts:628 — 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(100)` — 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: a Stop that fires before the CLI flushes the turn waits for the final message: a run that reran its check is met, not blocked test/skill-contract-stop-hook.test.ts:112 — This test starts work it did not wait for (`proc`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(300)` — 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: a Stop that fires before the CLI flushes the load itself still checks the run once the final message lands test/skill-contract-stop-hook.test.ts:125 — This test starts work it did not wait for (`proc`, still running when the sleep starts) and then orders itself against it with `Bun.sleep(300)` — 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:1111 — 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.
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:4943 — // 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:36 — // 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.
D29 · Static Analysis (SAST) · REDACTED · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×9
  • 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:1051 — `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:1190 — `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:203 — `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:69 — `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.
  • Outbound HTTP without resilience REDACTED:207 — `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 lib/review-risk.ts:91 — `got(` 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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×9
  • Recursive walk over a caller-supplied document has no depth cap lib/autoplan-owner-words.ts:233 — `dropOwnerFields` is exported, takes a document from its caller (line 230) and hands it to `walk`, which calls itself at line 233 (`walk`) with a piece of `v` (and at line 239) — 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 REDACTED:246 — `emitYamlBlock` is exported and takes `obj: Record<string, unknown>` from its caller, and it calls itself at line 246 (`emitYamlBlock`) with a piece of `obj` — and nowhere in `emitYamlBlock` 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 `emitYamlBlock` 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 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:340 — `checkSchema` is exported and takes `value: unknown` from its caller, and it calls itself at line 340 (`checkSchema`) with a piece of `value` (and at line 347) — 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/junit.ts:116 — `detectRunner` is exported, takes a document from its caller (line 121) and hands it to `allNodes`, which calls itself at line 116 (`allNodes`) with a piece of `node` — and nowhere in `allNodes` 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 `allNodes` 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/ship-receipt-prose.ts:26 — `receiptCounters` is exported, takes a document from its caller (line 20) and hands it to `walk`, which calls itself at line 26 (`walk`) with a piece of `value` — 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/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.
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:793 — MethodTooLong — launchHeaded 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.
  • 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:2162 — MethodTooLong — promoteToHeaded runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.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.
D31 · IaC & Container Security · Medium IaC · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block with local edits (16 matched lines × 2 locations) · ×6
  • Duplicated block with local edits (16 matched lines × 2 locations) design/src/cli.ts:409 — design/src/cli.ts:409 · 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) REDACTED:47 — REDACTED:47 · lib/spend-ledger.ts:62 — the two spans are one implementation copied and then locally edited — 142 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) lib/pregate/flaky-exception.ts:191 — lib/pregate/flaky-exception.ts:191 · lib/run-evidence.ts:168 — the two spans are one implementation copied and then locally edited — 353 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.
IC1 · Incompleteness & stubs · Fake-async · ×5
  • Fake-async — async method never awaits REDACTED:657 — `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:208 — `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:1255 — REDACTED:1255 · REDACTED:1287 — 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: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.
S1 · Web-Security Posture · Weak hash algorithm · ×5
  • Weak hash algorithm hosts/claude/hooks/question-log-hook.ts:101 — 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.
  • Weak hash algorithm lib/pr-wait.ts:211 — 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 lib/ship-receipt-depth.ts:382 — 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.
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
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · ClassTooLong · ×4
  • ClassTooLong: TabScope browse/src/browser-manager.ts:338 — ClassTooLong — 1142 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 742 over it, 2.86× 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.
D35 · Change Coupling · Change coupling · ×4
  • 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 56% of the time (9 of the 16 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: REDACTED ↔ review-pass.ts REDACTED:1 — `REDACTED` and `lib/review-pass.ts` change together 55% of the time (6 of the 11 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 `4bee369d` Retry /ship's second-model review on Astra, then Gemini, when OpenAI …; `a4d058b0` feat(review): enforce the reader fetch rule with a per-stage sweep (G…; `c9d55cf5` fix(review): Step 11 on its own --out renders only the voices (GST-13… — 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.
AC3 · Page structure · Page without a main landmark · ×3
  • Page without a main landmark browse/src/commands.ts:151 — 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>.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×3
  • 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) hosts/claude/hooks/auq-error-fallback-hook.ts:40 — hosts/claude/hooks/auq-error-fallback-hook.ts:40 · hosts/claude/hooks/question-log-hook.ts:79 — 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.
D2 · Cognitive Complexity · BrowseClient.command (cognitive 18) · ×2
  • BrowseClient.command (cognitive 18) browse/src/browse-client.ts:153 — BrowseClient.command has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (3 pts), ternaries 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.
  • BrowseClient.command (cognitive 18) browser-skills/hackernews-frontpage/_lib/browse-client.ts:153 — BrowseClient.command has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (3 pts), ternaries 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (26 lines × 2 locations) · ×2
  • 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.
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.
R7 · Dead Code · Dead file (~128 LoC) · ×2
  • Dead file (~128 LoC) REDACTED — no import path from any entry point (999 application, 82 tooling, 2110 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
  • Dead file (~128 LoC) test-setup.ts — no import path from any entry point (999 application, 82 tooling, 2110 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
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×2
  • Untrusted text written into markup unescaped design/src/daemon.ts:264 — `ROUTE_PREFIX` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through the HTML `Response` this server sends 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. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
  • 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×2
  • Swallowed exception (caught, then discarded) REDACTED:92 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) lib/autoplan-timing.ts:113 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
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.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.4 · ×1
  • Low contrast colour pair in CSS (2.4:1) extension/sidepanel.css:866 — `footer` sets color: #52525B on background-color: #141414 — 2.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.8 · ×1
  • Low contrast colour pair in CSS (3.8:1) extension/sidepanel.css:988 — `.mem-toast-btn.primary` sets color: #fff on background-color: #ef4444 — 3.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.0 · ×1
  • Low contrast colour pair in CSS (3.0:1) extension/sidepanel.css:1414 — `.inspector-specificity` sets color: #A1A1AA on background-color: #52525B — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · write-commands.handleWriteCommand (cyclomatic 386) · ×1
  • write-commands.handleWriteCommand (cyclomatic 386) browse/src/write-commands.ts:136 — write-commands.handleWriteCommand has cyclomatic complexity 386 (threshold 15). Of this number, 318 points are the body's own statements and 68 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 · meta-commands.handleMetaCommand (cyclomatic 192) · ×1
  • meta-commands.handleMetaCommand (cyclomatic 192) browse/src/meta-commands.ts:323 — meta-commands.handleMetaCommand has cyclomatic complexity 192 (threshold 15). Of this number, 168 points are the body's own statements and 24 belong to 10 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 · review-ledger.parseLabelled (cyclomatic 177) · ×1
  • review-ledger.parseLabelled (cyclomatic 177) lib/review-ledger.ts:195 — review-ledger.parseLabelled has cyclomatic complexity 177 (threshold 15). Of this number, 132 points are the body's own statements and 45 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:104 — 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 · 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 · review-ledger.verify (cyclomatic 125) · ×1
  • review-ledger.verify (cyclomatic 125) lib/review-ledger.ts:566 — review-ledger.verify has cyclomatic complexity 125 (threshold 15). Of this number, 102 points are the body's own statements and 23 belong to 12 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 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 · review-scope.summarizeReviewLoop (cyclomatic 107) · ×1
  • review-scope.summarizeReviewLoop (cyclomatic 107) lib/review-scope.ts:399 — review-scope.summarizeReviewLoop has cyclomatic complexity 107 (threshold 15). Of this number, 63 points are the body's own statements and 44 belong to 19 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-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 · gstack-design-detect.probe (cyclomatic 94) · ×1
  • gstack-design-detect.probe (cyclomatic 94) bin/gstack-design-detect.ts:345 — 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 · harness-register.register (cyclomatic 93) · ×1
  • harness-register.register (cyclomatic 93) REDACTED:583 — harness-register.register has cyclomatic complexity 93 (threshold 15). Of this number, 82 points are the body's own statements and 11 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-queue-land.land (cyclomatic 92) · ×1
  • ship-queue-land.land (cyclomatic 92) lib/ship-queue-land.ts:320 — ship-queue-land.land has cyclomatic complexity 92 (threshold 15). Of this number, 81 points are the body's own statements and 11 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 · 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 · ship-policy.validatePolicy (cyclomatic 89) · ×1
  • ship-policy.validatePolicy (cyclomatic 89) REDACTED:454 — ship-policy.validatePolicy has cyclomatic complexity 89 (threshold 15). Of this number, 82 points are the body's own statements and 7 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 · autoplan-gate.answerGate (cyclomatic 85) · ×1
  • autoplan-gate.answerGate (cyclomatic 85) REDACTED:403 — autoplan-gate.answerGate has cyclomatic complexity 85 (threshold 15). Of this number, 63 points are the body's own statements and 22 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lane-selection.selectLanes (cyclomatic 83) · ×1
  • lane-selection.selectLanes (cyclomatic 83) lib/pregate/lane-selection.ts:210 — lane-selection.selectLanes has cyclomatic complexity 83 (threshold 15). Of this number, 76 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.
D1 · Cyclomatic Complexity · config.validateConfig (cyclomatic 82) · ×1
  • config.validateConfig (cyclomatic 82) lib/pregate/config.ts:190 — config.validateConfig has cyclomatic complexity 82 (threshold 15). Of this number, 77 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 · ship-release.route (cyclomatic 81) · ×1
  • ship-release.route (cyclomatic 81) lib/ship-release.ts:378 — ship-release.route has cyclomatic complexity 81 (threshold 15). Of this number, 75 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 · terminal-agent.buildServer (cyclomatic 80) · ×1
  • terminal-agent.buildServer (cyclomatic 80) browse/src/terminal-agent.ts:595 — 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:1820 — 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 · ship-release.version (cyclomatic 79) · ×1
  • ship-release.version (cyclomatic 79) lib/ship-release.ts:95 — ship-release.version has cyclomatic complexity 79 (threshold 15). Of this number, 77 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 · 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 · run-evidence.verifyRun (cyclomatic 77) · ×1
  • run-evidence.verifyRun (cyclomatic 77) lib/run-evidence.ts:163 — run-evidence.verifyRun has cyclomatic complexity 77 (threshold 15). Of this number, 72 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 · review-depth.planReview (cyclomatic 76) · ×1
  • review-depth.planReview (cyclomatic 76) lib/review-depth.ts:572 — review-depth.planReview has cyclomatic complexity 76 (threshold 15). Of this number, 70 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 · run-evidence.runProfileErrors (cyclomatic 76) · ×1
  • run-evidence.runProfileErrors (cyclomatic 76) lib/run-evidence.ts:106 — run-evidence.runProfileErrors has cyclomatic complexity 76 (threshold 15). Of this number, 67 points are the body's own statements and 9 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 · ship-release.docsFresh (cyclomatic 75) · ×1
  • ship-release.docsFresh (cyclomatic 75) lib/ship-release.ts:489 — ship-release.docsFresh has cyclomatic complexity 75 (threshold 15). Of this number, 42 points are the body's own statements and 33 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 · 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 · release-cut.planRelease (cyclomatic 69) · ×1
  • release-cut.planRelease (cyclomatic 69) REDACTED:452 — release-cut.planRelease has cyclomatic complexity 69 (threshold 15). Of this number, 68 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 · 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 · claude-code-migration.migrateClaudeCodeSkills (cyclomatic 64) · ×1
  • claude-code-migration.migrateClaudeCodeSkills (cyclomatic 64) lib/claude-code-migration.ts:133 — claude-code-migration.migrateClaudeCodeSkills has cyclomatic complexity 64 (threshold 15). Of this number, 59 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 · server.handleCommandInternalImpl (cyclomatic 62) · ×1
  • server.handleCommandInternalImpl (cyclomatic 62) REDACTED:975 — server.handleCommandInternalImpl has cyclomatic complexity 62 (threshold 15). Of this number, 59 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 · 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 · autoplan-revise.reviseRun (cyclomatic 61) · ×1
  • autoplan-revise.reviseRun (cyclomatic 61) lib/autoplan-revise.ts:128 — autoplan-revise.reviseRun has cyclomatic complexity 61 (threshold 15). Of this number, 57 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 · 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 · index.clearByRuns (cyclomatic 60) · ×1
  • index.clearByRuns (cyclomatic 60) REDACTED:402 — index.clearByRuns has cyclomatic complexity 60 (threshold 15). Of this number, 52 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gate-reuse.findReusableGate (cyclomatic 60) · ×1
  • gate-reuse.findReusableGate (cyclomatic 60) crew/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 · 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 · claude-journal-records.ownedCausalOrder (cyclomatic 59) · ×1
  • claude-journal-records.ownedCausalOrder (cyclomatic 59) lib/claude-journal-records.ts:304 — claude-journal-records.ownedCausalOrder has cyclomatic complexity 59 (threshold 15). Of this number, 39 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 · 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 · review-fetch.scanWords (cyclomatic 59) · ×1
  • review-fetch.scanWords (cyclomatic 59) lib/review-fetch.ts:130 — review-fetch.scanWords has cyclomatic complexity 59 (threshold 15). Of this number, 54 points are the body's own statements and 5 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-land-direct.landDirect (cyclomatic 59) · ×1
  • ship-queue-land-direct.landDirect (cyclomatic 59) lib/ship-queue-land-direct.ts:151 — ship-queue-land-direct.landDirect has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ship-queue-land-direct.landDirect::locked) 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.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-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 · index.clearDecision (cyclomatic 56) · ×1
  • index.clearDecision (cyclomatic 56) REDACTED:306 — index.clearDecision has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · flaky-run.runFlaky (cyclomatic 56) · ×1
  • flaky-run.runFlaky (cyclomatic 56) REDACTED:304 — flaky-run.runFlaky has cyclomatic complexity 56 (threshold 15). Of this number, 43 points are the body's own statements and 13 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 · 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 · review-evidence.bindReview (cyclomatic 55) · ×1
  • review-evidence.bindReview (cyclomatic 55) lib/review-evidence.ts:266 — review-evidence.bindReview has cyclomatic complexity 55 (threshold 15). Of this number, 54 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 · 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 · 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 · design-build.receipt (cyclomatic 53) · ×1
  • design-build.receipt (cyclomatic 53) lib/design-build.ts:285 — design-build.receipt has cyclomatic complexity 53 (threshold 15). Of this number, 30 points are the body's own statements and 23 belong to 6 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 · inventory.validateEntry (cyclomatic 53) · ×1
  • inventory.validateEntry (cyclomatic 53) lib/inventory.ts:93 — inventory.validateEntry has cyclomatic complexity 53 (threshold 15). Of this number, 50 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 · server.start (cyclomatic 52) · ×1
  • server.start (cyclomatic 52) REDACTED:1859 — server.start has cyclomatic complexity 52 (threshold 15). Of this number, 42 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 · tree-receipt.buildReceipt (cyclomatic 52) · ×1
  • tree-receipt.buildReceipt (cyclomatic 52) lib/tree-receipt.ts:169 — tree-receipt.buildReceipt has cyclomatic complexity 52 (threshold 15). Of this number, 46 points are the body's own statements and 6 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 · ship-docs-result.checkDocsResult (cyclomatic 52) · ×1
  • ship-docs-result.checkDocsResult (cyclomatic 52) lib/ship-docs-result.ts:30 — ship-docs-result.checkDocsResult has cyclomatic complexity 52 (threshold 15). 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, separate the cases: extract each independent branch into its 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 · lanes.runSelected (cyclomatic 51) · ×1
  • lanes.runSelected (cyclomatic 51) lib/pregate/checks/lanes.ts:538 — lanes.runSelected has cyclomatic complexity 51 (threshold 15). 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, separate the cases: extract each independent branch into its 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.classify (cyclomatic 51) · ×1
  • version-gate-train.classify (cyclomatic 51) crew/lib/version-gate-train.ts:101 — version-gate-train.classify has cyclomatic complexity 51 (threshold 15). Of this number, 49 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-queue.ready (cyclomatic 51) · ×1
  • ship-queue.ready (cyclomatic 51) lib/ship-queue.ts:296 — ship-queue.ready 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 · 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 · ship-release.finishStages (cyclomatic 51) · ×1
  • ship-release.finishStages (cyclomatic 51) lib/ship-release.ts:582 — ship-release.finishStages has cyclomatic complexity 51 (threshold 15). Of this number, 50 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 · 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 · changelog-check.carryWith (cyclomatic 50) · ×1
  • changelog-check.carryWith (cyclomatic 50) lib/changelog-check.ts:271 — changelog-check.carryWith has cyclomatic complexity 50 (threshold 15). Of this number, 33 points are the body's own statements and 17 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 · ship-queue-train-ready.trainReady (cyclomatic 50) · ×1
  • ship-queue-train-ready.trainReady (cyclomatic 50) crew/lib/ship-queue-train-ready.ts:234 — ship-queue-train-ready.trainReady 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 · gstack-post.mergeSplit (cyclomatic 50) · ×1
  • gstack-post.mergeSplit (cyclomatic 50) lib/gstack-post.ts:294 — gstack-post.mergeSplit has cyclomatic complexity 50 (threshold 15). Of this number, 33 points are the body's own statements and 17 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 · 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.<returned closure> (cyclomatic 48) · ×1
  • guard-journal.select.<returned closure> (cyclomatic 48) autoplan/bin/guard-journal.ts:54 — guard-journal.select.<returned closure> has cyclomatic complexity 48 (threshold 15). Of this number, 37 points are the body's own statements and 11 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 · 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 · autoplan-carry.assess (cyclomatic 48) · ×1
  • autoplan-carry.assess (cyclomatic 48) lib/autoplan-carry.ts:113 — autoplan-carry.assess has cyclomatic complexity 48 (threshold 15). Of this number, 41 points are the body's own statements and 7 belong to 6 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 · shell-writes.writeTargets (cyclomatic 48) · ×1
  • shell-writes.writeTargets (cyclomatic 48) lib/shell-writes.ts:261 — shell-writes.writeTargets has cyclomatic complexity 48 (threshold 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, separate the cases: extract each independent branch into its 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-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 · model-policy-cli.modelsMain (cyclomatic 48) · ×1
  • model-policy-cli.modelsMain (cyclomatic 48) lib/model-policy-cli.ts:280 — model-policy-cli.modelsMain has cyclomatic complexity 48 (threshold 15). 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, separate the cases: extract each independent branch into its 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 47) · ×1
  • autoplan-reconcile.reconcile (cyclomatic 47) lib/autoplan-reconcile.ts:250 — autoplan-reconcile.reconcile has cyclomatic complexity 47 (threshold 15). Of this number, 38 points are the body's own statements and 9 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 · supervise.supervise (cyclomatic 47) · ×1
  • supervise.supervise (cyclomatic 47) REDACTED:131 — supervise.supervise has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 3 of the 47 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 215, readNew, a function literal at line 203, …). 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 · lanes.planRuns (cyclomatic 47) · ×1
  • lanes.planRuns (cyclomatic 47) lib/pregate/checks/lanes.ts:225 — lanes.planRuns has cyclomatic complexity 47 (threshold 15). Of this number, 39 points are the body's own statements and 8 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 · 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 · ship-budget-cli.cmdStart (cyclomatic 47) · ×1
  • ship-budget-cli.cmdStart (cyclomatic 47) lib/ship-budget-cli.ts:240 — ship-budget-cli.cmdStart has cyclomatic complexity 47 (threshold 15). Of this number, 43 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: 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 · (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 · review-risk.matchRisk (cyclomatic 46) · ×1
  • review-risk.matchRisk (cyclomatic 46) lib/review-risk.ts:178 — review-risk.matchRisk 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · gstack-post.parseArgs (cyclomatic 46) · ×1
  • gstack-post.parseArgs (cyclomatic 46) lib/gstack-post.ts:120 — gstack-post.parseArgs 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 · 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 · runaway.assess (cyclomatic 46) · ×1
  • runaway.assess (cyclomatic 46) lib/runaway.ts:134 — runaway.assess 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 · cli.ensureServer (cyclomatic 45) · ×1
  • cli.ensureServer (cyclomatic 45) browse/src/cli.ts:919 — cli.ensureServer 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 · bin-context.slugFromEnvironment (cyclomatic 45) · ×1
  • bin-context.slugFromEnvironment (cyclomatic 45) lib/bin-context.ts:406 — bin-context.slugFromEnvironment has cyclomatic complexity 45 (threshold 15). Of this number, 43 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · literals.consumersOf (cyclomatic 45) · ×1
  • literals.consumersOf (cyclomatic 45) REDACTED:115 — literals.consumersOf has cyclomatic complexity 45 (threshold 15). Of this number, 23 points are the body's own statements and 22 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · flaky-exception.readRunFailures (cyclomatic 45) · ×1
  • flaky-exception.readRunFailures (cyclomatic 45) lib/pregate/flaky-exception.ts:188 — flaky-exception.readRunFailures has cyclomatic complexity 45 (threshold 15). Of this number, 43 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 · 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 · autoplan-gate.buildGate (cyclomatic 44) · ×1
  • autoplan-gate.buildGate (cyclomatic 44) REDACTED:196 — autoplan-gate.buildGate has cyclomatic complexity 44 (threshold 15). Of this number, 40 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 44) · ×1
  • secrets.run (cyclomatic 44) lib/pregate/checks/secrets.ts:164 — secrets.run has cyclomatic complexity 44 (threshold 15). Of this number, 31 points are the body's own statements and 13 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 · ship-queue-wave.waveSettle (cyclomatic 44) · ×1
  • ship-queue-wave.waveSettle (cyclomatic 44) crew/lib/ship-queue-wave.ts:531 — ship-queue-wave.waveSettle has cyclomatic complexity 44 (threshold 15). Of this number, 37 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ship-queue-train.newTrain (cyclomatic 44) · ×1
  • ship-queue-train.newTrain (cyclomatic 44) crew/lib/ship-queue-train.ts:400 — ship-queue-train.newTrain has cyclomatic complexity 44 (threshold 15). Of this number, 38 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 · release-gate.runGate (cyclomatic 44) · ×1
  • release-gate.runGate (cyclomatic 44) crew/lib/release-gate.ts:233 — release-gate.runGate has cyclomatic complexity 44 (threshold 15). Of this number, 37 points are the body's own statements and 7 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 · ship-queue-train-cli.trainMain (cyclomatic 44) · ×1
  • ship-queue-train-cli.trainMain (cyclomatic 44) crew/lib/ship-queue-train-cli.ts:109 — ship-queue-train-cli.trainMain has cyclomatic complexity 44 (threshold 15). Of this number, 40 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 · shell-writes.tokenize (cyclomatic 44) · ×1
  • shell-writes.tokenize (cyclomatic 44) lib/shell-writes.ts:32 — shell-writes.tokenize has cyclomatic complexity 44 (threshold 15). Of this number, 38 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 · 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 · review-depth.leanPlan (cyclomatic 43) · ×1
  • review-depth.leanPlan (cyclomatic 43) lib/review-depth.ts:673 — review-depth.leanPlan has cyclomatic complexity 43 (threshold 15). Of this number, 36 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 · autoplan-run.nextStep (cyclomatic 43) · ×1
  • autoplan-run.nextStep (cyclomatic 43) REDACTED:211 — autoplan-run.nextStep has cyclomatic complexity 43 (threshold 15). Of this number, 39 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 · train-gate.routeDispatch (cyclomatic 43) · ×1
  • train-gate.routeDispatch (cyclomatic 43) crew/scripts/train-gate.ts:80 — train-gate.routeDispatch has cyclomatic complexity 43 (threshold 15). Of this number, 41 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 · 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 · phase-publication-hook.closePacket (cyclomatic 42) · ×1
  • phase-publication-hook.closePacket (cyclomatic 42) autoplan/bin/phase-publication-hook.ts:345 — 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:2106 — 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 · ci-carry.findCarry (cyclomatic 42) · ×1
  • ci-carry.findCarry (cyclomatic 42) lib/ci-carry.ts:75 — ci-carry.findCarry has cyclomatic complexity 42 (threshold 15). Of this number, 40 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 · tree-receipt.classifyFile (cyclomatic 42) · ×1
  • tree-receipt.classifyFile (cyclomatic 42) lib/tree-receipt.ts:102 — tree-receipt.classifyFile 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 · release-cut.readTrainNotes (cyclomatic 42) · ×1
  • release-cut.readTrainNotes (cyclomatic 42) REDACTED:175 — release-cut.readTrainNotes has cyclomatic complexity 42 (threshold 15). Of this number, 39 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 · 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 · gstack-post.runPost (cyclomatic 42) · ×1
  • gstack-post.runPost (cyclomatic 42) lib/gstack-post.ts:667 — gstack-post.runPost has cyclomatic complexity 42 (threshold 15). Of this number, 37 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 · runaway.runawayMain (cyclomatic 42) · ×1
  • runaway.runawayMain (cyclomatic 42) lib/runaway.ts:247 — runaway.runawayMain has cyclomatic complexity 42 (threshold 15). Of this number, 36 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 · gstack-design-detect.scan (cyclomatic 41) · ×1
  • gstack-design-detect.scan (cyclomatic 41) bin/gstack-design-detect.ts:919 — 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 · captain-brief.renderCaptainBrief (cyclomatic 41) · ×1
  • captain-brief.renderCaptainBrief (cyclomatic 41) lib/captain-brief.ts:77 — captain-brief.renderCaptainBrief has cyclomatic complexity 41 (threshold 15). Of this number, 31 points are the body's own statements and 10 belong to 6 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-queue-train.admitSlots (cyclomatic 41) · ×1
  • ship-queue-train.admitSlots (cyclomatic 41) crew/lib/ship-queue-train.ts:352 — ship-queue-train.admitSlots 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 · ship-mechanical.mechanicalPaths (cyclomatic 41) · ×1
  • ship-mechanical.mechanicalPaths (cyclomatic 41) lib/ship-mechanical.ts:73 — ship-mechanical.mechanicalPaths has cyclomatic complexity 41 (threshold 15). Of this number, 32 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 · phase-publication-hook.phaseDecision (cyclomatic 40) · ×1
  • phase-publication-hook.phaseDecision (cyclomatic 40) autoplan/bin/phase-publication-hook.ts:568 — 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:1074 — 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 · autoplan-run.initRun (cyclomatic 40) · ×1
  • autoplan-run.initRun (cyclomatic 40) REDACTED:87 — autoplan-run.initRun 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, 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-carry.shipLanesErrors (cyclomatic 40) · ×1
  • ci-carry.shipLanesErrors (cyclomatic 40) lib/ci-carry.ts:238 — ci-carry.shipLanesErrors has cyclomatic complexity 40 (threshold 15). Of this number, 36 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 · cli.main (cyclomatic 40) · ×1
  • cli.main (cyclomatic 40) design/src/cli.ts:172 — 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:166 — 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 · gstack-memory-ingest.parseTranscriptJsonl (cyclomatic 39) · ×1
  • gstack-memory-ingest.parseTranscriptJsonl (cyclomatic 39) bin/gstack-memory-ingest.ts:689 — 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 · autoplan-run.resumeRun (cyclomatic 39) · ×1
  • autoplan-run.resumeRun (cyclomatic 39) REDACTED:488 — autoplan-run.resumeRun has cyclomatic complexity 39 (threshold 15). Of this number, 38 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its 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 39) · ×1
  • approval-record.importAutoplan (cyclomatic 39) lib/approval-record.ts:323 — approval-record.importAutoplan has cyclomatic complexity 39 (threshold 15). Of this number, 32 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 · ship-receipt-depth.writeExcludeBinds · ×1
  • ship-receipt-depth.writeExcludeBinds::bindAudits (cyclomatic 39) lib/ship-receipt-depth.ts:390 — ship-receipt-depth.writeExcludeBinds::bindAudits 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. This shape REPEATS in the file: one other method here (ship-receipt-depth.writeExcludeBinds) 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 · 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 · 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:315 — 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 · cli.sendCommand (cyclomatic 38) · ×1
  • cli.sendCommand (cyclomatic 38) browse/src/cli.ts:1095 — cli.sendCommand 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 · restamp.restamp (cyclomatic 38) · ×1
  • restamp.restamp (cyclomatic 38) lib/restamp.ts:671 — restamp.restamp 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 · autoplan-run.submitResult (cyclomatic 38) · ×1
  • autoplan-run.submitResult (cyclomatic 38) REDACTED:342 — autoplan-run.submitResult 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 · ship-queue-train-land.landUpdate (cyclomatic 38) · ×1
  • ship-queue-train-land.landUpdate (cyclomatic 38) crew/lib/ship-queue-train-land.ts:194 — ship-queue-train-land.landUpdate 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 · 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 · 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 · ship-budget-cli.cmdResume (cyclomatic 38) · ×1
  • ship-budget-cli.cmdResume (cyclomatic 38) lib/ship-budget-cli.ts:437 — ship-budget-cli.cmdResume has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 10 of the 38 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 455, 462). 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 · redact-patterns.codeLineStart (cyclomatic 37) · ×1
  • redact-patterns.codeLineStart (cyclomatic 37) lib/redact-patterns.ts:1159 — redact-patterns.codeLineStart has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · redact-engine.scanInternal (cyclomatic 37) · ×1
  • redact-engine.scanInternal (cyclomatic 37) REDACTED:361 — redact-engine.scanInternal has cyclomatic complexity 37 (threshold 15). Of this number, 35 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 · server.buildFetchHandler.shutdown (cyclomatic 37) · ×1
  • server.buildFetchHandler.shutdown (cyclomatic 37) REDACTED:1631 — 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 · recover-receipts.collectRecovery (cyclomatic 37) · ×1
  • recover-receipts.collectRecovery (cyclomatic 37) crew/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 · outside-review-result.classifyOutsideReview (cyclomatic 37) · ×1
  • outside-review-result.classifyOutsideReview (cyclomatic 37) lib/outside-review-result.ts:248 — outside-review-result.classifyOutsideReview has cyclomatic complexity 37 (threshold 15). Of this number, 29 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 · ship-queue-train.trainStatus (cyclomatic 37) · ×1
  • ship-queue-train.trainStatus (cyclomatic 37) crew/lib/ship-queue-train.ts:609 — ship-queue-train.trainStatus has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 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 · review-pass.buildManifest (cyclomatic 37) · ×1
  • review-pass.buildManifest (cyclomatic 37) lib/review-pass.ts:134 — review-pass.buildManifest has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · phase-publication-hook.requirePublication (cyclomatic 36) · ×1
  • phase-publication-hook.requirePublication (cyclomatic 36) autoplan/bin/phase-publication-hook.ts:445 — 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 · cookie-import-native.importNativeCookies (cyclomatic 36) · ×1
  • cookie-import-native.importNativeCookies (cyclomatic 36) browse/src/cookie-import-native.ts:43 — 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 · restamp.rewriteStampPaths (cyclomatic 36) · ×1
  • restamp.rewriteStampPaths (cyclomatic 36) lib/restamp.ts:536 — restamp.rewriteStampPaths has cyclomatic complexity 36 (threshold 15). Of this number, 28 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 · release-stamp.classifyRelease (cyclomatic 36) · ×1
  • release-stamp.classifyRelease (cyclomatic 36) lib/release-stamp.ts:37 — release-stamp.classifyRelease has cyclomatic complexity 36 (threshold 15). Of this number, 33 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 · 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 · ship-queue-land-direct.landDirect · ×1
  • ship-queue-land-direct.landDirect::locked (cyclomatic 36) lib/ship-queue-land-direct.ts:242 — ship-queue-land-direct.landDirect::locked has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ship-queue-land-direct.landDirect) 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-release.accept (cyclomatic 36) · ×1
  • ship-release.accept (cyclomatic 36) lib/ship-release.ts:674 — ship-release.accept has cyclomatic complexity 36 (threshold 15). Of this number, 35 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 · review-depth.loopStep (cyclomatic 35) · ×1
  • review-depth.loopStep (cyclomatic 35) lib/review-depth.ts:438 — review-depth.loopStep 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 · terminal-agent-control.reclaimPublicationLock (cyclomatic 35) · ×1
  • terminal-agent-control.reclaimPublicationLock (cyclomatic 35) browse/src/terminal-agent-control.ts:78 — 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 · 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-release.push (cyclomatic 35) · ×1
  • ship-release.push (cyclomatic 35) lib/ship-release.ts:765 — ship-release.push has cyclomatic complexity 35 (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 · (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 · phase-publication-hook.invocation (cyclomatic 34) · ×1
  • phase-publication-hook.invocation (cyclomatic 34) autoplan/bin/phase-publication-hook.ts:268 — phase-publication-hook.invocation has cyclomatic complexity 34 (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.preparePages (cyclomatic 34) · ×1
  • gstack-memory-ingest.preparePages (cyclomatic 34) bin/gstack-memory-ingest.ts:1548 — 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:150 — 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 · autoplan-carry.submitCarryCheck (cyclomatic 34) · ×1
  • autoplan-carry.submitCarryCheck (cyclomatic 34) lib/autoplan-carry.ts:222 — autoplan-carry.submitCarryCheck has cyclomatic complexity 34 (threshold 15). Of this number, 32 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 · context.buildContext (cyclomatic 34) · ×1
  • context.buildContext (cyclomatic 34) lib/pregate/context.ts:209 — context.buildContext 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 · skill-contract.parseTranscript (cyclomatic 34) · ×1
  • skill-contract.parseTranscript (cyclomatic 34) REDACTED:179 — skill-contract.parseTranscript 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 · 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 · eval-plan.dryRun (cyclomatic 34) · ×1
  • eval-plan.dryRun (cyclomatic 34) lib/eval-plan.ts:311 — eval-plan.dryRun has cyclomatic complexity 34 (threshold 15). Of this number, 22 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 · gstack-post.splitSections (cyclomatic 34) · ×1
  • gstack-post.splitSections (cyclomatic 34) lib/gstack-post.ts:200 — gstack-post.splitSections has cyclomatic complexity 34 (threshold 15). Of this number, 32 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 · review-brief.renderRole (cyclomatic 34) · ×1
  • review-brief.renderRole (cyclomatic 34) lib/review-brief.ts:150 — review-brief.renderRole has cyclomatic complexity 34 (threshold 15). Of this number, 27 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 · skill-bill.checkEvalTasks (cyclomatic 34) · ×1
  • skill-bill.checkEvalTasks (cyclomatic 34) REDACTED:42 — skill-bill.checkEvalTasks 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 · 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.guardOutput (cyclomatic 33) · ×1
  • phase-publication-hook.guardOutput (cyclomatic 33) autoplan/bin/phase-publication-hook.ts:722 — 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.freshClassify (cyclomatic 33) · ×1
  • gbrain-local-status.freshClassify (cyclomatic 33) REDACTED:455 — gbrain-local-status.freshClassify has cyclomatic complexity 33 (threshold 15). Of this number, 19 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 · motion-capture.parseCaptureArgs (cyclomatic 33) · ×1
  • motion-capture.parseCaptureArgs (cyclomatic 33) lib/motion-capture.ts:81 — motion-capture.parseCaptureArgs 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 · BrowserManager.promoteToHeaded (cyclomatic 33) · ×1
  • BrowserManager.promoteToHeaded (cyclomatic 33) browse/src/browser-manager.ts:2162 — BrowserManager.promoteToHeaded has cyclomatic complexity 33 (threshold 15). Of this number, 29 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-receipt-depth.parseReviewLoopException (cyclomatic 33) · ×1
  • ship-receipt-depth.parseReviewLoopException (cyclomatic 33) lib/ship-receipt-depth.ts:160 — ship-receipt-depth.parseReviewLoopException 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 · ship-queue.verify (cyclomatic 33) · ×1
  • ship-queue.verify (cyclomatic 33) lib/ship-queue.ts:566 — 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 · Watcher.poll (cyclomatic 33) · ×1
  • Watcher.poll (cyclomatic 33) lib/pr-wait.ts:477 — Watcher.poll 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 · 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 · quarantine.entryProblems (cyclomatic 33) · ×1
  • quarantine.entryProblems (cyclomatic 33) lib/quarantine.ts:132 — quarantine.entryProblems 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 · retro-friction.frictionBySkill (cyclomatic 33) · ×1
  • retro-friction.frictionBySkill (cyclomatic 33) lib/retro-friction.ts:71 — retro-friction.frictionBySkill has cyclomatic complexity 33 (threshold 15). Of this number, 29 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 · review-bots.fetch (cyclomatic 33) · ×1
  • review-bots.fetch (cyclomatic 33) REDACTED:116 — review-bots.fetch has cyclomatic complexity 33 (threshold 15). Of this number, 30 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 · ship-release.fixChecked (cyclomatic 33) · ×1
  • ship-release.fixChecked (cyclomatic 33) lib/ship-release.ts:293 — ship-release.fixChecked 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 · ship-policy.trainErrors (cyclomatic 32) · ×1
  • ship-policy.trainErrors (cyclomatic 32) REDACTED:424 — ship-policy.trainErrors 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 · review-depth.classifyDiff (cyclomatic 32) · ×1
  • review-depth.classifyDiff (cyclomatic 32) lib/review-depth.ts:264 — review-depth.classifyDiff has cyclomatic complexity 32 (threshold 15). Of this number, 28 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 · git.sectionToFile (cyclomatic 32) · ×1
  • git.sectionToFile (cyclomatic 32) lib/gate-diff/git.ts:276 — 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 · audit.redactCommandArgs (cyclomatic 32) · ×1
  • audit.redactCommandArgs (cyclomatic 32) browse/src/audit.ts:81 — audit.redactCommandArgs 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 · gate-list.parseReply (cyclomatic 32) · ×1
  • gate-list.parseReply (cyclomatic 32) lib/gate-list.ts:187 — gate-list.parseReply has cyclomatic complexity 32 (threshold 15). 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, separate the cases: extract each independent branch into its 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-receipt-depth.ownChangeSince (cyclomatic 32) · ×1
  • ship-receipt-depth.ownChangeSince (cyclomatic 32) lib/ship-receipt-depth.ts:536 — ship-receipt-depth.ownChangeSince has cyclomatic complexity 32 (threshold 15). Of this number, 23 points are the body's own statements and 9 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 · ship-queue-train.mergeStep (cyclomatic 32) · ×1
  • ship-queue-train.mergeStep (cyclomatic 32) crew/lib/ship-queue-train.ts:160 — ship-queue-train.mergeStep has cyclomatic complexity 32 (threshold 15). Of this number, 28 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.buildTrain (cyclomatic 32) · ×1
  • ship-queue-train.buildTrain (cyclomatic 32) crew/lib/ship-queue-train.ts:550 — ship-queue-train.buildTrain 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 · ship-queue-train.pruneTrains (cyclomatic 32) · ×1
  • ship-queue-train.pruneTrains (cyclomatic 32) crew/lib/ship-queue-train.ts:670 — ship-queue-train.pruneTrains has cyclomatic complexity 32 (threshold 15). Of this number, 27 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 · skill-contract.checkItem (cyclomatic 32) · ×1
  • skill-contract.checkItem (cyclomatic 32) REDACTED:366 — skill-contract.checkItem has cyclomatic complexity 32 (threshold 15). Of this number, 21 points are the body's own statements and 11 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 · skill-contract-stop-hook.main (cyclomatic 32) · ×1
  • skill-contract-stop-hook.main (cyclomatic 32) hosts/claude/hooks/skill-contract-stop-hook.ts:76 — skill-contract-stop-hook.main 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 · 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 · qa-evidence.qaEvidenceMain (cyclomatic 32) · ×1
  • qa-evidence.qaEvidenceMain (cyclomatic 32) REDACTED:423 — qa-evidence.qaEvidenceMain has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 426, 424). 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 · review-pass.renderStage (cyclomatic 32) · ×1
  • review-pass.renderStage (cyclomatic 32) lib/review-pass.ts:201 — review-pass.renderStage has cyclomatic complexity 32 (threshold 15). Of this number, 25 points are the body's own statements and 7 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 · ship-preflight.preflight (cyclomatic 32) · ×1
  • ship-preflight.preflight (cyclomatic 32) lib/ship-preflight.ts:250 — ship-preflight.preflight 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 · diagram-prepass.inlineLocalImages (cyclomatic 32) · ×1
  • diagram-prepass.inlineLocalImages (cyclomatic 32) make-pdf/src/diagram-prepass.ts:549 — diagram-prepass.inlineLocalImages has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 2 of the 32 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 563, 679, 693). 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-memory-ingest.parseArgs (cyclomatic 31) · ×1
  • gstack-memory-ingest.parseArgs (cyclomatic 31) bin/gstack-memory-ingest.ts:321 — 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:2965 — 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 · BrowserManager.launchHeaded (cyclomatic 31) · ×1
  • BrowserManager.launchHeaded (cyclomatic 31) browse/src/browser-manager.ts:793 — 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 · ci-gate.evaluateChecks (cyclomatic 31) · ×1
  • ci-gate.evaluateChecks (cyclomatic 31) lib/ci-gate.ts:109 — 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 · restamp.planVersions (cyclomatic 31) · ×1
  • restamp.planVersions (cyclomatic 31) lib/restamp.ts:168 — restamp.planVersions has cyclomatic complexity 31 (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-collect.scanConsumers (cyclomatic 31) · ×1
  • review-collect.scanConsumers (cyclomatic 31) lib/review-collect.ts:209 — review-collect.scanConsumers has cyclomatic complexity 31 (threshold 15). 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, separate the cases: extract each independent branch into its 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-exclude.binaryContent (cyclomatic 31) · ×1
  • review-exclude.binaryContent (cyclomatic 31) lib/review-exclude.ts:195 — review-exclude.binaryContent has cyclomatic complexity 31 (threshold 15). Of this number, 27 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 · ship-queue-train-verify.verifyTrain (cyclomatic 31) · ×1
  • ship-queue-train-verify.verifyTrain (cyclomatic 31) crew/lib/ship-queue-train-verify.ts:231 — ship-queue-train-verify.verifyTrain has cyclomatic complexity 31 (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 · gate-cost-replay.parseArgs (cyclomatic 31) · ×1
  • gate-cost-replay.parseArgs (cyclomatic 31) crew/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 · 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 · checks.healthDimensions (cyclomatic 31) · ×1
  • checks.healthDimensions (cyclomatic 31) lib/checks.ts:140 — checks.healthDimensions 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, 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.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 · 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 · ship-patch.boundedPaths (cyclomatic 31) · ×1
  • ship-patch.boundedPaths (cyclomatic 31) lib/ship-patch.ts:313 — ship-patch.boundedPaths has cyclomatic complexity 31 (threshold 15). Of this number, 23 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 · ship-budget-cli.decide (cyclomatic 31) · ×1
  • ship-budget-cli.decide (cyclomatic 31) lib/ship-budget-cli.ts:142 — ship-budget-cli.decide 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-memory-ingest.admitTranscriptSource (cyclomatic 30) · ×1
  • gstack-memory-ingest.admitTranscriptSource (cyclomatic 30) bin/gstack-memory-ingest.ts:2538 — 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 · proxy-config.parseProxyConfig (cyclomatic 30) · ×1
  • proxy-config.parseProxyConfig (cyclomatic 30) REDACTED:55 — proxy-config.parseProxyConfig has cyclomatic complexity 30 (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-lean.captureDraft (cyclomatic 30) · ×1
  • autoplan-lean.captureDraft (cyclomatic 30) lib/autoplan-lean.ts:65 — autoplan-lean.captureDraft has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 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 · ship-queue-wave.waveMain (cyclomatic 30) · ×1
  • ship-queue-wave.waveMain (cyclomatic 30) crew/lib/ship-queue-wave.ts:630 — ship-queue-wave.waveMain has cyclomatic complexity 30 (threshold 15). Of this number, 27 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 · daemon.fetchHandler (cyclomatic 30) · ×1
  • daemon.fetchHandler (cyclomatic 30) design/src/daemon.ts:485 — daemon.fetchHandler 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 · 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 · autoplan-owner-words.ownerWords (cyclomatic 30) · ×1
  • autoplan-owner-words.ownerWords (cyclomatic 30) lib/autoplan-owner-words.ts:245 — autoplan-owner-words.ownerWords has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to 7 function items inside it that branch (note, strings, gateText, …). 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 · qa-deadline.runQaDeadlineCommand (cyclomatic 30) · ×1
  • qa-deadline.runQaDeadlineCommand (cyclomatic 30) lib/qa-deadline.ts:133 — qa-deadline.runQaDeadlineCommand has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 159, 169, 148, …). 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-plan.parseEvalCalls (cyclomatic 30) · ×1
  • eval-plan.parseEvalCalls (cyclomatic 30) lib/eval-plan.ts:557 — 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:684 — 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 · ship-call-log.countLoggedCalls (cyclomatic 30) · ×1
  • ship-call-log.countLoggedCalls (cyclomatic 30) lib/ship-call-log.ts:69 — ship-call-log.countLoggedCalls has cyclomatic complexity 30 (threshold 15). Of this number, 25 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 · ship-preflight.integrate (cyclomatic 30) · ×1
  • ship-preflight.integrate (cyclomatic 30) lib/ship-preflight.ts:73 — ship-preflight.integrate has cyclomatic complexity 30 (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-policy-mechanical.mechanicalErrors (cyclomatic 29) · ×1
  • ship-policy-mechanical.mechanicalErrors (cyclomatic 29) REDACTED:21 — ship-policy-mechanical.mechanicalErrors 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 25, 41, 35, …). 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 · autoplan-phase-publication.autoplanPhaseCompletions (cyclomatic 29) · ×1
  • autoplan-phase-publication.autoplanPhaseCompletions (cyclomatic 29) REDACTED:86 — 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:570 — 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 · head-policy.lanesOnlyHeadPolicy (cyclomatic 29) · ×1
  • head-policy.lanesOnlyHeadPolicy (cyclomatic 29) lib/pregate/head-policy.ts:84 — head-policy.lanesOnlyHeadPolicy has cyclomatic complexity 29 (threshold 15). Of this number, 17 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · stamp-only.versionStampOnly (cyclomatic 29) · ×1
  • stamp-only.versionStampOnly (cyclomatic 29) lib/pregate/stamp-only.ts:141 — stamp-only.versionStampOnly 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 · flaky-exception.shardFailures (cyclomatic 29) · ×1
  • flaky-exception.shardFailures (cyclomatic 29) lib/pregate/flaky-exception.ts:279 — flaky-exception.shardFailures has cyclomatic complexity 29 (threshold 15). Of this number, 27 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 · review-collect.readDiff (cyclomatic 29) · ×1
  • review-collect.readDiff (cyclomatic 29) lib/review-collect.ts:92 — review-collect.readDiff has cyclomatic complexity 29 (threshold 15). Of this number, 27 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 · ship-queue.stamp (cyclomatic 29) · ×1
  • ship-queue.stamp (cyclomatic 29) lib/ship-queue.ts:457 — 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 · release-gate.bisectRecord (cyclomatic 29) · ×1
  • release-gate.bisectRecord (cyclomatic 29) crew/lib/release-gate.ts:337 — release-gate.bisectRecord 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 · release-cut.gateVerdict (cyclomatic 29) · ×1
  • release-cut.gateVerdict (cyclomatic 29) REDACTED:120 — release-cut.gateVerdict has cyclomatic complexity 29 (threshold 15). Of this number, 27 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 · skill-contract.validateContract (cyclomatic 29) · ×1
  • skill-contract.validateContract (cyclomatic 29) REDACTED:109 — skill-contract.validateContract 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 · plain-title.loadPlainTitlePolicy (cyclomatic 29) · ×1
  • plain-title.loadPlainTitlePolicy (cyclomatic 29) REDACTED:41 — plain-title.loadPlainTitlePolicy has cyclomatic complexity 29 (threshold 15). Of this number, 17 points are the body's own statements and 12 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 29) · ×1
  • autoplan-public.exportPublic (cyclomatic 29) lib/autoplan-public.ts:161 — autoplan-public.exportPublic has cyclomatic complexity 29 (threshold 15). Of this number, 19 points are the body's own statements and 10 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 · 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 · 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:443 — 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 · cli.handlePairAgent (cyclomatic 28) · ×1
  • cli.handlePairAgent (cyclomatic 28) browse/src/cli.ts:1607 — 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 · gate-list.validateGateList (cyclomatic 28) · ×1
  • gate-list.validateGateList (cyclomatic 28) lib/gate-list.ts:77 — gate-list.validateGateList has cyclomatic complexity 28 (threshold 15). Of this number, 15 points are the body's own statements and 13 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 · regen.runRegen (cyclomatic 28) · ×1
  • regen.runRegen (cyclomatic 28) lib/regen.ts:233 — regen.runRegen has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 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 · import-graph.referencesIn (cyclomatic 28) · ×1
  • import-graph.referencesIn (cyclomatic 28) lib/pregate/import-graph.ts:412 — import-graph.referencesIn has cyclomatic complexity 28 (threshold 15). Of this number, 23 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 · ship-queue-train-record.parseNote (cyclomatic 28) · ×1
  • ship-queue-train-record.parseNote (cyclomatic 28) crew/lib/ship-queue-train-record.ts:342 — ship-queue-train-record.parseNote 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 · ship-queue-train-verdict.classifyGate (cyclomatic 28) · ×1
  • ship-queue-train-verdict.classifyGate (cyclomatic 28) crew/lib/ship-queue-train-verdict.ts:53 — 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 · ship-queue-train-verdict.trainVerdict (cyclomatic 28) · ×1
  • ship-queue-train-verdict.trainVerdict (cyclomatic 28) crew/lib/ship-queue-train-verdict.ts:108 — ship-queue-train-verdict.trainVerdict 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 · skill-contract.runsCheck (cyclomatic 28) · ×1
  • skill-contract.runsCheck (cyclomatic 28) REDACTED:308 — skill-contract.runsCheck 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 · 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 · review-evidence.reviewFreshness (cyclomatic 28) · ×1
  • review-evidence.reviewFreshness (cyclomatic 28) lib/review-evidence.ts:364 — review-evidence.reviewFreshness has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function item 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: 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 · tasks-prior.addRows (cyclomatic 28) · ×1
  • tasks-prior.addRows (cyclomatic 28) lib/tasks-prior.ts:88 — tasks-prior.addRows has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 93, 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 · review-depth.svgDrawing (cyclomatic 27) · ×1
  • review-depth.svgDrawing (cyclomatic 27) lib/review-depth.ts:125 — review-depth.svgDrawing 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-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:633 — 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:799 — 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:2424 — 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 2429, 2529, 2464, …). 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 · restamp.runStages (cyclomatic 27) · ×1
  • restamp.runStages (cyclomatic 27) lib/restamp.ts:458 — restamp.runStages has cyclomatic complexity 27 (threshold 15). Of this number, 25 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 · config.allowlistErrors (cyclomatic 27) · ×1
  • config.allowlistErrors (cyclomatic 27) lib/pregate/config.ts:166 — config.allowlistErrors has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 170, 180). 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 · 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 · import-graph.buildGraph (cyclomatic 27) · ×1
  • import-graph.buildGraph (cyclomatic 27) lib/pregate/import-graph.ts:480 — import-graph.buildGraph 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, 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 · plan-record.resolveApproved (cyclomatic 27) · ×1
  • plan-record.resolveApproved (cyclomatic 27) lib/plan-record.ts:191 — plan-record.resolveApproved 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 · ship-receipt.parseReviewLoop (cyclomatic 27) · ×1
  • ship-receipt.parseReviewLoop (cyclomatic 27) lib/ship-receipt.ts:479 — ship-receipt.parseReviewLoop has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 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-receipt-depth.writeExcludeBinds (cyclomatic 27) · ×1
  • ship-receipt-depth.writeExcludeBinds (cyclomatic 27) lib/ship-receipt-depth.ts:346 — ship-receipt-depth.writeExcludeBinds 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 (ship-receipt-depth.writeExcludeBinds::bindAudits) 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 · gate-reuse.ownDiffSignature (cyclomatic 27) · ×1
  • gate-reuse.ownDiffSignature (cyclomatic 27) crew/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 · ship-queue-wave.wavePlan (cyclomatic 27) · ×1
  • ship-queue-wave.wavePlan (cyclomatic 27) crew/lib/ship-queue-wave.ts:267 — ship-queue-wave.wavePlan 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 · ship-queue-train-verdict.trainBisect (cyclomatic 27) · ×1
  • ship-queue-train-verdict.trainBisect (cyclomatic 27) crew/lib/ship-queue-train-verdict.ts:247 — ship-queue-train-verdict.trainBisect 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, 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 · 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 · 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 · autoplan-public.scan (cyclomatic 27) · ×1
  • autoplan-public.scan (cyclomatic 27) lib/autoplan-public.ts:100 — autoplan-public.scan has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 106, values, a function literal at line 118, …). 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 · 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 · review-ledger.judge (cyclomatic 27) · ×1
  • review-ledger.judge (cyclomatic 27) lib/review-ledger.ts:427 — review-ledger.judge 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 · ship-release.prepushGuards (cyclomatic 27) · ×1
  • ship-release.prepushGuards (cyclomatic 27) lib/ship-release.ts:738 — ship-release.prepushGuards has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function items 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 · 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:273 — 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 · land-merged-checks.runMergedChecks (cyclomatic 26) · ×1
  • land-merged-checks.runMergedChecks (cyclomatic 26) lib/land-merged-checks.ts:101 — land-merged-checks.runMergedChecks 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 · redact-patterns.stringAt (cyclomatic 26) · ×1
  • redact-patterns.stringAt (cyclomatic 26) lib/redact-patterns.ts:947 — redact-patterns.stringAt 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 · git.resolveBase (cyclomatic 26) · ×1
  • git.resolveBase (cyclomatic 26) lib/gate-diff/git.ts:106 — git.resolveBase has cyclomatic complexity 26 (threshold 15). Of this number, 17 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.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 · cookie-import-native-job.createNativeCookieJob (cyclomatic 26) · ×1
  • cookie-import-native-job.createNativeCookieJob (cyclomatic 26) browse/src/cookie-import-native-job.ts:59 — cookie-import-native-job.createNativeCookieJob has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 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 · eval-input-cache.buildEvalInputIdentity (cyclomatic 26) · ×1
  • eval-input-cache.buildEvalInputIdentity (cyclomatic 26) crew/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) crew/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 · autoplan-export.runLog (cyclomatic 26) · ×1
  • autoplan-export.runLog (cyclomatic 26) lib/autoplan-export.ts:79 — autoplan-export.runLog has cyclomatic complexity 26 (threshold 15). Of this number, 21 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 · guards.run (cyclomatic 26) · ×1
  • guards.run (cyclomatic 26) lib/pregate/checks/guards.ts:70 — guards.run has cyclomatic complexity 26 (threshold 15). Of this number, 22 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 · review-exclude.reviewExclude (cyclomatic 26) · ×1
  • review-exclude.reviewExclude (cyclomatic 26) lib/review-exclude.ts:355 — review-exclude.reviewExclude has cyclomatic complexity 26 (threshold 15). Of this number, 21 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 · ship-receipt-depth.parseReviewTargeted (cyclomatic 26) · ×1
  • ship-receipt-depth.parseReviewTargeted (cyclomatic 26) lib/ship-receipt-depth.ts:240 — ship-receipt-depth.parseReviewTargeted 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-land.census (cyclomatic 26) · ×1
  • ship-queue-land.census (cyclomatic 26) lib/ship-queue-land.ts:230 — ship-queue-land.census has cyclomatic complexity 26 (threshold 15). Of this number, 23 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 · ship-queue-dispatch-ci.dispatchCi (cyclomatic 26) · ×1
  • ship-queue-dispatch-ci.dispatchCi (cyclomatic 26) crew/lib/ship-queue-dispatch-ci.ts:39 — ship-queue-dispatch-ci.dispatchCi has cyclomatic complexity 26 (threshold 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, separate the cases: extract each independent branch into its 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-land.landSlot (cyclomatic 26) · ×1
  • ship-queue-train-land.landSlot (cyclomatic 26) crew/lib/ship-queue-train-land.ts:333 — ship-queue-train-land.landSlot 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-cli.readyMain (cyclomatic 26) · ×1
  • ship-queue-train-cli.readyMain (cyclomatic 26) crew/lib/ship-queue-train-cli.ts:170 — ship-queue-train-cli.readyMain has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 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 · variants.requestVariantImage (cyclomatic 26) · ×1
  • variants.requestVariantImage (cyclomatic 26) design/src/variants.ts:98 — variants.requestVariantImage 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 · 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 · 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 · repo-state-clean.report (cyclomatic 26) · ×1
  • repo-state-clean.report (cyclomatic 26) lib/repo-state-clean.ts:339 — repo-state-clean.report has cyclomatic complexity 26 (threshold 15). Of this number, 22 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 · ship-handoff.cmdReconcile (cyclomatic 26) · ×1
  • ship-handoff.cmdReconcile (cyclomatic 26) lib/ship-handoff.ts:256 — ship-handoff.cmdReconcile 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 2 function literals inside it that branch (lines 258, 265). 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-release.release (cyclomatic 26) · ×1
  • ship-release.release (cyclomatic 26) lib/ship-release.ts:814 — ship-release.release 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 · 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 · 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:408 — 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 · gbrain-local-status.hasRemoteOnlyGbrainMcp (cyclomatic 25) · ×1
  • gbrain-local-status.hasRemoteOnlyGbrainMcp (cyclomatic 25) REDACTED:175 — gbrain-local-status.hasRemoteOnlyGbrainMcp has cyclomatic complexity 25 (threshold 15). Of this number, 17 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 · gate-cost-history.classifyReds (cyclomatic 25) · ×1
  • gate-cost-history.classifyReds (cyclomatic 25) crew/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 · changelog-fragments.readFragments (cyclomatic 25) · ×1
  • changelog-fragments.readFragments (cyclomatic 25) lib/changelog-fragments.ts:72 — changelog-fragments.readFragments 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, separate the cases: extract each independent branch into its 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 25) · ×1
  • autoplan-prompts.detectScope (cyclomatic 25) lib/autoplan-prompts.ts:57 — autoplan-prompts.detectScope 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 · stamp-only.jsonDiff (cyclomatic 25) · ×1
  • stamp-only.jsonDiff (cyclomatic 25) lib/pregate/stamp-only.ts:91 — stamp-only.jsonDiff 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:86 — 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 · Watcher.emitBots (cyclomatic 25) · ×1
  • Watcher.emitBots (cyclomatic 25) lib/pr-wait.ts:404 — Watcher.emitBots has cyclomatic complexity 25 (threshold 15). Of this number, 23 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 · ship-queue-screen.screenVerdict (cyclomatic 25) · ×1
  • ship-queue-screen.screenVerdict (cyclomatic 25) REDACTED:53 — ship-queue-screen.screenVerdict has cyclomatic complexity 25 (threshold 15). Of this number, 21 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 · tags.tagHunk (cyclomatic 25) · ×1
  • tags.tagHunk (cyclomatic 25) lib/gate-diff/tags.ts:236 — tags.tagHunk has cyclomatic complexity 25 (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.runSetup (cyclomatic 25) · ×1
  • cli.runSetup (cyclomatic 25) design/src/cli.ts:111 — cli.runSetup 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 · autoplan-stop-gate.checkRun (cyclomatic 25) · ×1
  • autoplan-stop-gate.checkRun (cyclomatic 25) lib/autoplan-stop-gate.ts:88 — autoplan-stop-gate.checkRun has cyclomatic complexity 25 (threshold 15). Of this number, 23 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 · autoplan-owner-words.ownerSpans (cyclomatic 25) · ×1
  • autoplan-owner-words.ownerSpans (cyclomatic 25) lib/autoplan-owner-words.ts:189 — autoplan-owner-words.ownerSpans has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · autoplan-shadow-reader.rowProblem (cyclomatic 25) · ×1
  • autoplan-shadow-reader.rowProblem (cyclomatic 25) REDACTED:116 — autoplan-shadow-reader.rowProblem has cyclomatic complexity 25 (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.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 · pr-shots.pathSides (cyclomatic 25) · ×1
  • pr-shots.pathSides (cyclomatic 25) lib/pr-shots.ts:78 — 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:162 — 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 · quarantine.quarantineMain (cyclomatic 25) · ×1
  • quarantine.quarantineMain (cyclomatic 25) lib/quarantine.ts:404 — quarantine.quarantineMain 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-budget-cli.cmdClose (cyclomatic 25) · ×1
  • ship-budget-cli.cmdClose (cyclomatic 25) lib/ship-budget-cli.ts:348 — ship-budget-cli.cmdClose has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 350, 355, 364). 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 · 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 · review-depth.nextStep (cyclomatic 24) · ×1
  • review-depth.nextStep (cyclomatic 24) lib/review-depth.ts:409 — review-depth.nextStep 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 · 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:2829 — 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:3206 — 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 · cli.proxyMismatchLines (cyclomatic 24) · ×1
  • cli.proxyMismatchLines (cyclomatic 24) browse/src/cli.ts:495 — cli.proxyMismatchLines has cyclomatic complexity 24 (threshold 15). 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, separate the cases: extract each independent branch into its 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.listProfiles (cyclomatic 24) · ×1
  • cookie-import-browser.listProfiles (cyclomatic 24) REDACTED:170 — 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 · 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 · sealed-guard.sealedErrors (cyclomatic 24) · ×1
  • sealed-guard.sealedErrors (cyclomatic 24) lib/sealed-guard.ts:71 — sealed-guard.sealedErrors has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 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 · lane-selection.removedPath (cyclomatic 24) · ×1
  • lane-selection.removedPath (cyclomatic 24) lib/pregate/lane-selection.ts:176 — lane-selection.removedPath has cyclomatic complexity 24 (threshold 15). Of this number, 20 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 · 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 · gate-reuse.parseBinding (cyclomatic 24) · ×1
  • gate-reuse.parseBinding (cyclomatic 24) crew/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 · ship-queue-train.freePhase (cyclomatic 24) · ×1
  • ship-queue-train.freePhase (cyclomatic 24) crew/lib/ship-queue-train.ts:481 — 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 · 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 · harness-register.hookPlan (cyclomatic 24) · ×1
  • harness-register.hookPlan (cyclomatic 24) REDACTED:534 — harness-register.hookPlan 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, 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 · repo-state-clean.evaluate (cyclomatic 24) · ×1
  • repo-state-clean.evaluate (cyclomatic 24) lib/repo-state-clean.ts:199 — repo-state-clean.evaluate 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-policy.compatErrors (cyclomatic 23) · ×1
  • ship-policy.compatErrors (cyclomatic 23) REDACTED:540 — ship-policy.compatErrors 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 · 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 · meta-commands.parseScreenshotArgs (cyclomatic 23) · ×1
  • meta-commands.parseScreenshotArgs (cyclomatic 23) browse/src/meta-commands.ts:30 — meta-commands.parseScreenshotArgs 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 · gate-cost-history.simulateArrivalTrains (cyclomatic 23) · ×1
  • gate-cost-history.simulateArrivalTrains (cyclomatic 23) crew/lib/gate-cost-history.ts:342 — 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 · ci-gate.parseCiGateArgs (cyclomatic 23) · ×1
  • ci-gate.parseCiGateArgs (cyclomatic 23) lib/ci-gate.ts:234 — 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 · 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 · 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 · ship-receipt.planCarry (cyclomatic 23) · ×1
  • ship-receipt.planCarry (cyclomatic 23) lib/ship-receipt.ts:344 — ship-receipt.planCarry 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 · gate-reuse.parseReuse (cyclomatic 23) · ×1
  • gate-reuse.parseReuse (cyclomatic 23) crew/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 · ship-queue-train-gate.dispatchWorkflows (cyclomatic 23) · ×1
  • ship-queue-train-gate.dispatchWorkflows (cyclomatic 23) crew/lib/ship-queue-train-gate.ts:249 — ship-queue-train-gate.dispatchWorkflows has cyclomatic complexity 23 (threshold 15). Of this number, 20 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 · ship-queue-post-merge.verifyPostMerge (cyclomatic 23) · ×1
  • ship-queue-post-merge.verifyPostMerge (cyclomatic 23) crew/lib/ship-queue-post-merge.ts:24 — ship-queue-post-merge.verifyPostMerge has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ship-queue-train-init.trainDoctor (cyclomatic 23) · ×1
  • ship-queue-train-init.trainDoctor (cyclomatic 23) REDACTED:201 — ship-queue-train-init.trainDoctor 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 · release-cadence.decideDaily (cyclomatic 23) · ×1
  • release-cadence.decideDaily (cyclomatic 23) crew/scripts/release-cadence.ts:59 — release-cadence.decideDaily 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 · shell-writes.shellCommands (cyclomatic 23) · ×1
  • shell-writes.shellCommands (cyclomatic 23) lib/shell-writes.ts:156 — shell-writes.shellCommands has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to one function item inside it that branches (end). 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 · timeline-stop-hook.repairTimeline (cyclomatic 23) · ×1
  • timeline-stop-hook.repairTimeline (cyclomatic 23) hosts/claude/hooks/timeline-stop-hook.ts:260 — 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 · prose-lint.lintProse (cyclomatic 23) · ×1
  • prose-lint.lintProse (cyclomatic 23) lib/prose-lint.ts:159 — prose-lint.lintProse has cyclomatic complexity 23 (threshold 15). 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 literals inside it that branch (lines 167, 192). 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 · archive-check.parseIssueList (cyclomatic 23) · ×1
  • archive-check.parseIssueList (cyclomatic 23) lib/archive-check.ts:57 — archive-check.parseIssueList 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 · 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 · 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 · runaway.emptyWakes (cyclomatic 23) · ×1
  • runaway.emptyWakes (cyclomatic 23) lib/runaway.ts:77 — runaway.emptyWakes has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 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-budget-cli.rebuildLedger (cyclomatic 23) · ×1
  • ship-budget-cli.rebuildLedger (cyclomatic 23) lib/ship-budget-cli.ts:490 — ship-budget-cli.rebuildLedger has cyclomatic complexity 23 (threshold 15). Of this number, 21 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 · ship-sidecar.uidSidecars (cyclomatic 23) · ×1
  • ship-sidecar.uidSidecars (cyclomatic 23) lib/ship-sidecar.ts:72 — ship-sidecar.uidSidecars 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 · ship-parts.shipParts (cyclomatic 23) · ×1
  • ship-parts.shipParts (cyclomatic 23) lib/ship-parts.ts:119 — ship-parts.shipParts has cyclomatic complexity 23 (threshold 15). Of this number, 19 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 · ship-queue-land-direct.verifyMerge (cyclomatic 23) · ×1
  • ship-queue-land-direct.verifyMerge (cyclomatic 23) lib/ship-queue-land-direct.ts:118 — ship-queue-land-direct.verifyMerge has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.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 · redact-engine.redactJsonFindingSpans (cyclomatic 22) · ×1
  • redact-engine.redactJsonFindingSpans (cyclomatic 22) REDACTED:669 — 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 · phase-publication-hook.disarmedAt (cyclomatic 22) · ×1
  • phase-publication-hook.disarmedAt (cyclomatic 22) autoplan/bin/phase-publication-hook.ts:391 — 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:484 — 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:2759 — 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 · aside-render.renderWithBrowse (cyclomatic 22) · ×1
  • aside-render.renderWithBrowse (cyclomatic 22) lib/aside-render.ts:614 — aside-render.renderWithBrowse has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 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.close (cyclomatic 22) · ×1
  • BrowserManager.close (cyclomatic 22) browse/src/browser-manager.ts:1091 — 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 · terminal-agent-control.agentStatus (cyclomatic 22) · ×1
  • terminal-agent-control.agentStatus (cyclomatic 22) browse/src/terminal-agent-control.ts:365 — terminal-agent-control.agentStatus 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 · cli.startServer (cyclomatic 22) · ×1
  • cli.startServer (cyclomatic 22) browse/src/cli.ts:728 — 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 · config.guardErrors (cyclomatic 22) · ×1
  • config.guardErrors (cyclomatic 22) lib/pregate/config.ts:144 — 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 149, 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.
D1 · Cyclomatic Complexity · index.keepSameTreeClears (cyclomatic 22) · ×1
  • index.keepSameTreeClears (cyclomatic 22) REDACTED:530 — index.keepSameTreeClears has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 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 · 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 · ship-receipt.heldBy (cyclomatic 22) · ×1
  • ship-receipt.heldBy (cyclomatic 22) lib/ship-receipt.ts:380 — ship-receipt.heldBy has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 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 · review-exclude.grepFixed (cyclomatic 22) · ×1
  • review-exclude.grepFixed (cyclomatic 22) lib/review-exclude.ts:305 — review-exclude.grepFixed 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 · ship-queue-land-lock.acquireLandLock (cyclomatic 22) · ×1
  • ship-queue-land-lock.acquireLandLock (cyclomatic 22) crew/lib/ship-queue-land-lock.ts:106 — ship-queue-land-lock.acquireLandLock has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 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-queue-land.buildStamp (cyclomatic 22) · ×1
  • ship-queue-land.buildStamp (cyclomatic 22) lib/ship-queue-land.ts:157 — ship-queue-land.buildStamp 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 · train-backstop.runBackstop (cyclomatic 22) · ×1
  • train-backstop.runBackstop (cyclomatic 22) crew/scripts/train-backstop.ts:133 — train-backstop.runBackstop 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 · variants.runBriefsBatch (cyclomatic 22) · ×1
  • variants.runBriefsBatch (cyclomatic 22) design/src/variants.ts:366 — 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 · index.handleLoopback (cyclomatic 22) · ×1
  • index.handleLoopback (cyclomatic 22) ios-qa/daemon/src/index.ts:398 — index.handleLoopback 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 · checks.manifestChecks (cyclomatic 22) · ×1
  • checks.manifestChecks (cyclomatic 22) lib/checks.ts:88 — checks.manifestChecks 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 · 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 · 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 · harness-start-hook.inspectHook (cyclomatic 22) · ×1
  • harness-start-hook.inspectHook (cyclomatic 22) lib/harness-start-hook.ts:189 — harness-start-hook.inspectHook 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 · pr-shots.diffLines (cyclomatic 22) · ×1
  • pr-shots.diffLines (cyclomatic 22) lib/pr-shots.ts:124 — 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 · review-sweep.inventory · ×1
  • review-sweep.inventory::walk (cyclomatic 22) lib/review-sweep.ts:121 — review-sweep.inventory::walk 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 · review-targeted-delta.targetedDelta (cyclomatic 22) · ×1
  • review-targeted-delta.targetedDelta (cyclomatic 22) lib/review-targeted-delta.ts:22 — review-targeted-delta.targetedDelta 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, 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-budget-cli.cmdCheck (cyclomatic 22) · ×1
  • ship-budget-cli.cmdCheck (cyclomatic 22) lib/ship-budget-cli.ts:302 — ship-budget-cli.cmdCheck 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 309, 312). 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 · review-depth.leanStep (cyclomatic 21) · ×1
  • review-depth.leanStep (cyclomatic 21) lib/review-depth.ts:425 — review-depth.leanStep 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-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:1291 — 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 · gstack-memory-ingest.probeMode (cyclomatic 21) · ×1
  • gstack-memory-ingest.probeMode (cyclomatic 21) bin/gstack-memory-ingest.ts:1349 — gstack-memory-ingest.probeMode 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 · 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.restoreState (cyclomatic 21) · ×1
  • BrowserManager.restoreState (cyclomatic 21) browse/src/browser-manager.ts:1919 — BrowserManager.restoreState 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 · 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:222 — 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:261 — 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:1493 — 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 1560, 1767, 1789). 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 · restamp.queueOrderCheck (cyclomatic 21) · ×1
  • restamp.queueOrderCheck (cyclomatic 21) lib/restamp.ts:116 — restamp.queueOrderCheck 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, 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 · 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 · autoplan-run.openPhase (cyclomatic 21) · ×1
  • autoplan-run.openPhase (cyclomatic 21) REDACTED:163 — autoplan-run.openPhase has cyclomatic complexity 21 (threshold 15). Of this number, 19 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-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 · approval-record.buildRow (cyclomatic 21) · ×1
  • approval-record.buildRow (cyclomatic 21) lib/approval-record.ts:168 — approval-record.buildRow has cyclomatic complexity 21 (threshold 15). Of this number, 14 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 · headless-artifacts.checkSchema (cyclomatic 21) · ×1
  • headless-artifacts.checkSchema (cyclomatic 21) lib/headless-artifacts.ts:322 — 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 · 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 · doc-links.brokenLinks (cyclomatic 21) · ×1
  • doc-links.brokenLinks (cyclomatic 21) lib/doc-links.ts:43 — doc-links.brokenLinks 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 50, anchorsAt). 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 · lanes.run (cyclomatic 21) · ×1
  • lanes.run (cyclomatic 21) lib/pregate/checks/lanes.ts:624 — lanes.run has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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 · stable-release.newestStableRelease (cyclomatic 21) · ×1
  • stable-release.newestStableRelease (cyclomatic 21) lib/stable-release.ts:27 — stable-release.newestStableRelease has cyclomatic complexity 21 (threshold 15). Of this number, 17 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.addedLines (cyclomatic 21) · ×1
  • secrets.addedLines (cyclomatic 21) lib/pregate/checks/secrets.ts:128 — secrets.addedLines has cyclomatic complexity 21 (threshold 15). Of this number, 19 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 · remote-receipt.substituteStampOnlyTree (cyclomatic 21) · ×1
  • remote-receipt.substituteStampOnlyTree (cyclomatic 21) lib/pregate/remote-receipt.ts:78 — remote-receipt.substituteStampOnlyTree has cyclomatic complexity 21 (threshold 15). 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, separate the cases: extract each independent branch into its 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) crew/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 · gate-dispositions.gateAcceptance (cyclomatic 21) · ×1
  • gate-dispositions.gateAcceptance (cyclomatic 21) lib/gate-dispositions.ts:160 — gate-dispositions.gateAcceptance 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. This is NOT this file's highest cyclomatic complexity: gate-dispositions.writerShaped (cyclomatic 22) 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-receipt-docs.carriedAudits (cyclomatic 21) · ×1
  • ship-receipt-docs.carriedAudits (cyclomatic 21) lib/ship-receipt-docs.ts:54 — ship-receipt-docs.carriedAudits has cyclomatic complexity 21 (threshold 15). 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, 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-wait.parsePrWaitArgs (cyclomatic 21) · ×1
  • pr-wait.parsePrWaitArgs (cyclomatic 21) lib/pr-wait.ts:125 — pr-wait.parsePrWaitArgs 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 · ship-queue-land.repair (cyclomatic 21) · ×1
  • ship-queue-land.repair (cyclomatic 21) lib/ship-queue-land.ts:269 — ship-queue-land.repair 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 · 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 · spawn-bin.runExternal (cyclomatic 21) · ×1
  • spawn-bin.runExternal (cyclomatic 21) hosts/claude/hooks/spawn-bin.ts:133 — 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 166, 139, 162, …). 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 · skill-gates.runGateHook (cyclomatic 21) · ×1
  • skill-gates.runGateHook (cyclomatic 21) lib/skill-gates.ts:248 — skill-gates.runGateHook has cyclomatic complexity 21 (threshold 15). Of this number, 18 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 · autoplan-shadow-reader.exportShadow (cyclomatic 21) · ×1
  • autoplan-shadow-reader.exportShadow (cyclomatic 21) REDACTED:37 — autoplan-shadow-reader.exportShadow 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 · 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 · design-build.parseInventory (cyclomatic 21) · ×1
  • design-build.parseInventory (cyclomatic 21) lib/design-build.ts:70 — design-build.parseInventory 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 · 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 · 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 · ship-budget.measureSettled (cyclomatic 21) · ×1
  • ship-budget.measureSettled (cyclomatic 21) lib/ship-budget.ts:263 — ship-budget.measureSettled has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 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 · ship-preflight.merge (cyclomatic 21) · ×1
  • ship-preflight.merge (cyclomatic 21) lib/ship-preflight.ts:143 — ship-preflight.merge has cyclomatic complexity 21 (threshold 15). 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, separate the cases: extract each independent branch into its 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.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 · 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 · 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 · autoplan-run.withRunLock (cyclomatic 20) · ×1
  • autoplan-run.withRunLock (cyclomatic 20) REDACTED:47 — autoplan-run.withRunLock 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 · sealed-guard.landedOnBase (cyclomatic 20) · ×1
  • sealed-guard.landedOnBase (cyclomatic 20) lib/sealed-guard.ts:367 — sealed-guard.landedOnBase has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 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 · sealed-guard.evaluateSealed (cyclomatic 20) · ×1
  • sealed-guard.evaluateSealed (cyclomatic 20) lib/sealed-guard.ts:425 — sealed-guard.evaluateSealed has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · install-verdict.verdictFileProblem (cyclomatic 20) · ×1
  • install-verdict.verdictFileProblem (cyclomatic 20) lib/install-verdict.ts:162 — install-verdict.verdictFileProblem 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 · runtime.launchRuntime (cyclomatic 20) · ×1
  • runtime.launchRuntime (cyclomatic 20) lib/pregate/runtime.ts:159 — runtime.launchRuntime 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, separate the cases: extract each independent branch into its 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:187 — 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 · init-draft.draftConfig (cyclomatic 20) · ×1
  • init-draft.draftConfig (cyclomatic 20) lib/pregate/init-draft.ts:52 — init-draft.draftConfig has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · docs-only.classifyEntries (cyclomatic 20) · ×1
  • docs-only.classifyEntries (cyclomatic 20) lib/docs-only.ts:181 — docs-only.classifyEntries has cyclomatic complexity 20 (threshold 15). 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: 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 · run-check.gateInputsChanged (cyclomatic 20) · ×1
  • run-check.gateInputsChanged (cyclomatic 20) lib/pregate/run-check.ts:29 — run-check.gateInputsChanged has cyclomatic complexity 20 (threshold 15). Of this number, 16 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 · ship-receipt.receiptSummaryLine (cyclomatic 20) · ×1
  • ship-receipt.receiptSummaryLine (cyclomatic 20) lib/ship-receipt.ts:185 — ship-receipt.receiptSummaryLine 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 · ship-receipt-depth.receiptDepthVerdict (cyclomatic 20) · ×1
  • ship-receipt-depth.receiptDepthVerdict (cyclomatic 20) lib/ship-receipt-depth.ts:475 — ship-receipt-depth.receiptDepthVerdict 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 · ship-queue.ciAtHead (cyclomatic 20) · ×1
  • ship-queue.ciAtHead (cyclomatic 20) lib/ship-queue.ts:211 — ship-queue.ciAtHead has cyclomatic complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 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 · ship-queue-train-gate.genericVerdict (cyclomatic 20) · ×1
  • ship-queue-train-gate.genericVerdict (cyclomatic 20) crew/lib/ship-queue-train-gate.ts:504 — ship-queue-train-gate.genericVerdict has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ship-queue-train.nextFor (cyclomatic 20) · ×1
  • ship-queue-train.nextFor (cyclomatic 20) crew/lib/ship-queue-train.ts:277 — ship-queue-train.nextFor has cyclomatic complexity 20 (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 · ship-queue-train-verdict.trainRebuild (cyclomatic 20) · ×1
  • ship-queue-train-verdict.trainRebuild (cyclomatic 20) crew/lib/ship-queue-train-verdict.ts:315 — ship-queue-train-verdict.trainRebuild 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 · release-gate.collectRound (cyclomatic 20) · ×1
  • release-gate.collectRound (cyclomatic 20) crew/lib/release-gate.ts:313 — release-gate.collectRound 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 · ship-queue-train-ready.verifyScreen (cyclomatic 20) · ×1
  • ship-queue-train-ready.verifyScreen (cyclomatic 20) crew/lib/ship-queue-train-ready.ts:323 — ship-queue-train-ready.verifyScreen 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 · ship-queue-train-verify.confirmMerged (cyclomatic 20) · ×1
  • ship-queue-train-verify.confirmMerged (cyclomatic 20) crew/lib/ship-queue-train-verify.ts:284 — ship-queue-train-verify.confirmMerged has cyclomatic complexity 20 (threshold 15). Of this number, 17 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 · ship-queue-train-land.trainLand (cyclomatic 20) · ×1
  • ship-queue-train-land.trainLand (cyclomatic 20) crew/lib/ship-queue-train-land.ts:296 — ship-queue-train-land.trainLand has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 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 · ship-queue-train-init.trainInit (cyclomatic 20) · ×1
  • ship-queue-train-init.trainInit (cyclomatic 20) REDACTED:168 — ship-queue-train-init.trainInit 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 · release-cut.planDaily (cyclomatic 20) · ×1
  • release-cut.planDaily (cyclomatic 20) REDACTED:628 — release-cut.planDaily 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 · train-backstop.coveringRecord (cyclomatic 20) · ×1
  • train-backstop.coveringRecord (cyclomatic 20) crew/scripts/train-backstop.ts:62 — train-backstop.coveringRecord has cyclomatic complexity 20 (threshold 15). Of this number, 17 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 · question-log-hook.main (cyclomatic 20) · ×1
  • question-log-hook.main (cyclomatic 20) hosts/claude/hooks/question-log-hook.ts:268 — question-log-hook.main 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 · 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 · 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:294 — 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 295). 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:187 — 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 · eval-plan.startPilot (cyclomatic 20) · ×1
  • eval-plan.startPilot (cyclomatic 20) lib/eval-plan.ts:395 — eval-plan.startPilot has cyclomatic complexity 20 (threshold 15). 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, separate the cases: extract each independent branch into its 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-fetch.splitCommands (cyclomatic 20) · ×1
  • review-fetch.splitCommands (cyclomatic 20) lib/review-fetch.ts:98 — review-fetch.splitCommands has cyclomatic complexity 20 (threshold 15). Of this number, 18 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 · 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 · ship-budget-cli.cmdNote (cyclomatic 20) · ×1
  • ship-budget-cli.cmdNote (cyclomatic 20) lib/ship-budget-cli.ts:392 — ship-budget-cli.cmdNote 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 one function literal inside it that branches (line 398). 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 · ship-handoff.cmdVerifyHandoff (cyclomatic 20) · ×1
  • ship-handoff.cmdVerifyHandoff (cyclomatic 20) lib/ship-handoff.ts:164 — ship-handoff.cmdVerifyHandoff 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 · 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 · ship-policy-readers.readersErrors (cyclomatic 19) · ×1
  • ship-policy-readers.readersErrors (cyclomatic 19) lib/ship-policy-readers.ts:39 — ship-policy-readers.readersErrors 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 · redact-patterns.pythonFieldEnd (cyclomatic 19) · ×1
  • redact-patterns.pythonFieldEnd (cyclomatic 19) lib/redact-patterns.ts:911 — redact-patterns.pythonFieldEnd 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 · redact-patterns.isPropertyRead (cyclomatic 19) · ×1
  • redact-patterns.isPropertyRead (cyclomatic 19) lib/redact-patterns.ts:1231 — redact-patterns.isPropertyRead 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 · 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:382 — 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 · restamp.gateAhead (cyclomatic 19) · ×1
  • restamp.gateAhead (cyclomatic 19) lib/restamp.ts:749 — 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 · autoplan-gate-cost.recReopens (cyclomatic 19) · ×1
  • autoplan-gate-cost.recReopens (cyclomatic 19) lib/autoplan-gate-cost.ts:52 — autoplan-gate-cost.recReopens 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 · outside-voice-api.callModel (cyclomatic 19) · ×1
  • outside-voice-api.callModel (cyclomatic 19) lib/outside-voice-api.ts:62 — outside-voice-api.callModel 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 · autoplan-shadow.publish (cyclomatic 19) · ×1
  • autoplan-shadow.publish (cyclomatic 19) lib/autoplan-shadow.ts:391 — autoplan-shadow.publish 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 2 function literals inside it that branch (lines 396, 421). 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 · sealed-guard.renderSealed (cyclomatic 19) · ×1
  • sealed-guard.renderSealed (cyclomatic 19) lib/sealed-guard.ts:475 — sealed-guard.renderSealed 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 · workflows.commandTestFiles (cyclomatic 19) · ×1
  • workflows.commandTestFiles (cyclomatic 19) lib/pregate/workflows.ts:103 — 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 · literals.run (cyclomatic 19) · ×1
  • literals.run (cyclomatic 19) REDACTED:175 — literals.run has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 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.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 · tree-receipt.classifyFiles (cyclomatic 19) · ×1
  • tree-receipt.classifyFiles (cyclomatic 19) lib/tree-receipt.ts:60 — tree-receipt.classifyFiles has cyclomatic complexity 19 (threshold 15). Of this number, 14 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 · review-collect.collectLive (cyclomatic 19) · ×1
  • review-collect.collectLive (cyclomatic 19) lib/review-collect.ts:350 — review-collect.collectLive has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 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 · review-secret-excerpt.hits (cyclomatic 19) · ×1
  • review-secret-excerpt.hits (cyclomatic 19) lib/review-secret-excerpt.ts:56 — review-secret-excerpt.hits 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 · review-exclude.readSelection (cyclomatic 19) · ×1
  • review-exclude.readSelection (cyclomatic 19) lib/review-exclude.ts:478 — review-exclude.readSelection 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 · ship-receipt-docs.parseReceiptDocs (cyclomatic 19) · ×1
  • ship-receipt-docs.parseReceiptDocs (cyclomatic 19) lib/ship-receipt-docs.ts:24 — ship-receipt-docs.parseReceiptDocs 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 · ship-queue.reproduceGateAhead (cyclomatic 19) · ×1
  • ship-queue.reproduceGateAhead (cyclomatic 19) lib/ship-queue.ts:533 — 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-land.unstampLegacy (cyclomatic 19) · ×1
  • ship-queue-land.unstampLegacy (cyclomatic 19) lib/ship-queue-land.ts:118 — ship-queue-land.unstampLegacy 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 · ship-queue-train-watch.watchGeneric (cyclomatic 19) · ×1
  • ship-queue-train-watch.watchGeneric (cyclomatic 19) crew/lib/ship-queue-train-watch.ts:57 — ship-queue-train-watch.watchGeneric 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) crew/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 · train-backstop.freeze (cyclomatic 19) · ×1
  • train-backstop.freeze (cyclomatic 19) crew/scripts/train-backstop.ts:242 — train-backstop.freeze has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 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 · skill-contract.checkContract (cyclomatic 19) · ×1
  • skill-contract.checkContract (cyclomatic 19) REDACTED:473 — skill-contract.checkContract 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 · autoplan-stop-gate.handle (cyclomatic 19) · ×1
  • autoplan-stop-gate.handle (cyclomatic 19) hosts/claude/hooks/autoplan-stop-gate.ts:94 — autoplan-stop-gate.handle has cyclomatic complexity 19 (threshold 15). 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 103). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · index.handleTailnet (cyclomatic 19) · ×1
  • index.handleTailnet (cyclomatic 19) ios-qa/daemon/src/index.ts:497 — 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 · 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 · junit.readCase (cyclomatic 19) · ×1
  • junit.readCase (cyclomatic 19) lib/junit.ts:148 — junit.readCase 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-post.command (cyclomatic 19) · ×1
  • gstack-post.command (cyclomatic 19) lib/gstack-post.ts:578 — 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:186 — 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 · 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 · 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 · 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 · ship-policy.commandGateErrors (cyclomatic 18) · ×1
  • ship-policy.commandGateErrors (cyclomatic 18) REDACTED:394 — ship-policy.commandGateErrors 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 · ship-policy.baseRedErrors (cyclomatic 18) · ×1
  • ship-policy.baseRedErrors (cyclomatic 18) REDACTED:602 — ship-policy.baseRedErrors 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 · 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:374 — 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 · BrowserManager.launch (cyclomatic 18) · ×1
  • BrowserManager.launch (cyclomatic 18) browse/src/browser-manager.ts:633 — BrowserManager.launch 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 · commands.canDispatchOverTunnel (cyclomatic 18) · ×1
  • commands.canDispatchOverTunnel (cyclomatic 18) browse/src/routes/commands.ts:50 — commands.canDispatchOverTunnel 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 · 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 · changelog-check.mergeChangelogsWithNotes (cyclomatic 18) · ×1
  • changelog-check.mergeChangelogsWithNotes (cyclomatic 18) lib/changelog-check.ts:369 — changelog-check.mergeChangelogsWithNotes 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, 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 · 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 · restamp.parseUnifiedDiff (cyclomatic 18) · ×1
  • restamp.parseUnifiedDiff (cyclomatic 18) lib/restamp.ts:260 — restamp.parseUnifiedDiff 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 · 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 · 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 · outside-review-result.execution (cyclomatic 18) · ×1
  • outside-review-result.execution (cyclomatic 18) lib/outside-review-result.ts:93 — outside-review-result.execution 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:549 — 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 · autoplan-shadow.shadowSwitch (cyclomatic 18) · ×1
  • autoplan-shadow.shadowSwitch (cyclomatic 18) lib/autoplan-shadow.ts:83 — autoplan-shadow.shadowSwitch 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 · autoplan-shadow.runShadow (cyclomatic 18) · ×1
  • autoplan-shadow.runShadow (cyclomatic 18) lib/autoplan-shadow.ts:289 — autoplan-shadow.runShadow has cyclomatic complexity 18 (threshold 15). Of this number, 12 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-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 · bin-context.markerSlug (cyclomatic 18) · ×1
  • bin-context.markerSlug (cyclomatic 18) lib/bin-context.ts:359 — bin-context.markerSlug 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 · sealed-guard.publishedViaPulls (cyclomatic 18) · ×1
  • sealed-guard.publishedViaPulls (cyclomatic 18) lib/sealed-guard.ts:330 — sealed-guard.publishedViaPulls 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, 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.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 · lanes.detectRunner (cyclomatic 18) · ×1
  • lanes.detectRunner (cyclomatic 18) lib/pregate/checks/lanes.ts:53 — lanes.detectRunner 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 · version-gate-train.regeneratedAtBase (cyclomatic 18) · ×1
  • version-gate-train.regeneratedAtBase (cyclomatic 18) crew/lib/version-gate-train.ts:57 — 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 · flaky-exception.flakyDecision (cyclomatic 18) · ×1
  • flaky-exception.flakyDecision (cyclomatic 18) lib/pregate/flaky-exception.ts:365 — flaky-exception.flakyDecision 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 · index.verifyPregate (cyclomatic 18) · ×1
  • index.verifyPregate (cyclomatic 18) REDACTED:222 — index.verifyPregate 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 · gate-dispositions.dispositionedOn (cyclomatic 18) · ×1
  • gate-dispositions.dispositionedOn (cyclomatic 18) lib/gate-dispositions.ts:197 — gate-dispositions.dispositionedOn 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 3 function items inside it that branch (a function literal at line 199, commitOf, a function literal at line 207). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: gate-dispositions.writerShaped (cyclomatic 22) 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-platform.platformReviewAt (cyclomatic 18) · ×1
  • review-platform.platformReviewAt (cyclomatic 18) lib/review-platform.ts:19 — review-platform.platformReviewAt has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 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 · ship-receipt-depth.receiptReviewAtHead (cyclomatic 18) · ×1
  • ship-receipt-depth.receiptReviewAtHead (cyclomatic 18) lib/ship-receipt-depth.ts:107 — ship-receipt-depth.receiptReviewAtHead 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 · Watcher.emitConversation (cyclomatic 18) · ×1
  • Watcher.emitConversation (cyclomatic 18) lib/pr-wait.ts:375 — Watcher.emitConversation 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 · ship-queue-wave.groupWaves (cyclomatic 18) · ×1
  • ship-queue-wave.groupWaves (cyclomatic 18) crew/lib/ship-queue-wave.ts:102 — ship-queue-wave.groupWaves has cyclomatic complexity 18 (threshold 15). Of this number, 13 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 · ship-queue-wave.waveStatus (cyclomatic 18) · ×1
  • ship-queue-wave.waveStatus (cyclomatic 18) crew/lib/ship-queue-wave.ts:499 — ship-queue-wave.waveStatus 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 · ship-queue-train-gate.readWorkflowAttempt (cyclomatic 18) · ×1
  • ship-queue-train-gate.readWorkflowAttempt (cyclomatic 18) crew/lib/ship-queue-train-gate.ts:443 — ship-queue-train-gate.readWorkflowAttempt 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 · gate-cost-replay.formatReport (cyclomatic 18) · ×1
  • gate-cost-replay.formatReport (cyclomatic 18) crew/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 · ceo-review-gate.handle (cyclomatic 18) · ×1
  • ceo-review-gate.handle (cyclomatic 18) hosts/claude/hooks/ceo-review-gate.ts:50 — ceo-review-gate.handle has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 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 · 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 · 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 · design-build.parseInventory.states (cyclomatic 18) · ×1
  • design-build.parseInventory.states (cyclomatic 18) lib/design-build.ts:87 — design-build.parseInventory.states 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 · factory-scorecard.readGateRuns (cyclomatic 18) · ×1
  • factory-scorecard.readGateRuns (cyclomatic 18) REDACTED:273 — factory-scorecard.readGateRuns has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 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:371 — 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 · harness-register.finishHook (cyclomatic 18) · ×1
  • harness-register.finishHook (cyclomatic 18) REDACTED:568 — harness-register.finishHook 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 · motion-encode.manifestError (cyclomatic 18) · ×1
  • motion-encode.manifestError (cyclomatic 18) lib/motion-encode.ts:40 — motion-encode.manifestError 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 · office-hours-probe.resolveProbe (cyclomatic 18) · ×1
  • office-hours-probe.resolveProbe (cyclomatic 18) lib/office-hours-probe.ts:59 — office-hours-probe.resolveProbe 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 · qa-evidence.reportDir (cyclomatic 18) · ×1
  • qa-evidence.reportDir (cyclomatic 18) REDACTED:392 — qa-evidence.reportDir 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 · review-bots.record (cyclomatic 18) · ×1
  • review-bots.record (cyclomatic 18) REDACTED:177 — review-bots.record 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, 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-fetch.scanEvents (cyclomatic 18) · ×1
  • review-fetch.scanEvents (cyclomatic 18) lib/review-fetch.ts:193 — review-fetch.scanEvents has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 2 function items 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 · review-ledger.collect (cyclomatic 18) · ×1
  • review-ledger.collect (cyclomatic 18) lib/review-ledger.ts:397 — review-ledger.collect 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 · review-ledger.ledgerBlockers (cyclomatic 18) · ×1
  • review-ledger.ledgerBlockers (cyclomatic 18) lib/review-ledger.ts:499 — review-ledger.ledgerBlockers has cyclomatic complexity 18 (threshold 15). Of this number, 14 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 · ship-patch.comparePath (cyclomatic 18) · ×1
  • ship-patch.comparePath (cyclomatic 18) lib/ship-patch.ts:116 — ship-patch.comparePath 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 · tasks-prior.supersede (cyclomatic 18) · ×1
  • tasks-prior.supersede (cyclomatic 18) lib/tasks-prior.ts:127 — tasks-prior.supersede 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 · ship-policy.docsErrors (cyclomatic 17) · ×1
  • ship-policy.docsErrors (cyclomatic 17) REDACTED:586 — ship-policy.docsErrors has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 592). 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 · ship-policy.fragmentsErrors (cyclomatic 17) · ×1
  • ship-policy.fragmentsErrors (cyclomatic 17) REDACTED:617 — ship-policy.fragmentsErrors 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 · 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-patterns.jsSpans (cyclomatic 17) · ×1
  • redact-patterns.jsSpans (cyclomatic 17) lib/redact-patterns.ts:1007 — redact-patterns.jsSpans 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 · redact-patterns.isSourceExpression (cyclomatic 17) · ×1
  • redact-patterns.isSourceExpression (cyclomatic 17) lib/redact-patterns.ts:1067 — redact-patterns.isSourceExpression 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 · redact-engine.jsonTokens (cyclomatic 17) · ×1
  • redact-engine.jsonTokens (cyclomatic 17) REDACTED:744 — 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 · review-depth.specialistsFor (cyclomatic 17) · ×1
  • review-depth.specialistsFor (cyclomatic 17) lib/review-depth.ts:511 — review-depth.specialistsFor 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 3 function items inside it that branch (want, a function literal at line 527, a function literal at line 515). 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-depth.batchChecklists (cyclomatic 17) · ×1
  • review-depth.batchChecklists (cyclomatic 17) lib/review-depth.ts:539 — review-depth.batchChecklists has cyclomatic complexity 17 (threshold 15). 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 literals inside it that branch (lines 545, 552). 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-autoplan-snapshot.methodologyContent (cyclomatic 17) · ×1
  • gstack-autoplan-snapshot.methodologyContent (cyclomatic 17) bin/gstack-autoplan-snapshot.ts:516 — gstack-autoplan-snapshot.methodologyContent 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-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:289 — 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 · gstack-global-discover.scanKimiCode (cyclomatic 17) · ×1
  • gstack-global-discover.scanKimiCode (cyclomatic 17) bin/gstack-global-discover.ts:536 — gstack-global-discover.scanKimiCode 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 · 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 · proxy-config.noProxyToChromiumRules (cyclomatic 17) · ×1
  • proxy-config.noProxyToChromiumRules (cyclomatic 17) REDACTED:227 — 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:1473 — 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 · session-tabs.runInSession (cyclomatic 17) · ×1
  • session-tabs.runInSession (cyclomatic 17) browse/src/session-tabs.ts:91 — session-tabs.runInSession 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) crew/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 · autoplan-confirm.annotateConfirm (cyclomatic 17) · ×1
  • autoplan-confirm.annotateConfirm (cyclomatic 17) lib/autoplan-confirm.ts:132 — 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 · no-stop.parseDiff (cyclomatic 17) · ×1
  • no-stop.parseDiff (cyclomatic 17) lib/no-stop.ts:40 — no-stop.parseDiff has cyclomatic complexity 17 (threshold 15). Of this number, 15 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 · CodexCliRunner.run (cyclomatic 17) · ×1
  • CodexCliRunner.run (cyclomatic 17) lib/outside-voice-runner.ts:126 — 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 · autoplan-shadow.claimShadow (cyclomatic 17) · ×1
  • autoplan-shadow.claimShadow (cyclomatic 17) lib/autoplan-shadow.ts:152 — autoplan-shadow.claimShadow 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, 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 · bin-context.markerIgnoredReason (cyclomatic 17) · ×1
  • bin-context.markerIgnoredReason (cyclomatic 17) lib/bin-context.ts:250 — bin-context.markerIgnoredReason 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 · headless-artifacts.validateRun (cyclomatic 17) · ×1
  • headless-artifacts.validateRun (cyclomatic 17) lib/headless-artifacts.ts:501 — 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 · lanes.parseSummary (cyclomatic 17) · ×1
  • lanes.parseSummary (cyclomatic 17) lib/pregate/checks/lanes.ts:346 — lanes.parseSummary 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 · 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 · ship-queue.joblessRuns (cyclomatic 17) · ×1
  • ship-queue.joblessRuns (cyclomatic 17) lib/ship-queue.ts:190 — ship-queue.joblessRuns has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function items inside it that branch (replaces, a function literal at line 198, order, …). 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 · ship-queue-wave.newWave (cyclomatic 17) · ×1
  • ship-queue-wave.newWave (cyclomatic 17) crew/lib/ship-queue-wave.ts:325 — ship-queue-wave.newWave 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 · ship-queue-train.baseOverlap (cyclomatic 17) · ×1
  • ship-queue-train.baseOverlap (cyclomatic 17) crew/lib/ship-queue-train.ts:227 — ship-queue-train.baseOverlap 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, 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-train-ready.dispatchScreen (cyclomatic 17) · ×1
  • ship-queue-train-ready.dispatchScreen (cyclomatic 17) crew/lib/ship-queue-train-ready.ts:147 — ship-queue-train-ready.dispatchScreen 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:308 — 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 319, 321). 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 · ceo-review-gate.rankedRisksGap (cyclomatic 17) · ×1
  • ceo-review-gate.rankedRisksGap (cyclomatic 17) lib/ceo-review-gate.ts:48 — ceo-review-gate.rankedRisksGap 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-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 · archive-check.checkThread (cyclomatic 17) · ×1
  • archive-check.checkThread (cyclomatic 17) lib/archive-check.ts:125 — archive-check.checkThread has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · archive-check.landedIssues (cyclomatic 17) · ×1
  • archive-check.landedIssues (cyclomatic 17) lib/archive-check.ts:174 — archive-check.landedIssues has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · base-red.parseEvidence (cyclomatic 17) · ×1
  • base-red.parseEvidence (cyclomatic 17) lib/base-red.ts:45 — base-red.parseEvidence 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 · base-red.classifyBaseRed (cyclomatic 17) · ×1
  • base-red.classifyBaseRed (cyclomatic 17) lib/base-red.ts:94 — base-red.classifyBaseRed has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, 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 · junit.parseXml (cyclomatic 17) · ×1
  • junit.parseXml (cyclomatic 17) lib/junit.ts:66 — junit.parseXml 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-post.receiptRunIdSpans (cyclomatic 17) · ×1
  • gstack-post.receiptRunIdSpans (cyclomatic 17) lib/gstack-post.ts:519 — gstack-post.receiptRunIdSpans has cyclomatic complexity 17 (threshold 15). 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 (span, rows). 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 · plan-reality-receipts.resolvePath (cyclomatic 17) · ×1
  • plan-reality-receipts.resolvePath (cyclomatic 17) lib/plan-reality-receipts.ts:50 — plan-reality-receipts.resolvePath 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-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 · review-scope.parseHunks (cyclomatic 17) · ×1
  • review-scope.parseHunks (cyclomatic 17) lib/review-scope.ts:69 — review-scope.parseHunks 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 · 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 · modelOf (cyclomatic 17) · ×1
  • modelOf (cyclomatic 17) REDACTED:111 — modelOf 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 · redact-engine.inStructuralToken (cyclomatic 16) · ×1
  • redact-engine.inStructuralToken (cyclomatic 16) REDACTED:781 — 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 · autoplan-phase-publication.withResultWithdrawn (cyclomatic 16) · ×1
  • autoplan-phase-publication.withResultWithdrawn (cyclomatic 16) REDACTED:55 — 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:2639 — 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 · aside-render.buildRenderScript (cyclomatic 16) · ×1
  • aside-render.buildRenderScript (cyclomatic 16) lib/aside-render.ts:210 — aside-render.buildRenderScript has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 236, setOverride, sized). 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 · BrowserManager.syncActiveTabByUrl (cyclomatic 16) · ×1
  • BrowserManager.syncActiveTabByUrl (cyclomatic 16) browse/src/browser-manager.ts:1282 — 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 · terminal-agent-control.acquireAgentStateLock (cyclomatic 16) · ×1
  • terminal-agent-control.acquireAgentStateLock (cyclomatic 16) browse/src/terminal-agent-control.ts:121 — terminal-agent-control.acquireAgentStateLock 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 · cookie-import-browser.normalizeCookieDomain (cyclomatic 16) · ×1
  • cookie-import-browser.normalizeCookieDomain (cyclomatic 16) REDACTED:236 — 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 · terminal-agent.maybeSpawnPty (cyclomatic 16) · ×1
  • terminal-agent.maybeSpawnPty (cyclomatic 16) browse/src/terminal-agent.ts:527 — 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 · gate-cost.simulateTrains (cyclomatic 16) · ×1
  • gate-cost.simulateTrains (cyclomatic 16) crew/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 · 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 · restamp.applyToBranch (cyclomatic 16) · ×1
  • restamp.applyToBranch (cyclomatic 16) lib/restamp.ts:598 — 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 · no-stop.checkNoStop (cyclomatic 16) · ×1
  • no-stop.checkNoStop (cyclomatic 16) lib/no-stop.ts:137 — no-stop.checkNoStop 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 · headless-artifacts.findCycle (cyclomatic 16) · ×1
  • headless-artifacts.findCycle (cyclomatic 16) lib/headless-artifacts.ts:404 — 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 · 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:147 — 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:214 — 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 · release-stamp.openRelease (cyclomatic 16) · ×1
  • release-stamp.openRelease (cyclomatic 16) lib/release-stamp.ts:108 — release-stamp.openRelease 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 · review-collect.grepConsumers (cyclomatic 16) · ×1
  • review-collect.grepConsumers (cyclomatic 16) lib/review-collect.ts:171 — review-collect.grepConsumers 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 · review-collect.executablesAt (cyclomatic 16) · ×1
  • review-collect.executablesAt (cyclomatic 16) lib/review-collect.ts:301 — review-collect.executablesAt has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 306, plain, a function literal at line 305, …). 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-exclude.pathReason (cyclomatic 16) · ×1
  • review-exclude.pathReason (cyclomatic 16) lib/review-exclude.ts:278 — review-exclude.pathReason 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-receipt-depth.baseMergedChangelogCommit (cyclomatic 16) · ×1
  • ship-receipt-depth.baseMergedChangelogCommit (cyclomatic 16) lib/ship-receipt-depth.ts:683 — ship-receipt-depth.baseMergedChangelogCommit has cyclomatic complexity 16 (threshold 15). 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, 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.stampPreflight (cyclomatic 16) · ×1
  • ship-queue.stampPreflight (cyclomatic 16) lib/ship-queue.ts:409 — 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 · ship-queue-train-gate.classifyWorkflowRun (cyclomatic 16) · ×1
  • ship-queue-train-gate.classifyWorkflowRun (cyclomatic 16) crew/lib/ship-queue-train-gate.ts:127 — ship-queue-train-gate.classifyWorkflowRun 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-queue-train-gate.parseTestRecord (cyclomatic 16) · ×1
  • ship-queue-train-gate.parseTestRecord (cyclomatic 16) crew/lib/ship-queue-train-gate.ts:149 — ship-queue-train-gate.parseTestRecord 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 · train-gate.stampFreeTree (cyclomatic 16) · ×1
  • train-gate.stampFreeTree (cyclomatic 16) crew/scripts/train-gate.ts:170 — train-gate.stampFreeTree 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 · ship-queue-train-ready.screenMerge (cyclomatic 16) · ×1
  • ship-queue-train-ready.screenMerge (cyclomatic 16) crew/lib/ship-queue-train-ready.ts:118 — ship-queue-train-ready.screenMerge 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-queue-train-land.landChain (cyclomatic 16) · ×1
  • ship-queue-train-land.landChain (cyclomatic 16) crew/lib/ship-queue-train-land.ts:89 — ship-queue-train-land.landChain has cyclomatic complexity 16 (threshold 15). Of this number, 11 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 · ship-queue-train-forget.trainForget (cyclomatic 16) · ×1
  • ship-queue-train-forget.trainForget (cyclomatic 16) crew/lib/ship-queue-train-forget.ts:21 — ship-queue-train-forget.trainForget 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 · ship-recheck.planRecheck (cyclomatic 16) · ×1
  • ship-recheck.planRecheck (cyclomatic 16) crew/lib/ship-recheck.ts:45 — ship-recheck.planRecheck 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 · gate-cost-replay.readGateRecord (cyclomatic 16) · ×1
  • gate-cost-replay.readGateRecord (cyclomatic 16) crew/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 · measure-journal-read.main (cyclomatic 16) · ×1
  • measure-journal-read.main (cyclomatic 16) crew/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 · daemon-client.ensureDaemon (cyclomatic 16) · ×1
  • daemon-client.ensureDaemon (cyclomatic 16) REDACTED:91 — daemon-client.ensureDaemon 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 · ceo-review-gate.checkOutput (cyclomatic 16) · ×1
  • ceo-review-gate.checkOutput (cyclomatic 16) lib/ceo-review-gate.ts:115 — ceo-review-gate.checkOutput has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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 · 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 · 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 · factory-scorecard.scorecardRows (cyclomatic 16) · ×1
  • factory-scorecard.scorecardRows (cyclomatic 16) REDACTED:411 — factory-scorecard.scorecardRows 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 9 function items inside it that branch (freeRetries, a function literal at line 416, row, …). 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 · 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:391 — 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 · ship-patch.readScopedReview (cyclomatic 16) · ×1
  • ship-patch.readScopedReview (cyclomatic 16) lib/ship-patch.ts:356 — ship-patch.readScopedReview 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-audit.audit (cyclomatic 16) · ×1
  • ship-audit.audit (cyclomatic 16) lib/ship-audit.ts:66 — ship-audit.audit has cyclomatic complexity 16 (threshold 15). 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: 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-budget-cli.cmdCalls (cyclomatic 16) · ×1
  • ship-budget-cli.cmdCalls (cyclomatic 16) lib/ship-budget-cli.ts:416 — ship-budget-cli.cmdCalls 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 · ship-preflight.simulate (cyclomatic 16) · ×1
  • ship-preflight.simulate (cyclomatic 16) lib/ship-preflight.ts:222 — ship-preflight.simulate has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent branch into its 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-receipt-prose.withoutApprovalsBlocks (cyclomatic 16) · ×1
  • ship-receipt-prose.withoutApprovalsBlocks (cyclomatic 16) lib/ship-receipt-prose.ts:72 — ship-receipt-prose.withoutApprovalsBlocks has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (blockEnd, skipBlank). 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 · ship-receipt-prose.withoutExceptionLines (cyclomatic 16) · ×1
  • ship-receipt-prose.withoutExceptionLines (cyclomatic 16) lib/ship-receipt-prose.ts:106 — ship-receipt-prose.withoutExceptionLines 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 · ship-release.harnessRepin (cyclomatic 16) · ×1
  • ship-release.harnessRepin (cyclomatic 16) lib/ship-release.ts:197 — ship-release.harnessRepin 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, 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 · skill-bill.buildSkillBill (cyclomatic 16) · ×1
  • skill-bill.buildSkillBill (cyclomatic 16) REDACTED:188 — skill-bill.buildSkillBill 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 758) · ×1
  • write-commands.handleWriteCommand (cognitive 758) browse/src/write-commands.ts:136 — write-commands.handleWriteCommand has cognitive complexity 758 (threshold 15). Drivers by points: if/else 208 (515 pts), boolean chains 77, ternaries 24 (63 pts), loops 22 (54 pts), error handling 15 (45 pts), match/switch 2 (4 pts) (nesting depth added 410). Of this number, 593 points are the body's own statements and 165 belong to 17 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 · meta-commands.handleMetaCommand (cognitive 349) · ×1
  • meta-commands.handleMetaCommand (cognitive 349) browse/src/meta-commands.ts:323 — meta-commands.handleMetaCommand has cognitive complexity 349 (threshold 15). Drivers by points: if/else 76 (186 pts), ternaries 22 (57 pts), boolean chains 41, error handling 11 (35 pts), loops 12 (29 pts), match/switch 1 (nesting depth added 186). Of this number, 317 points are the body's own statements and 32 belong to 10 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 · snapshot.handleSnapshot (cognitive 284) · ×1
  • snapshot.handleSnapshot (cognitive 284) browse/src/snapshot.ts:104 — 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 · review-ledger.verify (cognitive 192) · ×1
  • review-ledger.verify (cognitive 192) lib/review-ledger.ts:566 — review-ledger.verify has cognitive complexity 192 (threshold 15). Drivers by points: ternaries 30 (79 pts), if/else 31 (61 pts), boolean chains 36, error handling 5 (11 pts), loops 4 (5 pts) (nesting depth added 86). Of this number, 179 points are the body's own statements and 13 belong to 12 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-design-detect.probe (cognitive 173) · ×1
  • gstack-design-detect.probe (cognitive 173) bin/gstack-design-detect.ts:345 — 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 · review-ledger.parseLabelled (cognitive 169) · ×1
  • review-ledger.parseLabelled (cognitive 169) lib/review-ledger.ts:195 — review-ledger.parseLabelled has cognitive complexity 169 (threshold 15). Drivers by points: if/else 41 (92 pts), boolean chains 53, ternaries 14 (20 pts), error handling 1 (3 pts), loops 1 (nesting depth added 59). Of this number, 137 points are the body's own statements and 32 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · ship-queue-land.land (cognitive 141) · ×1
  • ship-queue-land.land (cognitive 141) lib/ship-queue-land.ts:320 — ship-queue-land.land has cognitive complexity 141 (threshold 15). Drivers by points: if/else 49 (94 pts), ternaries 16 (30 pts), boolean chains 16, loops 1 (nesting depth added 59). Of this number, 129 points are the body's own statements and 12 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 · config.validateConfig (cognitive 140) · ×1
  • config.validateConfig (cognitive 140) lib/pregate/config.ts:190 — config.validateConfig has cognitive complexity 140 (threshold 15). Drivers by points: if/else 51 (100 pts), boolean chains 20, loops 8 (17 pts), ternaries 2 (3 pts) (nesting depth added 59). Of this number, 122 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 · cli.main (cognitive 135) · ×1
  • cli.main (cognitive 135) browse/src/cli.ts:1820 — 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 · lane-selection.selectLanes (cognitive 132) · ×1
  • lane-selection.selectLanes (cognitive 132) lib/pregate/lane-selection.ts:210 — lane-selection.selectLanes has cognitive complexity 132 (threshold 15). Drivers by points: if/else 31 (66 pts), ternaries 11 (27 pts), loops 14 (21 pts), boolean chains 18 (nesting depth added 58). Of this number, 127 points are the body's own statements and 5 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · review-scope.summarizeReviewLoop (cognitive 131) · ×1
  • review-scope.summarizeReviewLoop (cognitive 131) lib/review-scope.ts:399 — review-scope.summarizeReviewLoop has cognitive complexity 131 (threshold 15). Drivers by points: if/else 23 (46 pts), boolean chains 37, ternaries 15 (33 pts), loops 11 (15 pts) (nesting depth added 45). Of this number, 102 points are the body's own statements and 29 belong to 19 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 · harness-register.register (cognitive 122) · ×1
  • harness-register.register (cognitive 122) REDACTED:583 — harness-register.register has cognitive complexity 122 (threshold 15). Drivers by points: if/else 26 (46 pts), ternaries 18 (33 pts), boolean chains 20, loops 11 (18 pts), error handling 2 (5 pts) (nesting depth added 45). Of this number, 99 points are the body's own statements and 23 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 · run-evidence.runProfileErrors (cognitive 118) · ×1
  • run-evidence.runProfileErrors (cognitive 118) lib/run-evidence.ts:106 — run-evidence.runProfileErrors has cognitive complexity 118 (threshold 15). Drivers by points: if/else 24 (78 pts), boolean chains 22, loops 5 (18 pts) (nesting depth added 67). Of this number, 115 points are the body's own statements and 3 belong to 3 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 · terminal-agent.buildServer (cognitive 116) · ×1
  • terminal-agent.buildServer (cognitive 116) browse/src/terminal-agent.ts:595 — 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 · ship-release.route (cognitive 114) · ×1
  • ship-release.route (cognitive 114) lib/ship-release.ts:378 — ship-release.route has cognitive complexity 114 (threshold 15). Drivers by points: ternaries 29 (58 pts), if/else 17 (23 pts), boolean chains 20, loops 9 (10 pts), error handling 1 (3 pts) (nesting depth added 38). Of this number, 110 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 · review-depth.planReview (cognitive 113) · ×1
  • review-depth.planReview (cognitive 113) lib/review-depth.ts:572 — review-depth.planReview has cognitive complexity 113 (threshold 15). Drivers by points: if/else 33 (52 pts), ternaries 14 (29 pts), boolean chains 27, loops 2 (5 pts) (nesting depth added 37). Of this number, 107 points are the body's own statements and 6 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 · 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 · ship-policy.validatePolicy (cognitive 108) · ×1
  • ship-policy.validatePolicy (cognitive 108) REDACTED:454 — ship-policy.validatePolicy has cognitive complexity 108 (threshold 15). Drivers by points: if/else 49 (65 pts), boolean chains 29, ternaries 5 (9 pts), loops 3 (5 pts) (nesting depth added 22). Of this number, 99 points are the body's own statements and 9 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 · 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 · claude-code-migration.migrateClaudeCodeSkills (cognitive 104) · ×1
  • claude-code-migration.migrateClaudeCodeSkills (cognitive 104) lib/claude-code-migration.ts:133 — claude-code-migration.migrateClaudeCodeSkills has cognitive complexity 104 (threshold 15). Drivers by points: if/else 26 (62 pts), boolean chains 21, loops 7 (14 pts), ternaries 2 (5 pts), error handling 1 (2 pts) (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 · run-evidence.verifyRun (cognitive 102) · ×1
  • run-evidence.verifyRun (cognitive 102) lib/run-evidence.ts:163 — run-evidence.verifyRun has cognitive complexity 102 (threshold 15). Drivers by points: if/else 38 (57 pts), ternaries 10 (22 pts), boolean chains 19, error handling 2, loops 2 (nesting depth added 31). Of this number, 99 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 · claude-journal-records.ownedCausalOrder (cognitive 99) · ×1
  • claude-journal-records.ownedCausalOrder (cognitive 99) lib/claude-journal-records.ts:304 — claude-journal-records.ownedCausalOrder has cognitive complexity 99 (threshold 15). Drivers by points: if/else 26 (54 pts), ternaries 8 (19 pts), loops 12 (15 pts), boolean chains 11 (nesting depth added 42). Of this number, 67 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.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 · ship-release.fixChecked (cognitive 95) · ×1
  • ship-release.fixChecked (cognitive 95) lib/ship-release.ts:293 — ship-release.fixChecked has cognitive complexity 95 (threshold 15). Drivers by points: ternaries 27 (47 pts), boolean chains 25, if/else 10 (16 pts), loops 6, error handling 1 (nesting depth added 26). Of this number, 52 points are the body's own statements and 43 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 · index.clearDecision (cognitive 94) · ×1
  • index.clearDecision (cognitive 94) REDACTED:306 — index.clearDecision has cognitive complexity 94 (threshold 15). Drivers by points: if/else 25 (42 pts), ternaries 12 (33 pts), boolean chains 12, error handling 3 (7 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ship-release.docsFresh (cognitive 93) · ×1
  • ship-release.docsFresh (cognitive 93) lib/ship-release.ts:489 — ship-release.docsFresh has cognitive complexity 93 (threshold 15). Drivers by points: ternaries 19 (52 pts), boolean chains 18, if/else 14 (17 pts), error handling 4 (5 pts), loops 1 (nesting depth added 37). Of this number, 74 points are the body's own statements and 19 belong to 6 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · server.handleCommandInternalImpl (cognitive 92) · ×1
  • server.handleCommandInternalImpl (cognitive 92) REDACTED:975 — server.handleCommandInternalImpl has cognitive complexity 92 (threshold 15). Drivers by points: if/else 36 (64 pts), boolean chains 18, ternaries 4 (6 pts), error handling 2 (4 pts) (nesting depth added 32). Of this number, 84 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 · lanes.planRuns (cognitive 87) · ×1
  • lanes.planRuns (cognitive 87) lib/pregate/checks/lanes.ts:225 — lanes.planRuns has cognitive complexity 87 (threshold 15). Drivers by points: if/else 21 (42 pts), ternaries 15 (30 pts), loops 8 (10 pts), boolean chains 5 (nesting depth added 38). Of this number, 71 points are the body's own statements and 16 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 · autoplan-gate.answerGate (cognitive 86) · ×1
  • autoplan-gate.answerGate (cognitive 86) REDACTED:403 — autoplan-gate.answerGate has cognitive complexity 86 (threshold 15). Drivers by points: ternaries 27 (41 pts), boolean chains 25, if/else 17 (19 pts), loops 1 (nesting depth added 16). Of this number, 70 points are the body's own statements and 16 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.clearByRuns (cognitive 86) · ×1
  • index.clearByRuns (cognitive 86) REDACTED:402 — index.clearByRuns has cognitive complexity 86 (threshold 15). Drivers by points: if/else 27 (41 pts), ternaries 18 (28 pts), boolean chains 8, loops 4 (7 pts), error handling 1 (2 pts) (nesting depth added 28). Of this number, 73 points are the body's own statements and 13 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 · autoplan-gate.buildGate (cognitive 85) · ×1
  • autoplan-gate.buildGate (cognitive 85) REDACTED:196 — autoplan-gate.buildGate has cognitive complexity 85 (threshold 15). Drivers by points: ternaries 12 (36 pts), if/else 11 (31 pts), boolean chains 11, loops 4 (7 pts) (nesting depth added 47). Of this number, 81 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 · review-collect.scanConsumers (cognitive 85) · ×1
  • review-collect.scanConsumers (cognitive 85) lib/review-collect.ts:209 — review-collect.scanConsumers has cognitive complexity 85 (threshold 15). Drivers by points: if/else 9 (35 pts), ternaries 6 (24 pts), loops 8 (19 pts), boolean chains 7 (nesting depth added 55). Of this number, 83 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 · review-fetch.scanWords (cognitive 85) · ×1
  • review-fetch.scanWords (cognitive 85) lib/review-fetch.ts:130 — review-fetch.scanWords has cognitive complexity 85 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 22, loops 8 (17 pts), ternaries 3 (5 pts) (nesting depth added 31). Of this number, 81 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 · server.start (cognitive 84) · ×1
  • server.start (cognitive 84) REDACTED:1859 — server.start has cognitive complexity 84 (threshold 15). Drivers by points: if/else 27 (42 pts), ternaries 9 (19 pts), error handling 7 (13 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 32). Of this number, 71 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 · shell-writes.tokenize (cognitive 84) · ×1
  • shell-writes.tokenize (cognitive 84) lib/shell-writes.ts:32 — shell-writes.tokenize has cognitive complexity 84 (threshold 15). Drivers by points: if/else 21 (36 pts), ternaries 7 (23 pts), loops 6 (14 pts), boolean chains 11 (nesting depth added 39). Of this number, 77 points are the body's own statements and 7 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 · gate-reuse.findReusableGate (cognitive 83) · ×1
  • gate-reuse.findReusableGate (cognitive 83) crew/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 · 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 · ship-release.version (cognitive 83) · ×1
  • ship-release.version (cognitive 83) lib/ship-release.ts:95 — ship-release.version has cognitive complexity 83 (threshold 15). Drivers by points: if/else 28 (32 pts), boolean chains 27, ternaries 13 (22 pts), error handling 1, loops 1 (nesting depth added 13). Of this number, 82 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 · 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 · release-cut.planRelease (cognitive 80) · ×1
  • release-cut.planRelease (cognitive 80) REDACTED:452 — release-cut.planRelease has cognitive complexity 80 (threshold 15). Drivers by points: if/else 29 (40 pts), ternaries 14 (21 pts), boolean chains 18, loops 1 (nesting depth added 18). Of this number, 79 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 · 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 · changelog-check.carryWith (cognitive 76) · ×1
  • changelog-check.carryWith (cognitive 76) lib/changelog-check.ts:271 — changelog-check.carryWith has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (39 pts), loops 9 (19 pts), boolean chains 16, ternaries 2 (nesting depth added 28). Of this number, 52 points are the body's own statements and 24 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 · guard-journal.select.<returned closure> (cognitive 74) · ×1
  • guard-journal.select.<returned closure> (cognitive 74) autoplan/bin/guard-journal.ts:54 — guard-journal.select.<returned closure> has cognitive complexity 74 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 8 (12 pts), boolean chains 11, ternaries 3 (8 pts), error handling 1 (2 pts) (nesting depth added 36). Of this number, 55 points are the body's own statements and 19 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 · 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 · flaky-run.runFlaky (cognitive 74) · ×1
  • flaky-run.runFlaky (cognitive 74) REDACTED:304 — flaky-run.runFlaky has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 16 (28 pts), if/else 15 (19 pts), loops 9 (15 pts), boolean chains 12 (nesting depth added 22). Of this number, 62 points are the body's own statements and 12 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · shell-writes.writeTargets (cognitive 73) · ×1
  • shell-writes.writeTargets (cognitive 73) lib/shell-writes.ts:261 — shell-writes.writeTargets has cognitive complexity 73 (threshold 15). Drivers by points: if/else 22 (37 pts), ternaries 6 (15 pts), boolean chains 14, loops 4 (7 pts) (nesting depth added 27). Of this number, 71 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 · 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 · model-policy-cli.modelsMain (cognitive 71) · ×1
  • model-policy-cli.modelsMain (cognitive 71) lib/model-policy-cli.ts:280 — model-policy-cli.modelsMain has cognitive complexity 71 (threshold 15). Drivers by points: if/else 16 (28 pts), ternaries 13 (27 pts), boolean chains 9, loops 4 (6 pts), error handling 1 (nesting depth added 28). Of this number, 68 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 · ship-queue-land-direct.landDirect (cognitive 70) · ×1
  • ship-queue-land-direct.landDirect (cognitive 70) lib/ship-queue-land-direct.ts:151 — ship-queue-land-direct.landDirect has cognitive complexity 70 (threshold 15). Drivers by points: if/else 56 (74 pts), ternaries 19 (30 pts), boolean chains 19, loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ship-queue-land-direct.landDirect::locked) 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.scan (cognitive 69) · ×1
  • gstack-design-detect.scan (cognitive 69) bin/gstack-design-detect.ts:919 — 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 · ship-queue-train.admitSlots (cognitive 69) · ×1
  • ship-queue-train.admitSlots (cognitive 69) crew/lib/ship-queue-train.ts:352 — ship-queue-train.admitSlots has cognitive complexity 69 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 11 (29 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-docs-result.checkDocsResult (cognitive 69) · ×1
  • ship-docs-result.checkDocsResult (cognitive 69) lib/ship-docs-result.ts:30 — ship-docs-result.checkDocsResult has cognitive complexity 69 (threshold 15). Drivers by points: if/else 27 (46 pts), boolean chains 18, loops 4, error handling 1 (nesting depth added 19). Of this number, 68 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-release.finishStages (cognitive 69) · ×1
  • ship-release.finishStages (cognitive 69) lib/ship-release.ts:582 — ship-release.finishStages has cognitive complexity 69 (threshold 15). Drivers by points: if/else 22 (36 pts), ternaries 12 (19 pts), boolean chains 6, loops 3 (5 pts), error handling 2 (3 pts) (nesting depth added 24). Of this number, 68 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 · autoplan-reconcile.reconcile (cognitive 68) · ×1
  • autoplan-reconcile.reconcile (cognitive 68) lib/autoplan-reconcile.ts:250 — autoplan-reconcile.reconcile has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 14, ternaries 5 (12 pts), loops 4 (5 pts) (nesting depth added 28). Of this number, 62 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 · ci-carry.findCarry (cognitive 67) · ×1
  • ci-carry.findCarry (cognitive 67) lib/ci-carry.ts:75 — ci-carry.findCarry has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 16 (35 pts), if/else 16 (23 pts), boolean chains 6, loops 2, error handling 1 (nesting depth added 26). Of this number, 64 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 · variants.requestVariantImage (cognitive 67) · ×1
  • variants.requestVariantImage (cognitive 67) design/src/variants.ts:98 — variants.requestVariantImage has cognitive complexity 67 (threshold 15). Drivers by points: if/else 18 (53 pts), ternaries 2 (7 pts), error handling 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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:570 — 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 · cli.sendCommand (cognitive 66) · ×1
  • cli.sendCommand (cognitive 66) browse/src/cli.ts:1095 — cli.sendCommand has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (40 pts), ternaries 6 (11 pts), boolean chains 9, error handling 2 (3 pts), loops 1 (3 pts) (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 · lanes.runSelected (cognitive 66) · ×1
  • lanes.runSelected (cognitive 66) lib/pregate/checks/lanes.ts:538 — lanes.runSelected has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 24 (42 pts), if/else 14 (16 pts), boolean chains 8 (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 · version-gate-train.classify (cognitive 66) · ×1
  • version-gate-train.classify (cognitive 66) crew/lib/version-gate-train.ts:101 — version-gate-train.classify has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (33 pts), ternaries 11 (20 pts), boolean chains 11, error handling 2 (nesting depth added 18). Of this number, 64 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-queue-train-land.landUpdate (cognitive 66) · ×1
  • ship-queue-train-land.landUpdate (cognitive 66) crew/lib/ship-queue-train-land.ts:194 — ship-queue-train-land.landUpdate has cognitive complexity 66 (threshold 15). Drivers by points: if/else 21 (39 pts), ternaries 8 (21 pts), boolean chains 5, error handling 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 · redact-engine.scanInternal (cognitive 65) · ×1
  • redact-engine.scanInternal (cognitive 65) REDACTED:361 — redact-engine.scanInternal has cognitive complexity 65 (threshold 15). Drivers by points: if/else 15 (44 pts), boolean chains 9, loops 5 (7 pts), ternaries 3 (5 pts) (nesting depth added 33). Of this number, 64 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-risk.matchRisk (cognitive 65) · ×1
  • review-risk.matchRisk (cognitive 65) lib/review-risk.ts:178 — review-risk.matchRisk has cognitive complexity 65 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 23, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 23). Of this number, 64 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 · skill-contract.parseTranscript (cognitive 65) · ×1
  • skill-contract.parseTranscript (cognitive 65) REDACTED:179 — skill-contract.parseTranscript has cognitive complexity 65 (threshold 15). Drivers by points: if/else 16 (34 pts), ternaries 4 (16 pts), boolean chains 10, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · approval-record.importAutoplan (cognitive 64) · ×1
  • approval-record.importAutoplan (cognitive 64) lib/approval-record.ts:323 — approval-record.importAutoplan has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 16 (42 pts), if/else 6 (8 pts), boolean chains 7, error handling 2 (4 pts), loops 3 (nesting depth added 30). Of this number, 60 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · 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 · ship-receipt-depth.writeExcludeBinds · ×1
  • ship-receipt-depth.writeExcludeBinds::bindAudits (cognitive 63) lib/ship-receipt-depth.ts:390 — ship-receipt-depth.writeExcludeBinds::bindAudits has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 10 (20 pts), loops 7 (9 pts), boolean chains 7 (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. This shape REPEATS in the file: one other method here (ship-receipt-depth.writeExcludeBinds) 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 · ship-queue-train.pruneTrains (cognitive 63) · ×1
  • ship-queue-train.pruneTrains (cognitive 63) crew/lib/ship-queue-train.ts:670 — ship-queue-train.pruneTrains has cognitive complexity 63 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 8 (22 pts), loops 4 (9 pts), boolean chains 6 (nesting depth added 31). Of this number, 58 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-post.parseArgs (cognitive 63) · ×1
  • gstack-post.parseArgs (cognitive 63) lib/gstack-post.ts:120 — gstack-post.parseArgs has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (33 pts), ternaries 8 (17 pts), boolean chains 12, 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 · 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:1548 — 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 · ship-queue-train-ready.trainReady (cognitive 62) · ×1
  • ship-queue-train-ready.trainReady (cognitive 62) crew/lib/ship-queue-train-ready.ts:234 — ship-queue-train-ready.trainReady has cognitive complexity 62 (threshold 15). Drivers by points: if/else 26 (31 pts), ternaries 11 (20 pts), boolean chains 11 (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 · gstack-memory-ingest.verifyResumeDir (cognitive 61) · ×1
  • gstack-memory-ingest.verifyResumeDir (cognitive 61) bin/gstack-memory-ingest.ts:2965 — 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 · literals.consumersOf (cognitive 61) · ×1
  • literals.consumersOf (cognitive 61) REDACTED:115 — literals.consumersOf has cognitive complexity 61 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 16, ternaries 6 (8 pts), loops 4 (7 pts), error handling 1 (2 pts) (nesting depth added 23). Of this number, 30 points are the body's own statements and 31 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 · ship-queue-wave.waveSettle (cognitive 61) · ×1
  • ship-queue-wave.waveSettle (cognitive 61) crew/lib/ship-queue-wave.ts:531 — ship-queue-wave.waveSettle has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 14 (30 pts), if/else 14 (18 pts), boolean chains 11, error handling 1, loops 1 (nesting depth added 20). Of this number, 51 points are the body's own statements and 10 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 · ship-queue-train-cli.trainMain (cognitive 61) · ×1
  • ship-queue-train-cli.trainMain (cognitive 61) crew/lib/ship-queue-train-cli.ts:109 — ship-queue-train-cli.trainMain has cognitive complexity 61 (threshold 15). Drivers by points: if/else 26 (40 pts), boolean chains 14, ternaries 3 (7 pts) (nesting depth added 18). Of this number, 54 points are the body's own statements and 7 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 · 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 · review-depth.loopStep (cognitive 60) · ×1
  • review-depth.loopStep (cognitive 60) lib/review-depth.ts:438 — review-depth.loopStep has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 11 (40 pts), if/else 10 (12 pts), boolean chains 8 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · bin-context.slugFromEnvironment (cognitive 60) · ×1
  • bin-context.slugFromEnvironment (cognitive 60) lib/bin-context.ts:406 — bin-context.slugFromEnvironment has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 11, error handling 3 (6 pts), ternaries 3 (6 pts), loops 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the 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-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 · review-depth.leanPlan (cognitive 59) · ×1
  • review-depth.leanPlan (cognitive 59) lib/review-depth.ts:673 — review-depth.leanPlan has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 11 (25 pts), if/else 13 (17 pts), boolean chains 13, loops 2 (4 pts) (nesting depth added 20). Of this number, 52 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 · train-gate.routeDispatch (cognitive 59) · ×1
  • train-gate.routeDispatch (cognitive 59) crew/scripts/train-gate.ts:80 — train-gate.routeDispatch has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 13, ternaries 3 (5 pts) (nesting depth added 21). Of this number, 57 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 · autoplan-public.scan (cognitive 59) · ×1
  • autoplan-public.scan (cognitive 59) lib/autoplan-public.ts:100 — autoplan-public.scan has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 13 (35 pts), if/else 5 (11 pts), loops 3 (6 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 33). Most of this is not in the body itself: 13 of the 59 points are its own statements and the rest belongs to 8 function items inside it that branch (values, a function literal at line 106, a function literal at line 118, …). 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 · inventory.validateEntry (cognitive 59) · ×1
  • inventory.validateEntry (cognitive 59) lib/inventory.ts:93 — inventory.validateEntry has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (43 pts), boolean chains 15, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-patch.boundedPaths (cognitive 59) · ×1
  • ship-patch.boundedPaths (cognitive 59) lib/ship-patch.ts:313 — ship-patch.boundedPaths has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (32 pts), ternaries 8 (20 pts), boolean chains 6, loops 1 (nesting depth added 31). Of this number, 41 points are the body's own statements and 18 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 · gate-cost-history.classifyReds (cognitive 58) · ×1
  • gate-cost-history.classifyReds (cognitive 58) crew/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 · 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 · eval-plan.parseEvalCalls (cognitive 58) · ×1
  • eval-plan.parseEvalCalls (cognitive 58) lib/eval-plan.ts:557 — 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 · gstack-post.mergeSplit (cognitive 58) · ×1
  • gstack-post.mergeSplit (cognitive 58) lib/gstack-post.ts:294 — gstack-post.mergeSplit has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 19, ternaries 10 (15 pts), loops 3 (nesting depth added 14). Of this number, 44 points are the body's own statements and 14 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.ensureServer (cognitive 57) · ×1
  • cli.ensureServer (cognitive 57) browse/src/cli.ts:919 — cli.ensureServer has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (30 pts), boolean chains 16, loops 2 (6 pts), ternaries 2 (5 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 · review-evidence.bindReview (cognitive 57) · ×1
  • review-evidence.bindReview (cognitive 57) lib/review-evidence.ts:266 — review-evidence.bindReview has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 17, 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 · runaway.runawayMain (cognitive 57) · ×1
  • runaway.runawayMain (cognitive 57) lib/runaway.ts:247 — runaway.runawayMain has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 9 (15 pts), boolean chains 7, loops 5 (7 pts), error handling 2 (4 pts) (nesting depth added 17). Of this number, 49 points are the body's own statements and 8 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 · ship-mechanical.mechanicalPaths (cognitive 57) · ×1
  • ship-mechanical.mechanicalPaths (cognitive 57) lib/ship-mechanical.ts:73 — ship-mechanical.mechanicalPaths has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 12, ternaries 4 (6 pts), loops 3 (nesting depth added 20). Of this number, 47 points are the body's own statements and 10 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 · autoplan-revise.reviseRun (cognitive 56) · ×1
  • autoplan-revise.reviseRun (cognitive 56) lib/autoplan-revise.ts:128 — autoplan-revise.reviseRun has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 15 (19 pts), boolean chains 17, if/else 9 (10 pts), loops 7 (9 pts), error handling 1 (nesting depth added 7). Of this number, 53 points are the body's own statements and 3 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 · ci-carry.shipLanesErrors (cognitive 56) · ×1
  • ci-carry.shipLanesErrors (cognitive 56) lib/ci-carry.ts:238 — ci-carry.shipLanesErrors has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (37 pts), loops 4 (10 pts), boolean chains 9 (nesting depth added 25). Of this number, 55 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 · secrets.run (cognitive 56) · ×1
  • secrets.run (cognitive 56) lib/pregate/checks/secrets.ts:164 — secrets.run has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 16, if/else 8 (12 pts), loops 3 (6 pts), error handling 2 (4 pts) (nesting depth added 16). Of this number, 39 points are the body's own statements and 17 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 · ship-queue-train.trainStatus (cognitive 56) · ×1
  • ship-queue-train.trainStatus (cognitive 56) crew/lib/ship-queue-train.ts:609 — 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 · review-pass.buildManifest (cognitive 56) · ×1
  • review-pass.buildManifest (cognitive 56) lib/review-pass.ts:134 — review-pass.buildManifest has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 18 (32 pts), if/else 7 (12 pts), boolean chains 8, error handling 1 (2 pts), loops 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tree-receipt.classifyFile (cognitive 55) · ×1
  • tree-receipt.classifyFile (cognitive 55) lib/tree-receipt.ts:102 — tree-receipt.classifyFile has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 11 (23 pts), if/else 15 (21 pts), boolean chains 9, error handling 1 (2 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 · tree-receipt.buildReceipt (cognitive 55) · ×1
  • tree-receipt.buildReceipt (cognitive 55) lib/tree-receipt.ts:169 — tree-receipt.buildReceipt has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (25 pts), ternaries 12 (13 pts), boolean chains 11, loops 3 (6 pts) (nesting depth added 9). Of this number, 51 points are the body's own statements and 4 belong 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 · ship-queue.ready (cognitive 55) · ×1
  • ship-queue.ready (cognitive 55) lib/ship-queue.ts:296 — ship-queue.ready has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (28 pts), ternaries 13 (17 pts), boolean chains 9, error handling 1 (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 · ship-queue-train.mergeStep (cognitive 55) · ×1
  • ship-queue-train.mergeStep (cognitive 55) crew/lib/ship-queue-train.ts:160 — ship-queue-train.mergeStep has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (26 pts), ternaries 8 (19 pts), boolean chains 7, loops 3 (nesting depth added 21). Of this number, 50 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 · 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 · 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 · 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 · cookie-import-browser.listProfiles (cognitive 54) · ×1
  • cookie-import-browser.listProfiles (cognitive 54) REDACTED:170 — 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 · release-cut.gateVerdict (cognitive 54) · ×1
  • release-cut.gateVerdict (cognitive 54) REDACTED:120 — release-cut.gateVerdict has cognitive complexity 54 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 7 (19 pts), loops 4 (10 pts), boolean chains 6 (nesting depth added 27). Of this number, 52 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 · release-cut.readTrainNotes (cognitive 54) · ×1
  • release-cut.readTrainNotes (cognitive 54) REDACTED:175 — release-cut.readTrainNotes has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 15, ternaries 2 (6 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 20). Of this number, 52 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 · question-log-hook.extractUserChoices (cognitive 54) · ×1
  • question-log-hook.extractUserChoices (cognitive 54) hosts/claude/hooks/question-log-hook.ts:166 — 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 · autoplan-shadow-reader.exportShadow (cognitive 53) · ×1
  • autoplan-shadow-reader.exportShadow (cognitive 53) REDACTED:37 — autoplan-shadow-reader.exportShadow has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 8 (35 pts), loops 3 (6 pts), boolean chains 5, if/else 2 (5 pts), error handling 1 (2 pts) (nesting depth added 34). Of this number, 52 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.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 · gstack-post.runPost (cognitive 53) · ×1
  • gstack-post.runPost (cognitive 53) lib/gstack-post.ts:667 — gstack-post.runPost has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 13 (20 pts), if/else 13 (16 pts), boolean chains 10, loops 3 (6 pts), error handling 1 (nesting depth added 13). Of this number, 47 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 · 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 · 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:86 — 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 · gate-cost-history.simulateArrivalTrains (cognitive 52) · ×1
  • gate-cost-history.simulateArrivalTrains (cognitive 52) crew/lib/gate-cost-history.ts:342 — 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 · autoplan-run.nextStep (cognitive 52) · ×1
  • autoplan-run.nextStep (cognitive 52) REDACTED:211 — autoplan-run.nextStep has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (27 pts), ternaries 6 (12 pts), boolean chains 8, loops 3, error handling 1 (2 pts) (nesting depth added 13). Of this number, 49 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 · autoplan-run.resumeRun (cognitive 52) · ×1
  • autoplan-run.resumeRun (cognitive 52) REDACTED:488 — autoplan-run.resumeRun has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 11, ternaries 3 (10 pts), loops 4 (nesting depth added 20). 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the 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 · skill-contract.checkItem (cognitive 52) · ×1
  • skill-contract.checkItem (cognitive 52) REDACTED:366 — skill-contract.checkItem has cognitive complexity 52 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 9 (21 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (nesting depth added 24). Of this number, 36 points are the body's own statements and 16 belong to 5 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · 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 · design-build.receipt (cognitive 52) · ×1
  • design-build.receipt (cognitive 52) lib/design-build.ts:285 — design-build.receipt has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 16 (19 pts), boolean chains 17, if/else 15, loops 1 (nesting depth added 3). Of this number, 30 points are the body's own statements and 22 belong to 6 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 · 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 · skill-bill.checkEvalTasks (cognitive 52) · ×1
  • skill-bill.checkEvalTasks (cognitive 52) REDACTED:42 — skill-bill.checkEvalTasks has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 10, loops 5 (10 pts), error handling 2 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · phase-publication-hook.phaseDecision (cognitive 51) · ×1
  • phase-publication-hook.phaseDecision (cognitive 51) autoplan/bin/phase-publication-hook.ts:568 — 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-carry.submitCarryCheck (cognitive 51) · ×1
  • autoplan-carry.submitCarryCheck (cognitive 51) lib/autoplan-carry.ts:222 — autoplan-carry.submitCarryCheck has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (28 pts), ternaries 7 (14 pts), boolean chains 6, loops 1 (3 pts) (nesting depth added 21). Of this number, 49 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 · supervise.supervise (cognitive 51) · ×1
  • supervise.supervise (cognitive 51) REDACTED:131 — supervise.supervise has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 9, ternaries 7 (8 pts), error handling 5 (6 pts), loops 1 (nesting depth added 7). Most of this is not in the body itself: 2 of the 51 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 215, readNew, a function literal at line 203, …). 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 · autoplan-owner-words.ownerSpans (cognitive 51) · ×1
  • autoplan-owner-words.ownerSpans (cognitive 51) lib/autoplan-owner-words.ts:189 — autoplan-owner-words.ownerSpans has cognitive complexity 51 (threshold 15). Drivers by points: loops 12 (34 pts), ternaries 2 (7 pts), if/else 3 (6 pts), boolean chains 4 (nesting depth added 30). Of this number, 48 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · 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 · review-pass.renderStage (cognitive 51) · ×1
  • review-pass.renderStage (cognitive 51) lib/review-pass.ts:201 — review-pass.renderStage has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 7 (15 pts), error handling 3 (9 pts), boolean chains 7, loops 1 (nesting depth added 23). Of this number, 42 points are the body's own statements and 9 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 · runaway.assess (cognitive 51) · ×1
  • runaway.assess (cognitive 51) lib/runaway.ts:134 — runaway.assess has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 16, ternaries 9 (11 pts), loops 3 (6 pts) (nesting depth added 12). 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, split the body into named stages: move each independent step or branch 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:799 — 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:443 — 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 · recover-receipts.collectRecovery (cognitive 50) · ×1
  • recover-receipts.collectRecovery (cognitive 50) crew/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-exclude.grepFixed (cognitive 50) · ×1
  • review-exclude.grepFixed (cognitive 50) lib/review-exclude.ts:305 — review-exclude.grepFixed has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (29 pts), ternaries 3 (9 pts), loops 4 (8 pts), boolean chains 4 (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 · 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 · ship-queue-land-direct.landDirect · ×1
  • ship-queue-land-direct.landDirect::locked (cognitive 50) lib/ship-queue-land-direct.ts:242 — ship-queue-land-direct.landDirect::locked has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (32 pts), ternaries 5 (10 pts), boolean chains 7, 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. This shape REPEATS in the file: one other method here (ship-queue-land-direct.landDirect) 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.parseTranscriptJsonl (cognitive 49) · ×1
  • gstack-memory-ingest.parseTranscriptJsonl (cognitive 49) bin/gstack-memory-ingest.ts:689 — 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:2106 — 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:374 — 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 · regen.runRegen (cognitive 49) · ×1
  • regen.runRegen (cognitive 49) lib/regen.ts:233 — regen.runRegen has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 11 (23 pts), if/else 8 (15 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 22). Of this number, 43 points are the body's own statements and 6 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 · 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 · Watcher.poll (cognitive 49) · ×1
  • Watcher.poll (cognitive 49) lib/pr-wait.ts:477 — Watcher.poll has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 11, ternaries 2 (5 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · 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:1631 — 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 · review-exclude.binaryContent (cognitive 48) · ×1
  • review-exclude.binaryContent (cognitive 48) lib/review-exclude.ts:195 — review-exclude.binaryContent has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 6 (12 pts), loops 6 (9 pts), boolean chains 7, error handling 1 (3 pts) (nesting depth added 19). Of this number, 44 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 · ship-queue.verify (cognitive 48) · ×1
  • ship-queue.verify (cognitive 48) lib/ship-queue.ts:566 — 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 · 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 · gbrain-local-status.freshClassify (cognitive 47) · ×1
  • gbrain-local-status.freshClassify (cognitive 47) REDACTED:455 — gbrain-local-status.freshClassify has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 5 (13 pts), boolean chains 7, error handling 3 (4 pts) (nesting depth added 19). Of this number, 18 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 · 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 · skill-contract.validateContract (cognitive 47) · ×1
  • skill-contract.validateContract (cognitive 47) REDACTED:109 — skill-contract.validateContract has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 7, loops 3 (5 pts), error handling 1 (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 · 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 · ship-budget-cli.cmdResume (cognitive 47) · ×1
  • ship-budget-cli.cmdResume (cognitive 47) lib/ship-budget-cli.ts:437 — ship-budget-cli.cmdResume has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 10 (17 pts), if/else 13 (16 pts), boolean chains 9, error handling 2 (5 pts) (nesting depth added 13). Most of this is not in the body itself: 11 of the 47 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 455, 462). 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 · redact-patterns.codeLineStart (cognitive 46) · ×1
  • redact-patterns.codeLineStart (cognitive 46) lib/redact-patterns.ts:1159 — redact-patterns.codeLineStart has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 11, loops 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · review-depth.svgDrawing (cognitive 46) · ×1
  • review-depth.svgDrawing (cognitive 46) lib/review-depth.ts:125 — review-depth.svgDrawing has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 7, ternaries 2 (7 pts), loops 4 (5 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrowserManager.launchHeaded (cognitive 46) · ×1
  • BrowserManager.launchHeaded (cognitive 46) browse/src/browser-manager.ts:793 — 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 · stamp-only.versionStampOnly (cognitive 46) · ×1
  • stamp-only.versionStampOnly (cognitive 46) lib/pregate/stamp-only.ts:141 — stamp-only.versionStampOnly has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 4 (11 pts), boolean chains 5, error handling 2, loops 1 (2 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 · cli.main (cognitive 46) · ×1
  • cli.main (cognitive 46) design/src/cli.ts:172 — 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:684 — 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 · repo-state-clean.report (cognitive 46) · ×1
  • repo-state-clean.report (cognitive 46) lib/repo-state-clean.ts:339 — repo-state-clean.report has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 17 (36 pts), if/else 5 (7 pts), loops 2, boolean chains 1 (nesting depth added 21). Of this number, 38 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 · review-brief.renderRole (cognitive 46) · ×1
  • review-brief.renderRole (cognitive 46) lib/review-brief.ts:150 — review-brief.renderRole has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 13 (25 pts), if/else 6 (11 pts), boolean chains 5, error handling 2 (4 pts), match/switch 1 (nesting depth added 19). Of this number, 39 points are the body's own statements and 7 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 · review-depth.classifyDiff (cognitive 45) · ×1
  • review-depth.classifyDiff (cognitive 45) lib/review-depth.ts:264 — review-depth.classifyDiff has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 6, loops 4 (5 pts), ternaries 2 (3 pts) (nesting depth added 13). Of this number, 41 points are the body's own statements and 4 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 · changelog-fragments.readFragments (cognitive 45) · ×1
  • changelog-fragments.readFragments (cognitive 45) lib/changelog-fragments.ts:72 — changelog-fragments.readFragments has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (23 pts), ternaries 9 (18 pts), boolean chains 2, loops 2 (nesting depth added 20). Of this number, 36 points are the body's own statements and 9 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.rewriteStampPaths (cognitive 45) · ×1
  • restamp.rewriteStampPaths (cognitive 45) lib/restamp.ts:536 — restamp.rewriteStampPaths has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 8, loops 4 (7 pts), ternaries 7 (nesting depth added 13). Of this number, 28 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 · release-stamp.classifyRelease (cognitive 45) · ×1
  • release-stamp.classifyRelease (cognitive 45) lib/release-stamp.ts:37 — release-stamp.classifyRelease has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (27 pts), ternaries 6 (9 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 10). Of this number, 40 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 · 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 · ship-release.accept (cognitive 45) · ×1
  • ship-release.accept (cognitive 45) lib/ship-release.ts:674 — ship-release.accept has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (26 pts), ternaries 6 (9 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 12). Of this number, 44 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-memory-helpers.extractGbrainBlock (cognitive 44) · ×1
  • gstack-memory-helpers.extractGbrainBlock (cognitive 44) lib/gstack-memory-helpers.ts:484 — 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 · restamp.restamp (cognitive 44) · ×1
  • restamp.restamp (cognitive 44) lib/restamp.ts:671 — restamp.restamp has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (22 pts), ternaries 6 (12 pts), boolean chains 7, error handling 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 · autoplan-carry.assess (cognitive 44) · ×1
  • autoplan-carry.assess (cognitive 44) lib/autoplan-carry.ts:113 — autoplan-carry.assess has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 16, ternaries 3, loops 2, error handling 1 (nesting depth added 4). Of this number, 37 points are the body's own statements and 7 belong to 6 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 · 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 · flaky-exception.readRunFailures (cognitive 44) · ×1
  • flaky-exception.readRunFailures (cognitive 44) lib/pregate/flaky-exception.ts:188 — flaky-exception.readRunFailures has cognitive complexity 44 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 9, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 8). Of this number, 43 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.
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 · ship-budget-cli.cmdStart (cognitive 44) · ×1
  • ship-budget-cli.cmdStart (cognitive 44) lib/ship-budget-cli.ts:240 — ship-budget-cli.cmdStart has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 13 (16 pts), if/else 13 (15 pts), boolean chains 13 (nesting depth added 5). Of this number, 37 points are the body's own statements and 7 belong 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 · (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 · audit.redactCommandArgs (cognitive 43) · ×1
  • audit.redactCommandArgs (cognitive 43) browse/src/audit.ts:81 — audit.redactCommandArgs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (28 pts), ternaries 2 (6 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.handlePairAgent (cognitive 43) · ×1
  • cli.handlePairAgent (cognitive 43) browse/src/cli.ts:1607 — 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:1074 — 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 · captain-brief.renderCaptainBrief (cognitive 43) · ×1
  • captain-brief.renderCaptainBrief (cognitive 43) lib/captain-brief.ts:77 — captain-brief.renderCaptainBrief has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 19 (27 pts), if/else 8 (9 pts), boolean chains 7 (nesting depth added 9). Of this number, 27 points are the body's own statements and 16 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 · autoplan-run.withRunLock (cognitive 43) · ×1
  • autoplan-run.withRunLock (cognitive 43) REDACTED:47 — autoplan-run.withRunLock has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 6 (17 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context.buildContext (cognitive 43) · ×1
  • context.buildContext (cognitive 43) lib/pregate/context.ts:209 — context.buildContext has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 10 (15 pts), boolean chains 7, 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 · import-graph.referencesIn (cognitive 43) · ×1
  • import-graph.referencesIn (cognitive 43) lib/pregate/import-graph.ts:412 — import-graph.referencesIn has cognitive complexity 43 (threshold 15). Drivers by points: loops 14 (27 pts), if/else 7 (9 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 18). Of this number, 40 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 · ship-queue-train.newTrain (cognitive 43) · ×1
  • ship-queue-train.newTrain (cognitive 43) crew/lib/ship-queue-train.ts:400 — ship-queue-train.newTrain has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 13, if/else 12 (13 pts), loops 1 (nesting depth added 3). Of this number, 40 points are the body's own statements and 3 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 · release-gate.runGate (cognitive 43) · ×1
  • release-gate.runGate (cognitive 43) crew/lib/release-gate.ts:233 — release-gate.runGate has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 11, ternaries 8, error handling 1 (nesting depth added 3). Of this number, 37 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, 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.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 · retro-friction.frictionBySkill (cognitive 43) · ×1
  • retro-friction.frictionBySkill (cognitive 43) lib/retro-friction.ts:71 — retro-friction.frictionBySkill has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 5 (10 pts), boolean chains 9, loops 4 (nesting depth added 14). Of this number, 41 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 · redact-engine.redactJsonFindingSpans (cognitive 42) · ×1
  • redact-engine.redactJsonFindingSpans (cognitive 42) REDACTED:669 — 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 · BrowserManager.restoreState (cognitive 42) · ×1
  • BrowserManager.restoreState (cognitive 42) browse/src/browser-manager.ts:1919 — BrowserManager.restoreState has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (23 pts), error handling 3 (9 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 22). Of this number, 28 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 · import-graph.buildGraph (cognitive 42) · ×1
  • import-graph.buildGraph (cognitive 42) lib/pregate/import-graph.ts:480 — import-graph.buildGraph has cognitive complexity 42 (threshold 15). Drivers by points: loops 13 (21 pts), if/else 6 (12 pts), boolean chains 4, ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 17). 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, 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 · plan-record.resolveApproved (cognitive 42) · ×1
  • plan-record.resolveApproved (cognitive 42) lib/plan-record.ts:191 — plan-record.resolveApproved has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 10 (22 pts), if/else 12 (17 pts), boolean chains 3 (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 · review-collect.readDiff (cognitive 42) · ×1
  • review-collect.readDiff (cognitive 42) lib/review-collect.ts:92 — review-collect.readDiff has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 8, loops 3, ternaries 1 (nesting depth added 17). 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the 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 · release-gate.bisectRecord (cognitive 42) · ×1
  • release-gate.bisectRecord (cognitive 42) crew/lib/release-gate.ts:337 — release-gate.bisectRecord has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · BrowserManager.promoteToHeaded (cognitive 41) · ×1
  • BrowserManager.promoteToHeaded (cognitive 41) browse/src/browser-manager.ts:2162 — BrowserManager.promoteToHeaded has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (27 pts), error handling 4 (5 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 11). Of this number, 39 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 · restamp.gateAhead (cognitive 41) · ×1
  • restamp.gateAhead (cognitive 41) lib/restamp.ts:749 — 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 · autoplan-export.runLog (cognitive 41) · ×1
  • autoplan-export.runLog (cognitive 41) lib/autoplan-export.ts:79 — autoplan-export.runLog has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 16 (29 pts), if/else 5 (8 pts), boolean chains 2, loops 2 (nesting depth added 16). Of this number, 33 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 · outside-review-result.classifyOutsideReview (cognitive 41) · ×1
  • outside-review-result.classifyOutsideReview (cognitive 41) lib/outside-review-result.ts:248 — outside-review-result.classifyOutsideReview has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 13, ternaries 9 (12 pts) (nesting depth added 7). Of this number, 35 points are the body's own statements and 6 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 · Watcher.emitBots (cognitive 41) · ×1
  • Watcher.emitBots (cognitive 41) lib/pr-wait.ts:404 — Watcher.emitBots has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 6 (17 pts), if/else 6 (13 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 19). Of this number, 39 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 · ship-queue-train-init.trainDoctor (cognitive 41) · ×1
  • ship-queue-train-init.trainDoctor (cognitive 41) REDACTED:201 — ship-queue-train-init.trainDoctor has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 5 (11 pts), loops 3 (6 pts), boolean chains 2, error handling 1 (nesting depth added 19). 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, split the body into named stages: move each independent step or branch 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:162 — 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 · diagram-prepass.inlineLocalImages (cognitive 41) · ×1
  • diagram-prepass.inlineLocalImages (cognitive 41) make-pdf/src/diagram-prepass.ts:549 — diagram-prepass.inlineLocalImages has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22 (32 pts), ternaries 3 (4 pts), boolean chains 3, error handling 2 (nesting depth added 11). Most of this is not in the body itself: 1 of the 41 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 563, 679, 693). 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-policy.trainErrors (cognitive 40) · ×1
  • ship-policy.trainErrors (cognitive 40) REDACTED:424 — ship-policy.trainErrors has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 6 (14 pts), boolean chains 8, loops 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · autoplan-run.initRun (cognitive 40) · ×1
  • autoplan-run.initRun (cognitive 40) REDACTED:87 — autoplan-run.initRun has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 20 (22 pts), if/else 7 (11 pts), boolean chains 6, loops 1 (nesting depth added 6). 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, 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-run.submitResult (cognitive 40) · ×1
  • autoplan-run.submitResult (cognitive 40) REDACTED:342 — autoplan-run.submitResult has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 8, ternaries 6 (8 pts) (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 · stamp-only.jsonDiff (cognitive 40) · ×1
  • stamp-only.jsonDiff (cognitive 40) lib/pregate/stamp-only.ts:91 — stamp-only.jsonDiff has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 5 (10 pts), boolean chains 5 (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-wait.parsePrWaitArgs (cognitive 40) · ×1
  • pr-wait.parsePrWaitArgs (cognitive 40) lib/pr-wait.ts:125 — pr-wait.parsePrWaitArgs has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (32 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli.runSetup (cognitive 40) · ×1
  • cli.runSetup (cognitive 40) design/src/cli.ts:111 — cli.runSetup has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 9 (22 pts), if/else 10 (13 pts), boolean chains 4, error handling 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 · 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 · phase-publication-hook.guardOutput (cognitive 39) · ×1
  • phase-publication-hook.guardOutput (cognitive 39) autoplan/bin/phase-publication-hook.ts:722 — 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 · motion-capture.parseCaptureArgs (cognitive 39) · ×1
  • motion-capture.parseCaptureArgs (cognitive 39) lib/motion-capture.ts:81 — motion-capture.parseCaptureArgs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 11, 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 · restamp.runStages (cognitive 39) · ×1
  • restamp.runStages (cognitive 39) lib/restamp.ts:458 — restamp.runStages has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 6 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). Of this number, 37 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 · gate-list.validateGateList (cognitive 39) · ×1
  • gate-list.validateGateList (cognitive 39) lib/gate-list.ts:77 — gate-list.validateGateList has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 10, loops 1 (3 pts) (nesting depth added 9). Of this number, 21 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 · 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 · workflows.commandTestFiles (cognitive 39) · ×1
  • workflows.commandTestFiles (cognitive 39) lib/pregate/workflows.ts:103 — 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 · 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 · 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 · gstack-post.splitSections (cognitive 39) · ×1
  • gstack-post.splitSections (cognitive 39) lib/gstack-post.ts:200 — gstack-post.splitSections has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 9, ternaries 3 (4 pts), loops 1 (nesting depth added 11). Of this number, 37 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 · qa-evidence.qaEvidenceMain (cognitive 39) · ×1
  • qa-evidence.qaEvidenceMain (cognitive 39) REDACTED:423 — qa-evidence.qaEvidenceMain has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 7 (12 pts), boolean chains 10, error handling 2 (3 pts) (nesting depth added 9). None of this is in the body itself: all 39 points belong to 2 function literals inside it that branch (lines 426, 424). 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-release.push (cognitive 39) · ×1
  • ship-release.push (cognitive 39) lib/ship-release.ts:765 — ship-release.push has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (21 pts), ternaries 6 (9 pts), boolean chains 8, error handling 1 (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.
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:2424 — 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 2429, 2451, 2464, …). 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 · ci-gate.evaluateChecks (cognitive 38) · ×1
  • ci-gate.evaluateChecks (cognitive 38) lib/ci-gate.ts:109 — 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 · gate-list.parseReply (cognitive 38) · ×1
  • gate-list.parseReply (cognitive 38) lib/gate-list.ts:187 — gate-list.parseReply has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (21 pts), ternaries 5 (9 pts), boolean chains 6, loops 2 (nesting depth added 8). Of this number, 37 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.launchRuntime (cognitive 38) · ×1
  • runtime.launchRuntime (cognitive 38) lib/pregate/runtime.ts:159 — runtime.launchRuntime has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 8 (21 pts), if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 19). 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, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the 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-land.census (cognitive 38) · ×1
  • ship-queue-land.census (cognitive 38) lib/ship-queue-land.ts:230 — ship-queue-land.census has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 12 (26 pts), boolean chains 4, if/else 3 (4 pts), loops 2 (3 pts), error handling 1 (nesting depth added 16). 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, split the body into named stages: move each independent step or branch 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.buildTrain (cognitive 38) · ×1
  • ship-queue-train.buildTrain (cognitive 38) crew/lib/ship-queue-train.ts:550 — ship-queue-train.buildTrain has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 5, ternaries 2 (5 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue-dispatch-ci.dispatchCi (cognitive 38) · ×1
  • ship-queue-dispatch-ci.dispatchCi (cognitive 38) crew/lib/ship-queue-dispatch-ci.ts:39 — ship-queue-dispatch-ci.dispatchCi has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 2 (8 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 16). 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, split the body into named stages: move each independent step or branch 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 · review-bots.fetch (cognitive 38) · ×1
  • review-bots.fetch (cognitive 38) REDACTED:116 — review-bots.fetch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 5 (9 pts), loops 6, boolean chains 5 (nesting depth added 10). Of this number, 36 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 · ship-budget-cli.decide (cognitive 38) · ×1
  • ship-budget-cli.decide (cognitive 38) lib/ship-budget-cli.ts:142 — ship-budget-cli.decide has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 12 (24 pts), boolean chains 7, if/else 7 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · aside-render.renderWithBrowse (cognitive 37) · ×1
  • aside-render.renderWithBrowse (cognitive 37) lib/aside-render.ts:614 — aside-render.renderWithBrowse has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (30 pts), ternaries 1 (3 pts), error handling 2, loops 2 (nesting depth added 13). 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, split the body into named stages: move each independent step or branch 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:150 — 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 · guards.run (cognitive 37) · ×1
  • guards.run (cognitive 37) lib/pregate/checks/guards.ts:70 — guards.run has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 11 (15 pts), loops 2, boolean chains 1 (nesting depth added 13). Of this number, 33 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-queue.stamp (cognitive 37) · ×1
  • ship-queue.stamp (cognitive 37) lib/ship-queue.ts:457 — 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 · ship-queue-wave.wavePlan (cognitive 37) · ×1
  • ship-queue-wave.wavePlan (cognitive 37) crew/lib/ship-queue-wave.ts:267 — ship-queue-wave.wavePlan has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 5 (7 pts), ternaries 3 (4 pts), boolean chains 2 (nesting depth added 13). Of this number, 34 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 · ship-queue-wave.waveMain (cognitive 37) · ×1
  • ship-queue-wave.waveMain (cognitive 37) crew/lib/ship-queue-wave.ts:630 — ship-queue-wave.waveMain has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 6 (11 pts), boolean chains 9, error handling 1 (nesting depth added 10). Of this number, 33 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 · ship-queue-train-gate.dispatchWorkflows (cognitive 37) · ×1
  • ship-queue-train-gate.dispatchWorkflows (cognitive 37) crew/lib/ship-queue-train-gate.ts:249 — ship-queue-train-gate.dispatchWorkflows has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (17 pts), ternaries 4 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · train-gate.stampFreeTree (cognitive 37) · ×1
  • train-gate.stampFreeTree (cognitive 37) crew/scripts/train-gate.ts:170 — train-gate.stampFreeTree has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 6 (21 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 · 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 · ship-preflight.preflight (cognitive 37) · ×1
  • ship-preflight.preflight (cognitive 37) lib/ship-preflight.ts:250 — ship-preflight.preflight has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 11, ternaries 5 (11 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 · 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 · redact-engine.jsonTokens (cognitive 36) · ×1
  • redact-engine.jsonTokens (cognitive 36) REDACTED:744 — 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 · gbrain-local-status.hasRemoteOnlyGbrainMcp (cognitive 36) · ×1
  • gbrain-local-status.hasRemoteOnlyGbrainMcp (cognitive 36) REDACTED:175 — gbrain-local-status.hasRemoteOnlyGbrainMcp has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 9, loops 3 (4 pts), error handling 1 (nesting depth added 13). 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-memory-ingest.probeMode (cognitive 36) · ×1
  • gstack-memory-ingest.probeMode (cognitive 36) bin/gstack-memory-ingest.ts:1349 — gstack-memory-ingest.probeMode has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 5, loops 3 (5 pts), error handling 1 (2 pts) (nesting depth added 16). 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 · gstack-memory-ingest.admitTranscriptSource (cognitive 36) · ×1
  • gstack-memory-ingest.admitTranscriptSource (cognitive 36) bin/gstack-memory-ingest.ts:2538 — 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:43 — 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 · 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 · doc-links.brokenLinks (cognitive 36) · ×1
  • doc-links.brokenLinks (cognitive 36) lib/doc-links.ts:43 — doc-links.brokenLinks has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (20 pts), error handling 2 (6 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 19). Most of this is not in the body itself: 3 of the 36 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 50, anchorsAt). 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 · review-secret-excerpt.hits (cognitive 36) · ×1
  • review-secret-excerpt.hits (cognitive 36) lib/review-secret-excerpt.ts:56 — review-secret-excerpt.hits has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 7 (13 pts), boolean chains 4, ternaries 1 (nesting depth added 18). 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 · ship-receipt-depth.parseReviewLoopException (cognitive 36) · ×1
  • ship-receipt-depth.parseReviewLoopException (cognitive 36) lib/ship-receipt-depth.ts:160 — ship-receipt-depth.parseReviewLoopException has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 7, loops 4 (5 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.
D2 · Cognitive Complexity · gate-cost-replay.parseArgs (cognitive 36) · ×1
  • gate-cost-replay.parseArgs (cognitive 36) crew/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 · daemon.fetchHandler (cognitive 36) · ×1
  • daemon.fetchHandler (cognitive 36) design/src/daemon.ts:485 — daemon.fetchHandler has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 12 (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.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 · junit.parseXml (cognitive 36) · ×1
  • junit.parseXml (cognitive 36) lib/junit.ts:66 — junit.parseXml has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · quarantine.entryProblems (cognitive 36) · ×1
  • quarantine.entryProblems (cognitive 36) lib/quarantine.ts:132 — quarantine.entryProblems has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 9, loops 1, ternaries 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 · 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 · ship-preflight.integrate (cognitive 36) · ×1
  • ship-preflight.integrate (cognitive 36) lib/ship-preflight.ts:73 — ship-preflight.integrate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 8, ternaries 4 (5 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 · git.sectionToFile (cognitive 35) · ×1
  • git.sectionToFile (cognitive 35) lib/gate-diff/git.ts:276 — 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 · config.allowlistErrors (cognitive 35) · ×1
  • config.allowlistErrors (cognitive 35) lib/pregate/config.ts:166 — config.allowlistErrors has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 6, ternaries 2 (5 pts), error handling 1 (3 pts), loops 1 (nesting depth added 10). Most of this is not in the body itself: 2 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 170, 180). 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 · 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 · ship-queue-train-gate.parseTestRecord (cognitive 35) · ×1
  • ship-queue-train-gate.parseTestRecord (cognitive 35) crew/lib/ship-queue-train-gate.ts:149 — ship-queue-train-gate.parseTestRecord has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 3 (7 pts), error handling 1 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · 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 · review-ledger.judge (cognitive 35) · ×1
  • review-ledger.judge (cognitive 35) lib/review-ledger.ts:427 — review-ledger.judge has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 7, ternaries 2 (5 pts), loops 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · git.resolveBase (cognitive 34) · ×1
  • git.resolveBase (cognitive 34) lib/gate-diff/git.ts:106 — git.resolveBase has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 10 (17 pts), if/else 10 (12 pts), boolean chains 4, loops 1 (nesting depth added 9). Of this number, 23 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue-train-gate.genericVerdict (cognitive 34) · ×1
  • ship-queue-train-gate.genericVerdict (cognitive 34) crew/lib/ship-queue-train-gate.ts:504 — ship-queue-train-gate.genericVerdict has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 8 (14 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 16). Of this number, 32 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 · ship-queue-train-verify.verifyTrain (cognitive 34) · ×1
  • ship-queue-train-verify.verifyTrain (cognitive 34) crew/lib/ship-queue-train-verify.ts:231 — ship-queue-train-verify.verifyTrain has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (21 pts), ternaries 8 (10 pts), boolean chains 3 (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 · 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 · 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 · redact-patterns.pythonFieldEnd (cognitive 33) · ×1
  • redact-patterns.pythonFieldEnd (cognitive 33) lib/redact-patterns.ts:911 — redact-patterns.pythonFieldEnd has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (23 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-memory-ingest.importBatch (cognitive 33) · ×1
  • gstack-memory-ingest.importBatch (cognitive 33) bin/gstack-memory-ingest.ts:2829 — 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 · cookie-import-native-job.createNativeCookieJob (cognitive 33) · ×1
  • cookie-import-native-job.createNativeCookieJob (cognitive 33) browse/src/cookie-import-native-job.ts:59 — cookie-import-native-job.createNativeCookieJob has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 4, error handling 2 (3 pts), loops 3, ternaries 1 (2 pts) (nesting depth added 6). Of this number, 29 points are the body's own statements and 4 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 · autoplan-lean.captureDraft (cognitive 33) · ×1
  • autoplan-lean.captureDraft (cognitive 33) lib/autoplan-lean.ts:65 — autoplan-lean.captureDraft has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 9 (13 pts), boolean chains 5, loops 2 (nesting depth added 7). Of this number, 23 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 · headless-artifacts.checkPhases (cognitive 33) · ×1
  • headless-artifacts.checkPhases (cognitive 33) lib/headless-artifacts.ts:434 — 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 · gate-reuse.ownDiffSignature (cognitive 33) · ×1
  • gate-reuse.ownDiffSignature (cognitive 33) crew/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 · ship-queue-post-merge.verifyPostMerge (cognitive 33) · ×1
  • ship-queue-post-merge.verifyPostMerge (cognitive 33) crew/lib/ship-queue-post-merge.ts:24 — ship-queue-post-merge.verifyPostMerge has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 9, if/else 4 (8 pts), loops 1 (nesting depth added 14). Of this number, 28 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · autoplan-stop-gate.checkRun (cognitive 33) · ×1
  • autoplan-stop-gate.checkRun (cognitive 33) lib/autoplan-stop-gate.ts:88 — autoplan-stop-gate.checkRun has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, ternaries 3 (4 pts), loops 3 (nesting depth added 10). 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 · timeline-stop-hook.repairTimeline (cognitive 33) · ×1
  • timeline-stop-hook.repairTimeline (cognitive 33) hosts/claude/hooks/timeline-stop-hook.ts:260 — 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 · 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 · qa-deadline.runQaDeadlineCommand (cognitive 33) · ×1
  • qa-deadline.runQaDeadlineCommand (cognitive 33) lib/qa-deadline.ts:133 — qa-deadline.runQaDeadlineCommand has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (19 pts), error handling 3 (6 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (nesting depth added 7). Most of this is not in the body itself: 6 of the 33 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 159, 148, 169, …). 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.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 · land-merged-checks.runMergedChecks (cognitive 32) · ×1
  • land-merged-checks.runMergedChecks (cognitive 32) lib/land-merged-checks.ts:101 — land-merged-checks.runMergedChecks has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 6 (9 pts), boolean chains 5, error handling 1 (3 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-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 · meta-commands.parseScreenshotArgs (cognitive 32) · ×1
  • meta-commands.parseScreenshotArgs (cognitive 32) browse/src/meta-commands.ts:30 — meta-commands.parseScreenshotArgs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 11). Of this number, 30 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 · gate-cost.simulateTrains (cognitive 32) · ×1
  • gate-cost.simulateTrains (cognitive 32) crew/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 · init-draft.draftConfig (cognitive 32) · ×1
  • init-draft.draftConfig (cognitive 32) lib/pregate/init-draft.ts:52 — init-draft.draftConfig has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 6 (16 pts), if/else 5 (10 pts), boolean chains 4, loops 2 (nesting depth added 15). Of this number, 31 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 · ship-queue-gate.recomputeMergeTree (cognitive 32) · ×1
  • ship-queue-gate.recomputeMergeTree (cognitive 32) crew/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 · ship-queue-wave.groupWaves (cognitive 32) · ×1
  • ship-queue-wave.groupWaves (cognitive 32) crew/lib/ship-queue-wave.ts:102 — ship-queue-wave.groupWaves has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 8 (11 pts), boolean chains 3 (nesting depth added 13). Of this number, 25 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 · ship-queue-train-verdict.trainVerdict (cognitive 32) · ×1
  • ship-queue-train-verdict.trainVerdict (cognitive 32) crew/lib/ship-queue-train-verdict.ts:108 — ship-queue-train-verdict.trainVerdict has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 7 (13 pts), boolean chains 5 (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 · gate-cost-replay.readGateRecord (cognitive 32) · ×1
  • gate-cost-replay.readGateRecord (cognitive 32) crew/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 · autoplan-public.exportPublic (cognitive 32) · ×1
  • autoplan-public.exportPublic (cognitive 32) lib/autoplan-public.ts:161 — autoplan-public.exportPublic has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, ternaries 3 (6 pts), error handling 1 (2 pts), loops 2 (nesting depth added 7). Of this number, 19 points are the body's own statements and 13 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 · quarantine.quarantineMain (cognitive 32) · ×1
  • quarantine.quarantineMain (cognitive 32) lib/quarantine.ts:404 — quarantine.quarantineMain has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 6 (12 pts), boolean chains 4, loops 2 (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 · 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 · phase-publication-hook.invocation (cognitive 31) · ×1
  • phase-publication-hook.invocation (cognitive 31) autoplan/bin/phase-publication-hook.ts:268 — phase-publication-hook.invocation has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 8, error handling 2 (4 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 · 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:78 — 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:549 — 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 · import-graph.blankDartComments (cognitive 31) · ×1
  • import-graph.blankDartComments (cognitive 31) lib/pregate/import-graph.ts:147 — 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 · ship-queue-train-land.landSlot (cognitive 31) · ×1
  • ship-queue-train-land.landSlot (cognitive 31) crew/lib/ship-queue-train-land.ts:333 — ship-queue-train-land.landSlot has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 7 (12 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 · autoplan-owner-words.ownerWords (cognitive 31) · ×1
  • autoplan-owner-words.ownerWords (cognitive 31) lib/autoplan-owner-words.ts:245 — autoplan-owner-words.ownerWords has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 10, if/else 3 (5 pts), loops 4, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 11 of the 31 points are its own statements and the rest belongs to 7 function items inside it that branch (strings, note, gateText, …). 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 · 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-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 · ship-budget-cli.cmdClose (cognitive 31) · ×1
  • ship-budget-cli.cmdClose (cognitive 31) lib/ship-budget-cli.ts:348 — ship-budget-cli.cmdClose has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 7, if/else 6 (7 pts), loops 3 (5 pts), error handling 1 (2 pts) (nesting depth added 8). None of this is in the body itself: all 31 points belong to 3 function literals inside it that branch (lines 350, 355, 364). 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 · 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 · gstack-memory-ingest.runLocked (cognitive 30) · ×1
  • gstack-memory-ingest.runLocked (cognitive 30) bin/gstack-memory-ingest.ts:3206 — 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 · gstack-global-discover.scanKimiCode (cognitive 30) · ×1
  • gstack-global-discover.scanKimiCode (cognitive 30) bin/gstack-global-discover.ts:536 — gstack-global-discover.scanKimiCode has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 4 (9 pts), error handling 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:728 — 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 · 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 · restamp.planVersions (cognitive 30) · ×1
  • restamp.planVersions (cognitive 30) lib/restamp.ts:168 — restamp.planVersions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 6 (9 pts), boolean chains 6, error handling 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 · autoplan-prompts.detectScope (cognitive 30) · ×1
  • autoplan-prompts.detectScope (cognitive 30) lib/autoplan-prompts.ts:57 — autoplan-prompts.detectScope has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (19 pts), boolean chains 11 (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 · 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 · gate-dispositions.gateAcceptance (cognitive 30) · ×1
  • gate-dispositions.gateAcceptance (cognitive 30) lib/gate-dispositions.ts:160 — gate-dispositions.gateAcceptance has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (6 pts), ternaries 3 (5 pts), boolean chains 3, error handling 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 · review-exclude.reviewExclude (cognitive 30) · ×1
  • review-exclude.reviewExclude (cognitive 30) lib/review-exclude.ts:355 — review-exclude.reviewExclude has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, loops 5 (6 pts), ternaries 4 (6 pts) (nesting depth added 6). Of this number, 25 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 · ship-queue-train-verdict.trainBisect (cognitive 30) · ×1
  • ship-queue-train-verdict.trainBisect (cognitive 30) crew/lib/ship-queue-train-verdict.ts:247 — ship-queue-train-verdict.trainBisect has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 4, loops 3, ternaries 1 (nesting depth added 5). 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: 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 · replay-pr-selection.loadInput (cognitive 30) · ×1
  • replay-pr-selection.loadInput (cognitive 30) crew/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 · daemon-client.ensureDaemon (cognitive 30) · ×1
  • daemon-client.ensureDaemon (cognitive 30) REDACTED:91 — daemon-client.ensureDaemon has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (2 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 · autoplan-owner-words.ownerIndex (cognitive 30) · ×1
  • autoplan-owner-words.ownerIndex (cognitive 30) lib/autoplan-owner-words.ts:155 — autoplan-owner-words.ownerIndex has cognitive complexity 30 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 3 (10 pts), boolean chains 2 (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · 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 · 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 · review-scope.parseHunks (cognitive 30) · ×1
  • review-scope.parseHunks (cognitive 30) lib/review-scope.ts:69 — review-scope.parseHunks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 2 (4 pts), loops 2, boolean chains 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 · 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:210 — aside-render.buildRenderScript has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 10). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 236, setOverride, sized). 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 · 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 · headless-artifacts.findCycle (cognitive 29) · ×1
  • headless-artifacts.findCycle (cognitive 29) lib/headless-artifacts.ts:404 — 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 · flaky-exception.logProblem (cognitive 29) · ×1
  • flaky-exception.logProblem (cognitive 29) lib/pregate/flaky-exception.ts:308 — flaky-exception.logProblem has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 15). Of this number, 27 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 · ship-receipt-depth.parseReviewTargeted (cognitive 29) · ×1
  • ship-receipt-depth.parseReviewTargeted (cognitive 29) lib/ship-receipt-depth.ts:240 — ship-receipt-depth.parseReviewTargeted has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 10, if/else 9 (10 pts), ternaries 3 (8 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 · ship-receipt-depth.writeExcludeBinds (cognitive 29) · ×1
  • ship-receipt-depth.writeExcludeBinds (cognitive 29) lib/ship-receipt-depth.ts:346 — ship-receipt-depth.writeExcludeBinds has cognitive complexity 29 (threshold 15). Drivers by points: if/else 33 (49 pts), ternaries 16 (26 pts), boolean chains 17, loops 9 (11 pts), error handling 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. This shape REPEATS in the file: one other method here (ship-receipt-depth.writeExcludeBinds::bindAudits) 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 · ship-receipt-depth.ownChangeSince (cognitive 29) · ×1
  • ship-receipt-depth.ownChangeSince (cognitive 29) lib/ship-receipt-depth.ts:536 — ship-receipt-depth.ownChangeSince has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts), ternaries 7, loops 2 (nesting depth added 2). Of this number, 25 points are the body's own statements and 4 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 · ship-queue-train-watch.watchGeneric (cognitive 29) · ×1
  • ship-queue-train-watch.watchGeneric (cognitive 29) crew/lib/ship-queue-train-watch.ts:57 — ship-queue-train-watch.watchGeneric has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, ternaries 1 (3 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · skill-contract-stop-hook.main (cognitive 29) · ×1
  • skill-contract-stop-hook.main (cognitive 29) hosts/claude/hooks/skill-contract-stop-hook.ts:76 — skill-contract-stop-hook.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 8, error handling 2, 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 · 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 · 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 · review-ledger.ledgerBlockers (cognitive 29) · ×1
  • review-ledger.ledgerBlockers (cognitive 29) lib/review-ledger.ts:499 — review-ledger.ledgerBlockers has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (3 pts), error handling 2 (nesting depth added 13). Of this number, 25 points are the body's own statements and 4 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 · ship-call-log.countLoggedCalls (cognitive 29) · ×1
  • ship-call-log.countLoggedCalls (cognitive 29) lib/ship-call-log.ts:69 — ship-call-log.countLoggedCalls has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 4 (8 pts), boolean chains 7, loops 3 (nesting depth added 8). Of this number, 21 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 · ship-sidecar.uidSidecars (cognitive 29) · ×1
  • ship-sidecar.uidSidecars (cognitive 29) lib/ship-sidecar.ts:72 — ship-sidecar.uidSidecars has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 8, loops 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 · phase-publication-hook.requirePublication (cognitive 28) · ×1
  • phase-publication-hook.requirePublication (cognitive 28) autoplan/bin/phase-publication-hook.ts:445 — 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 · restamp.applyToBranch (cognitive 28) · ×1
  • restamp.applyToBranch (cognitive 28) lib/restamp.ts:598 — 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 · autoplan-shadow.runShadow (cognitive 28) · ×1
  • autoplan-shadow.runShadow (cognitive 28) lib/autoplan-shadow.ts:289 — autoplan-shadow.runShadow has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 4 (6 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 10). Of this number, 22 points are the body's own statements and 6 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 · lane-selection.removedPath (cognitive 28) · ×1
  • lane-selection.removedPath (cognitive 28) lib/pregate/lane-selection.ts:176 — lane-selection.removedPath has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, ternaries 4 (5 pts), loops 3 (4 pts) (nesting depth added 5). Of this number, 24 points are the body's own statements and 4 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 · secrets.addedLines (cognitive 28) · ×1
  • secrets.addedLines (cognitive 28) lib/pregate/checks/secrets.ts:128 — secrets.addedLines has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, ternaries 3 (5 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 10). 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 into named stages: move each independent step or branch 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-land-lock.acquireLandLock (cognitive 28) · ×1
  • ship-queue-land-lock.acquireLandLock (cognitive 28) crew/lib/ship-queue-land-lock.ts:106 — ship-queue-land-lock.acquireLandLock has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 4 (5 pts), boolean chains 4 (nesting depth added 8). Of this number, 18 points are the body's own statements and 10 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-queue-train.freePhase (cognitive 28) · ×1
  • ship-queue-train.freePhase (cognitive 28) crew/lib/ship-queue-train.ts:481 — 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 · 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 · shell-writes.shellCommands (cognitive 28) · ×1
  • shell-writes.shellCommands (cognitive 28) lib/shell-writes.ts:156 — shell-writes.shellCommands has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 8). 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 · checks.manifestChecks (cognitive 28) · ×1
  • checks.manifestChecks (cognitive 28) lib/checks.ts:88 — checks.manifestChecks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 5, ternaries 2 (3 pts), error handling 1 (2 pts) (nesting depth added 7). Of this number, 27 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-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 · eval-plan.startPilot (cognitive 28) · ×1
  • eval-plan.startPilot (cognitive 28) lib/eval-plan.ts:395 — eval-plan.startPilot has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 5 (9 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). Of this number, 27 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 · ship-queue-land-direct.verifyMerge (cognitive 28) · ×1
  • ship-queue-land-direct.verifyMerge (cognitive 28) lib/ship-queue-land-direct.ts:118 — ship-queue-land-direct.verifyMerge has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7, ternaries 2 (5 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-release.prepushGuards (cognitive 28) · ×1
  • ship-release.prepushGuards (cognitive 28) lib/ship-release.ts:738 — ship-release.prepushGuards has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts), ternaries 4 (5 pts), error handling 2 (3 pts), loops 1 (nesting depth added 3). Of this number, 26 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 · ship-release.release (cognitive 28) · ×1
  • ship-release.release (cognitive 28) lib/ship-release.ts:814 — ship-release.release has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (12 pts), boolean chains 8, if/else 8 (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 · tasks-prior.supersede (cognitive 28) · ×1
  • tasks-prior.supersede (cognitive 28) lib/tasks-prior.ts:127 — tasks-prior.supersede has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 3, loops 1 (nesting depth added 11). Of this number, 27 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.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:633 — 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:1291 — 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 · proxy-config.parseProxyConfig (cognitive 27) · ×1
  • proxy-config.parseProxyConfig (cognitive 27) REDACTED:55 — proxy-config.parseProxyConfig has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (9 pts), if/else 8, 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 · BrowserManager.close (cognitive 27) · ×1
  • BrowserManager.close (cognitive 27) browse/src/browser-manager.ts:1091 — 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 · outside-voice-api.callModel (cognitive 27) · ×1
  • outside-voice-api.callModel (cognitive 27) lib/outside-voice-api.ts:62 — outside-voice-api.callModel has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 12 (20 pts), if/else 4 (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 · import-graph.stripJsonc (cognitive 27) · ×1
  • import-graph.stripJsonc (cognitive 27) lib/pregate/import-graph.ts:187 — 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 · remote-receipt.substituteStampOnlyTree (cognitive 27) · ×1
  • remote-receipt.substituteStampOnlyTree (cognitive 27) lib/pregate/remote-receipt.ts:78 — remote-receipt.substituteStampOnlyTree has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 7 (12 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 23 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 · flaky-exception.shardFailures (cognitive 27) · ×1
  • flaky-exception.shardFailures (cognitive 27) lib/pregate/flaky-exception.ts:279 — flaky-exception.shardFailures has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 10, ternaries 1 (2 pts), loops 1 (nesting depth added 2). 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, 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 · review-exclude.readSelection (cognitive 27) · ×1
  • review-exclude.readSelection (cognitive 27) lib/review-exclude.ts:478 — review-exclude.readSelection has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 6 (10 pts), boolean chains 4, loops 2 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch 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 27) · ×1
  • tags.tagHunk (cognitive 27) lib/gate-diff/tags.ts:236 — tags.tagHunk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8, loops 1 (2 pts), ternaries 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 · release-cut.planDaily (cognitive 27) · ×1
  • release-cut.planDaily (cognitive 27) REDACTED:628 — release-cut.planDaily has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (20 pts), boolean chains 5, if/else 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 · release-cadence.decideDaily (cognitive 27) · ×1
  • release-cadence.decideDaily (cognitive 27) crew/scripts/release-cadence.ts:59 — release-cadence.decideDaily has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 5, if/else 5 (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 · train-backstop.runBackstop (cognitive 27) · ×1
  • train-backstop.runBackstop (cognitive 27) crew/scripts/train-backstop.ts:133 — train-backstop.runBackstop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 6 (10 pts), boolean chains 3, loops 1 (nesting depth added 7). 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, split the body into named stages: move each independent step or branch 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:366 — 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 · ceo-review-gate.checkOutput (cognitive 27) · ×1
  • ceo-review-gate.checkOutput (cognitive 27) lib/ceo-review-gate.ts:115 — ceo-review-gate.checkOutput has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 3, error handling 1 (3 pts), loops 2 (3 pts), ternaries 3 (nesting depth added 13). Of this number, 22 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · plain-title.loadPlainTitlePolicy (cognitive 27) · ×1
  • plain-title.loadPlainTitlePolicy (cognitive 27) REDACTED:41 — plain-title.loadPlainTitlePolicy has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8, error handling 2, loops 2 (nesting depth added 2). Of this number, 15 points are the body's own statements and 12 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 · 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:78 — 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 · review-sweep.inventory · ×1
  • review-sweep.inventory::walk (cognitive 27) lib/review-sweep.ts:121 — review-sweep.inventory::walk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, error handling 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · redact-patterns.stringAt (cognitive 26) · ×1
  • redact-patterns.stringAt (cognitive 26) lib/redact-patterns.ts:947 — redact-patterns.stringAt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 8, ternaries 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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) REDACTED:227 — 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:876 — 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 · autoplan-export.buildTasks (cognitive 26) · ×1
  • autoplan-export.buildTasks (cognitive 26) lib/autoplan-export.ts:24 — autoplan-export.buildTasks has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 3 (6 pts), boolean chains 2, 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 · outside-review-result.execution (cognitive 26) · ×1
  • outside-review-result.execution (cognitive 26) lib/outside-review-result.ts:93 — outside-review-result.execution has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 4 (7 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 · 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 · ship-queue-land.buildStamp (cognitive 26) · ×1
  • ship-queue-land.buildStamp (cognitive 26) lib/ship-queue-land.ts:157 — ship-queue-land.buildStamp has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 6). 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 · ship-queue-train-cli.readyMain (cognitive 26) · ×1
  • ship-queue-train-cli.readyMain (cognitive 26) crew/lib/ship-queue-train-cli.ts:170 — ship-queue-train-cli.readyMain has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, if/else 9, ternaries 5 (6 pts) (nesting depth added 1). Of this number, 20 points are the body's own statements and 6 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 · index.handleLoopback (cognitive 26) · ×1
  • index.handleLoopback (cognitive 26) ios-qa/daemon/src/index.ts:398 — index.handleLoopback has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, 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 · 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:246 — 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:371 — 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 · qa-evidence.reportDir (cognitive 26) · ×1
  • qa-evidence.reportDir (cognitive 26) REDACTED:392 — qa-evidence.reportDir has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (5 pts), error handling 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repo-state-clean.evaluate (cognitive 26) · ×1
  • repo-state-clean.evaluate (cognitive 26) lib/repo-state-clean.ts:199 — repo-state-clean.evaluate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 3 (6 pts), error handling 4, boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ship-preflight.merge (cognitive 26) · ×1
  • ship-preflight.merge (cognitive 26) lib/ship-preflight.ts:143 — ship-preflight.merge has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 8 (9 pts), boolean chains 5, error handling 1 (nesting depth added 6). 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 · ship-policy-readers.readersErrors (cognitive 25) · ×1
  • ship-policy-readers.readersErrors (cognitive 25) lib/ship-policy-readers.ts:39 — ship-policy-readers.readersErrors has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 4, loops 1 (nesting depth added 7). Of this number, 21 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gstack-design-detect.pluginCacheImpeccableSkillDirs (cognitive 25) · ×1
  • gstack-design-detect.pluginCacheImpeccableSkillDirs (cognitive 25) bin/gstack-design-detect.ts:297 — 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:289 — 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:1282 — 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 · lane-ownership.laneCheck (cognitive 25) · ×1
  • lane-ownership.laneCheck (cognitive 25) crew/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 · autoplan-gate-cost.recReopens (cognitive 25) · ×1
  • autoplan-gate-cost.recReopens (cognitive 25) lib/autoplan-gate-cost.ts:52 — autoplan-gate-cost.recReopens has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 2 (4 pts), ternaries 3 (nesting depth added 9). 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 · 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) REDACTED:126 — 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 · 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 · headless-artifacts.checkSchema (cognitive 25) · ×1
  • headless-artifacts.checkSchema (cognitive 25) lib/headless-artifacts.ts:322 — 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 · head-policy.lanesOnlyHeadPolicy (cognitive 25) · ×1
  • head-policy.lanesOnlyHeadPolicy (cognitive 25) lib/pregate/head-policy.ts:84 — head-policy.lanesOnlyHeadPolicy has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 5 (6 pts), error handling 2 (nesting depth added 1). Of this number, 16 points are the body's own statements and 9 belong to 4 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 · context.touchedFiles (cognitive 25) · ×1
  • context.touchedFiles (cognitive 25) lib/pregate/context.ts:114 — 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 · lanes.run (cognitive 25) · ×1
  • lanes.run (cognitive 25) lib/pregate/checks/lanes.ts:624 — lanes.run has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 12 (17 pts), if/else 4, boolean chains 2, loops 2 (nesting depth added 5). Of this number, 22 points are the body's own statements and 3 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 · literals.run (cognitive 25) · ×1
  • literals.run (cognitive 25) REDACTED:175 — literals.run has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 4 (6 pts), loops 4 (6 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 8). Of this number, 17 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 · stable-release.newestStableRelease (cognitive 25) · ×1
  • stable-release.newestStableRelease (cognitive 25) lib/stable-release.ts:27 — stable-release.newestStableRelease has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 6, if/else 5 (6 pts), error handling 1, loops 1 (nesting depth added 5). Of this number, 21 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 · ship-receipt-docs.parseReceiptDocs (cognitive 25) · ×1
  • ship-receipt-docs.parseReceiptDocs (cognitive 25) lib/ship-receipt-docs.ts:24 — ship-receipt-docs.parseReceiptDocs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (5 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 · ship-queue.ciAtHead (cognitive 25) · ×1
  • ship-queue.ciAtHead (cognitive 25) lib/ship-queue.ts:211 — ship-queue.ciAtHead has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 4, if/else 4 (nesting depth added 7). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 230, 231, 223, …). 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-wave.newWave (cognitive 25) · ×1
  • ship-queue-wave.newWave (cognitive 25) crew/lib/ship-queue-wave.ts:325 — ship-queue-wave.newWave has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 pts), boolean chains 3, 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 · question-log-hook.main (cognitive 25) · ×1
  • question-log-hook.main (cognitive 25) hosts/claude/hooks/question-log-hook.ts:268 — question-log-hook.main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 6). 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 · index.handleTailnet (cognitive 25) · ×1
  • index.handleTailnet (cognitive 25) ios-qa/daemon/src/index.ts:497 — 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 · 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 · factory-scorecard.readGateRuns (cognitive 25) · ×1
  • factory-scorecard.readGateRuns (cognitive 25) REDACTED:273 — factory-scorecard.readGateRuns has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (6 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 10). Of this number, 18 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 · 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 · harness-register.hookPlan (cognitive 25) · ×1
  • harness-register.hookPlan (cognitive 25) REDACTED:534 — harness-register.hookPlan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 6 (7 pts), boolean chains 6, error handling 1 (nesting depth added 4). 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: 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 · plan-reality-receipts.resolvePath (cognitive 25) · ×1
  • plan-reality-receipts.resolvePath (cognitive 25) lib/plan-reality-receipts.ts:50 — plan-reality-receipts.resolvePath has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (2 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 · review-fetch.scanEvents (cognitive 25) · ×1
  • review-fetch.scanEvents (cognitive 25) lib/review-fetch.ts:193 — review-fetch.scanEvents has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 5 (10 pts), boolean chains 4, ternaries 1 (nesting depth added 9). 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 · tasks-prior.addRows (cognitive 25) · ×1
  • tasks-prior.addRows (cognitive 25) lib/tasks-prior.ts:88 — tasks-prior.addRows has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, ternaries 3, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 93, 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.
D2 · Cognitive Complexity · autoplan-phase-publication.withResultWithdrawn (cognitive 24) · ×1
  • autoplan-phase-publication.withResultWithdrawn (cognitive 24) REDACTED:55 — 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.spawnTerminalAgent (cognitive 24) · ×1
  • terminal-agent-control.spawnTerminalAgent (cognitive 24) browse/src/terminal-agent-control.ts:222 — 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 · cli.proxyMismatchLines (cognitive 24) · ×1
  • cli.proxyMismatchLines (cognitive 24) browse/src/cli.ts:495 — cli.proxyMismatchLines has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 6, if/else 6 (nesting depth added 5). Of this number, 20 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 · 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 · ci-gate.parseCiGateArgs (cognitive 24) · ×1
  • ci-gate.parseCiGateArgs (cognitive 24) lib/ci-gate.ts:234 — 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 · restamp.tentativeMentions (cognitive 24) · ×1
  • restamp.tentativeMentions (cognitive 24) lib/restamp.ts:346 — restamp.tentativeMentions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (10 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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-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 · approval-record.buildRow (cognitive 24) · ×1
  • approval-record.buildRow (cognitive 24) lib/approval-record.ts:168 — approval-record.buildRow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, ternaries 3 (7 pts), loops 2 (nesting depth added 7). Of this number, 20 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 · headless-artifacts.validateRun (cognitive 24) · ×1
  • headless-artifacts.validateRun (cognitive 24) lib/headless-artifacts.ts:501 — 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 · sealed-join.jsonRecords (cognitive 24) · ×1
  • sealed-join.jsonRecords (cognitive 24) lib/sealed-join.ts:60 — sealed-join.jsonRecords has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (9 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-receipt.planCarry (cognitive 24) · ×1
  • ship-receipt.planCarry (cognitive 24) lib/ship-receipt.ts:344 — ship-receipt.planCarry has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9, boolean chains 8, ternaries 4 (7 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 · ship-queue-screen.screenVerdict (cognitive 24) · ×1
  • ship-queue-screen.screenVerdict (cognitive 24) REDACTED:53 — ship-queue-screen.screenVerdict has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5 (7 pts), boolean chains 6 (nesting depth added 3). Of this number, 20 points are the body's own statements and 4 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-wave.waveStatus (cognitive 24) · ×1
  • ship-queue-wave.waveStatus (cognitive 24) crew/lib/ship-queue-wave.ts:499 — ship-queue-wave.waveStatus has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 6 (7 pts), boolean chains 2, loops 2 (nesting depth added 7). Of this number, 22 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 · ship-queue-train-verdict.classifyGate (cognitive 24) · ×1
  • ship-queue-train-verdict.classifyGate (cognitive 24) crew/lib/ship-queue-train-verdict.ts:53 — 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 · ship-queue-train-verdict.trainRebuild (cognitive 24) · ×1
  • ship-queue-train-verdict.trainRebuild (cognitive 24) crew/lib/ship-queue-train-verdict.ts:315 — ship-queue-train-verdict.trainRebuild has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 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 · 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 · prose-lint.lintProse (cognitive 24) · ×1
  • prose-lint.lintProse (cognitive 24) lib/prose-lint.ts:159 — prose-lint.lintProse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 7, boolean chains 5, ternaries 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 167, 192). 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 · archive-check.parseIssueList (cognitive 24) · ×1
  • archive-check.parseIssueList (cognitive 24) lib/archive-check.ts:57 — archive-check.parseIssueList has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (nesting depth added 6). Of this number, 22 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 · 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 · eval-plan.runPreregDiagnostics (cognitive 24) · ×1
  • eval-plan.runPreregDiagnostics (cognitive 24) lib/eval-plan.ts:187 — 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 · ship-budget-cli.cmdCheck (cognitive 24) · ×1
  • ship-budget-cli.cmdCheck (cognitive 24) lib/ship-budget-cli.ts:302 — ship-budget-cli.cmdCheck has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 4 (7 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 309, 312). 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 · 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 · 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 · ship-policy.compatErrors (cognitive 23) · ×1
  • ship-policy.compatErrors (cognitive 23) REDACTED:540 — ship-policy.compatErrors has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (11 pts), loops 1 (nesting depth added 3). 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 · redact-patterns.isSourceExpression (cognitive 23) · ×1
  • redact-patterns.isSourceExpression (cognitive 23) lib/redact-patterns.ts:1067 — redact-patterns.isSourceExpression has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, 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 · 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:321 — 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:2759 — 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 · terminal-agent-control.agentStatus (cognitive 23) · ×1
  • terminal-agent-control.agentStatus (cognitive 23) browse/src/terminal-agent-control.ts:365 — terminal-agent-control.agentStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, ternaries 3 (5 pts), 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 · meta-commands.buildPdfOptions (cognitive 23) · ×1
  • meta-commands.buildPdfOptions (cognitive 23) browse/src/meta-commands.ts:261 — 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 · restamp.queueOrderCheck (cognitive 23) · ×1
  • restamp.queueOrderCheck (cognitive 23) lib/restamp.ts:116 — restamp.queueOrderCheck has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 4, if/else 3 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · no-stop.parseDiff (cognitive 23) · ×1
  • no-stop.parseDiff (cognitive 23) lib/no-stop.ts:40 — no-stop.parseDiff has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 3, loops 1 (nesting depth added 5). Of this number, 20 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 · autoplan-shadow.publish (cognitive 23) · ×1
  • autoplan-shadow.publish (cognitive 23) lib/autoplan-shadow.ts:391 — autoplan-shadow.publish has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 5 (6 pts), boolean chains 4, error handling 3 (4 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 396, 421). 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 · bin-context.markerSlug (cognitive 23) · ×1
  • bin-context.markerSlug (cognitive 23) lib/bin-context.ts:359 — bin-context.markerSlug has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (6 pts), boolean chains 4, 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 · ship-receipt.computeCensus (cognitive 23) · ×1
  • ship-receipt.computeCensus (cognitive 23) lib/ship-receipt.ts:521 — 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-land.resolveReleaseConflicts (cognitive 23) · ×1
  • ship-queue-land.resolveReleaseConflicts (cognitive 23) lib/ship-queue-land.ts:67 — ship-queue-land.resolveReleaseConflicts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, ternaries 1 (3 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 · ship-queue-train-stamp.stampChain (cognitive 23) · ×1
  • ship-queue-train-stamp.stampChain (cognitive 23) crew/lib/ship-queue-train-stamp.ts:67 — ship-queue-train-stamp.stampChain has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (6 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 · generate.generate (cognitive 23) · ×1
  • generate.generate (cognitive 23) design/src/generate.ts:94 — 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:133 — 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 166, 139, 162, …). 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-route.scorePrompt (cognitive 23) · ×1
  • skill-route.scorePrompt (cognitive 23) lib/skill-route.ts:182 — skill-route.scorePrompt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (7 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 11). 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, split the body into named stages: move each independent step or branch 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-gates.runGateHook (cognitive 23) · ×1
  • skill-gates.runGateHook (cognitive 23) lib/skill-gates.ts:248 — skill-gates.runGateHook has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 2 (4 pts), error handling 3 (nesting depth added 3). Of this number, 20 points are the body's own statements and 3 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 · 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 · autoplan-shadow-reader.rowProblem (cognitive 23) · ×1
  • autoplan-shadow-reader.rowProblem (cognitive 23) REDACTED:116 — autoplan-shadow-reader.rowProblem has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, ternaries 1 (2 pts), 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 · 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 · eval-plan.dryRun (cognitive 23) · ×1
  • eval-plan.dryRun (cognitive 23) lib/eval-plan.ts:311 — eval-plan.dryRun has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 4, loops 2 (3 pts), error handling 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 9 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 · factory-scorecard.readMergedPrs (cognitive 23) · ×1
  • factory-scorecard.readMergedPrs (cognitive 23) REDACTED:172 — factory-scorecard.readMergedPrs has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 3 (7 pts), boolean chains 3, 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 · gstack-post.receiptRunIdSpans (cognitive 23) · ×1
  • gstack-post.receiptRunIdSpans (cognitive 23) lib/gstack-post.ts:519 — gstack-post.receiptRunIdSpans has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), boolean chains 2, error handling 1 (2 pts), ternaries 1 (nesting depth added 11). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (span, rows). 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 · review-sweep.quarantineStage (cognitive 23) · ×1
  • review-sweep.quarantineStage (cognitive 23) lib/review-sweep.ts:224 — review-sweep.quarantineStage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 5, error handling 1 (4 pts), loops 1 (nesting depth added 11). Of this number, 13 points are the body's own statements and 10 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 · review-depth.leanStep (cognitive 22) · ×1
  • review-depth.leanStep (cognitive 22) lib/review-depth.ts:425 — review-depth.leanStep has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 4 (8 pts), boolean chains 5 (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 · 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 · 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 · autoplan-state.readState (cognitive 22) · ×1
  • autoplan-state.readState (cognitive 22) lib/autoplan-state.ts:115 — 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 · bin-context.gitCommonDir (cognitive 22) · ×1
  • bin-context.gitCommonDir (cognitive 22) lib/bin-context.ts:171 — 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 · sealed-guard.sealedErrors (cognitive 22) · ×1
  • sealed-guard.sealedErrors (cognitive 22) lib/sealed-guard.ts:71 — sealed-guard.sealedErrors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, error handling 2, loops 2 (nesting depth added 2). Of this number, 11 points are the body's own statements and 11 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 · sealed-guard.evaluateSealed (cognitive 22) · ×1
  • sealed-guard.evaluateSealed (cognitive 22) lib/sealed-guard.ts:425 — sealed-guard.evaluateSealed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 5 (6 pts), loops 3 (4 pts), boolean chains 2, 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 · sealed-guard.renderSealed (cognitive 22) · ×1
  • sealed-guard.renderSealed (cognitive 22) lib/sealed-guard.ts:475 — sealed-guard.renderSealed has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 5 (7 pts), loops 7 (nesting depth added 4). 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 · config.guardErrors (cognitive 22) · ×1
  • config.guardErrors (cognitive 22) lib/pregate/config.ts:144 — 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 149, 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.effectiveOptions (cognitive 22) · ×1
  • import-graph.effectiveOptions (cognitive 22) lib/pregate/import-graph.ts:214 — 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:527 — 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 · flaky-exception.flakyRuns (cognitive 22) · ×1
  • flaky-exception.flakyRuns (cognitive 22) lib/pregate/flaky-exception.ts:137 — flaky-exception.flakyRuns has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · flaky-exception.reconcileJobs (cognitive 22) · ×1
  • flaky-exception.reconcileJobs (cognitive 22) lib/pregate/flaky-exception.ts:245 — flaky-exception.reconcileJobs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · review-collect.grepConsumers (cognitive 22) · ×1
  • review-collect.grepConsumers (cognitive 22) lib/review-collect.ts:171 — review-collect.grepConsumers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (5 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 7). 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 · ship-receipt-depth.exceptionProblems (cognitive 22) · ×1
  • ship-receipt-depth.exceptionProblems (cognitive 22) lib/ship-receipt-depth.ts:208 — ship-receipt-depth.exceptionProblems has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 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 · Watcher.emitConversation (cognitive 22) · ×1
  • Watcher.emitConversation (cognitive 22) lib/pr-wait.ts:375 — Watcher.emitConversation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, ternaries 2 (4 pts), loops 3 (nesting depth added 7). Of this number, 18 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 · Watcher.run (cognitive 22) · ×1
  • Watcher.run (cognitive 22) lib/pr-wait.ts:545 — Watcher.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 2 (4 pts), error handling 1 (2 pts), 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 · release-gate.collectRound (cognitive 22) · ×1
  • release-gate.collectRound (cognitive 22) crew/lib/release-gate.ts:313 — release-gate.collectRound has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (6 pts), boolean chains 4, loops 2 (3 pts), error handling 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 · 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 · skill-contract.runsCheck (cognitive 22) · ×1
  • skill-contract.runsCheck (cognitive 22) REDACTED:308 — skill-contract.runsCheck has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 13, if/else 9. 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 · skill-contract.checkContract (cognitive 22) · ×1
  • skill-contract.checkContract (cognitive 22) REDACTED:473 — skill-contract.checkContract has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 7). Of this number, 16 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 · ceo-review-gate.rankedRisksGap (cognitive 22) · ×1
  • ceo-review-gate.rankedRisksGap (cognitive 22) lib/ceo-review-gate.ts:48 — ceo-review-gate.rankedRisksGap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 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 · checks.healthDimensions (cognitive 22) · ×1
  • checks.healthDimensions (cognitive 22) lib/checks.ts:140 — checks.healthDimensions has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 14, ternaries 5 (6 pts), error handling 1, if/else 1 (nesting depth added 1). 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, 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 · 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 · review-fetch.splitCommands (cognitive 22) · ×1
  • review-fetch.splitCommands (cognitive 22) lib/review-fetch.ts:98 — review-fetch.splitCommands has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 1 (nesting depth added 7). Of this number, 20 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 · review-fetch.commandWords (cognitive 22) · ×1
  • review-fetch.commandWords (cognitive 22) lib/review-fetch.ts:117 — review-fetch.commandWords has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · review-targeted-delta.targetedDelta (cognitive 22) · ×1
  • review-targeted-delta.targetedDelta (cognitive 22) lib/review-targeted-delta.ts:22 — review-targeted-delta.targetedDelta has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9, boolean chains 7, ternaries 4 (6 pts) (nesting depth added 2). 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, 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-budget-cli.rebuildLedger (cognitive 22) · ×1
  • ship-budget-cli.rebuildLedger (cognitive 22) lib/ship-budget-cli.ts:490 — ship-budget-cli.rebuildLedger has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 5, if/else 4, error handling 1 (nesting depth added 1). Of this number, 20 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 · redact-engine.inStructuralToken (cognitive 21) · ×1
  • redact-engine.inStructuralToken (cognitive 21) REDACTED:781 — 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 · phase-publication-hook.verifyCloseEdits (cognitive 21) · ×1
  • phase-publication-hook.verifyCloseEdits (cognitive 21) autoplan/bin/phase-publication-hook.ts:408 — 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:1473 — 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 · ci-gate.parseChecks (cognitive 21) · ×1
  • ci-gate.parseChecks (cognitive 21) lib/ci-gate.ts:78 — 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 · 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 · no-stop.notEli5Only (cognitive 21) · ×1
  • no-stop.notEli5Only (cognitive 21) lib/no-stop.ts:117 — no-stop.notEli5Only 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 · autoplan-run.openPhase (cognitive 21) · ×1
  • autoplan-run.openPhase (cognitive 21) REDACTED:163 — autoplan-run.openPhase has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 6 (7 pts), boolean chains 3, loops 1 (nesting depth added 4). 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: 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 · sealed-join.delimitedRows (cognitive 21) · ×1
  • sealed-join.delimitedRows (cognitive 21) lib/sealed-join.ts:80 — sealed-join.delimitedRows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, 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 · sealed-guard.publishedViaPulls (cognitive 21) · ×1
  • sealed-guard.publishedViaPulls (cognitive 21) lib/sealed-guard.ts:330 — sealed-guard.publishedViaPulls has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 4). Of this number, 17 points are the body's own statements and 4 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 · sealed-guard.landedOnBase (cognitive 21) · ×1
  • sealed-guard.landedOnBase (cognitive 21) lib/sealed-guard.ts:367 — sealed-guard.landedOnBase has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 2, error handling 1, ternaries 1 (nesting depth added 3). 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: 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 · 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 · docs-only.classifyEntries (cognitive 21) · ×1
  • docs-only.classifyEntries (cognitive 21) lib/docs-only.ts:181 — docs-only.classifyEntries has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (6 pts), boolean chains 4, loops 1 (nesting depth added 3). Of this number, 17 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 · version-gate-train.regeneratedAtBase (cognitive 21) · ×1
  • version-gate-train.regeneratedAtBase (cognitive 21) crew/lib/version-gate-train.ts:57 — 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 · plan-record.readStore (cognitive 21) · ×1
  • plan-record.readStore (cognitive 21) lib/plan-record.ts:122 — plan-record.readStore has cognitive complexity 21 (threshold 15). Drivers by points: error handling 3 (9 pts), loops 3 (6 pts), if/else 2 (5 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 · 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 · ship-receipt.parseReviewLoop (cognitive 21) · ×1
  • ship-receipt.parseReviewLoop (cognitive 21) lib/ship-receipt.ts:479 — ship-receipt.parseReviewLoop has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, ternaries 2 (nesting depth added 1). 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: 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 · review-collect.collectLive (cognitive 21) · ×1
  • review-collect.collectLive (cognitive 21) lib/review-collect.ts:350 — review-collect.collectLive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 3 (5 pts), error handling 3 (4 pts), loops 1 (nesting depth added 4). Of this number, 13 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 · ship-queue-land.unstampLegacy (cognitive 21) · ×1
  • ship-queue-land.unstampLegacy (cognitive 21) lib/ship-queue-land.ts:118 — ship-queue-land.unstampLegacy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, ternaries 2, loops 1 (nesting depth added 4). 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 · ship-queue-train-verify.confirmMerged (cognitive 21) · ×1
  • ship-queue-train-verify.confirmMerged (cognitive 21) crew/lib/ship-queue-train-verify.ts:284 — ship-queue-train-verify.confirmMerged has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 6, if/else 4 (5 pts) (nesting depth added 6). 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 · ship-queue-train-land.trainLand (cognitive 21) · ×1
  • ship-queue-train-land.trainLand (cognitive 21) crew/lib/ship-queue-train-land.ts:296 — ship-queue-train-land.trainLand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, ternaries 4 (6 pts), boolean chains 5 (nesting depth added 2). 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: 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-forget.trainForget (cognitive 21) · ×1
  • ship-queue-train-forget.trainForget (cognitive 21) crew/lib/ship-queue-train-forget.ts:21 — ship-queue-train-forget.trainForget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 4 (7 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 · tags.detectRelaxation (cognitive 21) · ×1
  • tags.detectRelaxation (cognitive 21) lib/gate-diff/tags.ts:178 — 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 · 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 · 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 · factory-scorecard.readComments (cognitive 21) · ×1
  • factory-scorecard.readComments (cognitive 21) REDACTED:209 — factory-scorecard.readComments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), boolean chains 5, 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 · quarantine.reportLines (cognitive 21) · ×1
  • quarantine.reportLines (cognitive 21) lib/quarantine.ts:329 — quarantine.reportLines has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 4 (6 pts), loops 3 (5 pts), boolean chains 3 (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 · 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 · ship-parts.shipParts (cognitive 21) · ×1
  • ship-parts.shipParts (cognitive 21) lib/ship-parts.ts:119 — ship-parts.shipParts has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 4 (5 pts), error handling 2 (nesting depth added 1). Of this number, 17 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-preflight.simulate (cognitive 21) · ×1
  • ship-preflight.simulate (cognitive 21) lib/ship-preflight.ts:222 — ship-preflight.simulate has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 5 (8 pts), boolean chains 3, loops 1 (nesting depth added 6). Of this number, 20 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 · ship-receipt-prose.withoutApprovalsBlocks (cognitive 21) · ×1
  • ship-receipt-prose.withoutApprovalsBlocks (cognitive 21) lib/ship-receipt-prose.ts:72 — ship-receipt-prose.withoutApprovalsBlocks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 3, ternaries 1 (nesting depth added 6). Of this number, 11 points are the body's own statements and 10 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 · familyStop (cognitive 21) · ×1
  • familyStop (cognitive 21) REDACTED:121 — familyStop has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (7 pts), boolean chains 5, loops 1 (nesting depth added 8). Of this number, 20 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 · redact-patterns.jsSpans (cognitive 20) · ×1
  • redact-patterns.jsSpans (cognitive 20) lib/redact-patterns.ts:1007 — redact-patterns.jsSpans has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (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 · phase-publication-hook.autoplanReadRange (cognitive 20) · ×1
  • phase-publication-hook.autoplanReadRange (cognitive 20) autoplan/bin/phase-publication-hook.ts:315 — 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 · cookie-import-browser.withCookieReadRetry (cognitive 20) · ×1
  • cookie-import-browser.withCookieReadRetry (cognitive 20) REDACTED:259 — 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:527 — 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 · 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 · autoplan-export.aggregateFindings (cognitive 20) · ×1
  • autoplan-export.aggregateFindings (cognitive 20) lib/autoplan-export.ts:48 — 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 · 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 · 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 · doc-links.addedLines (cognitive 20) · ×1
  • doc-links.addedLines (cognitive 20) lib/doc-links.ts:79 — doc-links.addedLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 10). 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 · lanes.describe (cognitive 20) · ×1
  • lanes.describe (cognitive 20) lib/pregate/checks/lanes.ts:436 — lanes.describe has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 3, loops 3, 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 · 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 · run-check.gateInputsChanged (cognitive 20) · ×1
  • run-check.gateInputsChanged (cognitive 20) lib/pregate/run-check.ts:29 — run-check.gateInputsChanged has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 2, ternaries 2 (nesting depth added 3). Of this number, 16 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 · index.verifyPregate (cognitive 20) · ×1
  • index.verifyPregate (cognitive 20) REDACTED:222 — index.verifyPregate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, ternaries 5 (8 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · 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 · ship-receipt.heldBy (cognitive 20) · ×1
  • ship-receipt.heldBy (cognitive 20) lib/ship-receipt.ts:380 — ship-receipt.heldBy has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 5 (6 pts), boolean chains 5, loops 1 (nesting depth added 2). Of this number, 11 points are the body's own statements and 9 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 · ship-receipt-depth.receiptDepthVerdict (cognitive 20) · ×1
  • ship-receipt-depth.receiptDepthVerdict (cognitive 20) lib/ship-receipt-depth.ts:475 — ship-receipt-depth.receiptDepthVerdict has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 4 (5 pts), boolean chains 4 (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 · ship-queue-train-ready.dispatchScreen (cognitive 20) · ×1
  • ship-queue-train-ready.dispatchScreen (cognitive 20) crew/lib/ship-queue-train-ready.ts:147 — ship-queue-train-ready.dispatchScreen has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 6 (8 pts), boolean chains 4 (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 · ship-queue-train-init.trainInit (cognitive 20) · ×1
  • ship-queue-train-init.trainInit (cognitive 20) REDACTED:168 — ship-queue-train-init.trainInit has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 6, boolean chains 3, loops 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.
D2 · Cognitive Complexity · review-dispatch-compare.newShip (cognitive 20) · ×1
  • review-dispatch-compare.newShip (cognitive 20) crew/scripts/review-dispatch-compare.ts:70 — review-dispatch-compare.newShip has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 2 (4 pts), loops 3 (4 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 · train-backstop.coveringRecord (cognitive 20) · ×1
  • train-backstop.coveringRecord (cognitive 20) crew/scripts/train-backstop.ts:62 — train-backstop.coveringRecord has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 16 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 · memory.updateDesignMd (cognitive 20) · ×1
  • memory.updateDesignMd (cognitive 20) design/src/memory.ts:117 — 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 · base-red.parseEvidence (cognitive 20) · ×1
  • base-red.parseEvidence (cognitive 20) lib/base-red.ts:45 — base-red.parseEvidence has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, 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 · claude-code-migration.copySkill (cognitive 20) · ×1
  • claude-code-migration.copySkill (cognitive 20) lib/claude-code-migration.ts:82 — claude-code-migration.copySkill has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 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 · 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 · office-hours-probe.resolveProbe (cognitive 20) · ×1
  • office-hours-probe.resolveProbe (cognitive 20) lib/office-hours-probe.ts:59 — office-hours-probe.resolveProbe has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5 (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 · pr-shots.diffLines (cognitive 20) · ×1
  • pr-shots.diffLines (cognitive 20) lib/pr-shots.ts:124 — 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 · quarantine.baseProblems (cognitive 20) · ×1
  • quarantine.baseProblems (cognitive 20) lib/quarantine.ts:257 — quarantine.baseProblems has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 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.
D2 · Cognitive Complexity · quarantine.readLedgers (cognitive 20) · ×1
  • quarantine.readLedgers (cognitive 20) lib/quarantine.ts:299 — quarantine.readLedgers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch 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-handoff.cmdVerifyHandoff (cognitive 20) · ×1
  • ship-handoff.cmdVerifyHandoff (cognitive 20) lib/ship-handoff.ts:164 — ship-handoff.cmdVerifyHandoff has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 7, boolean chains 3, 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 · ship-handoff.cmdReconcile (cognitive 20) · ×1
  • ship-handoff.cmdReconcile (cognitive 20) lib/ship-handoff.ts:256 — ship-handoff.cmdReconcile has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 6. None of this is in the body itself: all 20 points belong to 2 function literals inside it that branch (lines 258, 265). 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-receipt-prose.withoutExceptionLines (cognitive 20) · ×1
  • ship-receipt-prose.withoutExceptionLines (cognitive 20) lib/ship-receipt-prose.ts:106 — ship-receipt-prose.withoutExceptionLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (7 pts), ternaries 4 (nesting depth added 5). 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: 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 · 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:273 — 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 · redact-patterns.expressionTail (cognitive 19) · ×1
  • redact-patterns.expressionTail (cognitive 19) lib/redact-patterns.ts:1050 — redact-patterns.expressionTail has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, 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 · review-depth.nextStep (cognitive 19) · ×1
  • review-depth.nextStep (cognitive 19) lib/review-depth.ts:409 — review-depth.nextStep has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (7 pts), if/else 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · git.untrackedAsAdded (cognitive 19) · ×1
  • git.untrackedAsAdded (cognitive 19) lib/gate-diff/git.ts:350 — 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 · gstack-design-detect.probe · ×1
  • gstack-design-detect.probe::checkSkillDir (cognitive 19) bin/gstack-design-detect.ts:382 — 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:505 — 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:1485 — 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 · terminal-agent-control.acquireAgentStateLock (cognitive 19) · ×1
  • terminal-agent-control.acquireAgentStateLock (cognitive 19) browse/src/terminal-agent-control.ts:121 — terminal-agent-control.acquireAgentStateLock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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 · cli.runHeadedSupervisor (cognitive 19) · ×1
  • cli.runHeadedSupervisor (cognitive 19) browse/src/cli.ts:612 — 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 · session-tabs.runInSession (cognitive 19) · ×1
  • session-tabs.runInSession (cognitive 19) browse/src/session-tabs.ts:91 — session-tabs.runInSession has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, error handling 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 · eval-input-cache.sourceDependencyClosure (cognitive 19) · ×1
  • eval-input-cache.sourceDependencyClosure (cognitive 19) crew/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 · 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 · changelog-fragments.parseFragment (cognitive 19) · ×1
  • changelog-fragments.parseFragment (cognitive 19) lib/changelog-fragments.ts:39 — changelog-fragments.parseFragment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (nesting depth added 5). 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 into named stages: move each independent step or branch 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 · autoplan-shadow.shadowSwitch (cognitive 19) · ×1
  • autoplan-shadow.shadowSwitch (cognitive 19) lib/autoplan-shadow.ts:83 — autoplan-shadow.shadowSwitch has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 6, boolean chains 3 (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 · bin-context.findProjectMarker (cognitive 19) · ×1
  • bin-context.findProjectMarker (cognitive 19) lib/bin-context.ts:283 — bin-context.findProjectMarker has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (6 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 · supervise.groupCpuMs (cognitive 19) · ×1
  • supervise.groupCpuMs (cognitive 19) REDACTED:92 — supervise.groupCpuMs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 1 (3 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 · strays.run (cognitive 19) · ×1
  • strays.run (cognitive 19) lib/pregate/checks/strays.ts:18 — 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-train-record.parseNote (cognitive 19) · ×1
  • ship-queue-train-record.parseNote (cognitive 19) crew/lib/ship-queue-train-record.ts:342 — ship-queue-train-record.parseNote has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 8, error handling 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 · ship-queue.acceptedReceiptHeads (cognitive 19) · ×1
  • ship-queue.acceptedReceiptHeads (cognitive 19) lib/ship-queue.ts:86 — 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.reproduceGateAhead (cognitive 19) · ×1
  • ship-queue.reproduceGateAhead (cognitive 19) lib/ship-queue.ts:533 — 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 · gate-cost-replay.formatReport (cognitive 19) · ×1
  • gate-cost-replay.formatReport (cognitive 19) crew/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 · release-cut.verifySecurity (cognitive 19) · ×1
  • release-cut.verifySecurity (cognitive 19) REDACTED:344 — release-cut.verifySecurity has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4 (6 pts), boolean chains 3, loops 1 (nesting depth added 6). 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 · release-cut.cutRelease (cognitive 19) · ×1
  • release-cut.cutRelease (cognitive 19) REDACTED:563 — release-cut.cutRelease has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · train-backstop.freeze (cognitive 19) · ×1
  • train-backstop.freeze (cognitive 19) crew/scripts/train-backstop.ts:242 — train-backstop.freeze has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (12 pts), if/else 4, boolean chains 3 (nesting depth added 1). 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, 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 · autoplan-stop-gate.handle (cognitive 19) · ×1
  • autoplan-stop-gate.handle (cognitive 19) hosts/claude/hooks/autoplan-stop-gate.ts:94 — autoplan-stop-gate.handle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6 (nesting depth added 1). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 103). 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 · 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 · 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 · design-build.parseInventory (cognitive 19) · ×1
  • design-build.parseInventory (cognitive 19) lib/design-build.ts:70 — design-build.parseInventory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 6, ternaries 2, error handling 1, loops 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 · design-build.parseInventory.states (cognitive 19) · ×1
  • design-build.parseInventory.states (cognitive 19) lib/design-build.ts:87 — design-build.parseInventory.states has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
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:294 — 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 295). 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 · harness-register.planPayload (cognitive 19) · ×1
  • harness-register.planPayload (cognitive 19) REDACTED:395 — harness-register.planPayload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 3 (6 pts), boolean chains 2, ternaries 2 (nesting depth added 4). Of this number, 10 points are the body's own statements and 9 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 · harness-register.finishHook (cognitive 19) · ×1
  • harness-register.finishHook (cognitive 19) REDACTED:568 — harness-register.finishHook has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 6, if/else 5 (6 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · motion-encode.manifestError (cognitive 19) · ×1
  • motion-encode.manifestError (cognitive 19) lib/motion-encode.ts:40 — motion-encode.manifestError has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 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 · review-evidence.reviewFreshness (cognitive 19) · ×1
  • review-evidence.reviewFreshness (cognitive 19) lib/review-evidence.ts:364 — review-evidence.reviewFreshness has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 3 (4 pts) (nesting depth added 1). 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: 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-budget-cli.cmdNote (cognitive 19) · ×1
  • ship-budget-cli.cmdNote (cognitive 19) lib/ship-budget-cli.ts:392 — ship-budget-cli.cmdNote has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 6, if/else 4 (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 one function literal inside it that branches (line 398). 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 · redact-patterns.isPropertyRead (cognitive 18) · ×1
  • redact-patterns.isPropertyRead (cognitive 18) lib/redact-patterns.ts:1231 — redact-patterns.isPropertyRead has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 3 (4 pts), loops 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 · gstack-autoplan-snapshot.methodologyContent (cognitive 18) · ×1
  • gstack-autoplan-snapshot.methodologyContent (cognitive 18) bin/gstack-autoplan-snapshot.ts:516 — gstack-autoplan-snapshot.methodologyContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, 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.closePacket (cognitive 18) · ×1
  • phase-publication-hook.closePacket (cognitive 18) autoplan/bin/phase-publication-hook.ts:345 — 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-memory-helpers.freshDetectEngineTier (cognitive 18) · ×1
  • gstack-memory-helpers.freshDetectEngineTier (cognitive 18) lib/gstack-memory-helpers.ts:399 — gstack-memory-helpers.freshDetectEngineTier has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (6 pts), error handling 3 (5 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:2639 — 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 · device-emulation.userAgentMetadata (cognitive 18) · ×1
  • device-emulation.userAgentMetadata (cognitive 18) browse/src/device-emulation.ts:86 — device-emulation.userAgentMetadata has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (17 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 · snapshot.parseSnapshotArgs (cognitive 18) · ×1
  • snapshot.parseSnapshotArgs (cognitive 18) browse/src/snapshot.ts:52 — 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 · recover-receipts.negativesFromRun (cognitive 18) · ×1
  • recover-receipts.negativesFromRun (cognitive 18) crew/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 · changelog-check.changelogDamage (cognitive 18) · ×1
  • changelog-check.changelogDamage (cognitive 18) lib/changelog-check.ts:188 — 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 · 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 · restamp.parseUnifiedDiff (cognitive 18) · ×1
  • restamp.parseUnifiedDiff (cognitive 18) lib/restamp.ts:260 — restamp.parseUnifiedDiff has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, 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 · autoplan-gate.challengeDefault (cognitive 18) · ×1
  • autoplan-gate.challengeDefault (cognitive 18) REDACTED:174 — 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 · no-stop.checkNoStop (cognitive 18) · ×1
  • no-stop.checkNoStop (cognitive 18) lib/no-stop.ts:137 — no-stop.checkNoStop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (5 pts), boolean chains 3 (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 · ApiRunner.run (cognitive 18) · ×1
  • ApiRunner.run (cognitive 18) lib/outside-voice-runner.ts:183 — ApiRunner.run has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 2, boolean chains 1, 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-shadow.parsePage (cognitive 18) · ×1
  • autoplan-shadow.parsePage (cognitive 18) lib/autoplan-shadow.ts:229 — autoplan-shadow.parsePage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 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 · bin-context.markerIgnoredReason (cognitive 18) · ×1
  • bin-context.markerIgnoredReason (cognitive 18) lib/bin-context.ts:250 — bin-context.markerIgnoredReason has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 1, 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 · sealed-join.fileRecords (cognitive 18) · ×1
  • sealed-join.fileRecords (cognitive 18) lib/sealed-join.ts:119 — sealed-join.fileRecords has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (4 pts), boolean chains 3, ternaries 2 (3 pts), error handling 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 · sealed-join.changedFiles (cognitive 18) · ×1
  • sealed-join.changedFiles (cognitive 18) lib/sealed-join.ts:158 — sealed-join.changedFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sealed-join.joinFindings (cognitive 18) · ×1
  • sealed-join.joinFindings (cognitive 18) lib/sealed-join.ts:208 — sealed-join.joinFindings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 5 (7 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). Of this number, 15 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 · workflows.outline (cognitive 18) · ×1
  • workflows.outline (cognitive 18) lib/pregate/workflows.ts:49 — 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:129 — 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 · docs-only.pathRefusal (cognitive 18) · ×1
  • docs-only.pathRefusal (cognitive 18) lib/docs-only.ts:133 — docs-only.pathRefusal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (6 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 · lanes.parseSummary (cognitive 18) · ×1
  • lanes.parseSummary (cognitive 18) lib/pregate/checks/lanes.ts:346 — lanes.parseSummary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 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 · secrets.parsePostimages (cognitive 18) · ×1
  • secrets.parsePostimages (cognitive 18) lib/pregate/checks/secrets.ts:56 — secrets.parsePostimages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · flaky-exception.flakyDecision (cognitive 18) · ×1
  • flaky-exception.flakyDecision (cognitive 18) lib/pregate/flaky-exception.ts:365 — flaky-exception.flakyDecision has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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 · ship-receipt-depth.receiptReviewAtHead (cognitive 18) · ×1
  • ship-receipt-depth.receiptReviewAtHead (cognitive 18) lib/ship-receipt-depth.ts:107 — ship-receipt-depth.receiptReviewAtHead has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 6, if/else 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 · ship-queue-train-stamp.stampMismatch (cognitive 18) · ×1
  • ship-queue-train-stamp.stampMismatch (cognitive 18) crew/lib/ship-queue-train-stamp.ts:44 — ship-queue-train-stamp.stampMismatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 pts), boolean chains 3 (nesting depth added 5). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch 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-gate.readWorkflowAttempt (cognitive 18) · ×1
  • ship-queue-train-gate.readWorkflowAttempt (cognitive 18) crew/lib/ship-queue-train-gate.ts:443 — ship-queue-train-gate.readWorkflowAttempt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 3 (4 pts), 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 · archive-check.checkThread (cognitive 18) · ×1
  • archive-check.checkThread (cognitive 18) lib/archive-check.ts:125 — archive-check.checkThread has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 1 (2 pts), ternaries 2, 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 · autoplan-public.validatePublic (cognitive 18) · ×1
  • autoplan-public.validatePublic (cognitive 18) lib/autoplan-public.ts:130 — 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 · 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:158 — 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:537 — 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 · 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 · greptile-early.detect (cognitive 18) · ×1
  • greptile-early.detect (cognitive 18) lib/greptile-early.ts:126 — greptile-early.detect has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 7 (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.send (cognitive 18) · ×1
  • gstack-post.send (cognitive 18) lib/gstack-post.ts:617 — gstack-post.send has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (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 · harness-start-hook.inspectHook (cognitive 18) · ×1
  • harness-start-hook.inspectHook (cognitive 18) lib/harness-start-hook.ts:189 — harness-start-hook.inspectHook has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, ternaries 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 · harness-register.withBlock (cognitive 18) · ×1
  • harness-register.withBlock (cognitive 18) REDACTED:473 — harness-register.withBlock has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 3 (4 pts), boolean chains 3 (nesting depth added 7). 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 · repo-state-clean.parseCleanArgs (cognitive 18) · ×1
  • repo-state-clean.parseCleanArgs (cognitive 18) lib/repo-state-clean.ts:84 — repo-state-clean.parseCleanArgs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, ternaries 1 (3 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 · review-ledger.parseReply (cognitive 18) · ×1
  • review-ledger.parseReply (cognitive 18) lib/review-ledger.ts:340 — review-ledger.parseReply has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 3 (4 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 · ship-patch.zeroHunks (cognitive 18) · ×1
  • ship-patch.zeroHunks (cognitive 18) lib/ship-patch.ts:67 — ship-patch.zeroHunks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 3 (5 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 · runaway.emptyWakes (cognitive 18) · ×1
  • runaway.emptyWakes (cognitive 18) lib/runaway.ts:77 — runaway.emptyWakes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, ternaries 2 (3 pts), loops 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 6 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-budget-cli.cmdCalls (cognitive 18) · ×1
  • ship-budget-cli.cmdCalls (cognitive 18) lib/ship-budget-cli.ts:416 — ship-budget-cli.cmdCalls has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 4, if/else 3 (4 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 · claude-journal-records.compactionCycle (cognitive 17) · ×1
  • claude-journal-records.compactionCycle (cognitive 17) lib/claude-journal-records.ts:431 — 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 · ship-policy-mechanical.mechanicalErrors (cognitive 17) · ×1
  • ship-policy-mechanical.mechanicalErrors (cognitive 17) REDACTED:21 — ship-policy-mechanical.mechanicalErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 2. Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 25, 35, 41, …). 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-policy.workflowsGateErrors (cognitive 17) · ×1
  • ship-policy.workflowsGateErrors (cognitive 17) REDACTED:381 — ship-policy.workflowsGateErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 3, 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 · ship-policy.baseRedErrors (cognitive 17) · ×1
  • ship-policy.baseRedErrors (cognitive 17) REDACTED:602 — ship-policy.baseRedErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 2). Of this number, 9 points are the body's own statements and 8 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 · 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 · phase-publication-hook.linkedWorktrees (cognitive 17) · ×1
  • phase-publication-hook.linkedWorktrees (cognitive 17) autoplan/bin/phase-publication-hook.ts:637 — 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-design-detect.writeTop (cognitive 17) · ×1
  • gstack-design-detect.writeTop (cognitive 17) bin/gstack-design-detect.ts:1015 — 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:656 — 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 · aside-render.resolveBrowseBin (cognitive 17) · ×1
  • aside-render.resolveBrowseBin (cognitive 17) lib/aside-render.ts:463 — aside-render.resolveBrowseBin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (5 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 · 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-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 · eval-input-cache.buildEvalInputIdentity (cognitive 17) · ×1
  • eval-input-cache.buildEvalInputIdentity (cognitive 17) crew/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 · changelog-check.mergeChangelogsWithNotes (cognitive 17) · ×1
  • changelog-check.mergeChangelogsWithNotes (cognitive 17) lib/changelog-check.ts:369 — changelog-check.mergeChangelogsWithNotes has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 5, if/else 5, ternaries 4 (5 pts), loops 2 (nesting depth added 1). 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, 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 · approval-record.locate (cognitive 17) · ×1
  • approval-record.locate (cognitive 17) lib/approval-record.ts:76 — approval-record.locate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (3 pts), boolean chains 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 · sealed-guard.spoolGit (cognitive 17) · ×1
  • sealed-guard.spoolGit (cognitive 17) lib/sealed-guard.ts:105 — sealed-guard.spoolGit has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 2, if/else 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 · install-verdict.verdictFileProblem (cognitive 17) · ×1
  • install-verdict.verdictFileProblem (cognitive 17) lib/install-verdict.ts:162 — install-verdict.verdictFileProblem 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 · starter.starterPolicy (cognitive 17) · ×1
  • starter.starterPolicy (cognitive 17) lib/pregate/starter.ts:33 — starter.starterPolicy has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 5, if/else 2 (3 pts), loops 2 (nesting depth added 3). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch 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.runRemote (cognitive 17) · ×1
  • lanes.runRemote (cognitive 17) lib/pregate/checks/lanes.ts:504 — lanes.runRemote has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 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 · allowlist.applyAllowlist (cognitive 17) · ×1
  • allowlist.applyAllowlist (cognitive 17) REDACTED:56 — allowlist.applyAllowlist has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 5, ternaries 2 (5 pts), loops 1 (nesting depth added 6). Of this number, 12 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 · release-stamp.openRelease (cognitive 17) · ×1
  • release-stamp.openRelease (cognitive 17) lib/release-stamp.ts:108 — release-stamp.openRelease has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (4 pts), boolean chains 2, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · tree-receipt.classifyFiles (cognitive 17) · ×1
  • tree-receipt.classifyFiles (cognitive 17) lib/tree-receipt.ts:60 — tree-receipt.classifyFiles has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 4). 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, split the body into named stages: move each independent step or branch 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 · gate-dispositions.openShipRunsOn (cognitive 17) · ×1
  • gate-dispositions.openShipRunsOn (cognitive 17) lib/gate-dispositions.ts:104 — gate-dispositions.openShipRunsOn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 5). 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 · gate-dispositions.withGateLock (cognitive 17) · ×1
  • gate-dispositions.withGateLock (cognitive 17) lib/gate-dispositions.ts:125 — gate-dispositions.withGateLock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue.stampPreflight (cognitive 17) · ×1
  • ship-queue.stampPreflight (cognitive 17) lib/ship-queue.ts:409 — 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 · pr-wait-github.runGh (cognitive 17) · ×1
  • pr-wait-github.runGh (cognitive 17) lib/pr-wait-github.ts:82 — pr-wait-github.runGh has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts), loops 1 (nesting depth added 4). 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 · ship-queue-land.repair (cognitive 17) · ×1
  • ship-queue-land.repair (cognitive 17) lib/ship-queue-land.ts:269 — ship-queue-land.repair has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, 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 · ship-queue-train-gate.baseRedAdmission (cognitive 17) · ×1
  • ship-queue-train-gate.baseRedAdmission (cognitive 17) crew/lib/ship-queue-train-gate.ts:79 — ship-queue-train-gate.baseRedAdmission has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 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 · ship-queue-train-gate.runCommands (cognitive 17) · ×1
  • ship-queue-train-gate.runCommands (cognitive 17) crew/lib/ship-queue-train-gate.ts:370 — ship-queue-train-gate.runCommands has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · train-gate.trainPrefixes (cognitive 17) · ×1
  • train-gate.trainPrefixes (cognitive 17) crew/scripts/train-gate.ts:200 — train-gate.trainPrefixes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, 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 · ship-queue-train-ready.verifyScreen (cognitive 17) · ×1
  • ship-queue-train-ready.verifyScreen (cognitive 17) crew/lib/ship-queue-train-ready.ts:323 — ship-queue-train-ready.verifyScreen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, ternaries 3 (5 pts), boolean chains 3, error handling 1, match/switch 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 · 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 · review-dispatch-compare.legacyShip (cognitive 17) · ×1
  • review-dispatch-compare.legacyShip (cognitive 17) crew/scripts/review-dispatch-compare.ts:49 — review-dispatch-compare.legacyShip has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (6 pts), loops 4 (5 pts), boolean chains 4, if/else 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · prose-lint.lintFiles (cognitive 17) · ×1
  • prose-lint.lintFiles (cognitive 17) lib/prose-lint.ts:239 — prose-lint.lintFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1, loops 1 (nesting depth added 9). 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 · base-red.classifyBaseRed (cognitive 17) · ×1
  • base-red.classifyBaseRed (cognitive 17) lib/base-red.ts:94 — base-red.classifyBaseRed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 4, ternaries 3 (4 pts) (nesting depth added 1). Of this number, 12 points are the body's own statements and 5 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 · 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 · cli.bindRecheckEvidence.evidence (cognitive 17) · ×1
  • cli.bindRecheckEvidence.evidence (cognitive 17) REDACTED:1190 — cli.bindRecheckEvidence.evidence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 · gstack-post.targetNumber (cognitive 17) · ×1
  • gstack-post.targetNumber (cognitive 17) lib/gstack-post.ts:391 — 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 · 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:186 — 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 · repo-state-clean.applyClean (cognitive 17) · ×1
  • repo-state-clean.applyClean (cognitive 17) lib/repo-state-clean.ts:308 — repo-state-clean.applyClean has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 15 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 · repo-state-clean.run (cognitive 17) · ×1
  • repo-state-clean.run (cognitive 17) lib/repo-state-clean.ts:377 — repo-state-clean.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 1 (3 pts), error handling 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 · skill-bill.buildSkillBill (cognitive 17) · ×1
  • skill-bill.buildSkillBill (cognitive 17) REDACTED:188 — skill-bill.buildSkillBill has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, ternaries 2 (4 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 · 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 · 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 · 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 · ship-policy.docsErrors (cognitive 16) · ×1
  • ship-policy.docsErrors (cognitive 16) REDACTED:586 — ship-policy.docsErrors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 2, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 592). 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 · redact-engine.normalizeOriginal (cognitive 16) · ×1
  • redact-engine.normalizeOriginal (cognitive 16) REDACTED:147 — 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 · 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:84 — 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 · aside-render.openBrowseTab (cognitive 16) · ×1
  • aside-render.openBrowseTab (cognitive 16) lib/aside-render.ts:572 — aside-render.openBrowseTab has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (3 pts), boolean chains 2, 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 · config.ensureStateDir (cognitive 16) · ×1
  • config.ensureStateDir (cognitive 16) REDACTED:122 — config.ensureStateDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 4 (5 pts), ternaries 2 (3 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 · 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 · proxy-config.resolveProxy (cognitive 16) · ×1
  • proxy-config.resolveProxy (cognitive 16) REDACTED:356 — proxy-config.resolveProxy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, error handling 1 (2 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 · BrowserManager.recreateContext (cognitive 16) · ×1
  • BrowserManager.recreateContext (cognitive 16) browse/src/browser-manager.ts:2011 — 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 · cookie-import-browser.openDbFromCopy (cognitive 16) · ×1
  • cookie-import-browser.openDbFromCopy (cognitive 16) REDACTED:529 — 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 · gate-list.renderGate (cognitive 16) · ×1
  • gate-list.renderGate (cognitive 16) lib/gate-list.ts:130 — gate-list.renderGate has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 6, loops 2, boolean chains 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 139). 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-budget.applyCapChoices (cognitive 16) · ×1
  • autoplan-budget.applyCapChoices (cognitive 16) lib/autoplan-budget.ts:176 — 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) REDACTED:534 — 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.withoutCode (cognitive 16) · ×1
  • outside-review-result.withoutCode (cognitive 16) lib/outside-review-result.ts:189 — outside-review-result.withoutCode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 203, 210). 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 · headless-artifacts.checkGateSettled (cognitive 16) · ×1
  • headless-artifacts.checkGateSettled (cognitive 16) lib/headless-artifacts.ts:557 — 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 · sealed-guard.pathFindings (cognitive 16) · ×1
  • sealed-guard.pathFindings (cognitive 16) lib/sealed-guard.ts:210 — 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 · 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:109 — 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 · regen.run (cognitive 16) · ×1
  • regen.run (cognitive 16) lib/pregate/checks/regen.ts:12 — regen.run has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 6, boolean chains 2 (nesting depth added 2). 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, 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 · secrets.parseAddedLineNumbers (cognitive 16) · ×1
  • secrets.parseAddedLineNumbers (cognitive 16) lib/pregate/checks/secrets.ts:40 — secrets.parseAddedLineNumbers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 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 · issue-links.relatedPrs (cognitive 16) · ×1
  • issue-links.relatedPrs (cognitive 16) lib/issue-links.ts:154 — 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 · ship-receipt.receiptSummaryLine (cognitive 16) · ×1
  • ship-receipt.receiptSummaryLine (cognitive 16) lib/ship-receipt.ts:185 — ship-receipt.receiptSummaryLine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4. 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 · review-collect.shebangCandidates (cognitive 16) · ×1
  • review-collect.shebangCandidates (cognitive 16) lib/review-collect.ts:280 — review-collect.shebangCandidates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 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.
D2 · Cognitive Complexity · review-exclude.pathReason (cognitive 16) · ×1
  • review-exclude.pathReason (cognitive 16) lib/review-exclude.ts:278 — review-exclude.pathReason has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 1 (2 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 · review-platform.platformReviewAt (cognitive 16) · ×1
  • review-platform.platformReviewAt (cognitive 16) lib/review-platform.ts:19 — review-platform.platformReviewAt has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 5, if/else 3, error handling 1 (nesting depth added 2). 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: 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-wait.resolveTarget (cognitive 16) · ×1
  • pr-wait.resolveTarget (cognitive 16) lib/pr-wait.ts:579 — pr-wait.resolveTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (6 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-queue-train-gate.classifyWorkflowRun (cognitive 16) · ×1
  • ship-queue-train-gate.classifyWorkflowRun (cognitive 16) crew/lib/ship-queue-train-gate.ts:127 — ship-queue-train-gate.classifyWorkflowRun has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 2, 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 · train-gate.plannedCases (cognitive 16) · ×1
  • train-gate.plannedCases (cognitive 16) crew/scripts/train-gate.ts:122 — 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.
D2 · Cognitive Complexity · ship-recheck.planRecheck (cognitive 16) · ×1
  • ship-recheck.planRecheck (cognitive 16) crew/lib/ship-recheck.ts:45 — ship-recheck.planRecheck has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, ternaries 1 (2 pts), boolean chains 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 · gate-cost-replay.listRunsByDay (cognitive 16) · ×1
  • gate-cost-replay.listRunsByDay (cognitive 16) crew/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 · measure-journal-read.main (cognitive 16) · ×1
  • measure-journal-read.main (cognitive 16) crew/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 · train-backstop.rewriteFreeze (cognitive 16) · ×1
  • train-backstop.rewriteFreeze (cognitive 16) crew/scripts/train-backstop.ts:202 — train-backstop.rewriteFreeze has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 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 · 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 · ceo-review-gate.handle (cognitive 16) · ×1
  • ceo-review-gate.handle (cognitive 16) hosts/claude/hooks/ceo-review-gate.ts:50 — ceo-review-gate.handle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 3, error handling 1. Of this number, 10 points are the body's own statements and 6 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 · 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 · autoplan-owner-words.pass (cognitive 16) · ×1
  • autoplan-owner-words.pass (cognitive 16) lib/autoplan-owner-words.ts:70 — autoplan-owner-words.pass has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (7 pts) (nesting depth added 9). 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 · 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 · junit.readCase (cognitive 16) · ×1
  • junit.readCase (cognitive 16) lib/junit.ts:148 — junit.readCase has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 1 (2 pts) (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 · 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 · gstack-post.receiptDigitTokens (cognitive 16) · ×1
  • gstack-post.receiptDigitTokens (cognitive 16) lib/gstack-post.ts:492 — gstack-post.receiptDigitTokens has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 1 (4 pts), boolean chains 2 (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 · 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 · repo-state-clean.candidates (cognitive 16) · ×1
  • repo-state-clean.candidates (cognitive 16) lib/repo-state-clean.ts:238 — repo-state-clean.candidates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (3 pts), loops 2 (3 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 · review-bots.record (cognitive 16) · ×1
  • review-bots.record (cognitive 16) REDACTED:177 — review-bots.record has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 3 (4 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 1). 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: 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-bin-common.laneLine (cognitive 16) · ×1
  • ship-bin-common.laneLine (cognitive 16) lib/ship-bin-common.ts:246 — ship-bin-common.laneLine has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ship-budget.admitReviewStart (cognitive 16) · ×1
  • ship-budget.admitReviewStart (cognitive 16) lib/ship-budget.ts:573 — ship-budget.admitReviewStart has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 5, if/else 5 (nesting depth added 3). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 576). 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 · ship-preflight.tests (cognitive 16) · ×1
  • ship-preflight.tests (cognitive 16) lib/ship-preflight.ts:196 — ship-preflight.tests has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (8 pts), loops 3 (5 pts), if/else 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · modelOf (cognitive 16) · ×1
  • modelOf (cognitive 16) REDACTED:111 — modelOf has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, ternaries 6. 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyMethods · ×1
  • TooManyMethods: BrowserManager browse/src/browser-manager.ts:340 — TooManyMethods — 89 methods. The bar is 30 methods; this is 59 over it, 2.97× 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: BrowserManager (LCOM4 4) browse/src/browser-manager.ts:340 — 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 558 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.
P3 · Security & performance tooling · Secret scanning runs, but gates no merge · ×1
  • Secret scanning runs, but gates no merge .github/workflows/platform-qualification.yml:9 — `.github/workflows/platform-qualification.yml` runs a secret scanner, but none of its triggers fires before a merge (no pull request, merge queue or unfiltered push), and no other workflow runs one that does. A change that commits a credential merges unscanned, and the scan reports it afterwards, when the secret is already in the default branch's history and must be rotated. Add the pull-request trigger to this workflow.
R10 · Code Duplication · Duplication concentrated across 11 sibling directories (39 clone groups) · ×1
  • Duplication concentrated across 11 sibling directories (39 clone groups) browse/src/browse-client.ts:34 — 39 duplicated blocks under the repository root have copies in at least two of the sibling directories browse, browser-skills, crew, design, design-review, extension (+5 more sibling(s) not listed) — 27 of them are reported below, and 12 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 39 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 39 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 39 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 (139 identical lines × 2 files) · ×1
  • Wholesale file copy (139 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 — 139 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 (60 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (60 matched lines × 2 locations) browse/src/snapshot.ts:333 — browse/src/snapshot.ts:333 · browse/src/snapshot.ts:464 — the two spans are one implementation copied and then locally edited — 491 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 (38 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (38 matched lines × 2 locations) design/src/evolve.ts:25 — design/src/evolve.ts:25 · design/src/iterate.ts:23 — the two spans are one implementation copied and then locally edited — 302 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (30 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (30 matched lines × 2 locations) hosts/claude/hooks/question-log-hook.ts:44 — hosts/claude/hooks/question-log-hook.ts:44 · hosts/claude/hooks/question-preference-hook.ts:56 — the two spans are one implementation copied and then locally edited — 207 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:438 — design/src/daemon.ts:438 · 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 (19 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (19 matched lines × 2 locations) crew/lib/gate-cost-history.ts:372 — crew/lib/gate-cost-history.ts:372 · crew/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 (19 lines × 2 locations) · ×1
  • Duplicated block (19 lines × 2 locations) design/src/evolve.ts:86 — design/src/evolve.ts:86 · design/src/generate.ts:52 — 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 (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) crew/lib/ship-queue-gate.ts:79 — crew/lib/ship-queue-gate.ts:79 · crew/lib/ship-queue-train.ts:160 — 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 (17 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (17 matched lines × 2 locations) lib/ruled-notes.ts:21 — lib/ruled-notes.ts:21 · lib/test-lane-exception.ts:24 — the two spans are one implementation copied and then locally edited — 248 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 (15 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (15 matched lines × 2 locations) design/src/daemon-state.ts:137 — design/src/daemon-state.ts:137 · 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 (14 lines × 3 locations) · ×1
  • 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.
R2 · Cyclomatic Complexity · Complex function handleWriteCommand (cyclomatic 321, cognitive 607) · ×1
  • Complex function handleWriteCommand (cyclomatic 321, cognitive 607) browse/src/write-commands.ts:136 — handleWriteCommand has cyclomatic complexity 321 and cognitive complexity 607; 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 handleMetaCommand (cyclomatic 173, cognitive 323) · ×1
  • Complex function handleMetaCommand (cyclomatic 173, cognitive 323) browse/src/meta-commands.ts:323 — handleMetaCommand has cyclomatic complexity 173 and cognitive complexity 323; 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 parseLabelled (cyclomatic 134, cognitive 160) · ×1
  • Complex function parseLabelled (cyclomatic 134, cognitive 160) lib/review-ledger.ts:195 — parseLabelled has cyclomatic complexity 134 and cognitive complexity 160; 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 124, cognitive 187) · ×1
  • Complex function runSkillTest (cyclomatic 124, cognitive 187) test/helpers/session-runner.ts:275 — runSkillTest has cyclomatic complexity 124 and cognitive complexity 187; 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 runPaidReport (cyclomatic 114, cognitive 166) · ×1
  • Complex function runPaidReport (cyclomatic 114, cognitive 166) scripts/lib/paid-report.ts:566 — runPaidReport has cyclomatic complexity 114 and cognitive complexity 166; 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:290 — 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:104 — 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 verify (cyclomatic 102, cognitive 182) · ×1
  • Complex function verify (cyclomatic 102, cognitive 182) lib/review-ledger.ts:566 — verify has cyclomatic complexity 102 and cognitive complexity 182; 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 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:45 — 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 land (cyclomatic 93, cognitive 142) · ×1
  • Complex function land (cyclomatic 93, cognitive 142) lib/ship-queue-land.ts:320 — land has cyclomatic complexity 93 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 register (cyclomatic 92, cognitive 115) · ×1
  • Complex function register (cyclomatic 92, cognitive 115) REDACTED:583 — register has cyclomatic complexity 92 and cognitive complexity 115; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function version (cyclomatic 91, cognitive 97) · ×1
  • Complex function version (cyclomatic 91, cognitive 97) lib/ship-release.ts:95 — version has cyclomatic complexity 91 and cognitive complexity 97; 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.
R2 · Cyclomatic Complexity · Complex function validateRuntimeCatalog (cyclomatic 89, cognitive 92) · ×1
  • Complex function validateRuntimeCatalog (cyclomatic 89, cognitive 92) REDACTED:171 — validateRuntimeCatalog has cyclomatic complexity 89 and cognitive complexity 92; 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 scanBash32CaseInSubstitution (cyclomatic 88, cognitive 143) · ×1
  • Complex function scanBash32CaseInSubstitution (cyclomatic 88, cognitive 143) test/helpers/bash32-case-scan.ts:18 — scanBash32CaseInSubstitution has cyclomatic complexity 88 and cognitive complexity 143; 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 verifySliceResults (cyclomatic 86, cognitive 148) · ×1
  • Complex function verifySliceResults (cyclomatic 86, cognitive 148) scripts/lib/paid-plan.ts:713 — verifySliceResults has cyclomatic complexity 86 and cognitive complexity 148; 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 engLibraryHooksFinding (cyclomatic 86, cognitive 79) · ×1
  • Complex function engLibraryHooksFinding (cyclomatic 86, cognitive 79) test/helpers/pty/boundaries.ts:336 — engLibraryHooksFinding has cyclomatic complexity 86 and cognitive complexity 79; 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 readCapturedEvents (cyclomatic 86, cognitive 58) · ×1
  • Complex function readCapturedEvents (cyclomatic 86, cognitive 58) test/helpers/plan-skill-question-events.ts:392 — readCapturedEvents has cyclomatic complexity 86 and cognitive complexity 58; 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 assertQaBrowserDeadline (cyclomatic 85, cognitive 98) · ×1
  • Complex function assertQaBrowserDeadline (cyclomatic 85, cognitive 98) test/helpers/qa-browser-deadline-evidence.ts:208 — assertQaBrowserDeadline has cyclomatic complexity 85 and cognitive complexity 98; 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 verifyRun (cyclomatic 84, cognitive 110) · ×1
  • Complex function verifyRun (cyclomatic 84, cognitive 110) lib/run-evidence.ts:163 — verifyRun has cyclomatic complexity 84 and cognitive complexity 110; 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 validatePolicy (cyclomatic 83, cognitive 101) · ×1
  • Complex function validatePolicy (cyclomatic 83, cognitive 101) REDACTED:454 — validatePolicy has cyclomatic complexity 83 and cognitive complexity 101; 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 route (cyclomatic 79, cognitive 103) · ×1
  • Complex function route (cyclomatic 79, cognitive 103) lib/ship-release.ts:378 — route has cyclomatic complexity 79 and cognitive complexity 103; 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 runPaidShard (cyclomatic 79, cognitive 86) · ×1
  • Complex function runPaidShard (cyclomatic 79, cognitive 86) scripts/test-paid-shards.ts:303 — runPaidShard has cyclomatic complexity 79 and cognitive complexity 86; 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 materializePreparedExport (cyclomatic 79, cognitive 83) · ×1
  • Complex function materializePreparedExport (cyclomatic 79, cognitive 83) lib/cso/preparation-docker.ts:258 — materializePreparedExport has cyclomatic complexity 79 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 79, cognitive 58) · ×1
  • Complex function (anonymous) (cyclomatic 79, cognitive 58) test/helpers/ceo-section-loading-fixture.ts:886 — (anonymous) has cyclomatic complexity 79 and cognitive complexity 58; 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 createContainer (cyclomatic 78, cognitive 69) · ×1
  • Complex function createContainer (cyclomatic 78, cognitive 69) REDACTED:627 — createContainer has cyclomatic complexity 78 and cognitive complexity 69; 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 77, cognitive 130) · ×1
  • Complex function main (cyclomatic 77, cognitive 130) browse/src/cli.ts:1820 — main has cyclomatic complexity 77 and cognitive complexity 130; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validateConfig (cyclomatic 77, cognitive 128) · ×1
  • Complex function validateConfig (cyclomatic 77, cognitive 128) lib/pregate/config.ts:190 — validateConfig has cyclomatic complexity 77 and cognitive complexity 128; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
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: 2333 lines of code browse/src/browser-manager.ts:1 — browse/src/browser-manager.ts has 2333 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: 2153 lines of code browse/src/cli.ts:1 — browse/src/cli.ts has 2153 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: 2147 lines of code scripts/test-free-shards.ts:1 — scripts/test-free-shards.ts has 2147 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: 2065 lines of code REDACTED:1 — REDACTED has 2065 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/redact-patterns.ts · ×1
  • lib/redact-patterns.ts: 1678 lines of code lib/redact-patterns.ts:1 — lib/redact-patterns.ts has 1678 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 · browse/src/write-commands.ts · ×1
  • browse/src/write-commands.ts: 1343 lines of code browse/src/write-commands.ts:1 — browse/src/write-commands.ts has 1343 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 · 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 · scripts/resolvers/design.ts · ×1
  • scripts/resolvers/design.ts: 1265 lines of code scripts/resolvers/design.ts:1 — scripts/resolvers/design.ts has 1265 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: 1150 lines of code browse/src/terminal-agent.ts:1 — browse/src/terminal-agent.ts has 1150 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 · scripts/gen-skill-docs.ts · ×1
  • scripts/gen-skill-docs.ts: 1105 lines of code scripts/gen-skill-docs.ts:1 — scripts/gen-skill-docs.ts has 1105 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 · browse/src/meta-commands.ts · ×1
  • browse/src/meta-commands.ts: 1052 lines of code browse/src/meta-commands.ts:1 — browse/src/meta-commands.ts has 1052 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 · 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 · lib/design-catalog.ts · ×1
  • lib/design-catalog.ts: 835 lines of code lib/design-catalog.ts:1 — lib/design-catalog.ts has 835 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: 821 lines of code REDACTED:1 — REDACTED has 821 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/ship-release.ts · ×1
  • lib/ship-release.ts: 805 lines of code lib/ship-release.ts:1 — lib/ship-release.ts has 805 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: 792 lines of code lib/result-codes.ts:1 — lib/result-codes.ts has 792 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: 788 lines of code make-pdf/src/diagram-prepass.ts:1 — make-pdf/src/diagram-prepass.ts has 788 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-report.ts · ×1
  • scripts/lib/paid-report.ts: 787 lines of code scripts/lib/paid-report.ts:1 — scripts/lib/paid-report.ts has 787 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/ship-measure.ts · ×1
  • scripts/ship-measure.ts: 775 lines of code scripts/ship-measure.ts:1 — scripts/ship-measure.ts 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 · lib/restamp.ts · ×1
  • lib/restamp.ts: 758 lines of code lib/restamp.ts:1 — lib/restamp.ts has 758 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: 747 lines of code REDACTED:1 — REDACTED has 747 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.
R4 · Test Coverage · This test file cannot be loaded · ×1
  • This test file cannot be loaded test/fixtures/design-lint/tailwind-fail/Hero.tsx:4 — test/fixtures/design-lint/tailwind-fail/Hero.tsx:4 imports './cn', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
R6 · Tooling · The declared test suite includes a file that cannot be loaded · ×1
  • The declared test suite includes a file that cannot be loaded test/fixtures/design-lint/tailwind-fail/Hero.tsx:4 — This repository declares test tooling, and the ✓ above records that declaration — but test/fixtures/design-lint/tailwind-fail/Hero.tsx cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
R7 · Dead Code · Dead file (~829 LoC) · ×1
  • Dead file (~829 LoC) lib/ship-release.ts — no import path from any entry point (999 application, 82 tooling, 2110 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 (~312 LoC) · ×1
  • Dead file (~312 LoC) lib/runaway.ts — no import path from any entry point (999 application, 82 tooling, 2110 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 (~296 LoC) · ×1
  • Dead file (~296 LoC) lib/ship-queue-land-direct.ts — no import path from any entry point (999 application, 82 tooling, 2110 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 (~278 LoC) · ×1
  • Dead file (~278 LoC) lib/ship-preflight.ts — no import path from any entry point (999 application, 82 tooling, 2110 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 (999 application, 82 tooling, 2110 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 (999 application, 82 tooling, 2110 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 (~132 LoC) · ×1
  • Dead file (~132 LoC) scripts/modules-cli.ts — no import path from any entry point (999 application, 82 tooling, 2110 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 (~115 LoC) · ×1
  • Dead file (~115 LoC) lib/ship-docs-result.ts — no import path from any entry point (999 application, 82 tooling, 2110 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 (~49 LoC) · ×1
  • Dead file (~49 LoC) lib/review-targeted-delta.ts — no import path from any entry point (999 application, 82 tooling, 2110 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 (~40 LoC) · ×1
  • Dead file (~40 LoC) lib/autoplan-admission.ts — no import path from any entry point (999 application, 82 tooling, 2110 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 (~39 LoC) · ×1
  • Dead file (~39 LoC) lib/remote-gate-stand-in.ts — no import path from any entry point (999 application, 82 tooling, 2110 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 — while test/fixtures/design-lint/tailwind-pass/Hero.tsx DOES import it and no package.json above that file declares it, so the import resolves through the copy this declaration installs. The declaration is misplaced rather than dead: removing it breaks that import. Move it to the package.json that owns the importing file (or, if the two packages are meant to share it, hoist it to the workspace root) rather than deleting it.
S1 · Web-Security Posture · Secure cookie flags not detected · ×1
  • Secure cookie flags not detected browse/src/cookie-picker-routes.ts:161 — The `gstack_picker` cookie (`Set-Cookie` header) carries who is signed in, and it is set without Secure. Without Secure the browser also sends it over plain http://, where anyone on the same network can read it. (−1.5 on this card.)
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×1
  • Process-global state is restored only on the happy path design/src/cli.ts:111 — `runSetup` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `GSTACK_DESIGN_PROVIDER` environment variable (set at line 146, put back at line 162) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between — or by a promise that rejects at an `await`, and while this function is suspended at one every other callback the event loop runs sees the moved value too: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or config read in ANY module resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the directory. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — the `cwd` and `env` options of `child_process.spawn`/`exec`/`execSync` (or `Deno.Command`) scope both to the CHILD — or build absolute paths with `path.resolve`. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
Minor — 175 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • 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:961 — `!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 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:50 — `!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 lib/runaway.ts:218 — `!d || typeof d !== 'object' || Array.isArray(d)` appears character-identically in 2 files — lib/runaway.ts, lib/ship-policy-docs-only.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/base-red.ts:47 — `!e || typeof e !== 'object' || Array.isArray(e)` appears character-identically in 3 files — lib/base-red.ts, lib/regen.ts, lib/ship-receipt-docs.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:446 — `!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:192 — `!parsed || typeof parsed !== 'object' || Array.isArray(parsed)` appears character-identically in 3 files — REDACTED, lib/ship-docs-result.ts, scripts/cso-public-ghcr.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 12 files — REDACTED, REDACTED, lib/ci-carry.ts, lib/design-build.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/autoplan-scope.ts:41 — `!rel || rel.startsWith('..') || path.isAbsolute(rel)` appears character-identically in 2 files — lib/autoplan-scope.ts, lib/review-fetch.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 14 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 crew/scripts/eval-input-cache.ts:128 — `Number.isSafeInteger(value) && Number(value) > 0` appears character-identically in 2 files — crew/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:78 — `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 lib/claude-usage.ts:33 — `env.CLAUDE_CONFIG_DIR || path.join(env.HOME || os.homedir(), '.claude')` appears character-identically in 2 files — lib/claude-usage.ts, lib/skill-route.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.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×40
  • 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:252 — `installedGstackVersion` swallows every exception into `return '0.0.0.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 autoplan/bin/phase-publication-hook.ts:647 — `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 lib/gate-diff/git.ts:413 — `readClaudeMd` 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-design-detect.ts:230 — `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:426 — `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:850 — `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 bin/gstack-global-discover.ts:541 — `scanKimiCode` 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-global-discover.ts:585 — `scanOmp` 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-global-discover.ts:622 — `countAntigravity` 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/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:628 — `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:1587 — `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:1618 — `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:1070 — `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 test/helpers/skill-census.ts:46 — `frontmatterName` 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.
  • + 15 more in this group — see findings.md.
D24 · Comment Value · redundant comment · ×32
  • redundant comment browse/src/cdp-inspector.ts:312 — "Get matched styles" repeats the code it sits on: 3 of its 3 words (get, matched, styles) are already in `const matchedData = await session.send('CSS.getMatchedStylesForNode', { nodeId });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment browse/src/cdp-inspector.ts:315 — "Get computed styles" repeats the code it sits on: 3 of its 3 words (get, computed, styles) are already in `const computedData = await session.send('CSS.getComputedStyleForNode', { nodeId });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment browse/src/cdp-inspector.ts:324 — "Get inline styles" repeats the code it sits on: 3 of its 3 words (get, inline, styles) are already in `const inlineData = await session.send('CSS.getInlineStylesForNode', { nodeId });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:1219 — "Run content filters" repeats the code it sits on: 3 of its 3 words (run, content, filters) are already in `const filterResult: ContentFilterResult = runContentFilters(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment browse/src/token-registry.ts:366 — "Create the session token" repeats the code it sits on: 3 of its 3 words (create, session, token) are already in `const session = createToken({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment browse/test/content-security.test.ts:361 — "Verify it's in the PAGE_CONTENT_COMMANDS set" repeats the code it sits on: 4 of its 5 words (page, content, commands, set) are already in `const setBlock = COMMANDS_SRC.slice(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment browse/test/cookie-import-browser.test.ts:165 — "Intercept security find-generic-password calls" repeats the code it sits on: 5 of its 6 words (security, find, generic, password, calls) are already in `if (Array.isArray(cmd) && cmd[0] === 'security' && cmd[1] === 'find-generic-password')`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment browse/test/file-drop.test.ts:194 — "Write a valid message" repeats the code it sits on: 3 of its 3 words (write, valid, message) are already in `writeTestInboxFile(inboxDir, 'valid message', 'https://example.com', '2024-06-15T10:30:00.000Z');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment browse/test/session-name.test.ts:17 — "400 bash -> 300 sh -> 200 <harness> -> 1" repeats the code it sits on: 6 of its 6 words (400, bash, 300, sh, 200, harness) are already in `const under = (harness: string) => table({ 400: [300, 'bash'], 300: [200, 'sh'], 200: [1, harness] });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment browse/test/sidebar-ux.test.ts:790 — "Step 1: sidepanel sends sidebarOpened when connected" repeats the code it sits on: 6 of its 6 words (step, sidepanel, sends, sidebar, opened, connected) are already in `test('step 1: sidepanel sends sidebarOpened message on connect', () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment browse/test/sidebar-ux.test.ts:842 — "Step 4: welcome page hides arrow on gstack-extension-ready" repeats the code it sits on: 8 of its 8 words (step, welcome, page, hides, arrow, gstack, extension, ready) are already in `test('step 4: welcome page hides arrow on gstack-extension-ready event', () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment design/prototype.ts:77 — "Find the image generation result in output" repeats the code it sits on: 4 of its 5 words (find, image, generation, output) are already in `const imageItem = data.output?.find((item: any) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment design/test/gallery.test.ts:136 — "All images are base64" repeats the code it sits on: 3 of its 3 words (images, base, 64) are already in `expect(html).toContain('data:image/png;base64,');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment extension/inspector.js:199 — "Box model from computed" repeats the code it sits on: 3 of its 3 words (box, model, computed) are already in `const boxModel = {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:387 — "Total budget: prefix + "-" + tail + "-" + hash" repeats the code it sits on: 4 of its 5 words (budget, prefix, tail, hash) are already in `const tailBudget = MAX - prefix.length - 2 - hash.length;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/eval-select.ts:36 — "Detect base branch" repeats the code it sits on: 3 of its 3 words (detect, base, branch) are already in `const baseBranch = baseOverride || detectBaseBranch(ROOT) || 'main';`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/lib/paid-select.ts:447 — "A registered file's case shard supervises its one case." repeats the code it sits on: 4 of its 5 words (registered, file, case, shard) are already in `const registeredMs = finding && shardCaseId(files[0]!) !== null`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/resolvers/testing.ts:377 — "── Check branches against tests + quality rubric (shared) ──" repeats the code it sits on: 6 of its 7 words (check, branches, against, tests, quality, rubric) are already in `sections.push(``. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/resolvers/testing.ts:622 — "── Test plan artifact (ship mode) ──" repeats the code it sits on: 4 of its 5 words (test, plan, artifact, ship) are already in `sections.push(``. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment test/brain-sync.test.ts:2067 — "Project data preserved." repeats the code it sits on: 3 of its 3 words (project, data, preserved) are already in `const preserved = fs.readFileSync(path.join(tmpHome, 'projects/user-data/learnings.jsonl'), 'utf-8');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment test/gen-skill-docs.test.ts:4238 — "Check for codex review with inline $(git rev-parse)" repeats the code it sits on: 6 of its 7 words (check, codex, review, git, rev, parse) are already in `if (line.includes('codex review') && line.includes('$(git rev-parse --show-toplevel)'))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment test/helpers/session-runner.test.ts:59 — "Fixture: minimal NDJSON session (system init, assistant with tool_use, tool result, assistant text, result)" repeats the code it sits on: 9 of its 11 words (fixture, session, system, init, assistant, tool, use, result, text) are already in `const FIXTURE_LINES = [`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment test/helpers/session-runner.ts:717 — "Parse all collected NDJSON lines" repeats the code it sits on: 4 of its 4 words (parse, collected, ndjson, lines) are already in `const parsed = parseNDJSON(collectedLines);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment test/ios-qa.test.ts:126 — "Restore with wrong schema hash" repeats the code it sits on: 4 of its 4 words (restore, wrong, schema, hash) are already in `const restoreR = await fetchJson('POST', `http://127.0.0.1:${daemon.loopbackPort}/state/restore`, {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment test/question-log-hook.test.ts:393 — "Error logged to hook-errors.log" repeats the code it sits on: 4 of its 5 words (error, hook, errors, log) are already in `const errLog = path.join(stateRoot, 'hook-errors.log');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 7 more in this group — see findings.md.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×7
  • 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/gh-poll.ts:49 — 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 REDACTED:89 — 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/no-stop.ts:102 — 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:1376 — 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/review-collect.ts:131 — 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 crew/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.
GD1 · Unfinished & placeholder code · Placeholder literal left in code · ×6
  • Placeholder literal left in code lib/design-catalog.ts:485 — A placeholder string ("Lorem ipsum") is still in shipped code — typical of generated boilerplate that was never filled in.
  • Placeholder literal left in code lib/design-catalog.ts:486 — A placeholder string ("Lorem ipsum where a visitor can read it.…") is still in shipped code — typical of generated boilerplate that was never filled in.
  • Placeholder literal left in code lib/design-catalog.ts:488 — A placeholder string ("Grep visible copy for "lorem ipsum".") is still in shipped code — typical of generated boilerplate that was never filled in.
  • Placeholder literal left in code lib/design-lint/rules/ids.ts:160 — A placeholder string ("lorem ipsum placeholder text") is still in shipped code — typical of generated boilerplate that was never filled in.
  • Placeholder literal left in code lib/redact-patterns.ts:689 — 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:690 — A placeholder string ("CHANGE_ME") is still in shipped code — typical of generated boilerplate that was never filled in.
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:92 — 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.
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:231 — `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.)
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×2
  • REDACTED
  • REDACTED
D21 · Naming Consistency · `getCookiePickerHTML` spells `HTML` where 19 names in the project spell it `Html` · ×1
  • `getCookiePickerHTML` spells `HTML` where 19 names in the project spell it `Html` browse/src/cookie-picker-ui.ts:10 — 19 of 20 names in project gstack spell the token `Html` (19 of 20; unit: names in project gstack containing `Html`). Peers: TabSession.loadedHtml (browse/src/tab-session.ts:69); TabSession.loadedHtmlWaitUntil (browse/src/tab-session.ts:70); TabSession.getLoadedHtml (browse/src/tab-session.ts:246); TabSession.clearLoadedHtml (browse/src/tab-session.ts:252); script.parseStoriesFromHtml (browser-skills/hackernews-frontpage/script.ts:53). Rename to `getCookiePickerHtml`. [rule N6]
D21 · Naming Consistency · `costUSD` spells `USD` where 71 names in the project spell it `Usd` · ×1
  • `costUSD` spells `USD` where 71 names in the project spell it `Usd` crew/lib/gate-cost.ts:46 — 71 of 72 names in project gstack spell the token `Usd` (71 of 72; unit: names in project gstack containing `Usd`). Peers: EvalTestRecord.costUsd (crew/lib/gate-cost.ts:55); ModelTokenClasses.pricedUsd (crew/lib/gate-cost.ts:129); ModelTokenClasses.recordedUsd (crew/lib/gate-cost.ts:130); GateCostBreakdown.recordedUsd (crew/lib/gate-cost.ts:135); GateSummary.recordedUsd (crew/lib/gate-cost.ts:178). Rename to `costUsd`. [rule N6]
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)` (186606 LoC, 2621 module-visible types across 37 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.
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:209 — 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 'branchExists' · ×1
  • Unused export 'branchExists' lib/approval-record.ts:60 — 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:217 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'repoVisibility' · ×1
  • Unused export 'repoVisibility' lib/approval-record.ts:251 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'renderMode' · ×1
  • Unused export 'renderMode' lib/approval-record.ts:270 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'checkCeoOnlyFlags' · ×1
  • Unused export 'checkCeoOnlyFlags' lib/autoplan-ceo-only.ts:39 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'refuseCeoOnly' · ×1
  • Unused export 'refuseCeoOnly' lib/autoplan-ceo-only.ts:53 — 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 'dispatchLine' · ×1
  • Unused export 'dispatchLine' lib/autoplan-export.ts:124 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'gateCostPayload' · ×1
  • Unused export 'gateCostPayload' lib/autoplan-gate-cost.ts:106 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'recommendGate' · ×1
  • Unused export 'recommendGate' REDACTED:280 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'migrateRun' · ×1
  • Unused export 'migrateRun' lib/autoplan-migrate.ts:53 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'reviseRun' · ×1
  • Unused export 'reviseRun' lib/autoplan-revise.ts:128 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'initRun' · ×1
  • Unused export 'initRun' REDACTED:87 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'nextStep' · ×1
  • Unused export 'nextStep' REDACTED:211 — Nothing imports THIS copy of 'nextStep' — but lib/review-depth.ts:409 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep lib/review-depth.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other.
R7 · Dead Code · Unused export 'submitResult' · ×1
  • Unused export 'submitResult' REDACTED:342 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'fitReservation' · ×1
  • Unused export 'fitReservation' REDACTED:438 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'markSent' · ×1
  • Unused export 'markSent' REDACTED:456 — 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 33/47 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~13.0 `!` null assertions per 1k TypeScript source lines — 2153 assertion(s) across the 165782 source line(s) of the 569 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: crew/lib/ship-queue-train-gate.ts (61), lib/ship-release.ts (54), lib/eval-plan.ts (49). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Minor — 451 finding(s)
D10 · Test Quality · Skipped (documented) · ×442
  • 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:190 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/aside-render.test.ts:263 — Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skipIf
  • Skipped (documented): (unnamed test) test/aside-render.test.ts:264 — 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:1544 — 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:1549 — 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:1554 — 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:1562 — 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:1567 — 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:1576 — 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:1589 — 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:1596 — 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:1604 — 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
  • + 417 more in this group — see findings.md.
D12 · Dependency Hygiene · Outdated (npm) · ×8
  • Outdated (npm): @anthropic-ai/sdk — @anthropic-ai/sdk is pinned at 0.78.0; registry.npmjs.org publishes 1.8.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 3.6.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): @ngrok/ngrok — @ngrok/ngrok is pinned at 1.7.0; registry.npmjs.org publishes 1.8.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): marked — marked is pinned at 18.1.3; registry.npmjs.org publishes 18.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): mermaid — mermaid is pinned at 11.16.1; registry.npmjs.org publishes 12.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): playwright — playwright is pinned at 1.65.0; registry.npmjs.org publishes 1.65.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.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names make-pdf/src/types.ts:66 — 0 of 6 documented parameters and 1 of 8344 summaries in `gstack` only repeat the member or parameter name (e.g. "Options for `$P preview`." for `PreviewOptions`). Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c0360f22150242158f58ebf9c13e660c/history.json --exit-code 0 --source .0—
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude canary/sections --exclude captain/sections --exclude context-save/sections --exclude devex-review/sections --exclude document-generate/sections --exclude eval-plan/sections --exclude health/sections --exclude ios-clean/sections --exclude ios-design-review/sections --exclude ios-fix/sections --exclude ios-qa/sections --exclude ios-sync/sections --exclude landing-report/sections --exclude learn/sections --exclude modernize/sections --exclude pair-agent/sections --exclude plan-tune/sections --exclude setup-deploy/sections --exclude skillify/sections --exclude sync-gbrain/sections --exclude test/fixtures/ios-qa/FixtureApp/Sources/DebugBridgeCore --exclude test/fixtures/ios-qa/FixtureApp/Sources/DebugBridgeUI --exclude test-audit/sections --exclude ubicloud/sections --exclude write-skill/sections .117artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .3artifacts/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 41 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`, … (+36 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/** .0artifacts/raw/trivy-fs.json

Run 01a1d975-897d-7451-b631-79f9bd7f39fe · 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