Public report of mvschwarz/openrig, published 17 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, 17 November 2026, 10:50 UTC · Survey ID cd_9da7b2ef5a344cb9a51bd8c20b2b5e8b

mvschwarz/openrig

Measured 17 November 2026, 10:47 UTC, at code version 9bb0802

First survey, so nothing to compare with yet
CAI score 35.9out of 100 At risk

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: 374,200 lines of product code in 6 projects, tests not counted · Estimated rebuild effort: about 5.6 person-years · Weakest lens: Domain Modelling, 27.5

Findings by how serious they are

134 critical 3915 serious 535 minor

6 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
17 November 2026, 10:47 UTC

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

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

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

91of 91 dimensions measured by tools.
4499of 4584 findings point to an exact file and line, so you can open each one in the code. The other 85 concern the repository as a whole, such as missing documentation.
91dimensions across 8 lenses, read from 374,200 lines of product code in 6 projects.
Chapters

Executive summary

mvschwarz/openrig is rated At risk because critical security findings are open. Its score is held back because it has pieces of business logic tied to the database or web code. It scores 35.9 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Domain Modelling, at 27.5, is the weakest lens and counts most in the score. The best first step is moving database and web code out of the business core, worth about 7.4 points. Fixing the four tests that passed on some runs and failed on others comes next, worth about 3.1 points. Raising Domain Modelling to 65 would lift the score to about 43.0.

Twelve known security holes in the packages the code depends on can be used by attackers. Eleven weaknesses in the code could be used by an attacker, and twenty-five form fields can't be read by a screen reader. Updating the vulnerable packages, fixing the weaknesses the scanner points to and labelling the form fields 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 the unsafe setting in infrastructure or container files needs changing to safe values. The 12 labels or groups of fields with no name need connecting to their fields or naming.

The product code is 374,200 lines, about €820,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.
Domain Modelling 27.5 · counts for 45%Production Readiness 36.2 · counts for 25%Architecture 42.8 · counts for 14%Security and Compliance 47.8 · counts for 8%Accessibility 55.9 · counts for 4%Code Health 58.4 · counts for 2%Performance 60.0 · counts for 1%Maturity 75.8 · counts for 1%

If Domain Modelling rose from 27.5 to 65, the lowest score rated Strong, the score would rise from 35.9 to about 43.0.

Code composition: what the lines of code are
Product code 39%Tests 61%
Rebuild cost: about €820,000 · Estimate
Cost to rebuild€270,000 to €1,400,000, for 4,523 to 14,349 hours of work, about 5.6 person-years for 3 to 11 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 36. 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: 374,200 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
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
Raises the score by about 7.4 points · Medium effort · Domain ↔ infrastructure boundary
2
Resolve the 4 Flaky test finding(s) in Test Reliability — start with socket-concurrency.test.ts.
Raises the score by about 3.1 points · Low effort · Test Reliability
3
Resolve the 1 Deprecated finding(s) in Dependency Hygiene — start with REDACTED.
Raises the score by about 2.6 points · Low effort · Dependency Hygiene

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.

Files that change often carry extra risk · Combined risk
5 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (389 files) · Code Coverage (7 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: context-packs.ts, settings-store.ts and seat-recap-store.ts
What to do: Add tests to these files and have a second person review every change to them, starting with context-packs.ts, settings-store.ts and seat-recap-store.ts.
Where the investment is most exposed · Value at risk
This code would cost about €820,000 to build again, about 5.6 person-years of work. Its weakest lens is Domain Modelling, at 27.5 (Weak). Domain Modelling is about whether the code protects the rules the business depends on. Because the weakest lens counts most in the score, work on Domain Modelling also moves the score most.
Based on: the rebuild estimate · the Domain Modelling grade · how much each lens counts
What to do: Start with the Domain Modelling actions in Top priorities.
If you do one thing first · First action
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository). Of all the actions in this report, it raises the score most for the work it takes: about 7.4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 794,689 lines over the last 90 days, which is about 3,222,905 lines a year. At that pace, the extra work comes to an estimated 402.9 to 2417.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

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

1139 modules, with 1991 dependencies between them. 4 loops run through 8 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1099 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 cli.src.commands.terminal2 cli.src.daemon-lifecycle3 daemon.src.adapters.tmux4 daemon.src.domain.gateway.slack.queue-access5 daemon.src.domain.provider.claude-usage-windows6 daemon.src.domain.types7 daemon.src.domain.user-settings.settings-store8 tui.src.theme9 ui.src.components10 ui.src.hooks11 cli.src12 daemon.src.domain.event-bus13 daemon.src.domain.projection-planner14 daemon.src.domain.provider15 daemon.src.domain.session-registry16 daemon.src.domain.terminal17 daemon.src.domain.watchdog-jobs-repository18 tui.src.types19 ui.src.lib20 cli.src.lib21 daemon.src.domain.model-divergence.current-model-reader22 daemon.src.domain.queue-repository23 daemon.src.domain.rig-repository24 daemon.src.domain.runtime-adapter25 tui.src26 cli.src.commands27 daemon.src.adapters28 daemon.src.domain.gateway29 daemon.src.domain.gateway.slack30 daemon.src.domain.policies31 daemon.src.domain.restore-orchestrator32 daemon.src.domain.rigspec-instantiator33 daemon.src.domain.seat-handover-service34 daemon.src.domain.seat-lifecycle-service35 daemon.src.domain.session-transport36 daemon.src.domain.workflow-runtime37 daemon.src.domain38 daemon.src.domain.bootstrap-orchestrator39 daemon.src.routes40 daemon.src.server
1 cli.src.commands.terminal
2 cli.src.daemon-lifecycle
3 daemon.src.adapters.tmux
4 daemon.src.domain.gateway.slack.queue-access
5 daemon.src.domain.provider.claude-usage-windows
6 daemon.src.domain.types
7 daemon.src.domain.user-settings.settings-store
8 tui.src.theme
9 ui.src.components
10 ui.src.hooks
11 cli.src4124
12 daemon.src.domain.event-bus1
13 daemon.src.domain.projection-planner2
14 daemon.src.domain.provider31
15 daemon.src.domain.session-registry2
16 daemon.src.domain.terminal23
17 daemon.src.domain.watchdog-jobs-repository1
18 tui.src.types1
19 ui.src.lib12
20 cli.src.lib111
21 daemon.src.domain.model-divergence.current-model-reader111
22 daemon.src.domain.queue-repository1111
23 daemon.src.domain.rig-repository91
24 daemon.src.domain.runtime-adapter11
25 tui.src1527
26 cli.src.commands215111
27 daemon.src.adapters51111
28 daemon.src.domain.gateway111
29 daemon.src.domain.gateway.slack323
30 daemon.src.domain.policies212
31 daemon.src.domain.restore-orchestrator2161222
32 daemon.src.domain.rigspec-instantiator11631341
33 daemon.src.domain.seat-handover-service22231
34 daemon.src.domain.seat-lifecycle-service321212122
35 daemon.src.domain.session-transport2122223
36 daemon.src.domain.workflow-runtime21212
37 daemon.src.domain1943961446413737119
38 daemon.src.domain.bootstrap-orchestrator12
39 daemon.src.routes124111311
40 daemon.src.server11111112111
Uses a module listed above itPart of a loopThe module itself
1 cli.src.commands.terminal2 cli.src.daemon-lifecycle3 daemon.src.adapters.tmux4 daemon.src.domain.gateway.slack.queue-access5 daemon.src.domain.provider.claude-usage-windows6 daemon.src.domain.types7 daemon.src.domain.user-settings.settings-store8 tui.src.theme9 ui.src.components10 ui.src.hooks11 cli.src12 daemon.src.domain.event-bus13 daemon.src.domain.projection-planner14 daemon.src.domain.provider15 daemon.src.domain.session-registry16 daemon.src.domain.terminal17 daemon.src.domain.watchdog-jobs-repository18 tui.src.types19 ui.src.lib20 cli.src.lib21 daemon.src.domain.model-divergence.current-model-reader22 daemon.src.domain.queue-repository23 daemon.src.domain.rig-repository24 daemon.src.domain.runtime-adapter25 tui.src26 cli.src.commands27 daemon.src.adapters28 daemon.src.domain.gateway29 daemon.src.domain.gateway.slack30 daemon.src.domain.policies31 daemon.src.domain.restore-orchestrator32 daemon.src.domain.rigspec-instantiator33 daemon.src.domain.seat-handover-service34 daemon.src.domain.seat-lifecycle-service35 daemon.src.domain.session-transport36 daemon.src.domain.workflow-runtime37 daemon.src.domain38 daemon.src.domain.bootstrap-orchestrator39 daemon.src.routes40 daemon.src.servercli.src.commands.terminal1cli.src.daemon-lifecycle2daemon.src.adapters.tmux3daemon.src.domain.gateway.slack.queue-access4daemon.src.domain.provider.claude-usage-windows5daemon.src.domain.types6daemon.src.domain.user-settings.settings-store7tui.src.theme8ui.src.components9ui.src.hooks10cli.src11daemon.src.domain.event-bus12daemon.src.domain.projection-planner13daemon.src.domain.provider14daemon.src.domain.session-registry15daemon.src.domain.terminal16daemon.src.domain.watchdog-jobs-repository17tui.src.types18ui.src.lib19cli.src.lib20daemon.src.domain.model-divergence.current-model-reader21daemon.src.domain.queue-repository22daemon.src.domain.rig-repository23daemon.src.domain.runtime-adapter24tui.src25cli.src.commands26daemon.src.adapters27daemon.src.domain.gateway28daemon.src.domain.gateway.slack29daemon.src.domain.policies30daemon.src.domain.restore-orchestrator31daemon.src.domain.rigspec-instantiator32daemon.src.domain.seat-handover-service33daemon.src.domain.seat-lifecycle-service34daemon.src.domain.session-transport35daemon.src.domain.workflow-runtime36daemon.src.domain37daemon.src.domain.bootstrap-orchestrator38daemon.src.routes39daemon.src.server40412412312231112111111111191111527215111511111113232122161222116313412223132121212221222232121219439614464137371191212411131111111112111+1099 more modules (most-connected shown)

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

At a glance — Architecture · 42.8 · Weak · gated by D26, R11, R9 ·

At a glance — Maturity · 75.8 · Strong ·

At a glance — Readiness · 36.2 · Weak · gated by D11, R8, P3, P7 ·

At a glance — Security · 47.8 · Weak · gated by D29, C1 ·

At a glance — Domain Modelling · 27.5 · Weak · gated by DM6 ·

At a glance — Accessibility · 55.9 · Adequate ·

At a glance — Performance · 60.0 · 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 — Injection73High / Critical
A03:2025 — Software Supply Chain Failures18High / Critical
A02:2025 — Security Misconfiguration4High / Critical

Roadmap

Top priorities: Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository); Resolve the 4 Flaky test finding(s) in Test Reliability — start with socket-concurrency.test.ts; Resolve the 1 Deprecated finding(s) in Dependency Hygiene — start with REDACTED.

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

Do thisHelpsEffortDimension
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).+7.4 ptsMediumDomain ↔ infrastructure boundary
Resolve the 4 Flaky test finding(s) in Test Reliability — start with socket-concurrency.test.ts.+3.1 ptsLowTest Reliability
Resolve the 1 Deprecated finding(s) in Dependency Hygiene — start with REDACTED.+2.6 ptsLowDependency Hygiene
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with queue-id-compatibility.test.ts.+1.7 ptsLowTest Quality
Resolve the 5 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with package.json (5).+1.4 ptsLowProject Cohesion
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+2.4 ptsMediumDependency Hygiene
Resolve the 7 Boundary-crossing change coupling finding(s) in Change Coupling — start with seat.ts, config.ts, provider.ts.+0.5 ptsLowChange Coupling
Fix the listed violations: import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (364 rows); respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (145 rows); move the shared test helper into a source directory production code may depend on (7 rows); declare the workspace packages these files import in the importing package's own package.json dependencies (6 rows) — those imports are already bare package specifiers, so the import statements do not change, only the manifest.+1.5 ptsMediumImport Boundaries

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.4SlopStatic Analysis (SAST): High: REDACTED
packages/daemon/src/startup.ts3.3MixedChange Coupling: Boundary-crossing change coupling: startup.ts ↔ health-model.ts
REDACTED3.7MixedStatic 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.3MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: REDACTED
packages/daemon/src/adapters/claude-code-adapter.ts4.8MixedCyclomatic Complexity: ClaudeCodeAdapter.launchHarness (cyclomatic 86)
packages/daemon/src/domain/community-harness-presets.ts4.8MixedCyclomatic Complexity: community-harness-presets.parsePreset (cyclomatic 53)
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedStatic 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 — 134

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

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

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

Could not be resolved — 6

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 91 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 1.0, 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 — 91 dimensions across the health lenses
D1D2D3D4D5D6D8D10D11D12D13D14D15D16D17D19D20D21D23D24D26D27D28D29D30D31D34D35D37D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX4AX6C1C2C3C4C5DM6DM9GD1IC1M1M2M3M4P1P2P3P4P6P7P9PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X12X13X14X16X17X18X19X2X21X24X25X28X29X3X30X5

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, 4499 of 4584 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 01a1e91e-b4f7-7249-bd39-9db0d91e4887.

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.

  • 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 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository publishes a package — a Claude Code plugin, declared by plugins/claude-directory/.claude-plugin/plugin.json — so it DOES have an intentionally-exposed surface: the commands, skills, agents and hooks the plugin contributes to its host, which consumers reach by name. D22 collects code-API surfaces (type and member signatures) only, and has no collector for a plugin's contribution surface, so the consistency of that surface was not judged. That is OUR side and it is a COLLECTOR gap, not an environment fault — no change to the scan image can close it.
  • D23 Boundary Type-Coupling — 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 measured 0/40 valid on a seeded held-out sample of its rows on 98 C# repositories (docs/plans/deterministic-engine/adjudication/P5c-D23-units.md, "Version 1 ON MAIN"): the noise rows were dependencies on layer folders, shared cores and grouping folders read as contexts. By the pre-registered fallback (PREREGISTRATION v37) it publishes no row until version 4 passes its gate. The candidates are counted here, not reported as findings, and the score does not include them.
  • 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.
  • 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. `packages/cli/src/bin-wrapper.ts`, `packages/cli/src/commands/exec.ts`, `packages/cli/src/commands/project-worker.ts`, `packages/cli/src/commands/ps.ts`, `packages/cli/src/commands/rig-mode.ts`, … (+67 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.
  • 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. A program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. (rule: missing-tool). The renderer reported: the dev server (`npm run dev` in packages/daemon/) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> @openrig/daemon@0.7.1 dev / > tsx watch src/index.ts / sh: 1: tsx: not found / npm error Lifecycle script `dev` failed with error: / npm error code 127 / npm error path <repo>/packages/daemon / npm error workspace @openrig/daemon@0.7.1 / npm error location <repo>/packages/daemon / npm error command failed / npm error command sh -c tsx watch src/index.ts" 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` in packages/daemon/) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> @openrig/daemon@0.7.1 dev / > tsx watch src/index.ts / sh: 1: tsx: not found / npm error Lifecycle script `dev` failed with error: / npm error code 127 / npm error path <repo>/packages/daemon / npm error workspace @openrig/daemon@0.7.1 / npm error location <repo>/packages/daemon / npm error command failed / npm error command sh -c tsx watch src/index.ts" No runtime evidence was gathered.
  • DM6 Domain ↔ infrastructure boundary — 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. 366 further occurrence(s) are not listed individually; the score already reflects all 406.
  • DM9 Scattered domain decisions — 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. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
  • DM9 Scattered domain decisions — 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. 9 further occurrence(s) are not listed individually; the score already reflects all 49.
  • 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.
  • P2 Observability — 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. 97 further occurrence(s) are not listed individually; the score already reflects all 137.
  • 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. 517 further occurrence(s) are not listed individually; the score already reflects all 557.
  • 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. 1068 further occurrence(s) are not listed individually; the score already reflects all 1108.
  • 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. 482 further occurrence(s) are not listed individually; the score already reflects all 522.
  • 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. 2349 further occurrence(s) are not listed individually; the score already reflects all 2389.
  • 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. 167 further occurrence(s) are not listed individually; the score already reflects all 207.
  • 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. 82 further occurrence(s) are not listed individually; the score already reflects all 122.
  • 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. 245 further occurrence(s) are not listed individually; the score already reflects all 285.
  • X2 Cancellation propagation — 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. 34 further occurrence(s) are not listed individually; the score already reflects all 74.
  • 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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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. 732 further occurrence(s) are not listed individually; the score already reflects all 772.
  • 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, Rust, Go, Swift, Erlang, F# and Visual Basic source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, 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. 60 further occurrence(s) are not listed individually; the score already reflects all 100.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • 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.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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 REDACTED (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.
  • C3 Audit Trail: This control is scored from in-repo evidence only — a working control configured outside the repository leaves no signal a static scan can credit.
  • C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
  • C5 Data-Subject Rights: This control is scored from in-repo evidence only — absence of evidence here means the scan found no in-repo trace, not that the control does not exist.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of 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

1150 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was mcp-server.createMcpServer at 556. A further 17 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 settings-store.getDefaultValue at 99 — they are counted neither in the figure above nor in this dimension's score. 4 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: packages/ui/src/components/lab/VellumBackgroundLab.tsx (VellumBackgroundLab.IsoSvg at 43), packages/cli/src/commands/project-jev.ts (project-jev.validateJev at 21), packages/ui/src/components/slices/tabs/TimelineTab.tsx (TimelineTab.statusFromEventKind at 20), packages/daemon/src/domain/pi-compaction-request-store.ts (PiCompactionRequestStore.get 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.

provider.providerCommand::renderUsageRow (cyclomatic 26) · ×5packages/cli/src/commands/provider.ts:241
queue-stuck-sweep.runStuckSweep::undeliveredCandidate (cyclomatic 27) · ×4packages/daemon/src/domain/queue-stuck-sweep.ts:985
main.run::handleInput (cyclomatic 114) · ×3packages/tui/src/main.ts:554
rigs.rigsRoutes.post("/:id/attach-self") (cyclomatic 43) · ×3packages/daemon/src/routes/rigs.ts:492
scope-audit.classifyScopeItem (cyclomatic 71) · ×2REDACTED:308

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

What to do

  1. Bring the 122 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with mcp-server.createMcpServer (cyclomatic 556), StartupOrchestrator.startNodeWithWarnings (cyclomatic 268), SessionTransport.sendUnguarded (cyclomatic 267). — 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 122 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

1396 method(s) exceeded the cognitive complexity threshold of 15; the worst was mcp-server.createMcpServer at 913.

provider.providerCommand::renderStatusHuman (cognitive 51) · ×6packages/cli/src/commands/provider.ts:94
queue-stuck-sweep.runStuckSweep::undeliveredCandidate (cognitive 32) · ×4packages/daemon/src/domain/queue-stuck-sweep.ts:985
main.run::handleInput (cognitive 229) · ×3packages/tui/src/main.ts:554
skill.skillCommand::seatLoadout (cognitive 48) · ×3packages/cli/src/commands/skill.ts:157
rigs.rigsRoutes.post("/:id/attach-self") (cognitive 32) · ×3packages/daemon/src/routes/rigs.ts:492

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

What to do

  1. Bring the 590 bodies over 30 down to 30 or less in Cognitive Complexity — start with mcp-server.createMcpServer (cognitive 913), queue.queueRoutes::errorResponse (cognitive 770), bundle-behaviour.describeBundleBehaviour (cognitive 577). — 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 590 together lifts Cognitive Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.

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

D3 · God Classes6.8 / 10Adequate✓ 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 6.8 / 10 · rule-coverage 100% · ceiling Prevented

376 god class(es) detected.

FunctionTooLong: startup.createDaemon · ×185packages/daemon/src/startup.ts:344
FileTooLong: domain/queue-repository.ts · ×95packages/daemon/src/domain/queue-repository.ts
MethodTooLong: StartupOrchestrator.startNodeWithWarnings · ×52packages/daemon/src/domain/startup-orchestrator.ts:347
ClassTooLong: QueueRepository · ×25packages/daemon/src/domain/queue-repository.ts:1131
TooManyMethods: QueueRepository · ×19packages/daemon/src/domain/queue-repository.ts:1131

What to do

  1. Resolve the 185 FunctionTooLong finding(s) in God Classes — start with scope.ts (5), render.ts (4), execution-view.ts (3). — One of this dimension's main actionable groups (185 warning-level).
  2. Resolve the 95 FileTooLong finding(s) in God Classes — start with startup.ts (2), queue.ts (2), seat.ts (2). — One of this dimension's main actionable groups (95 warning-level).
  3. Resolve the 52 MethodTooLong finding(s) in God Classes — start with queue-repository.ts (4), workflow-runtime.ts (4), seat-handover-service.ts (3). — One of this dimension's main actionable groups (52 warning-level).

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

D4 · Code Duplication10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

1 duplicated block group(s) detected. 0.0 % of the production lines (10 of 372,189) are in a reported copy. Measured on part of this repository only: .ts (90% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (5 lines × 2)packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:463

What to do

  1. Resolve the 1 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with compose.py. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

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

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

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

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

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

0 of 236 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D8 · Code Coverage9.7 / 10Stronggated by 7 serious findings✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

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

Line coverage 69.2% — 7 file(s) below 50%. Measured from the JavaScript/TypeScript suite (node:test via `npm ci --ignore-scripts` in the repository root, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it.

Low coverage: packages/daemon/src/domain/context-packs/profile-composer.ts · ×7packages/daemon/src/domain/context-packs/profile-composer.ts:1

What to do

  1. Resolve the 7 Low coverage finding(s) in Code Coverage — start with profile-composer.ts, profile-source-resolver.ts, seat-recap-store.ts. — One of this dimension's main actionable groups (7 warning-level).

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

D10 · Test Quality10.0 / 10Adequategated by 1 critical finding✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

157 skipped (153 with a documented reason), 15 zero-assertion, 41 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 29715 tests.

No assertions (empty test): preallocates timestamp/64-bit-hex IDs recognized by the existing lint, sort and last-eight consumerspackages/cli/test/queue-id-compatibility.test.ts:15
Fixed-sleep synchronisation: a slow read here holds up no other page: leaving it aborts it, and the next page reads and draws at once · ×41packages/tui/test/usage-hosts-journey.test.ts:206
No assertions: a dropped connection reconnects (connection maintenance, not data polling) and pushes resume · ×14packages/tui/test/live-events.test.ts:103
Skipped test: seat scope at /topology/seat/$rigId/$logicalId — covered by source-assertion + scope-page direct test · ×4packages/ui/test/topology-view-mode.test.tsx:117
Mock-dominated test: unrefs the production timeout handle and cancels that exact handle on close · ×55packages/tui/test/live-quiet-refresh.test.ts:126

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

What to do

  1. Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with queue-id-compatibility.test.ts. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 41 Fixed-sleep synchronisation finding(s) in Test Quality — start with browser-boundary.test.ts (3), hook-bridge-routes.test.ts (3), provider-switch-seat.test.ts (3). — One of this dimension's main actionable groups (41 warning-level).
  3. Resolve the 14 No assertions finding(s) in Test Quality — start with spec-library-starters.test.ts (3), context-monitor.test.ts (2), kernel-rig-spec-validate.test.ts (2). — One of this dimension's main actionable groups (14 warning-level).

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

D11 · Test Reliability2.0 / 10Critical✓ Tool-verified

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

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

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

4 flaky across 1 measured tier(s). JavaScript/TypeScript (node:test via `npm ci --ignore-scripts` in the repository root (380 tests); vitest via `npm ci --ignore-scripts` in packages/cli/ (5981 tests); vitest via `npm ci --ignore-scripts` in packages/daemon/ (11794 tests); vitest via `npm ci --ignore-scripts` in packages/tui/ (1271 tests); vitest via `npm ci --ignore-scripts` in packages/ui/ (1841 tests)): measured (4 flaky).

Flaky test: packages/daemon/test/list-processes-async.test.ts::B12-T real async list_processes — codex-runtime-adapter runs the REAL ps path and sees this very process in the table · ×4

What to do

  1. Resolve the 4 Flaky test finding(s) in Test Reliability — start with socket-concurrency.test.ts. — One of this dimension's main actionable groups (4 issue-level).

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

D12 · Dependency Hygiene8.5 / 10Strong✓ 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 8.5 / 10 · rule-coverage 100% · ceiling Verified

30 outdated direct production npm dependency(ies) of 41 graded, 0 pinning defect(s), across 5 package.json (5 of them the product) and 1 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.

Deprecated: whatwg-encodingREDACTED:7023
Outdated (npm): @fontsource-variable/jetbrains-mono · ×30

What to do

  1. Resolve the 1 Deprecated finding(s) in Dependency Hygiene — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 285 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 285 package(s) this repository's committed lockfile installs for a consumer — its 41 production, optional and peer dependency(ies), across 5 product package.json manifest(s), and everything those install in turn. Its 25 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. Third-party code that ships WITHOUT a manifest entry was read too: 1 component(s) whose licence travels in the tree (vendored or copied-in directories, licence comments preserved in committed bundles, compiled wasm modules) and 0 bundled package(s) named only by a bundle's module path, graded on the registry; 0 use a banned licence. 2 vendored, copied-in or compiled component(s) state no licence this pass can read — missing data, not charged. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: packages/daemon/src/startup.ts (239×269=64291); packages/daemon/src/domain/session-transport.ts (145×267=38715); packages/daemon/src/routes/queue.ts (76×468=35568) Repeated repair below the complexity floor: packages/daemon/src/domain/model-divergence/model-divergence-monitor.ts (14 of 17 changes were fixes); REDACTED (13 of 23 changes were fixes); REDACTED (8 of 11 changes were fixes)

Hotspot: packages/daemon/src/startup.ts · ×354packages/daemon/src/startup.ts:344
Repeated repair: packages/daemon/src/domain/model-divergence/model-divergence-monitor.ts · ×56packages/daemon/src/domain/model-divergence/model-divergence-monitor.ts:191

What to do

  1. Resolve the 354 Hotspot finding(s) in Churn × Complexity Hotspots — start with startup.ts (3), REDACTED (3), queue.ts (2). — One of this dimension's main actionable groups (354 warning-level).
  2. Resolve the 56 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), model-divergence-monitor.ts, REDACTED. — One of this dimension's main actionable groups (56 warning-level).

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

D16 · Bus Factor7.8 / 10Strong✓ Tool-verified

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

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

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

259 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is packages/ui/src/components/project/ScopePages.tsx. Counted over 1129 of the 1603 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×3
Further sole-owners (lower concentration)

What to do

  1. Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

37 deducted task-comment markers across 356304 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 · ×37packages/daemon/test/bootstrap-orchestrator.test.ts:1427

What to do

  1. Resolve the 37 TodoComment finding(s) in Explicit Debt — start with bundle-assembler.ts (4), bootstrap-orchestrator.ts (4), bundle-source-resolver.test.ts (3). — One of this dimension's main actionable groups (37 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

2 of 2 documentation facets pass in full. 112 document(s) read across 6 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs foundpackages/ui/package.json:11

What to do

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

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

D21 · Naming Consistency9.8 / 10Exemplary✓ 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 9.8 / 10 · rule-coverage 100% · ceiling Verified

5 naming inconsistencies among 2771 declarations measured against a convention their peers follow.

`queryAgentPIDs` spells `PI` where 37 names in the project spell it `Pi`REDACTED:301
`getUploadURLExternal` spells `URL` where 89 names in the project spell it `Url`REDACTED:380
`cachedAgentPIDs` spells `PI` where 37 names in the project spell it `Pi`packages/daemon/src/domain/session-fingerprinter.ts:58
`sourceToolUseID` spells `ID` where 2627 names in the project spell it `Id`packages/daemon/test/helpers/eval-rig-session.ts:179
`toJSON` spells `JSON` where 17 names in the project spell it `Json`packages/test-system/delivery/harness/oracle.mjs:151

✓ On the Gold path — maintain.

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

D23 · Boundary Type-Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.

Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.

Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.

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

18 domain type(s) cross context boundaries across 4 contexts; they are measured and withheld (not published, not scored). Contexts: cli, daemon, tui, ui.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D24 · Comment Value9.7 9.4 / 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.4 / 10 · rule-coverage 98% · ceiling Documented

86 of 25874 judged comments only repeat the code they sit on (0.3 %). 750 comment(s) in another language or script were not judged.

redundant comment · ×78packages/cli/src/commands/bundle.ts:272
doc comments repeat the names · ×2packages/cli/src/restore-packet/packet-writer.ts:58

✓ On the Gold path — maintain.

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

D26 · Project Cohesion0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

5 of 6 build units (npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×5packages/daemon/package.json:1

What to do

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

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

D27 · Navigability9.8 / 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.8 / 10 · rule-coverage 100% · ceiling Documented

12 % of calls cross a namespace and 3 % go through an interface, but 91 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

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

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

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

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

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

73 finding(s): 0 critical, 12 high, 61 medium, 0 low. semgrep hit a parse error in 87 file(s) — `docs/reference/community-harness-examples/cursor/openrig-cursor-launch` (lines 28–31), `packages/cli/src/bin-wrapper.ts` (line 125, line 126, line 144, …), `packages/cli/src/commands/exec.ts` (line 251, line 252, line 318, …), `packages/cli/src/commands/project-worker.ts` (line 119), `packages/cli/src/commands/ps.ts` (line 1880, line 1881, line 1882), … (+82 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 2 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

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

What to do

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

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

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

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

18 finding(s): 2 critical, 10 high, 4 medium, 2 low.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 10 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (10). — One of this dimension's main actionable groups (10 issue-level).
  2. Resolve the 4 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
  3. Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).

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

D31 · IaC & Container Security9.4 / 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 (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

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

4 finding(s): 0 critical, 1 high, 3 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 3 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 warning-level).

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

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.7 / 10Adequategated by 7 critical 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.7 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: hydrate.ts↔sections.ts 100%; daemon-client.ts↔sections.ts 92%; registry.ts↔sections.ts 83%

Boundary-crossing change coupling: seat.ts ↔ seat-status-service.ts · ×7packages/cli/src/commands/seat.ts:1
Change coupling: hydrate.ts ↔ sections.ts · ×17packages/tui/src/hydrate.ts:1
Change-coupling hub: registry.ts → daemon-client.ts, hydrate.ts, sections.tspackages/tui/src/commands/registry.ts

What to do

  1. Resolve the 7 Boundary-crossing change coupling finding(s) in Change Coupling — start with seat.ts, config.ts, provider.ts. — One of this dimension's main actionable groups (7 issue-level).
  2. Resolve the 17 Change coupling finding(s) in Change Coupling — start with community-harness-presets.ts (2), demo-data.ts (2), claude-code-adapter.ts (2). — One of this dimension's main actionable groups (17 warning-level).
  3. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with registry.ts. — One of this dimension's main actionable groups (1 warning-level).

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives4.8 / 10Adequate✓ 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.

  • Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). (×3) — packages/ui/src/components/review/EvidenceOpener.tsx:121, packages/ui/src/components/review/SliceReviewTab.tsx:72, packages/ui/src/components/slices/tabs/TestsVerificationTab.tsx:193

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels5.2 / 10Adequate✓ Tool-verified

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

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

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

  • This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×2) — packages/ui/src/components/AgentSpecValidateFlow.tsx:64, packages/ui/src/components/ImportFlow.tsx:190
  • This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. — packages/ui/src/components/AppShell.tsx:584
  • This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×12) — packages/ui/src/components/BootstrapWizard.tsx:118, packages/ui/src/components/BundleInspector.tsx:24, packages/ui/src/components/BundleInstallFlow.tsx:58, …
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×13) — packages/ui/src/components/BundleInspector.tsx:25, packages/ui/src/components/BundleInstallFlow.tsx:59, packages/ui/src/components/BundleInstallFlow.tsx:64, …
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×12) — packages/ui/src/components/DiscoveryOverlay.tsx:325, packages/ui/src/components/DiscoveryOverlay.tsx:339, packages/ui/src/components/PackageInstallFlow.tsx:329, …

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 structure10.0 / 10Exemplary○ Nothing flagged

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.

AC4 · Keyboard semantics4.2 / 10Weak✓ 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".

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×4) — packages/ui/src/components/AppShell.tsx:584, packages/ui/src/components/review/SliceReviewTab.tsx:100, packages/ui/src/components/topology/TopologyTableView.tsx:480, …
  • This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, 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. (×2) — packages/ui/src/components/project/Lightbox.tsx:9, packages/ui/src/components/project/ProofImageViewer.tsx:23
  • The repo's own CSS styles .sg-cnode 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. — packages/ui/src/components/project/StoryGraph.tsx:290

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 safety5.2 / 10Adequate✓ 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.

  • <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×7) — packages/ui/src/components/BundleInspector.tsx:25, packages/ui/src/components/BundleInstallFlow.tsx:59, packages/ui/src/components/BundleInstallFlow.tsx:64, …
  • <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×3) — packages/ui/src/components/DiscoveryOverlay.tsx:325, packages/ui/src/components/PackageInstallFlow.tsx:329, packages/ui/src/components/PackageInstallFlow.tsx:355
  • <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — packages/ui/src/components/files/FilesWorkspace.tsx:555
  • `.sg-cnode.sg-self` sets color: #b9822f on background-color: #fff — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/ui/src/components/project/StoryGraph.css:160

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 composition9.3 / 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.

C1 · Data Protection0.0 / 10Critical✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

  • No encryption usage (node:crypto createCipheriv, Web Crypto subtle.encrypt, crypto-js AES, tweetnacl/libsodium secretbox, a column-encryption layer such as typeorm-encrypted, prisma-field-encryption or mongoose-field-encryption, or MongoDB client-side field-level encryption) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore. — packages/daemon/src/domain/provider/provider-account-readings.ts:106

What to do

  • Encrypt sensitive data at rest (AES-256-GCM through node:crypto createCipheriv, or a column-encryption layer such as typeorm-encrypted / prisma-field-encryption / MongoDB CSFLE) and manage keys in a vault (AWS KMS, Azure Key Vault, GCP KMS, HashiCorp Vault). Skip if delegated to infra (Postgres TDE, KMS, etc.).
  • Enforce HTTPS (serve through https.createServer / NestJS httpsOptions, or redirect plain HTTP with express-sslify behind your TLS terminator) so data in transit is always encrypted.
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.

  • Here who is asking is taken from the 'piSessionId' request header (const piSessionId = stringOrNull(body.piSessionId)) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — packages/daemon/src/routes/activity.ts:320
  • Here who is asking is taken from the 'actor' form field (const identity = requireSenderIdentity(c, {verb:"record a delegated decision", bodyClai…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — packages/daemon/src/routes/queue.ts:1307
  • Here who is asking is taken from the 'X-Target-Rig-Id' request header (const targetRigId = c.req.header("X-Target-Rig-Id")) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — packages/daemon/src/routes/rigspec.ts:186
  • Here who is asking is taken from the 'permission' query parameter (const permissionDiagnostics = c.req.query("diagnostics")==="permission") and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed. — packages/daemon/src/routes/whoami.ts:17

What to do

  • Keep who is signed in on the server: give the browser only a long random session id (express-session, iron-session, a sessions table), or sign the cookie (cookie-parser with a secret and req.signedCookies, a verified JWT), and look the user up from that — never from an id, role or token claim the browser sends unchecked.
C3 · Audit Trail7.5 / 10Strong✓ Tool-verified

Other · Security — Whether changes to sensitive data are recorded (who, what, when) for compliance + incident response.

Method: Roslyn scan: audit-trail mechanism graded (SaveChanges interceptor/immutable AuditLog/[Audited] strong; bare IAuditable/AddAuditing weak). Deterministic.

  • An audit mechanism is present, but the trail is not yet complete — missing: an ORM write hook every change flows through (a TypeORM/MikroORM subscriber, a Sequelize or Mongoose hook, Prisma middleware or a query extension, or an event-store append), per-model coverage (@Audited, or a change-history plugin such as mongoose-history or sequelize-paper-trail applied to each model).

What to do

  • Back the audit convention with a structural mechanism: an ORM write hook (a TypeORM/MikroORM subscriber, a Sequelize or Mongoose hook, Prisma middleware) writing every sensitive change to an audit-log table, and apply it to each model that needs a who-changed-what trail.
C4 · Data Retention7.5 / 10Strong✓ Tool-verified

Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).

Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.

  • A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a cron task that deletes rows past their retention — purgeExpired… / deleteOld…).

What to do

  • Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
C5 · Data-Subject Rights4.0 / 10Weak✓ Tool-verified

Other · Security — Whether GDPR data-subject requests are supported in code — erasure, export/portability, consent.

Method: Roslyn scan: GDPR data-subject-rights corroboration (erasure/export/consent vocabulary co-occurring with subject-id store crossing or explicit GDPR pattern). Deterministic, gated by PII.

  • An erasure path exists (erasureLedgerPath at packages/daemon/src/index.ts:158), but this repository writes personal data to a store ('email' on a SQL INSERT in 'provider_account_readings_next') and the removals here (truncate text at packages/ui/src/components/ActivityFeed.tsx:70, …) reach other stores. When a subject's data is erased, the records in that store survive it. — packages/daemon/src/db/migrations/134_claude_token_readings.ts:14
  • Corroborated rights: erasure ✓ · export ✗ · consent ✗. Each tick means this scan found code in the repository implementing that right — a deletion/anonymisation path for erasure, a data-export or portability path for export, and consent state recorded alongside the personal data it authorises. A ✗ therefore means no such code was recognised HERE, not that the right is unsupported: a capability provided by a platform, a manual runbook, or code spelled in a way this scan does not match is not visible to it. Confirm before treating a cross as a gap; where it is one, the right has to be fulfilled manually.

What to do

  • Implement data export/portability for a data subject (a machine-readable export of their personal data).
  • Track GDPR consent (lawful basis) alongside the personal data it authorises.
  • Make erasure reach every store a subject's personal data is written to: delete (or anonymise) the subject's records in each collection, table, key space and bucket on the erasure path.
DM6 · Domain ↔ infrastructure boundary2.8 / 10Weak✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (TypeORM/Prisma/MikroORM/Sequelize/Mongoose) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

  • `packages/daemon/src/domain/active-lens-store.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/active-lens-store.ts:21
  • `REDACTED` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — REDACTED:19
  • `packages/daemon/src/domain/activity-grants.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/activity-grants.ts:8
  • `packages/daemon/src/domain/agent-activity-store.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/agent-activity-store.ts:8
  • `packages/daemon/src/domain/agent-images/agent-image-library-service.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/agent-images/agent-image-library-service.ts:16
  • `packages/daemon/src/domain/agent-images/agent-image-library-service.ts` (domain layer) depends on `node:fs` (dynamic import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/agent-images/agent-image-library-service.ts:81
  • `packages/daemon/src/domain/agent-images/evidence-guard.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/agent-images/evidence-guard.ts:18
  • `packages/daemon/src/domain/agent-images/evidence-guard.ts` (domain layer) depends on `node:fs` (dynamic import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/agent-images/evidence-guard.ts:148
  • `packages/daemon/src/domain/agent-images/resume-token-discovery.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/agent-images/resume-token-discovery.ts:13
  • `packages/daemon/src/domain/agent-images/snapshot-capturer.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/agent-images/snapshot-capturer.ts:15
  • `REDACTED` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — REDACTED:1
  • `packages/daemon/src/domain/applied-launch-observation-store.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/applied-launch-observation-store.ts:1
  • `packages/daemon/src/domain/bootstrap-orchestrator.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bootstrap-orchestrator.ts:5
  • `packages/daemon/src/domain/bootstrap-orchestrator.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bootstrap-orchestrator.ts:25
  • `packages/daemon/src/domain/bootstrap-repository.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bootstrap-repository.ts:1
  • `packages/daemon/src/domain/builtin-policy-reference.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/builtin-policy-reference.ts:17
  • `packages/daemon/src/domain/builtin-startup-files.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/builtin-startup-files.ts:19
  • `packages/daemon/src/domain/builtin-startup-files.ts` (domain layer) depends on `../openrig-compat.js` (import of `packages/daemon/src/openrig-compat.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/builtin-startup-files.ts:21
  • `packages/daemon/src/domain/bundle-archive.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-archive.ts:11
  • `packages/daemon/src/domain/bundle-behaviour-inspect.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-behaviour-inspect.ts:1
  • `packages/daemon/src/domain/bundle-carried-context-pack.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-carried-context-pack.ts:1
  • `packages/daemon/src/domain/bundle-carried-project.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-carried-project.ts:1
  • `packages/daemon/src/domain/bundle-content-routing.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-content-routing.ts:1
  • `packages/daemon/src/domain/bundle-content-routing.ts` (domain layer) depends on `../openrig-compat.js` (import of `packages/daemon/src/openrig-compat.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-content-routing.ts:6
  • `packages/daemon/src/domain/bundle-install-context.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-install-context.ts:1
  • `packages/daemon/src/domain/bundle-install-context.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-install-context.ts:5
  • `packages/daemon/src/domain/bundle-source-resolver.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-source-resolver.ts:2
  • `packages/daemon/src/domain/bundle-source-resolver.ts` (domain layer) depends on `../openrig-compat.js` (import of `packages/daemon/src/openrig-compat.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/bundle-source-resolver.ts:10
  • `packages/daemon/src/domain/chat-repository.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/chat-repository.ts:1
  • `packages/daemon/src/domain/checkpoint-store.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/checkpoint-store.ts:1
  • `packages/daemon/src/domain/claim-service.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/claim-service.ts:4
  • `packages/daemon/src/domain/classification-attempts.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/classification-attempts.ts:1
  • `packages/daemon/src/domain/classification-sources.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/classification-sources.ts:2
  • `packages/daemon/src/domain/classification-sources.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/classification-sources.ts:3
  • `packages/daemon/src/domain/classifier-lease-manager.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/classifier-lease-manager.ts:1
  • `packages/daemon/src/domain/claude-activity-hooks.ts` (domain layer) depends on `../openrig-compat.js` (import of `packages/daemon/src/openrig-compat.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/claude-activity-hooks.ts:3
  • `packages/daemon/src/domain/claude-auto-mode.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/claude-auto-mode.ts:1
  • `packages/daemon/src/domain/claude-compaction-enforcer.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/claude-compaction-enforcer.ts:8
  • `packages/daemon/src/domain/claude-core-plugin-env.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/claude-core-plugin-env.ts:1
  • `packages/daemon/src/domain/claude-core-plugin-env.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — packages/daemon/src/domain/claude-core-plugin-env.ts:3

What to do

  • Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
DM9 · Scattered domain decisions6.0 / 10Adequate✓ Tool-verified

Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.

Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.

  • packages.cli.src.client.DaemonResponse's [data, status] are judged in packages.cli.src.commands.ask, packages.cli.src.commands.gateway, packages.cli.src.commands.queue, packages.cli.src.commands.shrink, packages.cli.src.commands.slack, packages.cli.src.commands.stream-outcome, packages.cli.src.commands.terminal, packages.cli.src.lib.bundle-source — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.cli.src.commands.specs.LibraryEntry's [kind, sourceType] are judged in packages.cli.src.commands.specs, packages.cli.src.commands.up — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.cli.src.daemon-lifecycle.DaemonStatus's [healthy, state] are judged in packages.cli.src.commands.whoami, packages.cli.src.lib.bundle-source — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.cli.src.daemon-lifecycle.DaemonStatus's [port, state] are judged in packages.cli.src.commands.queue, packages.cli.src.commands.send, packages.cli.src.system-preflight.SystemPreflight — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.escalation-owner.EscalationOwner's [outcome, owner] are judged in packages.daemon.src.domain.queue-stuck-sweep, packages.daemon.src.domain.queue-wake-ladder — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.execution-view.SliceFacts's [dir, id] are judged in packages.daemon.src.domain.execution-view, packages.tui.src.execution.execution-model — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.expected-conversation.ExpectedConversation's [nodeId, runtime] are judged in packages.daemon.src.domain.expected-conversation, packages.daemon.src.routes.startup — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.gateway.human-registry.HumanConnectorBinding's [kind, role] are judged in packages.daemon.src.domain.gateway.slack.open-asks, packages.daemon.src.domain.gateway.slack.slack-subsystem, packages.daemon.src.routes.gateway — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.gateway.slack.inbound.SlackEvent's [subtype, thread_ts, ts] are judged in packages.daemon.src.domain.gateway.slack.channel-recovery.ChannelRecovery, packages.daemon.src.domain.gateway.slack.inbound — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.gateway.slack.inbound.SlackEvent's [thread_ts, ts] are judged in packages.daemon.src.domain.gateway.slack.channel-recovery.ChannelRecovery, packages.daemon.src.domain.gateway.slack.inbound.InboundRouter — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.gateway.slack.queue-access.QueueItem's [blockedOn, state] are judged in packages.daemon.src.domain.queue-repository.QueueRepository, packages.daemon.src.domain.workflow-projector.WorkflowProjector — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.gateway.slack.queue-access.QueueItem's [closureReason, state] are judged in packages.daemon.src.domain.network.network-connector, packages.daemon.src.domain.runner-permissions.RunnerPermissions, packages.daemon.src.routes.hosts, packages.daemon.src.routes.queue — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.gateway.slack.queue-access.QueueItem's [destinationSession, sourceSession] are judged in packages.daemon.src.domain.environment-artifacts.EnvironmentArtifacts, packages.daemon.src.domain.queue-repository.QueueRepository — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.gateway.slack.recovery-budget.RecoveryBudget's [deadline, entries] are judged in packages.daemon.src.domain.gateway.slack.channel-recovery.ChannelRecovery, packages.daemon.src.domain.gateway.slack.thread-recovery.ThreadRecovery — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.native-process-lineage.ClaudeLaunchedProcess's [pid, startedAt] are judged in packages.daemon.src.domain.native-process-lineage, packages.daemon.src.domain.session-registry — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.native-process-lineage.NativeProcessRow's [pgid, pid, tpgid] are judged in packages.daemon.src.domain.native-process-lineage, packages.daemon.src.domain.seat-handover-service.SeatHandoverService — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.native-process-lineage.NativeProcessRow's [pgid, tpgid] are judged in packages.daemon.src.domain.native-process-lineage, packages.daemon.src.domain.seat-handover-service.SeatHandoverService, packages.daemon.src.domain.seat-identity-reconciler.SeatIdentityReconciler — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.native-process-lineage.NativeProcessRow's [pid, ppid] are judged in packages.daemon.src.domain.seat-identity-reconciler.SeatIdentityReconciler, packages.daemon.src.domain.seat-restart-in-place.CodexInPlaceRestart — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.native-process-lineage.NativeProcessRow's [pid, startedAt] are judged in packages.daemon.src.domain.native-process-lineage, packages.daemon.src.domain.restore-orchestrator.RestoreOrchestrator — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.native-resume-probe.NativeResumeProbeResult's [code, status] are judged in packages.daemon.src.adapters.claude-code-adapter.ClaudeCodeAdapter, packages.daemon.src.adapters.claude-resume.ClaudeResumeAdapter, packages.daemon.src.adapters.codex-runtime-adapter.CodexRuntimeAdapter — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.permission-drift.AppliedLaunchObservation's [state, value] are judged in packages.daemon.src.adapters.codex-resume.CodexResumeAdapter, packages.daemon.src.adapters.codex-runtime-adapter.CodexRuntimeAdapter — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.projection-planner.ProjectionEntry's [category, classification] are judged in packages.daemon.src.domain.rigspec-instantiator.PodRigInstantiator, packages.daemon.src.domain.runtime-switch-materials — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.projection-planner.ProjectionEntry's [category, mergeStrategy] are judged in packages.daemon.src.adapters.claude-code-adapter.ClaudeCodeAdapter, packages.daemon.src.adapters.codex-runtime-adapter.CodexRuntimeAdapter, packages.daemon.src.adapters.pi-runtime-adapter.PiRuntimeAdapter, packages.daemon.src.adapters.stub-runtime-adapter.StubRuntimeAdapter, packages.daemon.src.domain.rigspec-instantiator.PodRigInstantiator, packages.daemon.src.domain.runtime-switch-materials — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.provider.provider-types.UsageRefreshOutcome's [outcome, reason] are judged in packages.daemon.src.domain.provider.claude-usage-windows.ClaudeUsageWindows, packages.daemon.src.domain.provider.usage-windows.UsageWindows — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.queue-transition-log.QueueTransition's [ownerNotificationKind, ownerNotificationLevel] are judged in packages.daemon.src.domain.queue-repository, packages.daemon.src.domain.queue-repository.QueueRepository — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.scope.scope-audit.ScopeAuditInput's [proofDirExists, proofDirHasEntries, proofFileExists] are judged in packages.cli.src.lib.scope.scope-audit, packages.daemon.src.domain.scope.scope-audit — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.seat-delivery-guard.GuardTarget's [nodeId, occupant, pane, session] are judged in packages.daemon.src.domain.queue-repository.QueueRepository, packages.daemon.src.domain.seat-delivery-guard.SeatDeliveryGuard — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.seat-structural-activity-service.StructuralObservation's [reason, state] are judged in packages.daemon.src.domain.node-inventory, packages.daemon.src.domain.seat-activity-service, packages.daemon.src.domain.seat-structural-activity-service.SeatStructuralActivityService — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.session-transport.SendResult's [inputPhase, sent] are judged in packages.daemon.src.domain.claim-service, packages.daemon.src.domain.draft-aware-delivery.DraftAwareDelivery, packages.daemon.src.domain.pi-compaction-service.PiCompactionService, packages.daemon.src.domain.session-transport, packages.daemon.src.domain.session-transport.SessionTransport, packages.daemon.src.domain.watchdog-delivery, packages.daemon.src.routes.transport — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.session-transport.SendResult's [reason, sent] are judged in packages.daemon.src.domain.session-transport.SessionTransport, packages.daemon.src.routes.transport — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.terminal.herdr-viewer.ViewerPane's [pane_id, terminal_id, workspace_id] are judged in packages.daemon.src.domain.terminal.herdr-follow-view.HerdrFollowView, packages.daemon.src.domain.terminal.herdr-viewer, packages.daemon.src.domain.terminal.herdr-viewer.HerdrViewer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.terminal.terminal-provider.ComposedPane's [paneCommand, readOnly] are judged in packages.daemon.src.domain.terminal.herdr-follow-view.HerdrFollowView, packages.daemon.src.domain.terminal.herdr-viewer.HerdrViewer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.types.AgentActivity's [evidenceSource, rawEvent, reason, stale] are judged in packages.daemon.src.domain.agent-activity-store, packages.daemon.src.domain.queue-wake-ladder — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.types.AgentActivity's [reason, state] are judged in packages.daemon.src.domain.node-inventory, packages.daemon.src.domain.session-transport.SessionTransport — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.types.Binding's [id, tmuxSession] are judged in packages.daemon.src.routes.startup, packages.daemon.src.server — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.types.Binding's [tmuxPane, tmuxSession] are judged in packages.daemon.src.domain.codex-rebuild-permissions, packages.daemon.src.domain.expected-conversation, packages.daemon.src.domain.model-divergence.current-model-reader.CurrentModelReader, packages.daemon.src.domain.node-launcher.NodeLauncher, packages.daemon.src.domain.seat-runtime-switch-service.SeatRuntimeSwitchService, packages.daemon.src.domain.startup-orchestrator.StartupOrchestrator, packages.daemon.src.routes.sessions — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.types.Node's [id, logicalId] are judged in packages.daemon.src.domain.node-launcher.NodeLauncher, packages.daemon.src.domain.restore-orchestrator.RestoreOrchestrator, packages.daemon.src.domain.shared-history-selection, packages.daemon.src.routes.sessions, packages.daemon.src.routes.startup — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.types.NodeInventoryEntry's [canonicalSessionName, logicalId] are judged in packages.daemon.src.domain.seat-lifecycle-service.SeatLifecycleService, packages.daemon.src.domain.seat-status-service.SeatStatusService — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.types.SeatIdentityVerdict's [evidence, sessionName, verdict] are judged in packages.daemon.src.domain.expected-conversation, packages.daemon.src.routes.sessions — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • packages.daemon.src.domain.types.Session's [createdAt, id] are judged in packages.daemon.src.domain.kernel-boot, packages.daemon.src.domain.kernel-boot-tracker.KernelBootTracker — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.

What to do

  • Move each repeated judgement onto the type that owns the members it reads, so the rule has one home and cannot drift.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

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.

IC1 · Incompleteness & stubs7.1 / 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.

  • `reopen` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — docs/reference/runner-conformance/fake-acp-agent.mjs:106
  • 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. (×3) — packages/cli/src/commands/policy.ts:255, packages/daemon/src/routes/terminal-ws.ts:39, packages/ui/src/components/topology/HybridTopologyNodes.tsx:281
  • The guard above `return true;` also returns `true`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — packages/cli/src/commands/ps.ts:503
  • `preflight` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/daemon/src/domain/environment-startup.ts:26
  • `ensureVendored` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/daemon/src/domain/plugin-vendor-service.ts:137
  • `refreshEscalationRowIfExists` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/daemon/src/domain/queue-wake-ladder.ts:1827
  • `launchBinding` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/daemon/src/domain/rigspec-instantiator.ts:2194
  • `cleanup` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — packages/daemon/src/domain/successor-session-launcher.ts:608
  • The guard above `return "dim";` also returns `"dim"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — packages/tui/src/execution/execution-model.ts:98
  • The guard above `return "text";` also returns `"text"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — packages/ui/src/components/drawer-viewers/FileViewer.tsx:45
  • The guard above `return "action-required";` also returns `"action-required"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — packages/ui/src/lib/attention-feed.ts:39
  • `dispatchEvent` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — packages/ui/twin/eventsource-stub.ts:50
  • 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) — packages/cli/test/mcp-daemon-endpoint-native.test.ts:86, packages/cli/test/up.test.ts:1239, packages/daemon/test/precompact-hook.test.ts:367, …

What to do

  • Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
  • 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)8.8 / 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 documentation5.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

M4 · Documentation accuracy8.8 / 10Exemplary✓ Tool-verified

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.

  • README.md names Node.js 20, but the repository declares engines `^22 || ^24`, engines `>=22`, engines `>=22`, engines `^22 || ^24`. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:486
  • docs/reference/getting-started.md names Node.js 20, but the repository declares engines `^22 || ^24`, engines `>=22`, engines `>=22`, engines `^22 || ^24`. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/reference/getting-started.md:104

What to do

  • Reconcile the README with reality: README.md names Node.js 20, but the repository declares engines `^22 || ^24`, engines `>=22`, engines `>=22`, engines `^22 || ^24`; docs/reference/getting-started.md names Node.js 20, but the repository declares engines `^22 || ^24`, engines `>=22`, engines `>=22`, engines `^22 || ^24`.
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 · Observability5.5 / 10Adequate✓ 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.

  • Only 1/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `packages/acp`, `packages/cli`, `packages/tui`.
  • `packages/daemon/src/openrig-compat.ts` reports through `console.*` at line 23 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/openrig-compat.ts:23
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 353 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:353
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 364 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:364
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 436 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:436
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 440 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:440
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 580 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:580
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 586 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:586
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 588 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:588
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 617 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:617
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 640 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:640
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 719 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:719
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 722 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:722
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 979 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:979
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 988 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:988
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 995 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:995
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1001 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1001
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1015 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1015
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1089 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1089
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1143 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1143
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1171 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1171
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1181 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1181
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1195 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1195
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1198 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1198
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1207 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1207
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1411 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1411
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1416 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1416
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1588 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1588
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1593 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1593
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 1973 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:1973
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 2030 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:2030
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 2671 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:2671
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 2806 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:2806
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 2812 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:2812
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 2912 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:2912
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 2922 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:2922
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 2978 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:2978
  • `packages/daemon/src/startup.ts` reports through `console.*` at line 2980 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/startup.ts:2980
  • `packages/daemon/src/tmux-server-start.ts` reports through `console.*` at line 35 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/tmux-server-start.ts:35
  • `packages/daemon/src/routes/bundles.ts` reports through `console.*` at line 795 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/daemon/src/routes/bundles.ts:795

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
P3 · Security & performance tooling3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 2 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — .github/workflows/portability-report.yml:11
  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `npm`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — REDACTED:8

What to do

  • Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
  • Dependabot is configured but does not watch `npm` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

What to do

  • Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where we can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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. (×4) — packages/cli/src/commands/chatroom.ts:215, REDACTED:76, REDACTED:78, …
  • `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. — REDACTED:71
  • `this.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. (×2) — packages/daemon/src/domain/mission-control/notification-adapter-ntfy.ts:75, packages/daemon/src/domain/mission-control/notification-adapter-webhook.ts:88

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.
P9 · Domain vs controller coverage5.5 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether test coverage concentrates on the domain (business rules) rather than the trivial web/controller layer — a focus check a generic tool can't make.

Method: Roslyn plus test-execution analysis: domain-layer versus trivial web/controller coverage ratio. Computed metric, 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.

  • `mkdtempSync` 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. — docs/reference/runner-conformance/check-runner.mjs:183
  • `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. (×3) — docs/reference/runner-conformance/check-runner.mjs:185, docs/reference/runner-conformance/check-runner.mjs:186, docs/reference/runner-conformance/check-runner.mjs:187
  • `writeFileSync` 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. (×4) — docs/reference/runner-conformance/check-runner.mjs:196, docs/reference/runner-conformance/check-runner.mjs:198, docs/reference/runner-conformance/check-runner.mjs:204, …
  • `chmodSync` 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. (×2) — docs/reference/runner-conformance/check-runner.mjs:199, docs/reference/runner-conformance/check-runner.mjs:218
  • `existsSync` in `log` 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. — docs/reference/runner-conformance/check-runner.mjs:222
  • `readFileSync` in `log` 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. — docs/reference/runner-conformance/check-runner.mjs:222
  • `existsSync` in `record` 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. — docs/reference/runner-conformance/check-runner.mjs:233
  • `readFileSync` in `record` 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. — docs/reference/runner-conformance/check-runner.mjs:233
  • `writeFileSync` in `paste` 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. — docs/reference/runner-conformance/check-runner.mjs:236
  • `mkdirSync` in `runAcpAssignment` 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. — packages/cli/src/acp/connector.ts:90
  • `appendFileSync` in `log` 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. — packages/cli/src/acp/connector.ts:91
  • `realpathSync` in `run` 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. — packages/cli/src/bin-wrapper.ts:117
  • `mkdirSync` in `callback to action` 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) — packages/cli/src/commands/acp.ts:231, REDACTED:923
  • `writeFileSync` in `writeRun` 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. — packages/cli/src/commands/acp.ts:233
  • `spawnSync` in `callback to action` 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) — packages/cli/src/commands/acp.ts:342, packages/cli/src/commands/chatroom.ts:198
  • `readFileSync` in `callback to action` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — packages/cli/src/commands/add.ts:55, REDACTED:819, REDACTED:919
  • `fs.rmSync` in `callback to action` 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. — packages/cli/src/commands/bundle.ts:165
  • `mkdirSync` in `installPackFromUrl` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — REDACTED:157, REDACTED:194, REDACTED:200
  • `mkdtempSync` in `installPackFromUrl` 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:158
  • `writeFileSync` in `installPackFromUrl` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:162, REDACTED:195
  • `existsSync` in `installPackFromUrl` 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:169
  • `renameSync` in `installPackFromUrl` 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:201
  • `rmSync` in `installPackFromUrl` 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:204
  • `existsSync` in `callback to action` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:910, REDACTED:915
  • `lstatSync` in `callback to action` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:911, REDACTED:928

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 Safety9.7 / 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 Duplication6.5 / 10Adequate✓ 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.

  • packages/daemon/specs/agents/shared/skills/ and skills/_canonical/ are near-verbatim copies of each other: 54 files are byte-identical under the same relative paths (~9686 lines; the trees hold 54 and 54 files). That is one structural fact, not 54 local ones: every edit made to one tree and not the other drifts silently, which is the failure whole-tree forks guarantee. Pick one tree as the single source and produce the other from it (generated, copied at build or release time, or re-exported) — or, if the copy is a stale snapshot nothing produces any more, delete it. Check first whether the copy is a deliberately published deliverable (a template consumers copy verbatim, a released sample frozen at a version); where it is, keep it produced from the source tree rather than edited in place. — skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:1
  • 153 duplicated blocks under packages/ have copies in at least two of the sibling directories cli, daemon, tui, ui — 96 of them are reported below, and 57 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 153 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 153 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 153 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. — REDACTED:1
  • 34 duplicated blocks under packages/daemon/src/ have copies in at least two of the sibling directories adapters, domain, routes, terminal — 26 of them are reported below, and 8 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 34 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 34 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 34 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. — packages/daemon/src/domain/hosts/read-through.ts:125
  • 14 duplicated blocks under packages/ui/src/components/ have copies in at least two of the sibling directories agent-images, dashboard, drawer-viewers, files, for-you, lab (+7 more sibling(s) not listed) — 6 of them are reported below, and 8 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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. — packages/ui/src/components/for-you/FeedCard.tsx:613
  • 13 duplicated blocks under packages/ui/src/ have copies in at least two of the sibling directories components, hooks, lib — 7 of them are reported below, and 6 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 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 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 13 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. — packages/ui/src/components/project/ScopePages.tsx:457
  • 11 duplicated blocks under packages/daemon/src/domain/ have copies in at least two of the sibling directories agent-images, context-packs, feed, files, gateway, hosts (+8 more sibling(s) not listed) — 6 of them are reported below, and 5 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 11 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 11 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 11 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. — packages/daemon/src/domain/agent-images/manifest-parser.ts:17
  • 9 of the duplicated blocks reported below have copies in at least two of the sibling directories packages, scripts, skills under the repository root. That concentration is one structural fact, not 9 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 9 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. — packages/daemon/scripts/gen-control-plane-json.mjs:249
  • 6 duplicated blocks under packages/tui/src/ have copies in at least two of the sibling directories attention, cost, crash-cart, execution, health, pulse (+3 more sibling(s) not listed) — 5 of them are reported below, and 1 is 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 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 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 6 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. — packages/tui/src/cost/cost-model.ts:139
  • 5 duplicated blocks under packages/daemon/ have copies in at least two of the sibling directories assets, scripts, src — 3 of them are reported below, and 2 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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. — packages/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs:34
  • REDACTED:1 · REDACTED:1 — these 2 files are line-for-line copies of one another — 365 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. — REDACTED:1
  • packages/cli/src/host-registry.ts:66 · packages/daemon/src/domain/hosts/hosts-registry-reader.ts:21 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/cli/src/host-registry.ts:66
  • packages/daemon/src/domain/review/types.ts:62 · packages/ui/src/hooks/useReview.ts:18 — the two spans are one implementation copied and then locally edited — 649 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. — packages/daemon/src/domain/review/types.ts:62
  • packages/daemon/src/domain/agent-images/manifest-parser.ts:17 · REDACTED:33 — the two spans are one implementation copied and then locally edited — 620 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. — packages/daemon/src/domain/agent-images/manifest-parser.ts:17
  • packages/cli/src/host-registry.ts:335 · packages/daemon/src/domain/hosts/hosts-registry-writer.ts:34 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/cli/src/host-registry.ts:335
  • packages/cli/src/commands/ps.ts:1764 · packages/cli/src/commands/whoami.ts:527 — the two spans are one implementation copied and then locally edited — 902 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. — packages/cli/src/commands/ps.ts:1764
  • packages/cli/src/lib/permission-policy/policy-ref.ts:17 · packages/daemon/src/domain/permission-policy/policy-ref.ts:17 — these 2 files are line-for-line copies of one another — 96 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. — packages/cli/src/lib/permission-policy/policy-ref.ts:17
  • packages/daemon/src/routes/plugins.ts:71 · packages/daemon/src/routes/skills.ts:44 — the two spans are one implementation copied and then locally edited — 873 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. — packages/daemon/src/routes/plugins.ts:71
  • packages/cli/src/commands/queue.ts:1919 · packages/cli/src/commands/queue.ts:2026 — 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. — packages/cli/src/commands/queue.ts:1919
  • packages/cli/src/lib/scope/types.ts:9 · packages/daemon/src/domain/scope/types.ts:9 — the 2 copies are spread across 2 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited. — packages/cli/src/lib/scope/types.ts:9
  • REDACTED:18 · REDACTED:18 — these 2 files are line-for-line copies of one another — 81 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. — REDACTED:18
  • packages/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs:34 · packages/daemon/src/domain/markdown-address.ts:64 — the two spans are one implementation copied and then locally edited — 662 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. — packages/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs:34
  • packages/daemon/src/domain/queue-repository.ts:2853 · packages/daemon/src/domain/queue-repository.ts:3039 — 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. — packages/daemon/src/domain/queue-repository.ts:2853
  • packages/daemon/src/routes/chat.ts:13 · packages/daemon/src/routes/stream.ts:38 — the two spans are one implementation copied and then locally edited — 578 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. — packages/daemon/src/routes/chat.ts:13
  • packages/daemon/src/domain/feed/attention-aggregator.ts:43 · packages/daemon/src/domain/review/fleet-compose.ts:227 — the two spans are one implementation copied and then locally edited — 615 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. — packages/daemon/src/domain/feed/attention-aggregator.ts:43
  • packages/daemon/src/routes/bundles.ts:1136 · packages/daemon/src/routes/up.ts:199 — the two spans are one implementation copied and then locally edited — 677 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. — packages/daemon/src/routes/bundles.ts:1136
  • packages/daemon/src/domain/mission-control/audit-browse.ts:42 · packages/daemon/src/domain/mission-control/mission-control-action-log.ts:63 — the two spans are one implementation copied and then locally edited — 407 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. — packages/daemon/src/domain/mission-control/audit-browse.ts:42
  • packages/cli/src/commands/scope.ts:1367 · packages/daemon/src/routes/scope-audit.ts:267 — 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. — packages/cli/src/commands/scope.ts:1367
  • packages/ui/src/hooks/useDismissedCardIds.ts:17 · packages/ui/src/hooks/useDismissedSeqs.ts:11 — the two spans are one implementation copied and then locally edited — 447 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. — packages/ui/src/hooks/useDismissedCardIds.ts:17
  • packages/cli/src/lib/permission-policy/policy-spec.ts:9 · packages/daemon/src/domain/permission-policy/policy-spec.ts:9 — these 2 files are line-for-line copies of one another — 62 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. — packages/cli/src/lib/permission-policy/policy-spec.ts:9
  • packages/cli/src/openrig-compat.ts:40 · packages/daemon/src/openrig-compat.ts:8 — the two spans are one implementation copied and then locally edited — 357 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. — packages/cli/src/openrig-compat.ts:40
  • packages/daemon/src/domain/claim-service.ts:396 · packages/daemon/src/domain/claim-service.ts:844 — the two spans are one implementation copied and then locally edited — 420 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. — packages/daemon/src/domain/claim-service.ts:396
  • packages/daemon/src/domain/spec-review-service.ts:12 · packages/ui/src/hooks/useSpecReview.ts:20 — the two spans are one implementation copied and then locally edited — 287 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. — packages/daemon/src/domain/spec-review-service.ts:12
  • packages/daemon/src/domain/files/file-write-service.ts:143 · packages/daemon/src/domain/files/file-write-service.ts:234 — the two spans are one implementation copied and then locally edited — 391 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. — packages/daemon/src/domain/files/file-write-service.ts:143
  • packages/ui/src/components/DiscoveryOverlay.tsx:32 · packages/ui/src/components/DiscoveryPanel.tsx:78 — 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. — packages/ui/src/components/DiscoveryOverlay.tsx:32
  • packages/cli/src/lib/scope/logical-checkbox.ts:45 · packages/daemon/src/domain/scope/logical-checkbox.ts:45 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/cli/src/lib/scope/logical-checkbox.ts:45
  • packages/daemon/src/adapters/pi-resume.ts:120 · packages/daemon/src/adapters/pi-runtime-adapter.ts:358 — the two spans are one implementation copied and then locally edited — 442 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. — packages/daemon/src/adapters/pi-resume.ts:120
  • packages/ui/src/components/AgentSpecReview.tsx:17 · packages/ui/src/components/RigSpecReview.tsx:20 — the two spans are one implementation copied and then locally edited — 270 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. — packages/ui/src/components/AgentSpecReview.tsx:17
  • packages/cli/src/config-store.ts:859 · packages/daemon/src/domain/user-settings/settings-store.ts:510 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/cli/src/config-store.ts:859
  • packages/daemon/src/domain/mission-control/notification-adapter-ntfy.ts:36 · packages/daemon/src/domain/mission-control/notification-adapter-webhook.ts:44 — the two spans are one implementation copied and then locally edited — 319 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. — packages/daemon/src/domain/mission-control/notification-adapter-ntfy.ts:36
  • packages/ui/src/hooks/usePluginFiles.ts:16 · packages/ui/src/hooks/useSkillFiles.ts:14 — 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. — packages/ui/src/hooks/usePluginFiles.ts:16

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 Boundaries0.0 / 10Critical✓ 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.

  • packages/cli/test/acp-real-queue.test.ts:12 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/event-bus.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-real-queue.test.ts:12
  • packages/cli/test/acp-real-queue.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/queue-repository.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-real-queue.test.ts:13
  • packages/cli/test/acp-real-queue.test.ts:14 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/queue.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-real-queue.test.ts:14
  • packages/cli/test/acp-serve.test.ts:12 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/connection.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:12
  • packages/cli/test/acp-serve.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/migrate.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:13
  • packages/cli/test/acp-serve.test.ts:14 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/all-migrations.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:14
  • packages/cli/test/acp-serve.test.ts:15 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/event-bus.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:15
  • packages/cli/test/acp-serve.test.ts:16 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/queue-repository.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:16
  • packages/cli/test/acp-serve.test.ts:17 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/queue.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:17
  • packages/cli/test/acp-serve.test.ts:18 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/mission-control.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:18
  • packages/cli/test/acp-serve.test.ts:19 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/mission-control/mission-control-write-contract.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:19
  • packages/cli/test/acp-serve.test.ts:20 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/mission-control/mission-control-action-log.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:20
  • packages/cli/test/acp-serve.test.ts:23 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/gateway/human-registry.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/acp-serve.test.ts:23
  • packages/cli/test/attach-reply-address.test.ts:16 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/connection.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:16
  • packages/cli/test/attach-reply-address.test.ts:17 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/migrate.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:17
  • packages/cli/test/attach-reply-address.test.ts:18 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/all-migrations.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:18
  • packages/cli/test/attach-reply-address.test.ts:19 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/rig-repository.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:19
  • packages/cli/test/attach-reply-address.test.ts:20 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/pod-repository.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:20
  • packages/cli/test/attach-reply-address.test.ts:21 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/session-registry.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:21
  • packages/cli/test/attach-reply-address.test.ts:22 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/event-bus.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:22
  • packages/cli/test/attach-reply-address.test.ts:23 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/self-attach-service.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:23
  • packages/cli/test/attach-reply-address.test.ts:24 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/session-transport.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:24
  • packages/cli/test/attach-reply-address.test.ts:25 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/whoami-service.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:25
  • packages/cli/test/attach-reply-address.test.ts:26 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/transcript-store.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:26
  • packages/cli/test/attach-reply-address.test.ts:27 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/rigs.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:27
  • packages/cli/test/attach-reply-address.test.ts:28 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/transport.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:28
  • packages/cli/test/attach-reply-address.test.ts:29 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/whoami.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/attach-reply-address.test.ts:29
  • packages/cli/test/browser-boundary-cli-render.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/middleware/browser-boundary.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/browser-boundary-cli-render.test.ts:13
  • packages/cli/test/bundle-behaviour.test.ts:7 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/bundle-behaviour.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/bundle-behaviour.test.ts:7
  • packages/cli/test/bundle-behaviour.test.ts:8 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/bundle-identity.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/bundle-behaviour.test.ts:8
  • packages/cli/test/bundle-link-legacy.test.ts:6 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/connection.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/bundle-link-legacy.test.ts:6
  • packages/cli/test/bundle-link-legacy.test.ts:7 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/migrate.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/bundle-link-legacy.test.ts:7
  • packages/cli/test/bundle-link-legacy.test.ts:8 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/all-migrations.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/bundle-link-legacy.test.ts:8
  • packages/cli/test/bundle-login-files.test.ts:7 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/connection.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/bundle-login-files.test.ts:7
  • packages/cli/test/bundle-login-files.test.ts:8 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/migrate.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/bundle-login-files.test.ts:8
  • packages/cli/test/bundle-login-files.test.ts:9 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/all-migrations.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/bundle-login-files.test.ts:9
  • packages/cli/test/bundle-source.test.ts:8 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/pod-bundle-assembler.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/bundle-source.test.ts:8
  • packages/cli/test/claude-versioned-attention.test.ts:7 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/rig-repository.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/claude-versioned-attention.test.ts:7
  • packages/cli/test/claude-versioned-attention.test.ts:8 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/session-registry.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/claude-versioned-attention.test.ts:8
  • packages/cli/test/claude-versioned-attention.test.ts:9 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/event-bus.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/cli/test/claude-versioned-attention.test.ts:9

What to do

  • Fix the listed violations: import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (364 rows); respect the layer/slice order — import only through a slice's public index and never upward into a higher layer (145 rows); move the shared test helper into a source directory production code may depend on (7 rows); declare the workspace packages these files import in the importing package's own package.json dependencies (6 rows) — those imports are already bare package specifiers, so the import statements do not change, only the manifest.
R2 · Cyclomatic Complexity8.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.

  • startNodeWithWarnings has cyclomatic complexity 280 and cognitive complexity 455; 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. — packages/daemon/src/domain/startup-orchestrator.ts:347
  • (anonymous) has cyclomatic complexity 255 and cognitive complexity 441; 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. — packages/cli/src/commands/up.ts:154
  • hydrateSnapshot has cyclomatic complexity 238 and cognitive complexity 262; 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. — packages/tui/src/hydrate.ts:392
  • contentLines has cyclomatic complexity 237 and cognitive complexity 520; 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. — packages/tui/src/render.ts:962
  • postLaunchRestore has cyclomatic complexity 216 and cognitive complexity 416; 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. — packages/daemon/src/domain/restore-orchestrator.ts:1947
  • advancePromptRefusals has cyclomatic complexity 203 and cognitive complexity 375; 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. — packages/daemon/src/domain/queue-wake-ladder.ts:1256
  • runStuckSweep has cyclomatic complexity 195 and cognitive complexity 337; 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. — packages/daemon/src/domain/queue-stuck-sweep.ts:804
  • sendUnguarded has cyclomatic complexity 191 and cognitive complexity 287; 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. — packages/daemon/src/domain/session-transport.ts:3444
  • describeBundleBehaviour has cyclomatic complexity 176 and cognitive complexity 430; 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. — packages/daemon/src/domain/bundle-behaviour.ts:110
  • updateInTransactionalContext has cyclomatic complexity 170 and cognitive complexity 186; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/daemon/src/domain/queue-repository.ts:3628
  • postHook has cyclomatic complexity 160 and cognitive complexity 229; 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. — packages/daemon/src/routes/activity.ts:396
  • handover has cyclomatic complexity 146 and cognitive complexity 216; 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. — packages/daemon/src/domain/seat-handover-service.ts:400
  • restoreNodeWithCompensation has cyclomatic complexity 146 and cognitive complexity 194; 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. — packages/daemon/src/domain/restore-orchestrator.ts:1274
  • reduce has cyclomatic complexity 143 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 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. — packages/tui/src/state.ts:124
  • (anonymous) has cyclomatic complexity 140 and cognitive complexity 288; 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. — packages/cli/src/commands/start.ts:210
  • openTerminalWindow has cyclomatic complexity 140 and cognitive complexity 202; 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. — packages/cli/src/terminal-window.ts:221
  • (anonymous) has cyclomatic complexity 137 and cognitive complexity 193; 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. — packages/cli/src/commands/launch.ts:93
  • createDaemon has cyclomatic complexity 136 and cognitive complexity 175; 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. — packages/daemon/src/startup.ts:344
  • handleEvent has cyclomatic complexity 132 and cognitive complexity 183; 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:1594
  • launchExistingAgentMember has cyclomatic complexity 121 and cognitive complexity 154; 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. — packages/daemon/src/domain/rigspec-instantiator.ts:2477
  • handleInput has cyclomatic complexity 116 and cognitive complexity 235; 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. — packages/tui/src/main.ts:554
  • runWakeLadderTick has cyclomatic complexity 113 and cognitive complexity 223; 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. — packages/daemon/src/domain/queue-wake-ladder.ts:671
  • setRuntime has cyclomatic complexity 112 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. — packages/daemon/src/domain/seat-runtime-switch-service.ts:200
  • (anonymous) has cyclomatic complexity 110 and cognitive complexity 217; 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. — packages/daemon/src/routes/attention.ts:21
  • (anonymous) has cyclomatic complexity 110 and cognitive complexity 141; 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. — packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs:361
  • renderBody has cyclomatic complexity 109 and cognitive complexity 145; 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. — packages/tui/src/render.ts:1925
  • apply has cyclomatic complexity 107 and cognitive complexity 145; 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. — packages/daemon/src/domain/terminal/herdr-follow-view.ts:47
  • engineDeliver has cyclomatic complexity 106 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. — packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:1038
  • (anonymous) has cyclomatic complexity 106 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. — packages/daemon/src/domain/finite-telemetry.ts:138
  • buildExecutionView has cyclomatic complexity 104 and cognitive complexity 152; 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. — packages/daemon/src/domain/execution-view.ts:751
  • rebindAndVerifyPaneIdentity has cyclomatic complexity 103 and cognitive complexity 127; 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. — packages/daemon/src/domain/seat-attention-reconciler.ts:134
  • (anonymous) has cyclomatic complexity 102 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. — packages/daemon/src/routes/startup.ts:397
  • handleResponse has cyclomatic complexity 100 and cognitive complexity 170; 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:1254
  • launchHarness has cyclomatic complexity 100 and cognitive complexity 121; 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. — packages/daemon/src/adapters/claude-code-adapter.ts:325
  • addNode has cyclomatic complexity 99 and cognitive complexity 121; 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. — packages/daemon/src/domain/rig-repository.ts:654
  • handleNodes has cyclomatic complexity 97 and cognitive complexity 153; 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. — packages/cli/src/commands/ps.ts:1362
  • (anonymous) has cyclomatic complexity 97 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. — packages/cli/src/commands/import.ts:59
  • validateAgentSpec has cyclomatic complexity 96 and cognitive complexity 243; 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. — packages/daemon/src/domain/agent-manifest.ts:151
  • recoverAfterRestart has cyclomatic complexity 96 and cognitive complexity 108; 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. — packages/daemon/src/domain/claude-compaction-enforcer.ts:2113
  • (anonymous) has cyclomatic complexity 95 and cognitive complexity 94; 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. — packages/cli/src/commands/ps.ts:1066
R3 · Large Files5.0 / 10Adequate✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • packages/daemon/src/domain/queue-repository.ts has 6154 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/queue-repository.ts:1
  • packages/daemon/src/domain/session-transport.ts has 5199 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/session-transport.ts:1
  • packages/daemon/src/domain/rigspec-instantiator.ts has 3145 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/rigspec-instantiator.ts:1
  • packages/daemon/src/startup.ts has 3063 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/startup.ts:1
  • packages/daemon/src/domain/restore-orchestrator.ts has 3052 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/restore-orchestrator.ts:1
  • packages/daemon/src/adapters/codex-runtime-adapter.ts has 2907 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/adapters/codex-runtime-adapter.ts:1
  • packages/daemon/src/adapters/tmux.ts has 2892 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/adapters/tmux.ts:1
  • packages/cli/src/commands/queue.ts has 2636 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/cli/src/commands/queue.ts:1
  • packages/cli/src/mcp-server.ts has 2610 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/cli/src/mcp-server.ts:1
  • REDACTED has 2517 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
  • packages/daemon/src/domain/seat-lifecycle-service.ts has 2472 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/seat-lifecycle-service.ts:1
  • packages/cli/src/commands/scope.ts has 2318 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/cli/src/commands/scope.ts:1
  • packages/daemon/src/domain/claude-compaction-enforcer.ts has 2304 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/claude-compaction-enforcer.ts:1
  • packages/daemon/src/domain/seat-handover-service.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. — packages/daemon/src/domain/seat-handover-service.ts:1
  • packages/tui/src/render.ts has 2077 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/tui/src/render.ts:1
  • packages/daemon/src/domain/workflow-projector.ts has 2050 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/workflow-projector.ts:1
  • packages/cli/src/commands/seat.ts has 2005 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/cli/src/commands/seat.ts:1
  • packages/daemon/src/domain/workflow-runtime.ts has 1974 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/workflow-runtime.ts:1
  • packages/daemon/src/domain/queue-stuck-sweep.ts has 1957 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/queue-stuck-sweep.ts:1
  • REDACTED has 1930 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
  • packages/cli/src/commands/ps.ts has 1922 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/cli/src/commands/ps.ts:1
  • packages/daemon/src/domain/queue-wake-ladder.ts has 1896 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/queue-wake-ladder.ts:1
  • packages/daemon/src/routes/queue.ts has 1868 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/routes/queue.ts:1
  • packages/cli/src/config-store.ts has 1773 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/cli/src/config-store.ts:1
  • packages/daemon/src/domain/restore-check-service.ts has 1766 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/restore-check-service.ts:1
  • packages/daemon/src/domain/types.ts has 1659 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/types.ts:1
  • packages/daemon/src/domain/slices/slice-indexer.ts has 1634 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/slices/slice-indexer.ts:1
  • packages/daemon/src/domain/user-settings/settings-store.ts has 1546 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/user-settings/settings-store.ts:1
  • packages/daemon/src/domain/gateway/slack/slack-subsystem.ts has 1517 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:1
  • REDACTED has 1488 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
  • packages/daemon/src/adapters/claude-code-adapter.ts has 1447 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/adapters/claude-code-adapter.ts:1
  • packages/daemon/src/domain/rigspec-schema.ts has 1443 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/rigspec-schema.ts:1
  • packages/daemon/src/domain/startup-orchestrator.ts has 1406 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/startup-orchestrator.ts:1
  • packages/daemon/src/domain/execution-view.ts has 1383 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/execution-view.ts:1
  • packages/daemon/src/domain/skill-catalog.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. — packages/daemon/src/domain/skill-catalog.ts:1
  • packages/ui/src/components/project/ScopePages.tsx has 1334 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/components/project/ScopePages.tsx:1
  • packages/daemon/src/domain/rig-repository.ts has 1310 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/rig-repository.ts:1
  • REDACTED has 1308 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
  • packages/daemon/src/routes/bundles.ts has 1230 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/routes/bundles.ts:1
  • packages/daemon/src/domain/seat-skill-storage.ts has 1216 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/daemon/src/domain/seat-skill-storage.ts:1

What to do

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

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×39) — skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:1, packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs:1, packages/ui/twin/corrective/fixtures-corrective.ts:1, …

What to do

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

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

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

  • 42 outdated package(s); JS/npm CVEs scored in D30
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

  • Unreachable from the 224 application, 235 tooling and 2399 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (224 application, 235 tooling, 2399 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 (×19) — packages/daemon/src/domain/workspace/getting-started-narrative.ts, packages/ui/src/components/mission-control/components/CompactStatusRow.tsx, packages/ui/src/components/RigEnvPanel.tsx, …
  • no import path from any entry point (224 application, 235 tooling, 2399 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/ui/src/components/RigCard.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/ui/src/hooks/useCountUp.ts
  • no import path from any entry point (224 application, 235 tooling, 2399 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/ui/src/components/RigEnvPanel.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/ui/src/hooks/useRigEnv.ts
  • Nothing imports this binding — it is safe to review for removal. (×18) — packages/cli/src/lib/hosts/fanout-contract.ts:30, packages/cli/src/lib/hosts/fanout-contract.ts:35, packages/cli/src/lib/hosts/fanout-contract.ts:48, …

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene0.0 / 10Critical✓ 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. (×9) — packages/test-system/ci/mcp-stdio.mjs:2, scripts/check-first-run-references.test.mjs:6, scripts/generate-context-packs.test.mjs:585, …
  • Declared in packages/cli/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. — packages/cli/package.json:49
  • Declared in packages/ui/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. — packages/ui/package.json:28
  • Only test files import it (first: packages/cli/test/acp-real-queue.test.ts:4) — move it to devDependencies. — packages/cli/package.json:48

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.

  • packages/daemon/src/adapters/kernel-authority.ts → packages/daemon/src/domain/claude-compaction-enforcer.ts → packages/daemon/src/domain/session-transport.ts → packages/daemon/src/domain/native-resume-probe.ts → packages/daemon/src/adapters/kernel-authority.ts (one verified cycle inside a mutually-dependent group of 19 files) — packages/daemon/src/adapters/kernel-authority.ts:5
  • packages/daemon/src/domain/activity-grants.ts → packages/daemon/src/domain/session-registry.ts → packages/daemon/src/domain/activity-grants.ts — packages/daemon/src/domain/activity-grants.ts:11
  • packages/daemon/src/domain/queue-repository.ts → packages/daemon/src/domain/queue-wake-ladder.ts → packages/daemon/src/domain/queue-stuck-sweep.ts → packages/daemon/src/domain/queue-repository.ts (one verified cycle inside a mutually-dependent group of 5 files) — packages/daemon/src/domain/queue-repository.ts:2
  • packages/daemon/src/domain/proof/judgments.ts → REDACTED → packages/daemon/src/domain/review/types.ts → packages/daemon/src/domain/proof/judgments.ts — packages/daemon/src/domain/proof/judgments.ts:6
  • packages/daemon/src/domain/workflow-instance-store.ts → packages/daemon/src/domain/workflow-scope.ts → packages/daemon/src/domain/workflow-instance-store.ts — packages/daemon/src/domain/workflow-instance-store.ts:10

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture8.0 / 10Strong✓ 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.

  • `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.) — REDACTED:554
  • `serve(…)` 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) — packages/daemon/src/index.ts:379, packages/daemon/src/index.ts:387

What to do

  • Enforce HTTPS on each listed server: serve TLS itself, or redirect plain requests to `https://` and send `Strict-Transport-Security` (`helmet()` does by default) behind the TLS-terminating proxy — and commit that proxy's configuration beside the service. A server only this machine reaches should bind `127.0.0.1`.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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 document1.5 / 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.

  • `canonicalJson` is exported, takes a document from its caller (line 24) and hands it to `sortValue`, which calls itself at line 9 (`sortValue`) with a piece of `value` (and at line 13) — and nowhere in `sortValue` 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 `sortValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/ui/twin/capture/payload-diff.ts:9
  • `diffPaths` is exported and takes `before: unknown` from its caller, and it calls itself at line 42 (`diffPaths`) with a piece of `before` — and nowhere in `diffPaths` 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 `diffPaths` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/ui/twin/capture/payload-diff.ts:42
  • `healthHash` is exported, takes a document from its caller (line 27) and hands it to `stable`, which calls itself at line 28 (`stable`) with a piece of `v` (and at line 29) — and nowhere in `stable` 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 `stable` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/daemon/src/domain/health-policy.ts:28
  • `settingsBrowser` is exported, takes a document from its caller (line 117) and hands it to `policyLeaves`, which calls itself at line 265 (`policyLeaves`) with a piece of `value` — and nowhere in `policyLeaves` 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 `policyLeaves` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/daemon/src/domain/user-settings/settings-browser.ts:265
  • `deriveRigLayout` is exported, takes a document from its caller (line 157) and hands it to `findParent`, which calls itself at line 72 (`findParent`) with a piece of `node` — and nowhere in `findParent` 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 `findParent` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/daemon/src/domain/terminal/herdr-app-layout.ts:72
  • `referencedTerminals` is exported, takes a document from its caller (line 81) and hands it to `walk`, which calls itself at line 87 (`walk`) with a piece of `n` (and at line 89) — 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. — packages/daemon/src/domain/terminal/herdr-app-layout.ts:87
  • `findNode` is exported and takes `node: unknown` from its caller, and it calls itself at line 164 (`findNode`) with a piece of `node` — and nowhere in `findNode` 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 `findNode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/daemon/src/domain/terminal/herdr-app-state.ts:164
  • `findCredential` is exported and takes `value: unknown` from its caller, and it calls itself at line 78 (`findCredential`) with a piece of `value` (and at line 87) — and nowhere in `findCredential` 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 `findCredential` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/daemon/src/domain/provider/subscription-move-report.ts:78
  • `canonicalV0` is exported and takes `value: Json` from its caller, and it calls itself at line 121 (`canonicalV0`) with a piece of `value` (and at line 122) — and nowhere in `canonicalV0` 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 `canonicalV0` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/cli/src/lib/reconstruction-reader.ts:121

What to do

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

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

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

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

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

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

X2 · Cancellation propagation5.5 / 10Adequate✓ 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 24/97 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.
  • `fetchAgentImages` 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 })`. — packages/ui/src/hooks/useAgentImageLibrary.ts:63
  • `fetchAgentImagePreview` 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 })`. — packages/ui/src/hooks/useAgentImageLibrary.ts:81
  • `fetchArchived` 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 })`. — packages/ui/src/hooks/useArchivedRigs.ts:9
  • `fetchAttentionItems` 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 })`. — packages/ui/src/hooks/useAttentionItems.ts:68
  • `fetchAggregatedAttention` 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 })`. — packages/ui/src/hooks/useAttentionItems.ts:76
  • `fetchFleet` 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 })`. (×2) — packages/ui/src/hooks/useContextFleet.ts:54, packages/ui/src/hooks/useFleet.ts:90
  • `fetchContextPacks` 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 })`. — packages/ui/src/hooks/useContextPackLibrary.ts:41
  • `fetchContextPackPreview` 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 })`. — packages/ui/src/hooks/useContextPackLibrary.ts:64
  • `fetchDaemonHealth` 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 })`. — packages/ui/src/hooks/useDaemonHealth.ts:31
  • `fetchDaemonVersion` 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 })`. — packages/ui/src/hooks/useDaemonVersion.ts:15
  • `queryFn` 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 })`. (×7) — packages/ui/src/hooks/useDiscovery.ts:64, packages/ui/src/hooks/useHosts.ts:179, packages/ui/src/hooks/useMissionStatuses.ts:29, …
  • `fetchRoots` 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 })`. — packages/ui/src/hooks/useFiles.ts:31
  • `fetchList` 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 })`. (×2) — packages/ui/src/hooks/useFiles.ts:69, packages/ui/src/hooks/usePluginFiles.ts:35
  • `fetchRead` 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 })`. (×2) — packages/ui/src/hooks/useFiles.ts:139, packages/ui/src/hooks/usePluginFiles.ts:43
  • `fetchHosts` 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 })`. — packages/ui/src/hooks/useHosts.ts:34
  • `fetchKernelStatus` 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 })`. — packages/ui/src/hooks/useKernelStatus.ts:46
  • `fetchLaunchPlan` 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 })`. — packages/ui/src/hooks/useLaunchPlan.ts:32
  • `fetchLibrarySkills` 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 })`. — packages/ui/src/hooks/useLibrarySkills.ts:42
  • `fetchNodeDetail` 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 })`. — packages/ui/src/hooks/useNodeDetail.ts:93
  • `fetchNodeInventory` 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 })`. — packages/ui/src/hooks/useNodeInventory.ts:87
  • `fetchNodePreview` 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 })`. — packages/ui/src/hooks/useNodePreview.ts:26
  • `fetchSessionPreview` 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 })`. — packages/ui/src/hooks/useNodePreview.ts:90
  • `fetchPackageSummaries` 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 })`. — packages/ui/src/hooks/usePackages.ts:16
  • `fetchPlugins` 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 })`. — packages/ui/src/hooks/usePlugins.ts:89
  • `fetchPlugin` 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 })`. — packages/ui/src/hooks/usePlugins.ts:95
  • `fetchPluginUsedBy` 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 })`. — packages/ui/src/hooks/usePlugins.ts:101
  • `fetchProgressTree` 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 })`. — packages/ui/src/hooks/useProgressTree.ts:41
  • `fetchReviewAgents` 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 })`. — packages/ui/src/hooks/useReviewAgents.ts:25
  • `fetchChatHistory` 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 })`. — packages/ui/src/hooks/useRigChat.ts:14
  • `sendChatMessage` 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 })`. — packages/ui/src/hooks/useRigChat.ts:20

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

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

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

  • `sessionName` is text this program did not author, and it is written into the text of an element through markup this function returns 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. — packages/daemon/src/routes/compaction.ts:246
  • `code` is text this program did not author, and it is written into the text of an element through markup this function returns 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. — packages/daemon/src/routes/hosts.ts:225
  • `JSON.stringify(deps.terminalBearerToken)` is text this program did not author, and it is written into a script or style context through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute. — packages/daemon/src/server.ts:991

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

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.

  • `NodeLauncher` accepts `deps.defaultSilenceWindowSeconds` from the caller and keeps it in `this.defaultSilenceWindowSeconds` on line 154, where only it can read the value — but nothing ever reads `this.defaultSilenceWindowSeconds`. Setting `deps.defaultSilenceWindowSeconds` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.defaultSilenceWindowSeconds` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `deps.defaultSilenceWindowSeconds` from the accepted options so callers stop setting a knob that does nothing. — packages/daemon/src/domain/node-launcher.ts:154
  • `SuccessorSessionLauncher` accepts `opts.newId` from the caller and keeps it in `this.newId` on line 189, where only it can read the value — but nothing ever reads `this.newId`. Setting `opts.newId` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.newId` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `opts.newId` from the accepted options so callers stop setting a knob that does nothing. — packages/daemon/src/domain/successor-session-launcher.ts:189
  • `WhoamiService` accepts `deps.sessionRegistry` from the caller and keeps it in `this.sessionRegistry` on line 163, where only it can read the value — but nothing ever reads `this.sessionRegistry`. Setting `deps.sessionRegistry` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.sessionRegistry` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `deps.sessionRegistry` from the accepted options so callers stop setting a knob that does nothing. — packages/daemon/src/domain/whoami-service.ts:163

What to do

  • Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
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 element7.8 / 10Strong✓ Tool-verified

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.

  • This loop runs once per element of `ids`, and the statement it guards acts on the element it is on — `id`. The test deciding whether that statement runs does not: `result.ok` reads `ids[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2890, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — packages/daemon/src/domain/session-transport.ts:2894
  • This loop runs once per element of `ids`, and the statement it guards acts on the element it is on — `id`. The test deciding whether that statement runs does not: `result.outcome === "rendered-unconfirmed" || (opts?.verify && result.verified...` reads `ids[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2890, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — packages/daemon/src/domain/session-transport.ts:2895
  • This loop runs once per element of `ids`, and the statement it guards acts on the element it is on — `id`. The test deciding whether that statement runs does not: `result.inputPhase === "attempted" || result.inputPhase === "written"` reads `ids[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2890, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — packages/daemon/src/domain/session-transport.ts:2897
  • This loop runs once per element of `ids`, and the statement it guards acts on the element it is on — `id`. The test deciding whether that statement runs does not: `result.sent === false || result.inputPhase === "not_reached"` reads `ids[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2890, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — packages/daemon/src/domain/session-transport.ts:2898

What to do

  • Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
X3 · Exception handling5.0 / 10Adequate✓ Tool-verified

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

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

  • 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. (×29) — skills/_canonical/core/openrig-upgrade/scripts/inspect-upgrade.mjs:15, packages/ui/twin/fetch-stub.ts:161, packages/ui/twin/twin-main.tsx:43, …
  • `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. (×3) — packages/ui/src/lib/topology-events.ts:88, packages/ui/src/hooks/useNeedsInputSeats.ts:32, packages/ui/src/hooks/useWorkflowSse.ts:46
  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×7) — packages/ui/src/components/review/SliceReviewTab.tsx:86, packages/tui/src/daemon-client.ts:125, packages/tui/src/live-events.ts:113, …
  • `.then(…, () => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — packages/tui/src/main.ts:186

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 types7.2 / 10Strong✓ 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.

  • ~7.0 `!` null assertions per 1k TypeScript source lines — 2629 assertion(s) across the 373590 source line(s) of the 1523 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: packages/daemon/src/domain/session-transport.ts (158), packages/daemon/src/domain/native-resume-probe.ts (42), packages/daemon/src/domain/queue-repository.ts (41). 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 Health58.4Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture42.8Weak — gated by D26, R11, R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity75.8StrongStrongest area.
Readiness36.2Weak — gated by D11, R8, P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security47.8Weak — gated by D29, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling27.5Weak — gated by DM6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility55.9AdequateAcceptable, with room to improve.
Performance60.0AdequateAcceptable, 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 — 1 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 — 40 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 applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module 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
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • 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` in packages/daemon/) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> @openrig/daemon@0.7.1 dev / > tsx watch src/index.ts / sh: 1: tsx: not found / npm error Lifecycle script `dev` failed with error: / npm error code 127 / npm error path <repo>/packages/daemon / npm error workspace @openrig/daemon@0.7.1 / npm error location <repo>/packages/daemon / npm error command failed / npm error command sh -c tsx watch src/index.ts" 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.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D25 ADR Conformance — no ADRs to check
  • D32 Data Compliance (PII/GDPR) — 72 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D36 Supply-chain Provenance & Signing — The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files).
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • DM1 Aggregate boundaries — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM10 One transaction, one aggregate — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM2 Strongly-typed ids — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM4 Rich vs anemic model — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM5 Encapsulated state — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • 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'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • 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.
  • 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 — X27 reached only 0% of this repository's production lines — typescript (354,788 lines), javascript (15,885 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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 — 134 finding(s)
DM6 · Domain ↔ infrastructure boundary · Domain depends on infrastructure · ×40
  • Domain depends on infrastructure: active-lens-store packages/daemon/src/domain/active-lens-store.ts:21 — `packages/daemon/src/domain/active-lens-store.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: activity-endpoint REDACTED:19 — `REDACTED` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: activity-grants packages/daemon/src/domain/activity-grants.ts:8 — `packages/daemon/src/domain/activity-grants.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: agent-activity-store packages/daemon/src/domain/agent-activity-store.ts:8 — `packages/daemon/src/domain/agent-activity-store.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: agent-image-library-service packages/daemon/src/domain/agent-images/agent-image-library-service.ts:16 — `packages/daemon/src/domain/agent-images/agent-image-library-service.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: agent-image-library-service packages/daemon/src/domain/agent-images/agent-image-library-service.ts:81 — `packages/daemon/src/domain/agent-images/agent-image-library-service.ts` (domain layer) depends on `node:fs` (dynamic import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: evidence-guard packages/daemon/src/domain/agent-images/evidence-guard.ts:18 — `packages/daemon/src/domain/agent-images/evidence-guard.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: evidence-guard packages/daemon/src/domain/agent-images/evidence-guard.ts:148 — `packages/daemon/src/domain/agent-images/evidence-guard.ts` (domain layer) depends on `node:fs` (dynamic import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: resume-token-discovery packages/daemon/src/domain/agent-images/resume-token-discovery.ts:13 — `packages/daemon/src/domain/agent-images/resume-token-discovery.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: snapshot-capturer packages/daemon/src/domain/agent-images/snapshot-capturer.ts:15 — `packages/daemon/src/domain/agent-images/snapshot-capturer.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: agent-starter-resolver REDACTED:1 — `REDACTED` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: applied-launch-observation-store packages/daemon/src/domain/applied-launch-observation-store.ts:1 — `packages/daemon/src/domain/applied-launch-observation-store.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bootstrap-orchestrator packages/daemon/src/domain/bootstrap-orchestrator.ts:5 — `packages/daemon/src/domain/bootstrap-orchestrator.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bootstrap-orchestrator packages/daemon/src/domain/bootstrap-orchestrator.ts:25 — `packages/daemon/src/domain/bootstrap-orchestrator.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bootstrap-repository packages/daemon/src/domain/bootstrap-repository.ts:1 — `packages/daemon/src/domain/bootstrap-repository.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: builtin-policy-reference packages/daemon/src/domain/builtin-policy-reference.ts:17 — `packages/daemon/src/domain/builtin-policy-reference.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: builtin-startup-files packages/daemon/src/domain/builtin-startup-files.ts:19 — `packages/daemon/src/domain/builtin-startup-files.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: builtin-startup-files packages/daemon/src/domain/builtin-startup-files.ts:21 — `packages/daemon/src/domain/builtin-startup-files.ts` (domain layer) depends on `../openrig-compat.js` (import of `packages/daemon/src/openrig-compat.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bundle-archive packages/daemon/src/domain/bundle-archive.ts:11 — `packages/daemon/src/domain/bundle-archive.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bundle-behaviour-inspect packages/daemon/src/domain/bundle-behaviour-inspect.ts:1 — `packages/daemon/src/domain/bundle-behaviour-inspect.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bundle-carried-context-pack packages/daemon/src/domain/bundle-carried-context-pack.ts:1 — `packages/daemon/src/domain/bundle-carried-context-pack.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bundle-carried-project packages/daemon/src/domain/bundle-carried-project.ts:1 — `packages/daemon/src/domain/bundle-carried-project.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bundle-content-routing packages/daemon/src/domain/bundle-content-routing.ts:1 — `packages/daemon/src/domain/bundle-content-routing.ts` (domain layer) depends on `node:fs` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bundle-content-routing packages/daemon/src/domain/bundle-content-routing.ts:6 — `packages/daemon/src/domain/bundle-content-routing.ts` (domain layer) depends on `../openrig-compat.js` (import of `packages/daemon/src/openrig-compat.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: bundle-install-context packages/daemon/src/domain/bundle-install-context.ts:1 — `packages/daemon/src/domain/bundle-install-context.ts` (domain layer) depends on `better-sqlite3` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • + 15 more in this group — see findings.md.
AC2 · Forms & labels · <input> without a programmatic label · ×17
  • <input> without a programmatic label packages/ui/src/components/BundleInspector.tsx:25 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/BundleInstallFlow.tsx:59 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/BundleInstallFlow.tsx:64 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/DiscoveryOverlay.tsx:339 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label packages/ui/src/components/PackageInstallFlow.tsx:262 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/PackageInstallFlow.tsx:343 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label packages/ui/src/components/PackageInstallFlow.tsx:370 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label packages/ui/src/components/RigChatPanel.tsx:55 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/dashboard/HostConfigCard.tsx:90 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label packages/ui/src/components/dashboard/HostConfigCard.tsx:174 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/mission-control/components/VerbActions.tsx:300 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/mission-control/components/VerbActions.tsx:325 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/mission-control/views/AuditHistoryView.tsx:70 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/mission-control/views/AuditHistoryView.tsx:91 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/review/TranscriptDrillPanel.tsx:103 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/slices/tabs/DecisionsTab.tsx:64 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label packages/ui/src/components/system/SettingsTab.tsx:69 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels · <label> that labels no control · ×12
  • <label> that labels no control packages/ui/src/components/BootstrapWizard.tsx:118 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/BundleInspector.tsx:24 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/BundleInstallFlow.tsx:58 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/BundleInstallFlow.tsx:63 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/DiscoveryOverlay.tsx:324 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/DiscoveryOverlay.tsx:338 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/ImportFlow.tsx:199 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/PackageInstallFlow.tsx:259 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/PackageInstallFlow.tsx:328 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/PackageInstallFlow.tsx:342 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/PackageInstallFlow.tsx:354 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control packages/ui/src/components/PackageInstallFlow.tsx:377 — This <label> has no htmlFor 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 htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
D30 · Dependency Vulnerabilities · High CVE · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×7
  • Boundary-crossing change coupling: seat.ts ↔ seat-status-service.ts packages/cli/src/commands/seat.ts:1 — `packages/cli/src/commands/seat.ts` (context cli) and `packages/daemon/src/domain/seat-status-service.ts` (context daemon) sit in DIFFERENT parts of the tree yet change together 71% of the time (10 of the 14 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `a5bda7fd` feat(daemon): seat status shows guidance written after the agent load…; `6e85d4ad` feat(daemon): seat status shows what a seat's refocus hook has record…; `4168fb46` Show sanitized permission request observations in seat status (#2562) — run `git show` on any of them.
  • Boundary-crossing change coupling: config.ts ↔ config-model.ts packages/cli/src/commands/config.ts:1 — `packages/cli/src/commands/config.ts` (context cli) and `packages/tui/src/config/config-model.ts` (context tui) sit in DIFFERENT parts of the tree yet change together 62% of the time (15 of the 24 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `72ccfd03` feat(tui): read a remote rig's seats in the topology view behind ui.t…; `9e004f2a` feat(daemon): erase queue content for closed-work retention and accou…; `5e5b328e` perf(daemon): prune the history-only event types from events (retenti… — run `git show` on any of them.
  • Boundary-crossing change coupling: provider.ts ↔ provider.ts packages/cli/src/commands/provider.ts:1 — `packages/cli/src/commands/provider.ts` (context cli) and `packages/daemon/src/routes/provider.ts` (context daemon) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `92ef6321` fix(daemon): a provider switch keeps the running effort instead of re…; `1de69844` feat(provider): rig provider switch --seat moves one Codex seat to a …; `44222396` feat(provider): subscription move reports the Fleet app and the manag… — run `git show` on any of them.
  • Boundary-crossing change coupling: host.ts ↔ hosts.ts packages/cli/src/commands/host.ts:1 — `packages/cli/src/commands/host.ts` (context cli) and `packages/daemon/src/routes/hosts.ts` (context daemon) sit in DIFFERENT parts of the tree yet change together 58% of the time (11 of the 19 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `fc2ec997` fix(pairing): show the requesting machine's self-description quoted e…; `f3a3b171` fix(ssh): avoid passive TCP probes in host status (#2979); `adb5555f` fix(cli,daemon): separate ssh's options from the target with -- (#2973) — run `git show` on any of them.
  • Boundary-crossing change coupling: health-detectors.ts ↔ health-model.ts packages/daemon/src/domain/health-detectors.ts:1 — `packages/daemon/src/domain/health-detectors.ts` (context daemon) and `packages/tui/src/health/health-model.ts` (context tui) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `f027fdeb` fix(health): preserve available findings when one source fails (#626); `71e66bfa` fix(daemon): evaluate the busiest ceremony families past the family l…; `0fcdc5bc` Add scoped human-led and delegated operating posture — run `git show` on any of them.
  • Boundary-crossing change coupling: startup.ts ↔ health-model.ts packages/daemon/src/startup.ts:1 — `packages/daemon/src/startup.ts` (context daemon) and `packages/tui/src/health/health-model.ts` (context tui) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `f027fdeb` fix(health): preserve available findings when one source fails (#626); `71e66bfa` fix(daemon): evaluate the busiest ceremony families past the family l…; `0fcdc5bc` Add scoped human-led and delegated operating posture — run `git show` on any of them.
  • Boundary-crossing change coupling: up.ts ↔ up.ts packages/cli/src/commands/up.ts:1 — `packages/cli/src/commands/up.ts` (context cli) and `packages/daemon/src/routes/up.ts` (context daemon) sit in DIFFERENT parts of the tree yet change together 52% of the time (17 of the 33 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `7c262e67` fix(daemon): show each seat's restore permission in the plan previews…; `f81d38f2` feat(cli): rig up <spec> --name <rig> launches a spec under a chosen …; `2456a572` fix: make bundle reinstalls actionable and preserve stopped-team edit… — run `git show` on any of them.
AC2 · Forms & labels · <select> without a programmatic label · ×6
  • <select> without a programmatic label packages/ui/src/components/DiscoveryOverlay.tsx:325 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label packages/ui/src/components/PackageInstallFlow.tsx:329 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label packages/ui/src/components/PackageInstallFlow.tsx:355 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label packages/ui/src/components/mission-control/views/AuditHistoryView.tsx:78 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label packages/ui/src/components/slices/tabs/DecisionsTab.tsx:48 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label packages/ui/src/components/slices/tabs/DecisionsTab.tsx:56 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
D11 · Test Reliability · Flaky test · ×4
  • Flaky test: packages/daemon/test/list-processes-async.test.ts::B12-T real async list_processes — codex-runtime-adapter runs the REAL ps path and sees this very process in the table — Passed 1×, failed 1× across repeated runs.
  • Flaky test: packages/daemon/test/list-processes-async.test.ts::B12-T real async list_processes — resume-metadata-refresher runs the REAL ps path and sees this very process in the table — Passed 1×, failed 1× across repeated runs.
  • Flaky test: packages/daemon/test/staging-docker-invoker.test.ts::makeRealStagingDocker — the two-process tar-pipe contract, hermetically (sh stand-ins) DUAL-EXIT: tar fails while docker succeeds → the step FAILS and names the tar side (the shell-pipeline false-green class) — Passed 1×, failed 1× across repeated runs.
  • Flaky test: packages/tui/test/socket-concurrency.test.ts::two standalone TUIs stay usable and expose the second control path without replacing the first packages/tui/test/socket-concurrency.test.ts:105 — Passed 1×, failed 1× across repeated runs.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <textarea> without a programmatic label · ×2
  • <textarea> without a programmatic label packages/ui/src/components/files/FilesWorkspace.tsx:555 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <textarea> without a programmatic label packages/ui/src/components/mission-control/components/VerbActions.tsx:315 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
D30 · Dependency Vulnerabilities · Critical CVE · ×2
  • REDACTED
  • REDACTED
R8 · Dependency Hygiene · Unlisted import 'commander' · ×2
  • Unlisted import 'commander' scripts/check-first-run-references.test.mjs:6 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
  • Unlisted import 'commander' packages/daemon/test/community-harness-existing.test.ts:5 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'hono' · ×2
  • Unlisted import 'hono' scripts/generate-context-packs.test.mjs:585 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
  • Unlisted import 'hono' packages/tui/test/action-auth.test.ts:6 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (2 files) · ×2
  • Import cycle (2 files) packages/daemon/src/domain/activity-grants.ts:11 — packages/daemon/src/domain/activity-grants.ts → packages/daemon/src/domain/session-registry.ts → packages/daemon/src/domain/activity-grants.ts
  • Import cycle (2 files) packages/daemon/src/domain/workflow-instance-store.ts:10 — packages/daemon/src/domain/workflow-instance-store.ts → packages/daemon/src/domain/workflow-scope.ts → packages/daemon/src/domain/workflow-instance-store.ts
R9 · Circular Imports · Import cycle (3 files) · ×2
  • Import cycle (3 files) packages/daemon/src/domain/queue-repository.ts:2 — packages/daemon/src/domain/queue-repository.ts → packages/daemon/src/domain/queue-wake-ladder.ts → packages/daemon/src/domain/queue-stuck-sweep.ts → packages/daemon/src/domain/queue-repository.ts (one verified cycle inside a mutually-dependent group of 5 files)
  • Import cycle (3 files) packages/daemon/src/domain/proof/judgments.ts:6 — packages/daemon/src/domain/proof/judgments.ts → REDACTED → packages/daemon/src/domain/review/types.ts → packages/daemon/src/domain/proof/judgments.ts
AC2 · Forms & labels · Custom control with no accessible name on <div> · ×1
  • Custom control with no accessible name on <div> packages/ui/src/components/AppShell.tsx:584 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×1
  • Click handler on a non-interactive <div> packages/ui/src/components/AppShell.tsx:584 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×1
  • Clickable element isn't keyboard-operable packages/ui/src/components/project/StoryGraph.tsx:290 — The repo's own CSS styles .sg-cnode 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.
AC4 · Keyboard semantics · Click handler on a non-interactive <img> · ×1
  • Click handler on a non-interactive <img> packages/ui/src/components/review/SliceReviewTab.tsx:100 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics · Click handler on a non-interactive <th> · ×1
  • Click handler on a non-interactive <th> packages/ui/src/components/topology/TopologyTableView.tsx:480 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics · Click handler on a non-interactive <tr> · ×1
  • Click handler on a non-interactive <tr> packages/ui/src/components/topology/TopologyTableView.tsx:501 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
D10 · Test Quality · No assertions (empty test) · ×1
  • No assertions (empty test): preallocates timestamp/64-bit-hex IDs recognized by the existing lint, sort and last-eight consumers packages/cli/test/queue-id-compatibility.test.ts:15 — Test method has an empty body — it asserts nothing and exercises no code.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D31 · IaC & Container Security · High IaC · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import '@modelcontextprotocol/sdk' · ×1
  • Unlisted import '@modelcontextprotocol/sdk' packages/test-system/ci/mcp-stdio.mjs:2 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'typescript' · ×1
  • Unlisted import 'typescript' scripts/check-first-run-references.mjs:6 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'yaml' · ×1
  • Unlisted import 'yaml' scripts/check-first-run-references.mjs:7 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'ws' · ×1
  • Unlisted import 'ws' packages/daemon/test/browser-boundary-listener.test.ts:10 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'better-sqlite3' · ×1
  • Unlisted import 'better-sqlite3' packages/tui/test/action-auth.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) packages/daemon/src/adapters/kernel-authority.ts:5 — packages/daemon/src/adapters/kernel-authority.ts → packages/daemon/src/domain/claude-compaction-enforcer.ts → packages/daemon/src/domain/session-transport.ts → packages/daemon/src/domain/native-resume-probe.ts → packages/daemon/src/adapters/kernel-authority.ts (one verified cycle inside a mutually-dependent group of 19 files)
Serious — 3915 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×354
  • Hotspot: packages/daemon/src/startup.ts packages/daemon/src/startup.ts:344 — packages/daemon/src/startup.ts changed 239 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 269 in startup.createDaemon at line 344. 130 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/startup.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: packages/daemon/src/domain/session-transport.ts packages/daemon/src/domain/session-transport.ts:3444 — packages/daemon/src/domain/session-transport.ts changed 145 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 267 in SessionTransport.sendUnguarded at line 3444. 117 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/session-transport.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: packages/daemon/src/routes/queue.ts packages/daemon/src/routes/queue.ts:156 — packages/daemon/src/routes/queue.ts changed 76 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 468 in queue.queueRoutes at line 156. 39 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/routes/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: packages/cli/src/mcp-server.ts packages/cli/src/mcp-server.ts:982 — packages/cli/src/mcp-server.ts changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 556 in mcp-server.createMcpServer at line 982. 28 of those changes were fix/bug commits, and the other 34 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/cli/src/mcp-server.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: packages/daemon/src/domain/queue-stuck-sweep.ts packages/daemon/src/domain/queue-stuck-sweep.ts:804 — packages/daemon/src/domain/queue-stuck-sweep.ts changed 63 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 439 in queue-stuck-sweep.runStuckSweep at line 804. 49 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/queue-stuck-sweep.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: packages/daemon/src/domain/queue-repository.ts packages/daemon/src/domain/queue-repository.ts:3628 — packages/daemon/src/domain/queue-repository.ts changed 186 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 148 in QueueRepository.updateInTransactionalContext at line 3628. 112 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/queue-repository.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: packages/daemon/src/domain/restore-orchestrator.ts packages/daemon/src/domain/restore-orchestrator.ts:1947 — packages/daemon/src/domain/restore-orchestrator.ts changed 117 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 220 in RestoreOrchestrator.postLaunchRestore at line 1947. 77 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/restore-orchestrator.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: packages/cli/src/commands/seat.ts packages/cli/src/commands/seat.ts:540 — packages/cli/src/commands/seat.ts changed 77 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 285 in seat.seatCommand at line 540. 31 of those changes were fix/bug commits, and the other 46 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/cli/src/commands/seat.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: packages/daemon/src/domain/startup-orchestrator.ts packages/daemon/src/domain/startup-orchestrator.ts:347 — packages/daemon/src/domain/startup-orchestrator.ts changed 78 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 268 in StartupOrchestrator.startNodeWithWarnings at line 347. 47 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/startup-orchestrator.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: packages/cli/src/commands/queue.ts packages/cli/src/commands/queue.ts:1299 — packages/cli/src/commands/queue.ts changed 73 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 265 in queue.queueCommand at line 1299. 41 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/cli/src/commands/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: packages/tui/src/main.ts packages/tui/src/main.ts:55 — packages/tui/src/main.ts changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 273 in main.run at line 55. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/tui/src/main.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: packages/tui/src/render.ts packages/tui/src/render.ts:962 — packages/tui/src/render.ts changed 66 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 207 in render.contentLines at line 962. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/tui/src/render.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: packages/tui/src/hydrate.ts packages/tui/src/hydrate.ts:392 — packages/tui/src/hydrate.ts changed 55 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 230 in hydrate.hydrateSnapshot at line 392. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/tui/src/hydrate.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: packages/daemon/src/domain/queue-wake-ladder.ts packages/daemon/src/domain/queue-wake-ladder.ts:1256 — packages/daemon/src/domain/queue-wake-ladder.ts changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 224 in queue-wake-ladder.advancePromptRefusals at line 1256. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/queue-wake-ladder.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: packages/cli/src/commands/up.ts packages/cli/src/commands/up.ts:101 — packages/cli/src/commands/up.ts changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 240 in up.upCommand at line 101. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/cli/src/commands/up.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: packages/daemon/src/domain/seat-handover-service.ts packages/daemon/src/domain/seat-handover-service.ts:400 — packages/daemon/src/domain/seat-handover-service.ts changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 128 in SeatHandoverService.handover at line 400. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/seat-handover-service.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:241 — REDACTED changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 194 in context.contextCommand at line 241. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08: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: packages/daemon/src/adapters/claude-code-adapter.ts packages/daemon/src/adapters/claude-code-adapter.ts:325 — packages/daemon/src/adapters/claude-code-adapter.ts changed 77 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in ClaudeCodeAdapter.launchHarness at line 325. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/adapters/claude-code-adapter.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: packages/daemon/src/routes/activity.ts packages/daemon/src/routes/activity.ts:396 — packages/daemon/src/routes/activity.ts changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 166 in activity.postHook at line 396. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/routes/activity.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: packages/daemon/src/domain/rigspec-instantiator.ts packages/daemon/src/domain/rigspec-instantiator.ts:2477 — packages/daemon/src/domain/rigspec-instantiator.ts changed 74 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 109 in PodRigInstantiator.launchExistingAgentMember at line 2477. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/rigspec-instantiator.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: packages/cli/src/commands/provider.ts packages/cli/src/commands/provider.ts:61 — packages/cli/src/commands/provider.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 296 in provider.providerCommand at line 61. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/cli/src/commands/provider.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: packages/daemon/src/domain/execution-view.ts packages/daemon/src/domain/execution-view.ts:751 — packages/daemon/src/domain/execution-view.ts changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 179 in execution-view.buildExecutionView at line 751. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/execution-view.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: packages/daemon/src/domain/gateway/slack/slack-subsystem.ts packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:303 — packages/daemon/src/domain/gateway/slack/slack-subsystem.ts changed 65 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 102 in slack-subsystem.buildSlackGatewayWire at line 303. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/gateway/slack/slack-subsystem.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: packages/daemon/src/adapters/codex-runtime-adapter.ts packages/daemon/src/adapters/codex-runtime-adapter.ts:414 — packages/daemon/src/adapters/codex-runtime-adapter.ts changed 80 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in CodexRuntimeAdapter.ensureCodexCorePlugin at line 414. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/adapters/codex-runtime-adapter.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:1594 — REDACTED changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 133 in RunnerCore.handleEvent at line 1594. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08: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.
  • + 329 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×185
  • FunctionTooLong: startup.createDaemon packages/daemon/src/startup.ts:344 — FunctionTooLong — createDaemon runs 1663 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1563 over it, 16.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: queue.queueRoutes packages/daemon/src/routes/queue.ts:156 — FunctionTooLong — queueRoutes runs 1175 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1075 over it, 11.75× 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: seat.seatCommand packages/cli/src/commands/seat.ts:540 — FunctionTooLong — seatCommand runs 1104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1004 over it, 11.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: slack-subsystem.buildSlackGatewayWire packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:303 — FunctionTooLong — buildSlackGatewayWire runs 850 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 750 over it, 8.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: workflow.workflowCommand packages/cli/src/commands/workflow.ts:163 — FunctionTooLong — workflowCommand runs 769 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 669 over it, 7.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: provider.providerCommand packages/cli/src/commands/provider.ts:61 — FunctionTooLong — providerCommand runs 623 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 523 over it, 6.23× 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: context.contextCommand REDACTED:241 — FunctionTooLong — contextCommand runs 607 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 507 over it, 6.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: main.run packages/tui/src/main.ts:55 — FunctionTooLong — run runs 540 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 440 over it, 5.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: gateway.gatewayCommand packages/cli/src/commands/gateway.ts:166 — FunctionTooLong — gatewayCommand runs 530 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 430 over it, 5.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: execution-view.buildExecutionView packages/daemon/src/domain/execution-view.ts:751 — FunctionTooLong — buildExecutionView runs 524 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 424 over it, 5.24× 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: relay-inbound.createRelayInboundHandler packages/daemon/src/domain/gateway/relay-inbound.ts:551 — FunctionTooLong — createRelayInboundHandler runs 454 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 354 over it, 4.54× 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: context-packs.contextPacksRoutes packages/daemon/src/routes/context-packs.ts:62 — FunctionTooLong — contextPacksRoutes runs 437 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 337 over it, 4.37× 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: render.contentLines packages/tui/src/render.ts:962 — FunctionTooLong — contentLines runs 403 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 303 over it, 4.03× 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: hydrate.hydrateSnapshot packages/tui/src/hydrate.ts:392 — FunctionTooLong — hydrateSnapshot runs 399 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 299 over it, 3.99× 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: host.hostCommand packages/cli/src/commands/host.ts:558 — FunctionTooLong — hostCommand runs 393 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 293 over it, 3.93× 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: slack.slackCommand packages/cli/src/commands/slack.ts:188 — FunctionTooLong — slackCommand runs 362 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 262 over it, 3.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: server.createApp packages/daemon/src/server.ts:493 — FunctionTooLong — createApp runs 360 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 260 over it, 3.60× 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: gateway.gatewayRoutes packages/daemon/src/routes/gateway.ts:54 — FunctionTooLong — gatewayRoutes runs 347 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 247 over it, 3.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: workflow.workflowRoutes packages/daemon/src/routes/workflow.ts:36 — FunctionTooLong — workflowRoutes runs 347 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 247 over it, 3.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: queue-erasure.eraseQueue REDACTED:573 — FunctionTooLong — eraseQueue runs 337 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 237 over it, 3.37× 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: PackageInstallFlow.PackageInstallFlow packages/ui/src/components/PackageInstallFlow.tsx:133 — FunctionTooLong — PackageInstallFlow runs 332 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 232 over it, 3.32× 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: start.startCommand packages/cli/src/commands/start.ts:181 — FunctionTooLong — startCommand runs 326 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 226 over it, 3.26× 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: queue-wake-ladder.advancePromptRefusals packages/daemon/src/domain/queue-wake-ladder.ts:1256 — FunctionTooLong — advancePromptRefusals runs 325 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 225 over it, 3.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: RigGraph.RigGraph packages/ui/src/components/RigGraph.tsx:107 — FunctionTooLong — RigGraph runs 323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 223 over it, 3.23× 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: VellumBackgroundLab.IsoSvg packages/ui/src/components/lab/VellumBackgroundLab.tsx:335 — FunctionTooLong — IsoSvg runs 318 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 218 over it, 3.18× 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.
  • + 160 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×95
  • FileTooLong: domain/queue-repository.ts packages/daemon/src/domain/queue-repository.ts — FileTooLong — 3908 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: QueueRepository (1131-6418). The bar is 500 significant lines; this is 3408 over it, 7.82× 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: domain/session-transport.ts packages/daemon/src/domain/session-transport.ts — FileTooLong — 3524 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3024 over it, 7.05× 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: domain/rigspec-instantiator.ts packages/daemon/src/domain/rigspec-instantiator.ts — FileTooLong — 2185 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: PodRigInstantiator (523-3349). The bar is 500 significant lines; this is 1685 over it, 4.37× 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: domain/restore-orchestrator.ts packages/daemon/src/domain/restore-orchestrator.ts — FileTooLong — 2065 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: RestoreOrchestrator (301-3189). The bar is 500 significant lines; this is 1565 over it, 4.13× 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/startup.ts packages/daemon/src/startup.ts — FileTooLong — 2050 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: createDaemon (344-3002). The bar is 500 significant lines; this is 1550 over it, 4.10× 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: commands/queue.ts packages/cli/src/commands/queue.ts — FileTooLong — 1963 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1463 over it, 3.93× 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: domain/seat-lifecycle-service.ts packages/daemon/src/domain/seat-lifecycle-service.ts — FileTooLong — 1912 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: SeatLifecycleService (362-2552). The bar is 500 significant lines; this is 1412 over it, 3.82× 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: adapters/codex-runtime-adapter.ts packages/daemon/src/adapters/codex-runtime-adapter.ts — FileTooLong — 1877 significant lines (blank, comment-only and punctuation-only lines excluded), about 66% of them inside a single declaration: CodexRuntimeAdapter (152-2125). The bar is 500 significant lines; this is 1377 over it, 3.75× 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/mcp-server.ts packages/cli/src/mcp-server.ts — FileTooLong — 1830 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1330 over it, 3.66× 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: adapters/tmux.ts packages/daemon/src/adapters/tmux.ts — FileTooLong — 1818 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1318 over it, 3.64× 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: commands/scope.ts packages/cli/src/commands/scope.ts — FileTooLong — 1797 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1297 over it, 3.59× 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 — 1743 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1243 over it, 3.49× 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: commands/seat.ts packages/cli/src/commands/seat.ts — FileTooLong — 1723 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: seatCommand (540-1829). The bar is 500 significant lines; this is 1223 over it, 3.45× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/render.ts packages/tui/src/render.ts — FileTooLong — 1553 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1053 over it, 3.11× 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: domain/claude-compaction-enforcer.ts packages/daemon/src/domain/claude-compaction-enforcer.ts — FileTooLong — 1514 significant lines (blank, comment-only and punctuation-only lines excluded), about 73% of them inside a single declaration: ClaudeCompactionEnforcer (717-2404). The bar is 500 significant lines; this is 1014 over it, 3.03× 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: domain/seat-handover-service.ts packages/daemon/src/domain/seat-handover-service.ts — FileTooLong — 1489 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: SeatHandoverService (329-2167). The bar is 500 significant lines; this is 989 over it, 2.98× 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: domain/queue-wake-ladder.ts packages/daemon/src/domain/queue-wake-ladder.ts — FileTooLong — 1343 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 843 over it, 2.69× 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: commands/ps.ts packages/cli/src/commands/ps.ts — FileTooLong — 1340 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 840 over it, 2.68× 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: domain/workflow-projector.ts packages/daemon/src/domain/workflow-projector.ts — FileTooLong — 1338 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: WorkflowProjector (259-1499). The bar is 500 significant lines; this is 838 over it, 2.68× 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: domain/workflow-runtime.ts packages/daemon/src/domain/workflow-runtime.ts — FileTooLong — 1327 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: WorkflowRuntime (160-1990). The bar is 500 significant lines; this is 827 over it, 2.65× 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: domain/restore-check-service.ts packages/daemon/src/domain/restore-check-service.ts — FileTooLong — 1316 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: RestoreCheckService (286-1898). The bar is 500 significant lines; this is 816 over it, 2.63× 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: domain/queue-stuck-sweep.ts packages/daemon/src/domain/queue-stuck-sweep.ts — FileTooLong — 1276 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 776 over it, 2.55× 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: routes/queue.ts packages/daemon/src/routes/queue.ts — FileTooLong — 1275 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: queueRoutes (156-1942). The bar is 500 significant lines; this is 775 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: REDACTED REDACTED — FileTooLong — 1262 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 762 over it, 2.52× 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/migrate-telemetry-state-0.5.9.mjs skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs — FileTooLong — 1109 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 609 over it, 2.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.
  • + 70 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×56
  • Repeated repair: packages/daemon/src/domain/model-divergence/model-divergence-monitor.ts packages/daemon/src/domain/model-divergence/model-divergence-monitor.ts:191 — packages/daemon/src/domain/model-divergence/model-divergence-monitor.ts changed 17 times in last 90 days and 14 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 ModelDivergenceMonitor.checkSeat at line 191), 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(model-divergence): a Bedrock inference-profile pin matches its model (#1931)”; “fix(model-divergence): a Claude pin matches its dated snapshot (#1927)”; “fix(daemon): avoid false divergence for Claude model pins (#1482)”; “fix(daemon): Pi model-pin check reads a :<thinking level> suffix as Pi does (#1403)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/model-divergence/model-divergence-monitor.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:393 — REDACTED changed 23 times in last 90 days and 13 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 DaemonClient.fetch at line 393), 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(cli): resolve a recovered terminal's queue seat, and report what a queue update persisted (#3209)”; “fix(hosts): pairing answers reach an agent, and typed words never deny (#2900)”; “fix(cli): treat a trailing slash in OPENRIG_URL as the same daemon (#2220)”; “fix(cli): --wait-for-idle longer than 300s uses one request (#2020)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08: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: REDACTED REDACTED:88 — REDACTED changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is managed-blocks.mergeManagedBlockText at line 88), 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(daemon): a guidance file keeps one copy of each managed block (#3020)”; “fix(daemon): refresh stale managed guidance blocks, never overwrite a person's edit (#2461)”; “fix(daemon): re-merging a managed block no longer adds a blank line on every launch (#2376)”; “fix(daemon): rig down gives back a guidance file's exact bytes (#1867)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08: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: REDACTED REDACTED:405 — REDACTED changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is TranscriptStore.grepSync at line 405), 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(daemon): avoid rescanning long transcript lines during grep (#2397)”; “fix(daemon): preserve complete lines in transcript tails (#1227)”; “fix(transcripts): compare redraws with the next cleaned line (#1104)”; “fix(transcripts): read coherent captures during atomic publication (#843)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08: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: packages/daemon/src/lib/pane-envelope.ts packages/daemon/src/lib/pane-envelope.ts:114 — packages/daemon/src/lib/pane-envelope.ts changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is pane-envelope.wrapPaneEnvelope at line 114), 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: a reply hint never points at human@host, and three delivery doc lines (#3132)”; “fix(cli): no rig send reply hint for a sender that has no session (#2898)”; “fix(delivery): route replies to forwarded people through the queue (#2504)”; “fix(delivery): give human aliases a usable queue reply hint (#2493)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/lib/pane-envelope.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: packages/daemon/src/domain/kernel-boot.ts packages/daemon/src/domain/kernel-boot.ts:198 — packages/daemon/src/domain/kernel-boot.ts changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is kernel-boot.classifyManagedKernel at line 198), 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(daemon): retain the kernel variant from bootstrap history (#2471)”; “fix(kernel): start a new kernel in the workspace's own kernel folder (#2402)”; “fix(daemon,cli): say why a stale kernel stays down, and count a detached session before notifying (#2152)”; “fix(daemon): restore only a kernel this daemon start found down (#2146)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/kernel-boot.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: packages/tui/src/health/health-model.ts packages/tui/src/health/health-model.ts:287 — packages/tui/src/health/health-model.ts changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is health-model.healthDetailLines at line 287), 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(tui): show a health source's evaluation cap as coverage, not as degraded health (#2885)”; “fix(tui): keep emoji whole when health and config rows are cut to width (#2252)”; “fix(health): preserve available findings when one source fails (#626)”; “fix(daemon): evaluate the busiest ceremony families past the family limit (#357)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/tui/src/health/health-model.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: packages/daemon/src/domain/crash-cart-conductor.ts packages/daemon/src/domain/crash-cart-conductor.ts:161 — packages/daemon/src/domain/crash-cart-conductor.ts changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is crash-cart-conductor.adoptLivePanesRig at line 161), 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: report exited agents in preserved launch panes (#1070)”; “fix: make missing-snapshot recovery guidance actionable”; “fix restore recovery truth and narrow launch”; “fix(B1): r1 LOW — drop the stale adopt-failure node when the launcher proves the seat alreadyRunning [NOT guard-accepted]”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/crash-cart-conductor.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: packages/daemon/src/terminal/TerminalSessionBroker.ts packages/daemon/src/terminal/TerminalSessionBroker.ts:683 — packages/daemon/src/terminal/TerminalSessionBroker.ts changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is TerminalBrokerRegistry.attach at line 683), 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(terminal): avoid closing reattach with 1011 during broker teardown (#2671)”; “fix(terminal): preserve styling in snapshots and scroll-back (#2654)”; “fix(terminal): a window gets its own sizing back after the web terminal and capture's resize hint (#2065)”; “fix(daemon): drop queued terminal input after teardown (#1636)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/terminal/TerminalSessionBroker.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: packages/daemon/src/domain/active-occupant.ts packages/daemon/src/domain/active-occupant.ts:39 — packages/daemon/src/domain/active-occupant.ts changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is active-occupant.resolveActiveOccupantRow at line 39), 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(daemon): keep a seat whose saved conversation is missing paused, and say what starting it fresh takes (#2255)”; “fix: restore reasons name the one-seat command; clearer y-answer outcomes (#1804)”; “fix: keep proved current stops on existing rig up (#1644)”; “fix(daemon): don't silently fresh-prime a stopped seat that has a resume token (#1141)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/active-occupant.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: packages/cli/src/cli-error.ts packages/cli/src/cli-error.ts:100 — packages/cli/src/cli-error.ts changed 7 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is cli-error.renderDaemonTransportError at line 100), 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(cli): resolve a recovered terminal's queue seat, and report what a queue update persisted (#3209)”; “fix(cli): send the real request to a busy daemon; refuse only one confirmed down (#1650)”; “fix(cli): respect the option terminator in error output (#1106)”; “fix(cli): report an invalid --wake-after duration instead of exiting silently (#945)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/cli/src/cli-error.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: packages/daemon/src/domain/workflow-exception-escalation.ts packages/daemon/src/domain/workflow-exception-escalation.ts:75 — packages/daemon/src/domain/workflow-exception-escalation.ts changed 10 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 12 (its worst body is workflow-exception-escalation.makeEnsureStuckExceptionItem.<returned closure> at line 75), 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(queue): keep work for missing destinations and explain status (#3142)”; “fix(daemon): one standing notice per (parent, child seat) for unclaimed rows routed to a delegation parent (#2988) (#3049)”; “fix(workflows): a running workflow keeps its spec when another file reuses its id and version (#2696)”; “fix(slack): reuse failed human notices as queue recovery (#1709)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/workflow-exception-escalation.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: packages/daemon/src/adapters/tmux-server.ts packages/daemon/src/adapters/tmux-server.ts:27 — packages/daemon/src/adapters/tmux-server.ts changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is tmux-server.tmuxServerArgs at line 27), 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(daemon): name inherited custom tmux socket in attachments (#3165)”; “fix(daemon): quote the session name in tmuxAttachCommand (#2971)”; “fix(daemon): rig down stops only a terminal it can show is the seat's (#2962)”; “fix(tmux): say when tmux control mode is off, and how to move a team onto it (#2707)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/adapters/tmux-server.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: packages/daemon/src/domain/terminal/tile-attach.ts packages/daemon/src/domain/terminal/tile-attach.ts:18 — packages/daemon/src/domain/terminal/tile-attach.ts changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is tile-attach.earlierTileAttachment at line 18), 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(daemon): typing into a writable tile reaches the seat on tmux before 3.5 (#2821)”; “fix(daemon): a paste during a tile's attach stays one paste (#2795)”; “fix(terminal): let tiles show whole lines, and attach only while someone types (#2757)”; “fix(terminal): keep Herdr views from earlier releases after upgrading (#2634)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/terminal/tile-attach.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:37 — REDACTED changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is crash-cart.readDaemonJsonWithDb at line 37), 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(cli): treat a trailing slash in OPENRIG_URL as the same daemon (#2220)”; “fix: treat an empty OPENRIG_HOME as unset in the TUI socket, terminal token and crash-cart (#1470)”; “fix(cli): bracket IPv6 hosts in daemon endpoint URLs (#461)”; “fix(B1): ROUND 5 — the whole-unit composition GUARD found: reachability, honesty, scope [NOT guard-accepted]”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08: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: packages/daemon/scripts/run-evals.mjs packages/daemon/scripts/run-evals.mjs:44 — packages/daemon/scripts/run-evals.mjs 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 2 (its worst body is run-evals.opt at line 44), 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-a b3 round 7): wire the current-generation reader into the shipped runner + entry discriminator”; “fix(test-a b3 round 5): transcript-boundary capture — remove the forbidden marker send”; “fix(evals): OPR.0.5.3.7 re-review r2 — runnable eval entry + no temp-package leak”; “fix(evals+router): OPR.0.5.3.7 re-review — hermetic production-ref resolution + truthful instructions”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/scripts/run-evals.mjs`: 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: packages/daemon/src/domain/reconciler.ts packages/daemon/src/domain/reconciler.ts:133 — packages/daemon/src/domain/reconciler.ts changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is reconciler.recordedProcessStillRunning at line 133), 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(daemon): a fresh launch after rig unclaim ended the server's last session reopens the server (#3009)”; “fix(daemon,cli): say why a stale kernel stays down, and count a detached session before notifying (#2152)”; “fix(daemon): restore only a kernel this daemon start found down (#2146)”; “fix(daemon): don't detach seats that still run on a tmux server the daemon can't see (#1906)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/reconciler.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: packages/daemon/src/domain/queue-recovery.ts packages/daemon/src/domain/queue-recovery.ts:103 — packages/daemon/src/domain/queue-recovery.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 queue-recovery.settleRecovery at line 103), 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(queue): index bounded listings over retained history (#3090)”; “fix(daemon): one standing notice per (parent, child seat) for unclaimed rows routed to a delegation parent (#2988) (#3049)”; “fix: honor accepted queue closure re-estimates without reclaiming work (#2460)”; “fix(slack): reuse failed human notices as queue recovery (#1709)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/queue-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: packages/daemon/src/domain/event-bus.ts packages/daemon/src/domain/event-bus.ts:120 — packages/daemon/src/domain/event-bus.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 13 (its worst body is EventBus.discardOnThrow 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: “fix(daemon): a runner answer's failed handoff rolls back whole before the answer is kept (#2966)”; “fix(daemon,tui): follow-ups to runner permission answers (#2934) (#2950)”; “fix(events): page the notification drain (#2610)”; “fix(events): serialize subscriber-generated fanout (#527)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/event-bus.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: packages/tui/src/live.ts packages/tui/src/live.ts:138 — packages/tui/src/live.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 15 (its worst body is live.createLiveRefresh.readPage at line 138), 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(tui): preserve stream connection state across pages (#2014)”; “fix(tui): read less often while the activity stream is connected (#1602)”; “fix(tui): stop background refresh when the daemon's build differs (#1600)”; “fix(tui): bound quiet topology freshness”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/tui/src/live.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: packages/daemon/src/domain/gateway/destination-resolver.ts packages/daemon/src/domain/gateway/destination-resolver.ts:67 — packages/daemon/src/domain/gateway/destination-resolver.ts changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is destination-resolver.classifyDestination at line 67), 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(queue): a hosted member's work reads as waiting, and hub notes leave out local ids (#3222)”; “fix(mcp): say how to see your own team, and how a member without a trigger picks up work (#3104)”; “fix: tell a hosted member how it gets work, what it may read and how to close (#2187)”; “fix(OPR.0.5.6.14): scope delivery truth to current episode”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/gateway/destination-resolver.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: packages/daemon/src/adapters/stub-runtime-adapter.ts packages/daemon/src/adapters/stub-runtime-adapter.ts:121 — packages/daemon/src/adapters/stub-runtime-adapter.ts changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is StubRuntimeAdapter.deliverStartup 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: “fix(daemon): refresh stale managed guidance blocks, never overwrite a person's edit (#2461)”; “fix(daemon): a seat's own role as an auto-hinted startup file goes to that seat, never into the shared file (#1854)”; “fix(daemon): a seat's legacy role guidance never merges into shared guidance (#1840)”; “fix(daemon): submit with named Enter key instead of C-m (#496) (#540)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/adapters/stub-runtime-adapter.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: packages/daemon/src/adapters/compose-services-adapter.ts packages/daemon/src/adapters/compose-services-adapter.ts:240 — packages/daemon/src/adapters/compose-services-adapter.ts changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is ComposeServicesAdapter.checkTcp at line 240), 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(bundles): a service bundle install without Docker Compose v2 stops before the target or team, and a plan says so (#2025)”; “fix(daemon): probe TCP wait targets without an external nc (#1574)”; “fix(daemon): read an empty compose ps JSON array as no services (#1452)”; “fix(compose): retain an explicit zero log tail (#673)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/adapters/compose-services-adapter.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: packages/daemon/src/domain/chat-repository.ts packages/daemon/src/domain/chat-repository.ts:80 — packages/daemon/src/domain/chat-repository.ts changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ChatRepository.history at line 80), 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(daemon): match chat search keywords literally, not as LIKE wildcards (#1455)”; “fix(daemon): return 400, not 500, for a non-numeric ?limit= (#586)”; “fix(chat): return the newest messages when chat history is limited (#1057)”; “fix(chat): refuse a chat history since value SQLite cannot parse (#930)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/daemon/src/domain/chat-repository.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: packages/cli/src/lib/file-transfer.ts packages/cli/src/lib/file-transfer.ts:64 — packages/cli/src/lib/file-transfer.ts changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is file-transfer.parseFilePathArg 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(cli): report byte counts from Apple openrsync (#1232)”; “fix(cli): recognize dotted registered hosts in file operands (#368)”; “fix(cli): preserve local rsync directory content operands (#231)”; “fix(cli): decode SSH and rsync output across UTF-8 chunks (#230)”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 01:09:45 -08:00' --until='2026-11-17 01:09:45 -08:00' --full-history --no-merges -- packages/cli/src/lib/file-transfer.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.
  • + 31 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×52
  • MethodTooLong: StartupOrchestrator.startNodeWithWarnings packages/daemon/src/domain/startup-orchestrator.ts:347 — MethodTooLong — startNodeWithWarnings runs 472 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 372 over it, 4.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.
  • MethodTooLong: WorkflowProjector.projectStep packages/daemon/src/domain/workflow-projector.ts:301 — MethodTooLong — projectStep runs 410 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 310 over it, 4.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.
  • MethodTooLong: SeatHandoverService.handover packages/daemon/src/domain/seat-handover-service.ts:400 — MethodTooLong — handover runs 350 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: QueueRepository.updateInTransactionalContext packages/daemon/src/domain/queue-repository.ts:3628 — MethodTooLong — updateInTransactionalContext runs 328 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 228 over it, 3.28× 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: PodRigInstantiator.launchExistingAgentMember packages/daemon/src/domain/rigspec-instantiator.ts:2477 — MethodTooLong — launchExistingAgentMember runs 308 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 208 over it, 3.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PodRigInstantiator.instantiateOnce packages/daemon/src/domain/rigspec-instantiator.ts:1478 — MethodTooLong — instantiateOnce runs 298 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 198 over it, 2.98× 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: WorkflowRuntime.instantiate packages/daemon/src/domain/workflow-runtime.ts:388 — MethodTooLong — instantiate runs 287 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 187 over it, 2.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WorkflowValidator.validate packages/daemon/src/domain/workflow-validator.ts:60 — MethodTooLong — validate runs 271 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 171 over it, 2.71× 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: WorkflowRuntime.route packages/daemon/src/domain/workflow-runtime.ts:1520 — MethodTooLong — route runs 260 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 160 over it, 2.60× 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: SeatLifecycleService.launchFresh packages/daemon/src/domain/seat-lifecycle-service.ts:1638 — MethodTooLong — launchFresh runs 259 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 159 over it, 2.59× 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: WatchdogPolicyEngine.evaluate packages/daemon/src/domain/watchdog-policy-engine.ts:341 — MethodTooLong — evaluate runs 242 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 142 over it, 2.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WorkflowProjector.projectDependencyGraph packages/daemon/src/domain/workflow-projector.ts:1244 — MethodTooLong — projectDependencyGraph runs 206 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 106 over it, 2.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SeatHandoverService.commit packages/daemon/src/domain/seat-handover-service.ts:1864 — MethodTooLong — commit 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.
  • MethodTooLong: InstallPlanner.plan packages/daemon/src/domain/install-planner.ts:73 — MethodTooLong — plan runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× 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: BootstrapOrchestrator.bootstrap packages/daemon/src/domain/bootstrap-orchestrator.ts:147 — MethodTooLong — bootstrap runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RestoreOrchestrator.restore packages/daemon/src/domain/restore-orchestrator.ts:386 — MethodTooLong — restore runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.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.
  • MethodTooLong: RestoreOrchestrator.launchNodeTargets packages/daemon/src/domain/restore-orchestrator.ts:740 — MethodTooLong — launchNodeTargets runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: QueueRepository.deliverWakeIntent packages/daemon/src/domain/queue-repository.ts:1695 — MethodTooLong — deliverWakeIntent runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HerdrAdapter.openView packages/daemon/src/domain/terminal/herdr-adapter.ts:488 — MethodTooLong — openView 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: NodeLauncher.launchNode packages/daemon/src/domain/node-launcher.ts:159 — MethodTooLong — launchNode 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: CodexInPlaceRestart.observe packages/daemon/src/domain/seat-restart-in-place.ts:419 — MethodTooLong — observe runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ConfigStore.resolve packages/cli/src/config-store.ts:1376 — MethodTooLong — resolve runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: RigRepository.addNode packages/daemon/src/domain/rig-repository.ts:654 — MethodTooLong — addNode 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.
  • MethodTooLong: WorkflowRuntime.resume packages/daemon/src/domain/workflow-runtime.ts:1139 — MethodTooLong — resume 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.
  • MethodTooLong: CodexRuntimeAdapter.verifyResumeLaunch packages/daemon/src/adapters/codex-runtime-adapter.ts:1890 — MethodTooLong — verifyResumeLaunch 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.
  • + 27 more in this group — see findings.md.
D10 · Test Quality · Fixed-sleep synchronisation · ×41
  • Fixed-sleep synchronisation: a slow read here holds up no other page: leaving it aborts it, and the next page reads and draws at once packages/tui/test/usage-hosts-journey.test.ts:206 — This test starts work it did not wait for (`live`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 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: refuses unknown, peer-suffix and malformed names with zero handler effects packages/daemon/test/browser-boundary.test.ts:76 — This test starts work it did not wait for (`g`, 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: accepts the exact discovered self MagicDNS name and its short form only packages/daemon/test/browser-boundary.test.ts:91 — This test starts work it did not wait for (`g`, 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: an unrecognized name triggers at most one bounded re-lookup per window, single-flight packages/daemon/test/browser-boundary.test.ts:128 — This test starts work it did not wait for (`g`, 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: a web terminal that opens while a read takes the pin waits its turn, so neither holder is lost (one daemon) packages/daemon/test/capture-prompt-pane.test.ts:175 — This test starts work it did not wait for (`attaching`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 20))` — 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: acks only once its output has been written, and acks nothing when the write fails packages/daemon/test/claude-hook-bridge-script.test.ts:67 — This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 20))` — 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: does not block the daemon's event loop while Codex starts packages/daemon/test/codex-network-default-reader.test.ts:140 — This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 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: leaves a free-text self-attached seat as it was, before and after a same-named preset appears packages/daemon/test/community-harness-runtime.integration.test.ts:315 — This test starts work it did not wait for (`check`, still running when the sleep starts) and then orders itself against it with `sleep(4_000)` — 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: H3: cancel mid-fleet through the route → later rigs not_attempted packages/daemon/test/crash-cart-route.test.ts:167 — This test starts work it did not wait for (`app`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 0))` — 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: holds a gated answer until the case releases the gate, having logged the request on arrival packages/daemon/test/delivery-stand-ins.test.ts:314 — This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 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: names a gate after the turn's marker, so releasing one turn leaves another held packages/daemon/test/delivery-stand-ins.test.ts:325 — This test starts work it did not wait for (`first`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 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: when its window ends with the gate closed, the cell says so and still takes no input packages/daemon/test/herdr-app-viewer-gate.test.ts:109 — This test starts work it did not wait for (`cell`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 2_000))` — 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: refuses a poll whose grant was revoked while it waited for the seat's lease, and claims nothing packages/daemon/test/hook-bridge-routes.test.ts:139 — This test starts work it did not wait for (`lease`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 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: refuses a poll whose occupant was replaced while it waited for the seat's lease, and claims nothing packages/daemon/test/hook-bridge-routes.test.ts:154 — This test starts work it did not wait for (`lease`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 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: still delivers once to a poll whose authority didn't change while it waited packages/daemon/test/hook-bridge-routes.test.ts:168 — This test starts work it did not wait for (`lease`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 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: a replace whose wait for the installation's turn uses up its deadline sends no code and changes nothing packages/daemon/test/network-installations.test.ts:428 — This test starts work it did not wait for (`slow`, still running when the sleep starts) and then orders itself against it with `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: GET /api/events (global) receives package.installed via SSE packages/daemon/test/packages-routes.test.ts:943 — This test starts work it did not wait for (`ssePromise`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 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: reads off the event loop: a command line that waits holds no timer, and its row comes once it is read packages/daemon/test/process-table.test.ts:92 — This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 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 switch that waited behind another on its home checks the seat again before it changes the login packages/daemon/test/provider-switch-seat.test.ts:143 — This test starts work it did not wait for (`a`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — 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 switch whose seat moved to another home while it waited touches neither home packages/daemon/test/provider-switch-seat.test.ts:173 — This test starts work it did not wait for (`a`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 0))` — 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: two switches on one home run one at a time, so each restart loads the login its receipt names packages/daemon/test/provider-switch-seat.test.ts:266 — This test starts work it did not wait for (`first`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 20))` — 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 leg asked for while the same (host, provider) leg runs joins it packages/daemon/test/provider-usage-across-hosts.test.ts:150 — This test starts work it did not wait for (`first`, 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: wakes a waiting read when the answer arrives packages/daemon/test/runner-permission-path.test.ts:227 — This test starts work it did not wait for (`f`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 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: refuses a waiting read whose grant's occupant is replaced during the wait packages/daemon/test/runner-permission-path.test.ts:518 — This test starts work it did not wait for (`waiting`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 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 runner already waiting when the answer is handed to the agent reads the agent's decision at once, not at its read's end packages/daemon/test/runner-permission-path.test.ts:1117 — This test starts work it did not wait for (`f`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 20))` — 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.
  • + 16 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×40
  • Sync-over-async blocking docs/reference/runner-conformance/check-runner.mjs:183 — `mkdtempSync` 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 docs/reference/runner-conformance/check-runner.mjs:185 — `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 docs/reference/runner-conformance/check-runner.mjs:186 — `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 docs/reference/runner-conformance/check-runner.mjs:187 — `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 docs/reference/runner-conformance/check-runner.mjs:196 — `writeFileSync` 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 docs/reference/runner-conformance/check-runner.mjs:198 — `writeFileSync` 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 docs/reference/runner-conformance/check-runner.mjs:199 — `chmodSync` 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 docs/reference/runner-conformance/check-runner.mjs:204 — `writeFileSync` 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 docs/reference/runner-conformance/check-runner.mjs:217 — `writeFileSync` 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 docs/reference/runner-conformance/check-runner.mjs:218 — `chmodSync` 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 docs/reference/runner-conformance/check-runner.mjs:222 — `existsSync` in `log` 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 docs/reference/runner-conformance/check-runner.mjs:222 — `readFileSync` in `log` 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 docs/reference/runner-conformance/check-runner.mjs:233 — `existsSync` in `record` 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 docs/reference/runner-conformance/check-runner.mjs:233 — `readFileSync` in `record` 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 docs/reference/runner-conformance/check-runner.mjs:236 — `writeFileSync` in `paste` 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 packages/cli/src/acp/connector.ts:90 — `mkdirSync` in `runAcpAssignment` 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 packages/cli/src/acp/connector.ts:91 — `appendFileSync` in `log` 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 packages/cli/src/bin-wrapper.ts:117 — `realpathSync` in `run` 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 packages/cli/src/commands/acp.ts:231 — `mkdirSync` in `callback to action` 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 packages/cli/src/commands/acp.ts:233 — `writeFileSync` in `writeRun` 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 packages/cli/src/commands/acp.ts:342 — `spawnSync` in `callback to action` 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 packages/cli/src/commands/add.ts:55 — `readFileSync` in `callback to action` 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 packages/cli/src/commands/bundle.ts:165 — `fs.rmSync` in `callback to action` 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 packages/cli/src/commands/chatroom.ts:198 — `spawnSync` in `callback to action` 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:157 — `mkdirSync` in `installPackFromUrl` 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-cross-package-internals] packages/cli/test/acp-real-queue.test.ts:12 — packages/cli/test/acp-real-queue.test.ts:12 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/event-bus.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-real-queue.test.ts:13 — packages/cli/test/acp-real-queue.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/queue-repository.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-real-queue.test.ts:14 — packages/cli/test/acp-real-queue.test.ts:14 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/queue.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:12 — packages/cli/test/acp-serve.test.ts:12 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/connection.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:13 — packages/cli/test/acp-serve.test.ts:13 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/migrate.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:14 — packages/cli/test/acp-serve.test.ts:14 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/all-migrations.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:15 — packages/cli/test/acp-serve.test.ts:15 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/event-bus.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:16 — packages/cli/test/acp-serve.test.ts:16 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/queue-repository.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:17 — packages/cli/test/acp-serve.test.ts:17 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/queue.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:18 — packages/cli/test/acp-serve.test.ts:18 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/mission-control.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:19 — packages/cli/test/acp-serve.test.ts:19 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/mission-control/mission-control-write-contract.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:20 — packages/cli/test/acp-serve.test.ts:20 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/mission-control/mission-control-action-log.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/acp-serve.test.ts:23 — packages/cli/test/acp-serve.test.ts:23 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/gateway/human-registry.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:16 — packages/cli/test/attach-reply-address.test.ts:16 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/connection.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:17 — packages/cli/test/attach-reply-address.test.ts:17 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/migrate.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:18 — packages/cli/test/attach-reply-address.test.ts:18 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/db/all-migrations.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:19 — packages/cli/test/attach-reply-address.test.ts:19 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/rig-repository.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:20 — packages/cli/test/attach-reply-address.test.ts:20 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/pod-repository.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:21 — packages/cli/test/attach-reply-address.test.ts:21 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/session-registry.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:22 — packages/cli/test/attach-reply-address.test.ts:22 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/event-bus.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:23 — packages/cli/test/attach-reply-address.test.ts:23 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/self-attach-service.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:24 — packages/cli/test/attach-reply-address.test.ts:24 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/session-transport.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:25 — packages/cli/test/attach-reply-address.test.ts:25 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/whoami-service.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:26 — packages/cli/test/attach-reply-address.test.ts:26 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/domain/transcript-store.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • Boundary violation [package:test-cross-package-internals] packages/cli/test/attach-reply-address.test.ts:27 — packages/cli/test/attach-reply-address.test.ts:27 reaches past another workspace package's public entry into its internals with a relative path (../../daemon/src/routes/rigs.js) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead.
  • + 15 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×39
  • No test reaches this file skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs: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 packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs: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 packages/ui/twin/corrective/fixtures-corrective.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 packages/ui/twin/fixtures.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 packages/ui/src/components/mission-control/components/CompactStatusRow.tsx: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 packages/ui/twin/capture/twin-capture.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 packages/ui/src/components/RigEnvPanel.tsx: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 packages/ui/twin/fetch-stub.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 packages/daemon/assets/herdr-app/mods/rig-strip/main.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 skills/_canonical/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs: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 skills/_canonical/process/systematic-debugging/condition-based-waiting-example.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 packages/daemon/scripts/probe-health-calibration.mjs: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 packages/daemon/scripts/probe-health-diagnosis.mjs: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 packages/ui/src/components/slices/tabs/DecisionsTab.tsx: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 packages/daemon/scripts/probe-passive-ceremony.mjs: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 packages/ui/src/hooks/useContextFleet.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 packages/ui/twin/twin-main.tsx: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 packages/ui/twin/eventsource-stub.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 packages/ui/src/components/mission-control/hooks/useMissionControlView.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 packages/daemon/scripts/capture-send-header.mjs: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 packages/ui/src/hooks/useProgressTree.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 packages/tui/scripts/capture-crash-cart.mjs: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 packages/cli/src/release-surface/generate.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 packages/daemon/src/seed.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 packages/ui/src/hooks/useMissionStatuses.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.
  • + 14 more in this group — see findings.md.
X2 · Cancellation propagation · Async function without AbortSignal · ×39
  • Async function without AbortSignal: fetchAgentImages packages/ui/src/hooks/useAgentImageLibrary.ts:63 — `fetchAgentImages` 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: fetchAgentImagePreview packages/ui/src/hooks/useAgentImageLibrary.ts:81 — `fetchAgentImagePreview` 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: fetchArchived packages/ui/src/hooks/useArchivedRigs.ts:9 — `fetchArchived` 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: fetchAttentionItems packages/ui/src/hooks/useAttentionItems.ts:68 — `fetchAttentionItems` 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: fetchAggregatedAttention packages/ui/src/hooks/useAttentionItems.ts:76 — `fetchAggregatedAttention` 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: fetchFleet packages/ui/src/hooks/useContextFleet.ts:54 — `fetchFleet` 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: fetchContextPacks packages/ui/src/hooks/useContextPackLibrary.ts:41 — `fetchContextPacks` 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: fetchContextPackPreview packages/ui/src/hooks/useContextPackLibrary.ts:64 — `fetchContextPackPreview` 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: fetchDaemonHealth packages/ui/src/hooks/useDaemonHealth.ts:31 — `fetchDaemonHealth` 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: fetchDaemonVersion packages/ui/src/hooks/useDaemonVersion.ts:15 — `fetchDaemonVersion` 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: queryFn packages/ui/src/hooks/useDiscovery.ts:64 — `queryFn` 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: fetchRoots packages/ui/src/hooks/useFiles.ts:31 — `fetchRoots` 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: fetchList packages/ui/src/hooks/useFiles.ts:69 — `fetchList` 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: fetchRead packages/ui/src/hooks/useFiles.ts:139 — `fetchRead` 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: fetchFleet packages/ui/src/hooks/useFleet.ts:90 — `fetchFleet` 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: fetchHosts packages/ui/src/hooks/useHosts.ts:34 — `fetchHosts` 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: queryFn packages/ui/src/hooks/useHosts.ts:179 — `queryFn` 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: fetchKernelStatus packages/ui/src/hooks/useKernelStatus.ts:46 — `fetchKernelStatus` 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: fetchLaunchPlan packages/ui/src/hooks/useLaunchPlan.ts:32 — `fetchLaunchPlan` 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: fetchLibrarySkills packages/ui/src/hooks/useLibrarySkills.ts:42 — `fetchLibrarySkills` 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: queryFn packages/ui/src/hooks/useMissionStatuses.ts:29 — `queryFn` 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: queryFn packages/ui/src/hooks/useNeedsInputSeats.ts:17 — `queryFn` 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: fetchNodeDetail packages/ui/src/hooks/useNodeDetail.ts:93 — `fetchNodeDetail` 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: fetchNodeInventory packages/ui/src/hooks/useNodeInventory.ts:87 — `fetchNodeInventory` 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: fetchNodePreview packages/ui/src/hooks/useNodePreview.ts:26 — `fetchNodePreview` 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 })`.
  • + 14 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×37
  • TodoComment packages/daemon/test/bootstrap-orchestrator.test.ts:1427 — // TODO: AS-T12 — 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 packages/daemon/test/bootstrap-orchestrator.test.ts:1430 — // TODO: AS-T12 — 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 packages/daemon/test/bundle-archive.test.ts:9 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/test/bundle-archive.test.ts:554 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/test/bundle-assembler.test.ts:7 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/test/bundle-integrity.test.ts:7 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/test/bundle-source-resolver.test.ts:196 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/test/bundle-types.test.ts:2 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/src/domain/bundle-archive.ts:15 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/src/domain/bundle-assembler.ts:4 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/src/domain/bundle-integrity.ts:3 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/src/domain/bundle-source-resolver.ts:5 — // TODO: AS-T12 — migrate to pod-aware bundle types — 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 packages/daemon/test/bundle-assembler.test.ts:5 — // TODO: AS-T12 — migrate to pod-aware bundle assembler — 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 packages/daemon/test/bundle-source-resolver.test.ts:5 — // TODO: AS-T12 — migrate to pod-aware bundle assembler — 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 packages/daemon/src/domain/bundle-assembler.ts:52 — // TODO: AS-T12 — migrate to pod-aware bundle assembler — 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 packages/daemon/test/bundle-source-resolver.test.ts:11 — // TODO: AS-T12 — migrate to pod-aware bundle source resolver — 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 packages/daemon/src/startup.ts:108 — // TODO: AS-T12 — migrate to pod-aware bundle source resolver — 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 packages/daemon/src/domain/bootstrap-orchestrator.ts:19 — // TODO: AS-T12 — migrate to pod-aware bundle source resolver — 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 packages/daemon/src/domain/bundle-source-resolver.ts:27 — // TODO: AS-T12 — migrate to pod-aware bundle source resolver — 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 packages/daemon/test/openrig-core-plugin.test.ts:335 — // TODO(P6-B ← dev-driver (A) canon-restore): re-add `expect(architectSkill).toContain("rig spec — 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 packages/daemon/test/rigspec-instantiator.test.ts:20 — // TODO: AS-T08b — migrate to pod-aware RigSpec — 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 packages/daemon/test/rigspec-preflight.test.ts:18 — // TODO: AS-T08b — migrate to pod-aware RigSpec — 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 packages/daemon/test/rigspec-routes.test.ts:6 — // TODO: AS-T08b — migrate to pod-aware RigSpec — 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 packages/daemon/src/domain/bootstrap-orchestrator.ts:6 — // TODO: AS-T08b — migrate to pod-aware RigSpec — 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 packages/daemon/src/domain/bootstrap-orchestrator.ts:7 — // TODO: AS-T08b — migrate to pod-aware RigSpec — 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.
  • + 12 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×37
  • Swallowed exception (empty catch) skills/_canonical/core/openrig-upgrade/scripts/inspect-upgrade.mjs:15 — 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) packages/ui/twin/fetch-stub.ts:161 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/ui/twin/twin-main.tsx:43 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) packages/ui/src/lib/copy-text.ts:7 — 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) packages/ui/src/lib/theme.ts:56 — 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) packages/ui/src/lib/theme.ts: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) packages/ui/src/hooks/launchRigCmux.ts:46 — 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) packages/ui/src/hooks/useCompletedMissions.ts:29 — 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) packages/ui/src/hooks/useDismissedCardIds.ts:35 — 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) packages/ui/src/hooks/useDismissedSeqs.ts:29 — 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) packages/ui/src/components/LiveNodeDetails.tsx:199 — 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) packages/ui/src/components/NodeDetailPlaceholder.tsx:15 — 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) packages/ui/src/components/RigNode.tsx:162 — 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) packages/ui/src/components/UiMaintenanceNotice.tsx:24 — 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) packages/ui/src/components/terminal/FocusedTerminal.tsx:230 — 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) packages/ui/src/components/review/review-actions.ts:35 — 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) packages/ui/src/components/review/SliceReviewTab.tsx:86 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) packages/ui/src/components/dashboard/HostConfigCard.tsx:61 — 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) packages/tui/src/daemon-client.ts:125 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) packages/tui/src/hydrate.ts:520 — 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) packages/tui/src/live-events.ts:83 — 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) packages/tui/src/live-events.ts:113 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) packages/tui/src/live-events.ts:133 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) packages/tui/src/main.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) packages/tui/src/main.ts:186 — `.then(…, () => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • + 12 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 6 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×25
  • ClassTooLong: QueueRepository packages/daemon/src/domain/queue-repository.ts:1131 — ClassTooLong — 3236 significant lines (blank, comment-only and punctuation-only lines excluded), 166 methods. The bar is 400 significant lines; this is 2836 over it, 8.09× 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: RestoreOrchestrator packages/daemon/src/domain/restore-orchestrator.ts:301 — ClassTooLong — 1843 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 1443 over it, 4.61× 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: PodRigInstantiator packages/daemon/src/domain/rigspec-instantiator.ts:523 — ClassTooLong — 1838 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 1438 over it, 4.60× 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: SeatLifecycleService packages/daemon/src/domain/seat-lifecycle-service.ts:362 — ClassTooLong — 1615 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 1215 over it, 4.04× 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: SeatHandoverService packages/daemon/src/domain/seat-handover-service.ts:329 — ClassTooLong — 1246 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 846 over it, 3.12× 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: CodexRuntimeAdapter packages/daemon/src/adapters/codex-runtime-adapter.ts:152 — ClassTooLong — 1235 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 400 significant lines; this is 835 over it, 3.09× 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: WorkflowRuntime packages/daemon/src/domain/workflow-runtime.ts:160 — ClassTooLong — 1186 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 786 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.
  • ClassTooLong: RestoreCheckService packages/daemon/src/domain/restore-check-service.ts:286 — ClassTooLong — 1118 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 718 over it, 2.80× 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: ClaudeCompactionEnforcer packages/daemon/src/domain/claude-compaction-enforcer.ts:717 — ClassTooLong — 1104 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 704 over it, 2.76× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WorkflowProjector packages/daemon/src/domain/workflow-projector.ts:259 — ClassTooLong — 822 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 422 over it, 2.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SliceIndexer packages/daemon/src/domain/slices/slice-indexer.ts:367 — ClassTooLong — 808 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 408 over it, 2.02× 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: ClaudeCodeAdapter packages/daemon/src/adapters/claude-code-adapter.ts:110 — ClassTooLong — 798 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 398 over it, 2.00× 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: StartupOrchestrator packages/daemon/src/domain/startup-orchestrator.ts:291 — ClassTooLong — 797 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 397 over it, 1.99× 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: RigRepository packages/daemon/src/domain/rig-repository.ts:362 — ClassTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 277 over it, 1.69× 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: BootstrapOrchestrator packages/daemon/src/domain/bootstrap-orchestrator.ts:112 — ClassTooLong — 619 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 219 over it, 1.55× 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: SeatActivityService packages/daemon/src/domain/seat-activity-service.ts:125 — ClassTooLong — 616 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 216 over it, 1.54× 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: RigLifecycleService packages/daemon/src/domain/rig-lifecycle-service.ts:163 — ClassTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 201 over it, 1.50× 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: ReviewGatherer packages/daemon/src/domain/review/gather.ts:126 — ClassTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 198 over it, 1.50× 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: ClaimService packages/daemon/src/domain/claim-service.ts:145 — ClassTooLong — 517 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 117 over it, 1.29× 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: CodexInPlaceRestart packages/daemon/src/domain/seat-restart-in-place.ts:213 — ClassTooLong — 504 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 104 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SessionRegistry packages/daemon/src/domain/session-registry.ts:207 — ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 70 over it, 1.18× 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: OutboxHandler packages/daemon/src/domain/outbox-handler.ts:147 — ClassTooLong — 462 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 62 over it, 1.16× 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: WatchdogJobsRepository packages/daemon/src/domain/watchdog-jobs-repository.ts:191 — ClassTooLong — 462 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 62 over it, 1.16× 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: WatchdogPolicyEngine packages/daemon/src/domain/watchdog-policy-engine.ts:280 — ClassTooLong — 452 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 52 over it, 1.13× 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: SliceDetailProjector packages/daemon/src/domain/slices/slice-detail-projector.ts:217 — ClassTooLong — 413 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 13 over it, 1.03× 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyMethods · ×19
  • TooManyMethods: QueueRepository packages/daemon/src/domain/queue-repository.ts:1131 — TooManyMethods — 166 methods. The bar is 30 methods; this is 136 over it, 5.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TmuxAdapter packages/daemon/src/adapters/tmux.ts:664 — TooManyMethods — 112 methods. The bar is 30 methods; this is 82 over it, 3.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CodexRuntimeAdapter packages/daemon/src/adapters/codex-runtime-adapter.ts:152 — TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RigRepository packages/daemon/src/domain/rig-repository.ts:362 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DaemonClient packages/tui/src/daemon-client.ts:78 — TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.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.
  • TooManyMethods: SessionTransport packages/daemon/src/domain/session-transport.ts:2373 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ClaudeCompactionEnforcer packages/daemon/src/domain/claude-compaction-enforcer.ts:717 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SeatLifecycleService packages/daemon/src/domain/seat-lifecycle-service.ts:362 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SessionRegistry packages/daemon/src/domain/session-registry.ts:207 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PodRigInstantiator packages/daemon/src/domain/rigspec-instantiator.ts:523 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OutboxHandler packages/daemon/src/domain/outbox-handler.ts:147 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SliceIndexer packages/daemon/src/domain/slices/slice-indexer.ts:367 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RestoreOrchestrator packages/daemon/src/domain/restore-orchestrator.ts:301 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SeatActivityService packages/daemon/src/domain/seat-activity-service.ts:125 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RestoreCheckService packages/daemon/src/domain/restore-check-service.ts:286 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SeatDeliveryGuard packages/daemon/src/domain/seat-delivery-guard.ts:126 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SeatHandoverService packages/daemon/src/domain/seat-handover-service.ts:329 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HookBridge packages/daemon/src/domain/hook-bridge.ts:122 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ReviewGatherer packages/daemon/src/domain/review/gather.ts:126 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× 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 · ×17
  • Change coupling: hydrate.ts ↔ sections.ts packages/tui/src/hydrate.ts:1 — `packages/tui/src/hydrate.ts` and `packages/tui/src/sections.ts` change together 100% of the time (12 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 12 shared commits counted here, the most recent 3 are `778355b6` feat(tui): fleet Projects view across registered hosts (implements #3…; `d8fb6ea9` feat(tui): System → Cost, each seat's reported cost beside its tokens…; `6448f6bf` feat(tui): System → Usage · all hosts, the registered hosts' usage wi… — run `git show` on any of them.
  • Change coupling: daemon-client.ts ↔ sections.ts packages/tui/src/daemon-client.ts:1 — `packages/tui/src/daemon-client.ts` and `packages/tui/src/sections.ts` change together 92% of the time (11 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 11 shared commits counted here, the most recent 3 are `778355b6` feat(tui): fleet Projects view across registered hosts (implements #3…; `d8fb6ea9` feat(tui): System → Cost, each seat's reported cost beside its tokens…; `6448f6bf` feat(tui): System → Usage · all hosts, the registered hosts' usage wi… — run `git show` on any of them.
  • Change coupling: community-harness-presets.ts ↔ startup-orchestrator.ts packages/daemon/src/domain/community-harness-presets.ts:1 — `packages/daemon/src/domain/community-harness-presets.ts` and `packages/daemon/src/domain/startup-orchestrator.ts` change together 82% of the time (9 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 9 shared commits counted here, the most recent 3 are `d5832cd9` feat(harness): community harnesses can declare protocol: pi-rpc (fini…; `0ccd0132` feat: add observed OpenShell lifecycle and exact native restore (#2300); `9924040b` feat(daemon): a community harness can take the seat's declared model … — run `git show` on any of them.
  • Change coupling: ProjectTreeView.tsx ↔ ScopePages.tsx packages/ui/src/components/project/ProjectTreeView.tsx:1 — `packages/ui/src/components/project/ProjectTreeView.tsx` and `packages/ui/src/components/project/ScopePages.tsx` change together 82% of the time (9 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 9 shared commits counted here, the most recent 3 are `98ae3754` VM-005 (release-0.4.7): mission-status reconciliation — one status, e…; `cd6d592a` fix(ui): refine library and project density; `1c4b8921` feat(ui): single-row density for project slice list items (slice 19) — run `git show` on any of them.
  • Change coupling: navigator.ts ↔ stylize.ts packages/tui/src/navigator.ts:1 — `packages/tui/src/navigator.ts` and `packages/tui/src/stylize.ts` change together 77% of the time (10 of the 13 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 10 shared commits counted here, the most recent 3 are `fa0c05b9` fix(tui): size table cells in terminal columns, not string length (#3…; `f3a3b171` fix(ssh): avoid passive TCP probes in host status (#2979); `b22c9794` fix(tui): distinguish observed rig presence on topology landing — run `git show` on any of them.
  • Change coupling: demo-data.ts ↔ hydrate.ts packages/tui/src/demo-data.ts:1 — `packages/tui/src/demo-data.ts` and `packages/tui/src/hydrate.ts` change together 75% of the time (9 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 9 shared commits counted here, the most recent 3 are `b22c9794` fix(tui): distinguish observed rig presence on topology landing; `0e43967a` feat(tui): PULSE lane selection + drill-in + compact-seat form [pulse…; `dbc0e057` feat(tui): PULSE lanes LIVE — NOW / JUST FINISHED / UP NEXT + live fo… — run `git show` on any of them.
  • Change coupling: claude-code-adapter.ts ↔ claude-resume.ts packages/daemon/src/adapters/claude-code-adapter.ts:1 — `packages/daemon/src/adapters/claude-code-adapter.ts` and `packages/daemon/src/adapters/claude-resume.ts` change together 67% of the time (24 of the 36 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 24 shared commits counted here, the most recent 3 are `eb67b30d` Slice 13: Claude wake-ups through a launch-owned hook bridge (opt-in)…; `9c99d12b` fix(daemon): apply a Claude seat's token when its pane doesn't read a…; `3d1f2f9b` fix(daemon): preserve Claude launch during token switches (#2853) — run `git show` on any of them.
  • Change coupling: all-migrations.ts ↔ queue-retention.ts packages/daemon/src/db/all-migrations.ts:1 — `packages/daemon/src/db/all-migrations.ts` and `packages/daemon/src/domain/queue-retention.ts` change together 62% of the time (8 of the 13 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 — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, 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 `9e004f2a` feat(daemon): erase queue content for closed-work retention and accou…; `5e5b328e` perf(daemon): prune the history-only event types from events (retenti…; `4c34d13c` feat(daemon): record which MCP grant's caller acted (principal:v1) (#… — run `git show` on any of them.
  • Change coupling: codex-resume.ts ↔ codex-runtime-adapter.ts packages/daemon/src/adapters/codex-resume.ts:1 — `packages/daemon/src/adapters/codex-resume.ts` and `packages/daemon/src/adapters/codex-runtime-adapter.ts` change together 61% of the time (19 of the 31 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 19 shared commits counted here, the most recent 3 are `a1dd3333` feat(daemon): support per-seat Codex filesystem policies (#3085) (#3108); `09781df0` fix(codex): keep OpenRig's command folder on managed seats' tool PATH…; `db90c6da` feat: resume explicitly reviewed history by node ID (#2109) — run `git show` on any of them.
  • Change coupling: RigNode.tsx ↔ HybridTopologyNodes.tsx packages/ui/src/components/RigNode.tsx:1 — `packages/ui/src/components/RigNode.tsx` and `packages/ui/src/components/topology/HybridTopologyNodes.tsx` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, 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 `d0d8fad6` fix(activity): keep current usage limits visible (#1185); `02c3df37` fix(ui): distinguish pane_heuristic from hook-grade activity source (…; `af705c6a` fix(ui,daemon): surface activity source at dot consumers + fix stale … — run `git show` on any of them.
  • Change coupling: codex-runtime-adapter.ts ↔ pi-runtime-adapter.ts packages/daemon/src/adapters/codex-runtime-adapter.ts:1 — `packages/daemon/src/adapters/codex-runtime-adapter.ts` and `packages/daemon/src/adapters/pi-runtime-adapter.ts` change together 59% of the time (13 of the 22 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 13 shared commits counted here, the most recent 3 are `5f31cb57` fix(daemon): refresh stale managed guidance blocks, never overwrite a…; `267bde02` fix(daemon): a seat's own role as an auto-hinted startup file goes to…; `e33d722a` fix(daemon): a seat's legacy role guidance never merges into shared g… — run `git show` on any of them.
  • Change coupling: claude-code-adapter.ts ↔ pi-runtime-adapter.ts packages/daemon/src/adapters/claude-code-adapter.ts:1 — `packages/daemon/src/adapters/claude-code-adapter.ts` and `packages/daemon/src/adapters/pi-runtime-adapter.ts` change together 59% of the time (13 of the 22 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 13 shared commits counted here, the most recent 3 are `5f31cb57` fix(daemon): refresh stale managed guidance blocks, never overwrite a…; `267bde02` fix(daemon): a seat's own role as an auto-hinted startup file goes to…; `e33d722a` fix(daemon): a seat's legacy role guidance never merges into shared g… — run `git show` on any of them.
  • Change coupling: input.ts ↔ render.ts packages/tui/src/input.ts:1 — `packages/tui/src/input.ts` and `packages/tui/src/render.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 `12059e75` Preserve filtered Specs caller on Back; `986a24a6` Make workflow progress and spec consumers navigable in the TUI; `7ce65399` feat(tui): surface canonical fleet health — run `git show` on any of them.
  • Change coupling: community-harness-presets.ts ↔ runtime-adapter.ts packages/daemon/src/domain/community-harness-presets.ts:1 — `packages/daemon/src/domain/community-harness-presets.ts` and `packages/daemon/src/domain/runtime-adapter.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 `0ccd0132` feat: add observed OpenShell lifecycle and exact native restore (#2300); `9924040b` feat(daemon): a community harness can take the seat's declared model …; `802d44a2` feat(daemon): pass community first input at launch (#1987) — run `git show` on any of them.
  • Change coupling: demo-data.ts ↔ state.ts packages/tui/src/demo-data.ts:1 — `packages/tui/src/demo-data.ts` and `packages/tui/src/state.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 `dbc0e057` feat(tui): PULSE lanes LIVE — NOW / JUST FINISHED / UP NEXT + live fo…; `ef57bc2c` feat(tui): PULSE ◌ PARKED WITH BATON — LIVE premature-park join [puls…; `2ee2bfec` feat(tui): PULSE Exceptions strip LIVE — NEEDS YOU + BLOCKED ON AGENT… — run `git show` on any of them.
  • Change coupling: community-harness-runtime-adapter.ts ↔ types.ts packages/daemon/src/adapters/community-harness-runtime-adapter.ts:1 — `packages/daemon/src/adapters/community-harness-runtime-adapter.ts` and `packages/daemon/src/domain/types.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 — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, 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 `d5832cd9` feat(harness): community harnesses can declare protocol: pi-rpc (fini…; `0ccd0132` feat: add observed OpenShell lifecycle and exact native restore (#2300); `9924040b` feat(daemon): a community harness can take the seat's declared model … — run `git show` on any of them.
  • Change coupling: storytelling-cards.tsx ↔ Feed.tsx packages/ui/src/components/feed/cards/storytelling-cards.tsx:1 — `packages/ui/src/components/feed/cards/storytelling-cards.tsx` and `packages/ui/src/components/for-you/Feed.tsx` change together 50% of the time (5 of the 10 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 — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `14234dcf` feat(for-you): wire ApprovalCard to real data; remove ConceptCard fro…; `f609d060` fix(daemon,ui): durable status-backed storytelling filter + commit Ch…; `ac3df45f` feat(daemon,ui): getting-started complete-and-hide (slice 18 Checkpoi… — run `git show` on any of them.
D10 · Test Quality · No assertions · ×14
  • No assertions: a dropped connection reconnects (connection maintenance, not data polling) and pushes resume packages/tui/test/live-events.test.ts:103 — 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 integrity verified after extraction packages/daemon/test/bundle-archive.test.ts:528 — 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: silently exits with no output path argument packages/daemon/test/claude-context-collector.test.ts:237 — 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: releases the hold when the turn ends with a person's ask still pending, and withdraws the ask packages/daemon/test/community-harness-dsh-example.test.ts:437 — 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: pollOnce with zero eligible sessions does nothing packages/daemon/test/context-monitor.test.ts:419 — 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: start/stop manages interval lifecycle packages/daemon/test/context-monitor.test.ts:425 — 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: shared/agent.yaml skills all resolve to packaged SKILL.md files on disk packages/daemon/test/kernel-rig-spec-validate.test.ts:99 — 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: ${label}: profile.uses.skills all resolve in shared resource pool packages/daemon/test/kernel-rig-spec-validate.test.ts:134 — 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: consumes only its preload and leaves Node tools and nested unselected Pi untouched packages/daemon/test/pi-account-lock.test.ts:64 — 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 daemon src file constructs the plugins path via homedir() literal packages/daemon/test/plugin-discovery-openrig-home-wiring.test.ts:188 — 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: routes natural capability discovery to the router before the command reference packages/daemon/test/router-stub.test.ts:76 — 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 rig specs have acyclic launch-dependency edges packages/daemon/test/spec-library-starters.test.ts:275 — 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: AGENT_SPECS + kernel agent.yaml carry no deprecated KEY paths packages/daemon/test/spec-library-starters.test.ts:620 — 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: AGENT_SPECS + kernel agent.yaml pass validateAgentSpec strict validator packages/daemon/test/spec-library-starters.test.ts:642 — 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.
AC6 · Visual & motion safety · Focus outline removed inline · ×11
  • Focus outline removed inline packages/ui/src/components/BundleInspector.tsx:25 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/BundleInstallFlow.tsx:59 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/BundleInstallFlow.tsx:64 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/DiscoveryOverlay.tsx:325 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/DiscoveryOverlay.tsx:339 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/DiscoveryPanel.tsx:354 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/PackageInstallFlow.tsx:262 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/PackageInstallFlow.tsx:329 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/PackageInstallFlow.tsx:343 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/PackageInstallFlow.tsx:355 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline packages/ui/src/components/files/FilesWorkspace.tsx:555 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
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 packages/ui/twin/capture/payload-diff.ts:9 — `canonicalJson` is exported, takes a document from its caller (line 24) and hands it to `sortValue`, which calls itself at line 9 (`sortValue`) with a piece of `value` (and at line 13) — and nowhere in `sortValue` 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 `sortValue` 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 packages/ui/twin/capture/payload-diff.ts:42 — `diffPaths` is exported and takes `before: unknown` from its caller, and it calls itself at line 42 (`diffPaths`) with a piece of `before` — and nowhere in `diffPaths` 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 `diffPaths` 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 packages/daemon/src/domain/health-policy.ts:28 — `healthHash` is exported, takes a document from its caller (line 27) and hands it to `stable`, which calls itself at line 28 (`stable`) with a piece of `v` (and at line 29) — and nowhere in `stable` 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 `stable` 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 packages/daemon/src/domain/user-settings/settings-browser.ts:265 — `settingsBrowser` is exported, takes a document from its caller (line 117) and hands it to `policyLeaves`, which calls itself at line 265 (`policyLeaves`) with a piece of `value` — and nowhere in `policyLeaves` 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 `policyLeaves` 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 packages/daemon/src/domain/terminal/herdr-app-layout.ts:72 — `deriveRigLayout` is exported, takes a document from its caller (line 157) and hands it to `findParent`, which calls itself at line 72 (`findParent`) with a piece of `node` — and nowhere in `findParent` 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 `findParent` 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 packages/daemon/src/domain/terminal/herdr-app-layout.ts:87 — `referencedTerminals` is exported, takes a document from its caller (line 81) and hands it to `walk`, which calls itself at line 87 (`walk`) with a piece of `n` (and at line 89) — 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 packages/daemon/src/domain/terminal/herdr-app-state.ts:164 — `findNode` is exported and takes `node: unknown` from its caller, and it calls itself at line 164 (`findNode`) with a piece of `node` — and nowhere in `findNode` 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 `findNode` 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 packages/daemon/src/domain/provider/subscription-move-report.ts:78 — `findCredential` is exported and takes `value: unknown` from its caller, and it calls itself at line 78 (`findCredential`) with a piece of `value` (and at line 87) — and nowhere in `findCredential` 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 `findCredential` 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 packages/cli/src/lib/reconstruction-reader.ts:121 — `canonicalV0` is exported and takes `value: Json` from its caller, and it calls itself at line 121 (`canonicalV0`) with a piece of `value` (and at line 122) — and nowhere in `canonicalV0` 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 `canonicalV0` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D8 · Code Coverage · Low coverage · ×7
  • Low coverage: packages/daemon/src/domain/context-packs/profile-composer.ts packages/daemon/src/domain/context-packs/profile-composer.ts:1 — 19.0% line coverage (39/205).
  • Low coverage: packages/daemon/src/domain/context-packs/profile-source-resolver.ts packages/daemon/src/domain/context-packs/profile-source-resolver.ts:1 — 36.4% line coverage (60/165).
  • Low coverage: packages/daemon/src/domain/context-packs/seat-recap-store.ts packages/daemon/src/domain/context-packs/seat-recap-store.ts:1 — 25.0% line coverage (59/236).
  • Low coverage: packages/daemon/src/domain/session-name.ts packages/daemon/src/domain/session-name.ts:1 — 35.7% line coverage (81/227).
  • Low coverage: packages/daemon/src/domain/user-settings/settings-store.ts packages/daemon/src/domain/user-settings/settings-store.ts:1 — 44.2% line coverage (665/1503).
  • Low coverage: packages/daemon/src/routes/context-packs.ts packages/daemon/src/routes/context-packs.ts:1 — 26.3% line coverage (180/684).
  • Low coverage: packages/test-system/ci/prompt-state.mjs packages/test-system/ci/prompt-state.mjs:1 — 42.0% line coverage (95/226).
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×7
  • Outbound HTTP without resilience packages/cli/src/commands/chatroom.ts:215 — `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:76 — `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:78 — `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:71 — `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 packages/daemon/scripts/probe-health-diagnosis.mjs:102 — `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 packages/daemon/src/domain/mission-control/notification-adapter-ntfy.ts:75 — `this.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 packages/daemon/src/domain/mission-control/notification-adapter-webhook.ts:88 — `this.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.
D2 · Cognitive Complexity · provider.providerCommand · ×6
  • provider.providerCommand::renderStatusHuman (cognitive 51) packages/cli/src/commands/provider.ts:94 — provider.providerCommand::renderStatusHuman has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 6 (11 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (provider.providerCommand::renderSeatAccounts, provider.providerCommand::identityLabel, provider.providerCommand::renderUsageRow, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • provider.providerCommand::renderSeatAccounts (cognitive 40) packages/cli/src/commands/provider.ts:174 — provider.providerCommand::renderSeatAccounts has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 7 (24 pts), if/else 7 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 5 other methods here (provider.providerCommand::renderStatusHuman, provider.providerCommand::identityLabel, provider.providerCommand::renderUsageRow, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • provider.providerCommand::renderUsageRow (cognitive 39) packages/cli/src/commands/provider.ts:241 — provider.providerCommand::renderUsageRow has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 10 (12 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (provider.providerCommand::renderStatusHuman, provider.providerCommand::renderSeatAccounts, provider.providerCommand::identityLabel, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • provider.providerCommand::renderAcrossHosts (cognitive 39) packages/cli/src/commands/provider.ts:299 — provider.providerCommand::renderAcrossHosts has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 11 (28 pts), loops 7 (10 pts), if/else 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (provider.providerCommand::renderStatusHuman, provider.providerCommand::renderSeatAccounts, provider.providerCommand::identityLabel, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • provider.providerCommand::statusAcrossHosts (cognitive 31) packages/cli/src/commands/provider.ts:343 — provider.providerCommand::statusAcrossHosts has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 3 (6 pts), boolean chains 2, loops 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. This shape REPEATS in the file: 5 other methods here (provider.providerCommand::renderStatusHuman, provider.providerCommand::renderSeatAccounts, provider.providerCommand::identityLabel, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • provider.providerCommand::identityLabel (cognitive 16) packages/cli/src/commands/provider.ts:207 — provider.providerCommand::identityLabel has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 5 other methods here (provider.providerCommand::renderStatusHuman, provider.providerCommand::renderSeatAccounts, provider.providerCommand::renderUsageRow, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Fake-async · ×6
  • Fake-async — async method never awaits docs/reference/runner-conformance/fake-acp-agent.mjs:106 — `reopen` 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 packages/daemon/src/domain/environment-startup.ts:26 — `preflight` 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 packages/daemon/src/domain/plugin-vendor-service.ts:137 — `ensureVendored` 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 packages/daemon/src/domain/queue-wake-ladder.ts:1827 — `refreshEscalationRowIfExists` 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 packages/daemon/src/domain/rigspec-instantiator.ts:2194 — `launchBinding` 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 packages/daemon/src/domain/successor-session-launcher.ts:608 — `cleanup` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
D1 · Cyclomatic Complexity · provider.providerCommand · ×5
  • provider.providerCommand::renderUsageRow (cyclomatic 26) packages/cli/src/commands/provider.ts:241 — provider.providerCommand::renderUsageRow 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. This shape REPEATS in the file: 4 other methods here (provider.providerCommand::renderStatusHuman, provider.providerCommand::renderSeatAccounts, provider.providerCommand::renderAcrossHosts, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • provider.providerCommand::renderStatusHuman (cyclomatic 25) packages/cli/src/commands/provider.ts:94 — provider.providerCommand::renderStatusHuman has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 4 other methods here (provider.providerCommand::renderSeatAccounts, provider.providerCommand::renderUsageRow, provider.providerCommand::renderAcrossHosts, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • provider.providerCommand::renderAcrossHosts (cyclomatic 20) packages/cli/src/commands/provider.ts:299 — provider.providerCommand::renderAcrossHosts 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: 4 other methods here (provider.providerCommand::renderStatusHuman, provider.providerCommand::renderSeatAccounts, provider.providerCommand::renderUsageRow, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • provider.providerCommand::renderSeatAccounts (cyclomatic 19) packages/cli/src/commands/provider.ts:174 — provider.providerCommand::renderSeatAccounts has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 4 other methods here (provider.providerCommand::renderStatusHuman, provider.providerCommand::renderUsageRow, provider.providerCommand::renderAcrossHosts, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • provider.providerCommand::statusAcrossHosts (cyclomatic 18) packages/cli/src/commands/provider.ts:343 — provider.providerCommand::statusAcrossHosts 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: 4 other methods here (provider.providerCommand::renderStatusHuman, provider.providerCommand::renderSeatAccounts, provider.providerCommand::renderUsageRow, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
C2 · Access Controls · Anyone can act as another user by changing what their browser sends · ×4
  • Anyone can act as another user by changing what their browser sends packages/daemon/src/routes/activity.ts:320 — Here who is asking is taken from the 'piSessionId' request header (const piSessionId = stringOrNull(body.piSessionId)) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends packages/daemon/src/routes/queue.ts:1307 — Here who is asking is taken from the 'actor' form field (const identity = requireSenderIdentity(c, {verb:"record a delegated decision", bodyClai…) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends packages/daemon/src/routes/rigspec.ts:186 — Here who is asking is taken from the 'X-Target-Rig-Id' request header (const targetRigId = c.req.header("X-Target-Rig-Id")) and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
  • Anyone can act as another user by changing what their browser sends packages/daemon/src/routes/whoami.ts:17 — Here who is asking is taken from the 'permission' query parameter (const permissionDiagnostics = c.req.query("diagnostics")==="permission") and nothing checks it: no signature, no server-side session, no verified token. Cookies, headers and form or address values come from the visitor's browser and they can change them, so anyone can put another person's id there and be treated as that person — no password needed.
D1 · Cyclomatic Complexity · queue-stuck-sweep.runStuckSweep · ×4
  • queue-stuck-sweep.runStuckSweep::undeliveredCandidate (cyclomatic 27) packages/daemon/src/domain/queue-stuck-sweep.ts:985 — queue-stuck-sweep.runStuckSweep::undeliveredCandidate 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: 4 other methods here (queue-stuck-sweep.runStuckSweep, queue-stuck-sweep.runStuckSweep::unclaimedCandidate, queue-stuck-sweep.runStuckSweep::custodyCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • queue-stuck-sweep.runStuckSweep::foldInto (cyclomatic 24) packages/daemon/src/domain/queue-stuck-sweep.ts:1697 — queue-stuck-sweep.runStuckSweep::foldInto 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: 4 other methods here (queue-stuck-sweep.runStuckSweep, queue-stuck-sweep.runStuckSweep::undeliveredCandidate, queue-stuck-sweep.runStuckSweep::unclaimedCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • queue-stuck-sweep.runStuckSweep::unclaimedCandidate (cyclomatic 21) packages/daemon/src/domain/queue-stuck-sweep.ts:1039 — queue-stuck-sweep.runStuckSweep::unclaimedCandidate 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. This shape REPEATS in the file: 4 other methods here (queue-stuck-sweep.runStuckSweep, queue-stuck-sweep.runStuckSweep::undeliveredCandidate, queue-stuck-sweep.runStuckSweep::custodyCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • queue-stuck-sweep.runStuckSweep::custodyCandidate (cyclomatic 20) packages/daemon/src/domain/queue-stuck-sweep.ts:1121 — queue-stuck-sweep.runStuckSweep::custodyCandidate 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 shape REPEATS in the file: 4 other methods here (queue-stuck-sweep.runStuckSweep, queue-stuck-sweep.runStuckSweep::undeliveredCandidate, queue-stuck-sweep.runStuckSweep::unclaimedCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
D10 · Test Quality · Skipped test · ×4
  • Skipped test: seat scope at /topology/seat/$rigId/$logicalId — covered by source-assertion + scope-page direct test packages/ui/test/topology-view-mode.test.tsx:117 — Skipped — switched off by it.skip
  • Skipped test: records restoreMapPath = the per-seat post-compact-extra/<seat>.md when it EXISTS packages/daemon/test/precompact-hook.test.ts:367 — Skipped — switched off by it.skip
  • Skipped test: records restoreMapPath = null when no per-seat extra exists (never an unresolvable pointer) packages/daemon/test/precompact-hook.test.ts:379 — Skipped — switched off by it.skip
  • Skipped test: up surfaces the real daemon auto-start failure instead of a generic hint packages/cli/test/up.test.ts:1239 — Skipped — switched off by it.skip
D2 · Cognitive Complexity · queue-stuck-sweep.runStuckSweep · ×4
  • queue-stuck-sweep.runStuckSweep::undeliveredCandidate (cognitive 32) packages/daemon/src/domain/queue-stuck-sweep.ts:985 — queue-stuck-sweep.runStuckSweep::undeliveredCandidate has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 8, if/else 7 (8 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. This shape REPEATS in the file: 4 other methods here (queue-stuck-sweep.runStuckSweep, queue-stuck-sweep.runStuckSweep::unclaimedCandidate, queue-stuck-sweep.runStuckSweep::custodyCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • queue-stuck-sweep.runStuckSweep::foldInto (cognitive 29) packages/daemon/src/domain/queue-stuck-sweep.ts:1697 — queue-stuck-sweep.runStuckSweep::foldInto has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, ternaries 1 (3 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. This shape REPEATS in the file: 4 other methods here (queue-stuck-sweep.runStuckSweep, queue-stuck-sweep.runStuckSweep::undeliveredCandidate, queue-stuck-sweep.runStuckSweep::unclaimedCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • queue-stuck-sweep.runStuckSweep::custodyCandidate (cognitive 20) packages/daemon/src/domain/queue-stuck-sweep.ts:1121 — queue-stuck-sweep.runStuckSweep::custodyCandidate has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (9 pts), error handling 1, 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. This shape REPEATS in the file: 4 other methods here (queue-stuck-sweep.runStuckSweep, queue-stuck-sweep.runStuckSweep::undeliveredCandidate, queue-stuck-sweep.runStuckSweep::unclaimedCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
  • queue-stuck-sweep.runStuckSweep::unclaimedCandidate (cognitive 19) packages/daemon/src/domain/queue-stuck-sweep.ts:1039 — queue-stuck-sweep.runStuckSweep::unclaimedCandidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 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. This shape REPEATS in the file: 4 other methods here (queue-stuck-sweep.runStuckSweep, queue-stuck-sweep.runStuckSweep::undeliveredCandidate, queue-stuck-sweep.runStuckSweep::custodyCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Guard cannot change the result · ×4
  • Guard cannot change the result — returns what the code already falls through to packages/cli/src/commands/ps.ts:503 — The guard above `return true;` also returns `true`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
  • Guard cannot change the result — returns what the code already falls through to packages/tui/src/execution/execution-model.ts:98 — The guard above `return "dim";` also returns `"dim"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
  • Guard cannot change the result — returns what the code already falls through to packages/ui/src/components/drawer-viewers/FileViewer.tsx:45 — The guard above `return "text";` also returns `"text"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
  • Guard cannot change the result — returns what the code already falls through to packages/ui/src/lib/attention-feed.ts:39 — The guard above `return "action-required";` also returns `"action-required"`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
X29 · Per-element action decided by a fixed element · Per-element action decided by a fixed element · ×4
  • Per-element action decided by a fixed element packages/daemon/src/domain/session-transport.ts:2894 — This loop runs once per element of `ids`, and the statement it guards acts on the element it is on — `id`. The test deciding whether that statement runs does not: `result.ok` reads `ids[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2890, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
  • Per-element action decided by a fixed element packages/daemon/src/domain/session-transport.ts:2895 — This loop runs once per element of `ids`, and the statement it guards acts on the element it is on — `id`. The test deciding whether that statement runs does not: `result.outcome === "rendered-unconfirmed" || (opts?.verify && result.verified...` reads `ids[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2890, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
  • Per-element action decided by a fixed element packages/daemon/src/domain/session-transport.ts:2897 — This loop runs once per element of `ids`, and the statement it guards acts on the element it is on — `id`. The test deciding whether that statement runs does not: `result.inputPhase === "attempted" || result.inputPhase === "written"` reads `ids[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2890, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
  • Per-element action decided by a fixed element packages/daemon/src/domain/session-transport.ts:2898 — This loop runs once per element of `ids`, and the statement it guards acts on the element it is on — `id`. The test deciding whether that statement runs does not: `result.sent === false || result.inputPhase === "not_reached"` reads `ids[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 2890, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
AC1 · Text alternatives · <video> without a captions track · ×3
  • <video> without a captions track packages/ui/src/components/review/EvidenceOpener.tsx:121 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track packages/ui/src/components/review/SliceReviewTab.tsx:72 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track packages/ui/src/components/slices/tabs/TestsVerificationTab.tsx:193 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
D1 · Cyclomatic Complexity · main.run · ×3
  • main.run::handleInput (cyclomatic 114) packages/tui/src/main.ts:554 — main.run::handleInput has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent 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: 3 other methods here (main.run, main.run::draw, main.run::executeAct) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • main.run::draw (cyclomatic 34) packages/tui/src/main.ts:197 — main.run::draw 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. This shape REPEATS in the file: 3 other methods here (main.run, main.run::executeAct, main.run::handleInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • main.run::executeAct (cyclomatic 17) packages/tui/src/main.ts:450 — main.run::executeAct 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 shape REPEATS in the file: 3 other methods here (main.run, main.run::draw, main.run::handleInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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 · rigs.rigsRoutes.post("/ · ×3
  • rigs.rigsRoutes.post("/:id/attach-self") (cyclomatic 43) packages/daemon/src/routes/rigs.ts:492 — rigs.rigsRoutes.post("/:id/attach-self") has cyclomatic complexity 43 (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.
  • rigs.rigsRoutes.post("/:rigId/pods/:podNamespace/members") (cyclomatic 28) packages/daemon/src/routes/rigs.ts:742 — rigs.rigsRoutes.post("/:rigId/pods/:podNamespace/members") 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.
  • rigs.rigsRoutes.post("/:id/up") (cyclomatic 17) packages/daemon/src/routes/rigs.ts:572 — rigs.rigsRoutes.post("/:id/up") 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.
D2 · Cognitive Complexity · main.run · ×3
  • main.run::handleInput (cognitive 229) packages/tui/src/main.ts:554 — main.run::handleInput has cognitive complexity 229 (threshold 15). Drivers by points: if/else 66 (178 pts), boolean chains 33, ternaries 3 (14 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 125). 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: 3 other methods here (main.run, main.run::draw, main.run::executeAct) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • main.run::draw (cognitive 37) packages/tui/src/main.ts:197 — main.run::draw has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 6 (12 pts), boolean chains 11 (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: 3 other methods here (main.run, main.run::executeAct, main.run::handleInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • main.run::executeAct (cognitive 21) packages/tui/src/main.ts:450 — main.run::executeAct has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (9 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. This shape REPEATS in the file: 3 other methods here (main.run, main.run::draw, main.run::handleInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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 · skill.skillCommand · ×3
  • skill.skillCommand::seatLoadout (cognitive 48) packages/cli/src/commands/skill.ts:157 — skill.skillCommand::seatLoadout has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 14 (17 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (skill.skillCommand::printSeat, skill.skillCommand::describeDelivery) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • skill.skillCommand::printSeat (cognitive 36) packages/cli/src/commands/skill.ts:211 — skill.skillCommand::printSeat has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 8 (28 pts), if/else 4, boolean chains 2, loops 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 2 other methods here (skill.skillCommand::seatLoadout, skill.skillCommand::describeDelivery) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • skill.skillCommand::describeDelivery (cognitive 18) packages/cli/src/commands/skill.ts:235 — skill.skillCommand::describeDelivery has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 2 other methods here (skill.skillCommand::seatLoadout, skill.skillCommand::printSeat) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · rigs.rigsRoutes.post("/ · ×3
  • rigs.rigsRoutes.post("/:id/attach-self") (cognitive 32) packages/daemon/src/routes/rigs.ts:492 — rigs.rigsRoutes.post("/:id/attach-self") has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 13, boolean chains 11, if/else 7, match/switch 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.
  • rigs.rigsRoutes.post("/:rigId/pods/:podNamespace/members") (cognitive 29) packages/daemon/src/routes/rigs.ts:742 — rigs.rigsRoutes.post("/:rigId/pods/:podNamespace/members") has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 8, boolean chains 3, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rigs.rigsRoutes.post("/:id/up") (cognitive 22) packages/daemon/src/routes/rigs.ts:572 — rigs.rigsRoutes.post("/:id/up") has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4 (6 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.
D31 · IaC & Container Security · Medium IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Both branches are identical · ×3
  • Both branches are identical — the condition decides nothing packages/cli/src/commands/policy.ts:255 — 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.
  • Both branches are identical — the condition decides nothing packages/daemon/src/routes/terminal-ws.ts:39 — 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.
  • Both branches are identical — the condition decides nothing packages/ui/src/components/topology/HybridTopologyNodes.tsx:281 — 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.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×3
  • Untrusted text written into markup unescaped packages/daemon/src/routes/compaction.ts:246 — `sessionName` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped packages/daemon/src/routes/hosts.ts:225 — `code` is text this program did not author, and it is written into the text of an element through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped packages/daemon/src/server.ts:991 — `JSON.stringify(deps.terminalBearerToken)` is text this program did not author, and it is written into a script or style context through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. A script or style context needs its own escaping (or a JSON serialiser that escapes `<`); better, pass the value through a data attribute.
X25 · Inert configuration knob · Option is kept and never read · ×3
  • Option is kept and never read packages/daemon/src/domain/node-launcher.ts:154 — `NodeLauncher` accepts `deps.defaultSilenceWindowSeconds` from the caller and keeps it in `this.defaultSilenceWindowSeconds` on line 154, where only it can read the value — but nothing ever reads `this.defaultSilenceWindowSeconds`. Setting `deps.defaultSilenceWindowSeconds` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.defaultSilenceWindowSeconds` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `deps.defaultSilenceWindowSeconds` from the accepted options so callers stop setting a knob that does nothing.
  • Option is kept and never read packages/daemon/src/domain/successor-session-launcher.ts:189 — `SuccessorSessionLauncher` accepts `opts.newId` from the caller and keeps it in `this.newId` on line 189, where only it can read the value — but nothing ever reads `this.newId`. Setting `opts.newId` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.newId` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `opts.newId` from the accepted options so callers stop setting a knob that does nothing.
  • Option is kept and never read packages/daemon/src/domain/whoami-service.ts:163 — `WhoamiService` accepts `deps.sessionRegistry` from the caller and keeps it in `this.sessionRegistry` on line 163, where only it can read the value — but nothing ever reads `this.sessionRegistry`. Setting `deps.sessionRegistry` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.sessionRegistry` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `deps.sessionRegistry` from the accepted options so callers stop setting a knob that does nothing.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×3
  • Swallowed exception (caught, then discarded) packages/ui/src/lib/topology-events.ts:88 — `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) packages/ui/src/hooks/useNeedsInputSeats.ts:32 — `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) packages/ui/src/hooks/useWorkflowSse.ts:46 — `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.
AC2 · Forms & labels · <Textarea> field component without a label · ×2
  • <Textarea> field component without a label packages/ui/src/components/AgentSpecValidateFlow.tsx:64 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label packages/ui/src/components/ImportFlow.tsx:190 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×2
  • Modal dialog does not manage focus packages/ui/src/components/project/Lightbox.tsx:9 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, 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.
  • Modal dialog does not manage focus packages/ui/src/components/project/ProofImageViewer.tsx:23 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, 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.
D1 · Cyclomatic Complexity · scope-audit.classifyScopeItem (cyclomatic 71) · ×2
  • scope-audit.classifyScopeItem (cyclomatic 71) REDACTED:308 — scope-audit.classifyScopeItem has cyclomatic complexity 71 (threshold 15). Of this number, 63 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.
  • scope-audit.classifyScopeItem (cyclomatic 71) REDACTED:308 — scope-audit.classifyScopeItem has cyclomatic complexity 71 (threshold 15). Of this number, 63 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 · queue.queueRoutes · ×2
  • queue.queueRoutes::errorResponse (cyclomatic 47) packages/daemon/src/routes/queue.ts:326 — queue.queueRoutes::errorResponse has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (queue.queueRoutes::crossHostHandoff) 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.
  • queue.queueRoutes::crossHostHandoff (cyclomatic 41) packages/daemon/src/routes/queue.ts:529 — queue.queueRoutes::crossHostHandoff has cyclomatic complexity 41 (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 (queue.queueRoutes::errorResponse) 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 · skill.skillCommand · ×2
  • skill.skillCommand::seatLoadout (cyclomatic 35) packages/cli/src/commands/skill.ts:157 — skill.skillCommand::seatLoadout has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (skill.skillCommand::printSeat) 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.
  • skill.skillCommand::printSeat (cyclomatic 17) packages/cli/src/commands/skill.ts:211 — skill.skillCommand::printSeat 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 shape REPEATS in the file: one other method here (skill.skillCommand::seatLoadout) 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 · discovery.discoveryRoutes.post("/ · ×2
  • discovery.discoveryRoutes.post("/:id/adopt") (cyclomatic 34) packages/daemon/src/routes/discovery.ts:140 — discovery.discoveryRoutes.post("/:id/adopt") 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.
  • discovery.discoveryRoutes.post("/:id/bind") (cyclomatic 25) packages/daemon/src/routes/discovery.ts:77 — discovery.discoveryRoutes.post("/:id/bind") has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · sessions.sessionAdminRoutes.post("/ · ×2
  • sessions.sessionAdminRoutes.post("/:sessionName/repair-missing-pane") (cyclomatic 17) packages/daemon/src/routes/sessions.ts:684 — sessions.sessionAdminRoutes.post("/:sessionName/repair-missing-pane") 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.
  • sessions.sessionAdminRoutes.post("/:sessionName/reconcile") (cyclomatic 16) packages/daemon/src/routes/sessions.ts:641 — sessions.sessionAdminRoutes.post("/:sessionName/reconcile") has cyclomatic complexity 16 (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 · policy-ref.resolvePermissionPolicyAttachment (cyclomatic 16) · ×2
  • policy-ref.resolvePermissionPolicyAttachment (cyclomatic 16) packages/daemon/src/domain/permission-policy/policy-ref.ts:172 — policy-ref.resolvePermissionPolicyAttachment 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.
  • policy-ref.resolvePermissionPolicyAttachment (cyclomatic 16) packages/cli/src/lib/permission-policy/policy-ref.ts:172 — policy-ref.resolvePermissionPolicyAttachment 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 · scope-audit.deriveMissionDependencyGraph (cyclomatic 16) · ×2
  • scope-audit.deriveMissionDependencyGraph (cyclomatic 16) REDACTED:115 — scope-audit.deriveMissionDependencyGraph has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • scope-audit.deriveMissionDependencyGraph (cyclomatic 16) REDACTED:115 — scope-audit.deriveMissionDependencyGraph has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · logical-checkbox.parseLogicalCheckboxes (cyclomatic 16) · ×2
  • logical-checkbox.parseLogicalCheckboxes (cyclomatic 16) packages/daemon/src/domain/scope/logical-checkbox.ts:45 — logical-checkbox.parseLogicalCheckboxes 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.
  • logical-checkbox.parseLogicalCheckboxes (cyclomatic 16) packages/cli/src/lib/scope/logical-checkbox.ts:45 — logical-checkbox.parseLogicalCheckboxes 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.
D2 · Cognitive Complexity · queue.queueRoutes · ×2
  • queue.queueRoutes::errorResponse (cognitive 770) packages/daemon/src/routes/queue.ts:326 — queue.queueRoutes::errorResponse has cognitive complexity 770 (threshold 15). Drivers by points: ternaries 44 (768 pts), if/else 2 (nesting depth added 724). 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 (queue.queueRoutes::crossHostHandoff) 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.
  • queue.queueRoutes::crossHostHandoff (cognitive 45) packages/daemon/src/routes/queue.ts:529 — queue.queueRoutes::crossHostHandoff has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 25 (31 pts), boolean chains 9, if/else 4, error handling 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. This shape REPEATS in the file: one other method here (queue.queueRoutes::errorResponse) 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 · scope-audit.classifyScopeItem (cognitive 141) · ×2
  • scope-audit.classifyScopeItem (cognitive 141) REDACTED:308 — scope-audit.classifyScopeItem has cognitive complexity 141 (threshold 15). Drivers by points: if/else 30 (64 pts), ternaries 17 (54 pts), boolean chains 19, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 73). Of this number, 125 points are the body's own statements and 16 belong to one function item 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.
  • scope-audit.classifyScopeItem (cognitive 141) REDACTED:308 — scope-audit.classifyScopeItem has cognitive complexity 141 (threshold 15). Drivers by points: if/else 30 (64 pts), ternaries 17 (54 pts), boolean chains 19, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 73). Of this number, 125 points are the body's own statements and 16 belong to one function item 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 · mission-control.missionControlRoutes · ×2
  • mission-control.missionControlRoutes::errorResponse (cognitive 63) packages/daemon/src/routes/mission-control.ts:226 — mission-control.missionControlRoutes::errorResponse has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 12 (60 pts), if/else 2, boolean chains 1 (nesting depth added 48). 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 (mission-control.missionControlRoutes::listDestinations) 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.
  • mission-control.missionControlRoutes::listDestinations (cognitive 19) packages/daemon/src/routes/mission-control.ts:116 — mission-control.missionControlRoutes::listDestinations has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 4 (5 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (mission-control.missionControlRoutes::errorResponse) 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 · extract-surface.extractFile · ×2
  • extract-surface.extractFile::evalExpr (cognitive 48) packages/cli/src/release-surface/extract-surface.ts:130 — extract-surface.extractFile::evalExpr has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (37 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (extract-surface.extractFile::processBody) 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.
  • extract-surface.extractFile::processBody (cognitive 19) packages/cli/src/release-surface/extract-surface.ts:107 — extract-surface.extractFile::processBody has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 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. This shape REPEATS in the file: one other method here (extract-surface.extractFile::evalExpr) 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 · queue-erasure.eraseQueue · ×2
  • queue-erasure.eraseQueue::planBatch (cognitive 40) REDACTED:848 — queue-erasure.eraseQueue::planBatch has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (28 pts), loops 7 (10 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (queue-erasure.eraseQueue, queue-erasure.eraseQueue::page) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • queue-erasure.eraseQueue::page (cognitive 22) REDACTED:694 — queue-erasure.eraseQueue::page has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (5 pts), ternaries 1 (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. This shape REPEATS in the file: 2 other methods here (queue-erasure.eraseQueue, queue-erasure.eraseQueue::planBatch) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · discovery.discoveryRoutes.post("/ · ×2
  • discovery.discoveryRoutes.post("/:id/adopt") (cognitive 32) packages/daemon/src/routes/discovery.ts:140 — discovery.discoveryRoutes.post("/:id/adopt") has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 7 (11 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • discovery.discoveryRoutes.post("/:id/bind") (cognitive 16) packages/daemon/src/routes/discovery.ts:77 — discovery.discoveryRoutes.post("/:id/bind") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4, boolean chains 3, match/switch 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 · scope-audit.deriveMissionDependencyGraph (cognitive 28) · ×2
  • scope-audit.deriveMissionDependencyGraph (cognitive 28) REDACTED:115 — scope-audit.deriveMissionDependencyGraph has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 4 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). 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.
  • scope-audit.deriveMissionDependencyGraph (cognitive 28) REDACTED:115 — scope-audit.deriveMissionDependencyGraph has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 4 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). 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 · logical-checkbox.parseLogicalCheckboxes (cognitive 21) · ×2
  • logical-checkbox.parseLogicalCheckboxes (cognitive 21) packages/daemon/src/domain/scope/logical-checkbox.ts:45 — logical-checkbox.parseLogicalCheckboxes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 1 (nesting depth added 8). 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.
  • logical-checkbox.parseLogicalCheckboxes (cognitive 21) packages/cli/src/lib/scope/logical-checkbox.ts:45 — logical-checkbox.parseLogicalCheckboxes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 1 (nesting depth added 8). 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 · bundle-check.checkBundleFolder · ×2
  • bundle-check.checkBundleFolder::startupFiles (cognitive 21) packages/cli/src/lib/bundle-check.ts:85 — bundle-check.checkBundleFolder::startupFiles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (bundle-check.checkBundleFolder, bundle-check.checkBundleFolder::agent) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • bundle-check.checkBundleFolder::agent (cognitive 20) packages/cli/src/lib/bundle-check.ts:100 — bundle-check.checkBundleFolder::agent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (4 pts), boolean chains 2, 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. This shape REPEATS in the file: 2 other methods here (bundle-check.checkBundleFolder, bundle-check.checkBundleFolder::startupFiles) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · policy-ref.resolvePermissionPolicyAttachment (cognitive 19) · ×2
  • policy-ref.resolvePermissionPolicyAttachment (cognitive 19) packages/daemon/src/domain/permission-policy/policy-ref.ts:172 — policy-ref.resolvePermissionPolicyAttachment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, ternaries 1 (2 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.
  • policy-ref.resolvePermissionPolicyAttachment (cognitive 19) packages/cli/src/lib/permission-policy/policy-ref.ts:172 — policy-ref.resolvePermissionPolicyAttachment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, ternaries 1 (2 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (47 lines × 2 locations) · ×2
  • Duplicated block (47 lines × 2 locations) packages/cli/src/config-store.ts:859 — packages/cli/src/config-store.ts:859 · packages/daemon/src/domain/user-settings/settings-store.ts:510 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (47 lines × 2 locations) packages/ui/src/hooks/usePluginFiles.ts:16 — packages/ui/src/hooks/usePluginFiles.ts:16 · packages/ui/src/hooks/useSkillFiles.ts:14 — 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.
R7 · Dead Code · Dead file (~112 LoC) · ×2
  • Dead file (~112 LoC) packages/daemon/scripts/probe-passive-ceremony.mjs — no import path from any entry point (224 application, 235 tooling, 2399 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 (~112 LoC) packages/ui/src/hooks/useContextFleet.ts — no import path from any entry point (224 application, 235 tooling, 2399 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 (~51 LoC) · ×2
  • Dead file (~51 LoC) packages/ui/src/hooks/useCountUp.ts — no import path from any entry point (224 application, 235 tooling, 2399 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/ui/src/components/RigCard.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~51 LoC) packages/ui/src/hooks/useMissionStatuses.ts — no import path from any entry point (224 application, 235 tooling, 2399 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
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.3 · ×1
  • Low contrast colour pair in CSS (3.3:1) packages/ui/src/components/project/StoryGraph.css:160 — `.sg-cnode.sg-self` sets color: #b9822f on background-color: #fff — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
C1 · Data Protection · No data-protection/encryption · ×1
  • No data-protection/encryption packages/daemon/src/domain/provider/provider-account-readings.ts:106 — No encryption usage (node:crypto createCipheriv, Web Crypto subtle.encrypt, crypto-js AES, tweetnacl/libsodium secretbox, a column-encryption layer such as typeorm-encrypted, prisma-field-encryption or mongoose-field-encryption, or MongoDB client-side field-level encryption) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
D1 · Cyclomatic Complexity · mcp-server.createMcpServer (cyclomatic 556) · ×1
  • mcp-server.createMcpServer (cyclomatic 556) packages/cli/src/mcp-server.ts:982 — mcp-server.createMcpServer has cyclomatic complexity 556 (threshold 15). Of this number, 47 points are the body's own statements and 509 belong to 73 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 · StartupOrchestrator.startNodeWithWarnings (cyclomatic 268) · ×1
  • StartupOrchestrator.startNodeWithWarnings (cyclomatic 268) packages/daemon/src/domain/startup-orchestrator.ts:347 — StartupOrchestrator.startNodeWithWarnings has cyclomatic complexity 268 (threshold 15). Of this number, 240 points are the body's own statements and 28 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 · SessionTransport.sendUnguarded (cyclomatic 267) · ×1
  • SessionTransport.sendUnguarded (cyclomatic 267) packages/daemon/src/domain/session-transport.ts:3444 — SessionTransport.sendUnguarded has cyclomatic complexity 267 (threshold 15). Of this number, 184 points are the body's own statements and 83 belong to 23 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 · queue.queueCommand (cyclomatic 265) · ×1
  • queue.queueCommand (cyclomatic 265) packages/cli/src/commands/queue.ts:1299 — queue.queueCommand has cyclomatic complexity 265 (threshold 15). Most of this is not in the body itself: 1 of the 265 points is its own statement and the rest belongs to 40 function literals inside it that branch (lines 1458, 2381, 1336, …). 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 · up.upCommand (cyclomatic 240) · ×1
  • up.upCommand (cyclomatic 240) packages/cli/src/commands/up.ts:101 — up.upCommand has cyclomatic complexity 240 (threshold 15). Most of this is not in the body itself: 1 of the 240 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 154, 380, 365, …). 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 · hydrate.hydrateSnapshot (cyclomatic 230) · ×1
  • hydrate.hydrateSnapshot (cyclomatic 230) packages/tui/src/hydrate.ts:392 — hydrate.hydrateSnapshot has cyclomatic complexity 230 (threshold 15). Of this number, 196 points are the body's own statements and 34 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 · queue-wake-ladder.advancePromptRefusals (cyclomatic 224) · ×1
  • queue-wake-ladder.advancePromptRefusals (cyclomatic 224) packages/daemon/src/domain/queue-wake-ladder.ts:1256 — queue-wake-ladder.advancePromptRefusals has cyclomatic complexity 224 (threshold 15). Of this number, 192 points are the body's own statements and 32 belong to 14 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 · RestoreOrchestrator.postLaunchRestore (cyclomatic 220) · ×1
  • RestoreOrchestrator.postLaunchRestore (cyclomatic 220) packages/daemon/src/domain/restore-orchestrator.ts:1947 — RestoreOrchestrator.postLaunchRestore has cyclomatic complexity 220 (threshold 15). Of this number, 188 points are the body's own statements and 32 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 · bundle-behaviour.describeBundleBehaviour (cyclomatic 218) · ×1
  • bundle-behaviour.describeBundleBehaviour (cyclomatic 218) packages/daemon/src/domain/bundle-behaviour.ts:110 — bundle-behaviour.describeBundleBehaviour has cyclomatic complexity 218 (threshold 15). Of this number, 160 points are the body's own statements and 58 belong to 16 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 · render.contentLines (cyclomatic 207) · ×1
  • render.contentLines (cyclomatic 207) packages/tui/src/render.ts:962 — render.contentLines has cyclomatic complexity 207 (threshold 15). Of this number, 191 points are the body's own statements and 16 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 · context.contextCommand (cyclomatic 194) · ×1
  • context.contextCommand (cyclomatic 194) REDACTED:241 — context.contextCommand has cyclomatic complexity 194 (threshold 15). Most of this is not in the body itself: 3 of the 194 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 276, a function literal at line 723, a function literal at line 892, …). 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 · queue-stuck-sweep.runStuckSweep (cyclomatic 179) · ×1
  • queue-stuck-sweep.runStuckSweep (cyclomatic 179) packages/daemon/src/domain/queue-stuck-sweep.ts:804 — queue-stuck-sweep.runStuckSweep has cyclomatic complexity 179 (threshold 15). To reduce it, separate the cases: extract each independent 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: 4 other methods here (queue-stuck-sweep.runStuckSweep::undeliveredCandidate, queue-stuck-sweep.runStuckSweep::unclaimedCandidate, queue-stuck-sweep.runStuckSweep::custodyCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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 · provider.providerRoutes (cyclomatic 167) · ×1
  • provider.providerRoutes (cyclomatic 167) packages/daemon/src/routes/provider.ts:143 — provider.providerRoutes has cyclomatic complexity 167 (threshold 15). Most of this is not in the body itself: 3 of the 167 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 366, a function literal at line 188, a function literal at line 264, …). 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 · activity.postHook (cyclomatic 166) · ×1
  • activity.postHook (cyclomatic 166) packages/daemon/src/routes/activity.ts:396 — activity.postHook has cyclomatic complexity 166 (threshold 15). Of this number, 156 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 · gateway.gatewayCommand (cyclomatic 165) · ×1
  • gateway.gatewayCommand (cyclomatic 165) packages/cli/src/commands/gateway.ts:166 — gateway.gatewayCommand has cyclomatic complexity 165 (threshold 15). Most of this is not in the body itself: 1 of the 165 points is its own statement and the rest belongs to 33 function items inside it that branch (a function literal at line 192, a function literal at line 759, a function literal at line 579, …). 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 · attention.attentionRoutes (cyclomatic 164) · ×1
  • attention.attentionRoutes (cyclomatic 164) packages/daemon/src/routes/attention.ts:19 — attention.attentionRoutes has cyclomatic complexity 164 (threshold 15). Most of this is not in the body itself: 1 of the 164 points is its own statement and the rest belongs to 24 function literals inside it that branch (lines 21, 223, 117, …). 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 · QueueRepository.updateInTransactionalContext (cyclomatic 148) · ×1
  • QueueRepository.updateInTransactionalContext (cyclomatic 148) packages/daemon/src/domain/queue-repository.ts:3628 — QueueRepository.updateInTransactionalContext has cyclomatic complexity 148 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · finite-telemetry.readTelemetryPage (cyclomatic 142) · ×1
  • finite-telemetry.readTelemetryPage (cyclomatic 142) packages/daemon/src/domain/finite-telemetry.ts:114 — finite-telemetry.readTelemetryPage has cyclomatic complexity 142 (threshold 15). Of this number, 35 points are the body's own statements and 107 belong to 7 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 · startup.applySelectedHistory (cyclomatic 138) · ×1
  • startup.applySelectedHistory (cyclomatic 138) packages/daemon/src/routes/startup.ts:382 — startup.applySelectedHistory has cyclomatic complexity 138 (threshold 15). Most of this is not in the body itself: 11 of the 138 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 397, 495, 402, …). 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 · RestoreOrchestrator.restoreNodeWithCompensation (cyclomatic 136) · ×1
  • RestoreOrchestrator.restoreNodeWithCompensation (cyclomatic 136) packages/daemon/src/domain/restore-orchestrator.ts:1274 — RestoreOrchestrator.restoreNodeWithCompensation has cyclomatic complexity 136 (threshold 15). Of this number, 133 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 · RunnerCore.handleEvent (cyclomatic 133) · ×1
  • RunnerCore.handleEvent (cyclomatic 133) REDACTED:1594 — RunnerCore.handleEvent has cyclomatic complexity 133 (threshold 15). Of this number, 129 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 · HerdrFollowView.apply (cyclomatic 133) · ×1
  • HerdrFollowView.apply (cyclomatic 133) packages/daemon/src/domain/terminal/herdr-follow-view.ts:47 — HerdrFollowView.apply has cyclomatic complexity 133 (threshold 15). Of this number, 98 points are the body's own statements and 35 belong to 13 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 · launch.launchCommand (cyclomatic 132) · ×1
  • launch.launchCommand (cyclomatic 132) packages/cli/src/commands/launch.ts:70 — launch.launchCommand has cyclomatic complexity 132 (threshold 15). Most of this is not in the body itself: 1 of the 132 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 93, a function literal at line 249, a function literal at line 273, …). 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 · SessionTransport.sendClassifiedInput (cyclomatic 128) · ×1
  • SessionTransport.sendClassifiedInput (cyclomatic 128) packages/daemon/src/domain/session-transport.ts:3046 — SessionTransport.sendClassifiedInput has cyclomatic complexity 128 (threshold 15). Of this number, 69 points are the body's own statements and 59 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 · SeatHandoverService.handover (cyclomatic 128) · ×1
  • SeatHandoverService.handover (cyclomatic 128) packages/daemon/src/domain/seat-handover-service.ts:400 — SeatHandoverService.handover has cyclomatic complexity 128 (threshold 15). Of this number, 118 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 · context-packs.contextPacksRoutes (cyclomatic 128) · ×1
  • context-packs.contextPacksRoutes (cyclomatic 128) packages/daemon/src/routes/context-packs.ts:62 — context-packs.contextPacksRoutes has cyclomatic complexity 128 (threshold 15). Most of this is not in the body itself: 1 of the 128 points is its own statement and the rest belongs to 16 function items inside it that branch (a function literal at line 351, a function literal at line 273, a function literal at line 99, …). 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 · terminal-window.openTerminalWindow (cyclomatic 126) · ×1
  • terminal-window.openTerminalWindow (cyclomatic 126) packages/cli/src/terminal-window.ts:221 — terminal-window.openTerminalWindow has cyclomatic complexity 126 (threshold 15). To reduce it, separate the cases: extract each independent 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 (terminal-window.openTerminalWindow::measureWindow) 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.reduce (cyclomatic 125) · ×1
  • state.reduce (cyclomatic 125) packages/tui/src/state.ts:124 — state.reduce has cyclomatic complexity 125 (threshold 15). Of this number, 124 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 · start.startCommand (cyclomatic 116) · ×1
  • start.startCommand (cyclomatic 116) packages/cli/src/commands/start.ts:181 — start.startCommand has cyclomatic complexity 116 (threshold 15). Most of this is not in the body itself: 1 of the 116 points is its own statement and the rest belongs to one function literal inside it that branches (line 210). 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 · slack.slackCommand (cyclomatic 114) · ×1
  • slack.slackCommand (cyclomatic 114) packages/cli/src/commands/slack.ts:188 — slack.slackCommand has cyclomatic complexity 114 (threshold 15). Most of this is not in the body itself: 1 of the 114 points is its own statement and the rest belongs to 16 function items inside it that branch (a function literal at line 241, a function literal at line 381, a function literal at line 584, …). 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 · queue-wake-ladder.runWakeLadderTick (cyclomatic 112) · ×1
  • queue-wake-ladder.runWakeLadderTick (cyclomatic 112) packages/daemon/src/domain/queue-wake-ladder.ts:671 — queue-wake-ladder.runWakeLadderTick has cyclomatic complexity 112 (threshold 15). Of this number, 103 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 · startup.createDaemon (cyclomatic 112) · ×1
  • startup.createDaemon (cyclomatic 112) packages/daemon/src/startup.ts:344 — startup.createDaemon has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent 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 (startup.createDaemon::topologyDestinationAdvisory) 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 · PodRigInstantiator.launchExistingAgentMember (cyclomatic 109) · ×1
  • PodRigInstantiator.launchExistingAgentMember (cyclomatic 109) packages/daemon/src/domain/rigspec-instantiator.ts:2477 — PodRigInstantiator.launchExistingAgentMember has cyclomatic complexity 109 (threshold 15). Of this number, 100 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 · host.hostCommand (cyclomatic 108) · ×1
  • host.hostCommand (cyclomatic 108) packages/cli/src/commands/host.ts:558 — host.hostCommand has cyclomatic complexity 108 (threshold 15). Most of this is not in the body itself: 3 of the 108 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 766, 603, 991, …). 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 · gateway.gatewayRoutes (cyclomatic 108) · ×1
  • gateway.gatewayRoutes (cyclomatic 108) packages/daemon/src/routes/gateway.ts:54 — gateway.gatewayRoutes has cyclomatic complexity 108 (threshold 15). Most of this is not in the body itself: 2 of the 108 points are its own statements and the rest belongs to 29 function items inside it that branch (a function literal at line 196, a function literal at line 250, a function literal at line 296, …). 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 · bundle.bundleCommand (cyclomatic 105) · ×1
  • bundle.bundleCommand (cyclomatic 105) packages/cli/src/commands/bundle.ts:65 — bundle.bundleCommand has cyclomatic complexity 105 (threshold 15). Most of this is not in the body itself: 1 of the 105 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 93, a function literal at line 286, a function literal at line 221, …). 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 · SeatRuntimeSwitchService.setRuntime (cyclomatic 104) · ×1
  • SeatRuntimeSwitchService.setRuntime (cyclomatic 104) packages/daemon/src/domain/seat-runtime-switch-service.ts:200 — SeatRuntimeSwitchService.setRuntime has cyclomatic complexity 104 (threshold 15). Of this number, 102 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 · agent-manifest.validateAgentSpec (cyclomatic 103) · ×1
  • agent-manifest.validateAgentSpec (cyclomatic 103) packages/daemon/src/domain/agent-manifest.ts:151 — agent-manifest.validateAgentSpec has cyclomatic complexity 103 (threshold 15). Of this number, 96 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 · proof.proofCommand (cyclomatic 103) · ×1
  • proof.proofCommand (cyclomatic 103) packages/cli/src/commands/proof.ts:138 — proof.proofCommand has cyclomatic complexity 103 (threshold 15). Most of this is not in the body itself: 1 of the 103 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 247, a function literal at line 206, a function literal at line 188, …). 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 · workflow.workflowCommand (cyclomatic 103) · ×1
  • workflow.workflowCommand (cyclomatic 103) packages/cli/src/commands/workflow.ts:163 — workflow.workflowCommand has cyclomatic complexity 103 (threshold 15). Most of this is not in the body itself: 1 of the 103 points is its own statement and the rest belongs to 19 function literals inside it that branch (lines 461, 688, 669, …). 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 · WorkflowProjector.projectStep (cyclomatic 102) · ×1
  • WorkflowProjector.projectStep (cyclomatic 102) packages/daemon/src/domain/workflow-projector.ts:301 — WorkflowProjector.projectStep has cyclomatic complexity 102 (threshold 15). Of this number, 45 points are the body's own statements and 57 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 · slack-subsystem.buildSlackGatewayWire (cyclomatic 102) · ×1
  • slack-subsystem.buildSlackGatewayWire (cyclomatic 102) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:303 — slack-subsystem.buildSlackGatewayWire has cyclomatic complexity 102 (threshold 15). Of this number, 44 points are the body's own statements and 58 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 · render.renderBody (cyclomatic 101) · ×1
  • render.renderBody (cyclomatic 101) packages/tui/src/render.ts:1925 — render.renderBody has cyclomatic complexity 101 (threshold 15). Of this number, 97 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 · parked-owner-consumer.makeParkedOwnerConsumerPolicy.evaluate (cyclomatic 99) · ×1
  • parked-owner-consumer.makeParkedOwnerConsumerPolicy.evaluate (cyclomatic 99) packages/daemon/src/domain/policies/parked-owner-consumer.ts:202 — parked-owner-consumer.makeParkedOwnerConsumerPolicy.evaluate has cyclomatic complexity 99 (threshold 15). Of this number, 88 points are the body's own statements and 11 belong to 8 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 · ps.psCommand (cyclomatic 99) · ×1
  • ps.psCommand (cyclomatic 99) packages/cli/src/commands/ps.ts:949 — ps.psCommand has cyclomatic complexity 99 (threshold 15). Most of this is not in the body itself: 1 of the 99 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1066, 1276). 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 · agent-images.agentImagesRoutes (cyclomatic 95) · ×1
  • agent-images.agentImagesRoutes (cyclomatic 95) packages/daemon/src/routes/agent-images.ts:124 — agent-images.agentImagesRoutes has cyclomatic complexity 95 (threshold 15). Most of this is not in the body itself: 1 of the 95 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 192, 140, 336, …). 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-catalog.reconcileSkillLoadout (cyclomatic 94) · ×1
  • skill-catalog.reconcileSkillLoadout (cyclomatic 94) packages/daemon/src/domain/skill-catalog.ts:861 — skill-catalog.reconcileSkillLoadout has cyclomatic complexity 94 (threshold 15). Of this number, 84 points are the body's own statements and 10 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 · WorkflowValidator.validate (cyclomatic 94) · ×1
  • WorkflowValidator.validate (cyclomatic 94) packages/daemon/src/domain/workflow-validator.ts:60 — WorkflowValidator.validate has cyclomatic complexity 94 (threshold 15). Of this number, 34 points are the body's own statements and 60 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 · RunnerCore.handleResponse (cyclomatic 92) · ×1
  • RunnerCore.handleResponse (cyclomatic 92) REDACTED:1254 — RunnerCore.handleResponse has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rig-repository.isStoredRigSpec (cyclomatic 91) · ×1
  • rig-repository.isStoredRigSpec (cyclomatic 91) packages/daemon/src/domain/rig-repository.ts:151 — rig-repository.isStoredRigSpec has cyclomatic complexity 91 (threshold 15). Of this number, 27 points are the body's own statements and 64 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 · slack-subsystem.buildSlackGatewayWire.engineDeliver (cyclomatic 89) · ×1
  • slack-subsystem.buildSlackGatewayWire.engineDeliver (cyclomatic 89) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:1038 — slack-subsystem.buildSlackGatewayWire.engineDeliver has cyclomatic complexity 89 (threshold 15). Of this number, 88 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 · rigspec-schema.validateMember (cyclomatic 87) · ×1
  • rigspec-schema.validateMember (cyclomatic 87) packages/daemon/src/domain/rigspec-schema.ts:488 — rigspec-schema.validateMember has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · walk.walkCommand (cyclomatic 87) · ×1
  • walk.walkCommand (cyclomatic 87) packages/cli/src/commands/walk.ts:54 — walk.walkCommand has cyclomatic complexity 87 (threshold 15). Most of this is not in the body itself: 1 of the 87 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 96, a function literal at line 263, resolveProfilePieces, …). 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 · execution-view.buildExecutionView (cyclomatic 87) · ×1
  • execution-view.buildExecutionView (cyclomatic 87) packages/daemon/src/domain/execution-view.ts:751 — execution-view.buildExecutionView has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (execution-view.buildExecutionView::ladderOf) 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 · ClaudeCodeAdapter.launchHarness (cyclomatic 86) · ×1
  • ClaudeCodeAdapter.launchHarness (cyclomatic 86) packages/daemon/src/adapters/claude-code-adapter.ts:325 — ClaudeCodeAdapter.launchHarness has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent 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 (ClaudeCodeAdapter.launchHarness::sendClassic) 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 · ClaudeCompactionEnforcer.recoverAfterRestart (cyclomatic 84) · ×1
  • ClaudeCompactionEnforcer.recoverAfterRestart (cyclomatic 84) packages/daemon/src/domain/claude-compaction-enforcer.ts:2113 — ClaudeCompactionEnforcer.recoverAfterRestart has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · seat-attention-reconciler.rebindAndVerifyPaneIdentity (cyclomatic 84) · ×1
  • seat-attention-reconciler.rebindAndVerifyPaneIdentity (cyclomatic 84) packages/daemon/src/domain/seat-attention-reconciler.ts:134 — seat-attention-reconciler.rebindAndVerifyPaneIdentity has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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.importCommand (cyclomatic 83) · ×1
  • import.importCommand (cyclomatic 83) packages/cli/src/commands/import.ts:40 — import.importCommand has cyclomatic complexity 83 (threshold 15). Most of this is not in the body itself: 1 of the 83 points is its own statement and the rest belongs to one function literal inside it that branches (line 59). 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 · send.sendCommand (cyclomatic 83) · ×1
  • send.sendCommand (cyclomatic 83) packages/cli/src/commands/send.ts:239 — send.sendCommand has cyclomatic complexity 83 (threshold 15). Most of this is not in the body itself: 1 of the 83 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 363, 563). 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 · workflow-guidance.readWorkflowGuidance (cyclomatic 83) · ×1
  • workflow-guidance.readWorkflowGuidance (cyclomatic 83) packages/daemon/src/domain/workflow-guidance.ts:35 — workflow-guidance.readWorkflowGuidance has cyclomatic complexity 83 (threshold 15). Of this number, 73 points are the body's own statements and 10 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 · permission-account.planPermissionAccount (cyclomatic 83) · ×1
  • permission-account.planPermissionAccount (cyclomatic 83) packages/daemon/src/domain/permission-account.ts:55 — permission-account.planPermissionAccount has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PodRigInstantiator.instantiateOnce (cyclomatic 81) · ×1
  • PodRigInstantiator.instantiateOnce (cyclomatic 81) packages/daemon/src/domain/rigspec-instantiator.ts:1478 — PodRigInstantiator.instantiateOnce has cyclomatic complexity 81 (threshold 15). Of this number, 56 points are the body's own statements and 25 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 · settings-browser.settingsBrowser (cyclomatic 81) · ×1
  • settings-browser.settingsBrowser (cyclomatic 81) packages/daemon/src/domain/user-settings/settings-browser.ts:117 — settings-browser.settingsBrowser has cyclomatic complexity 81 (threshold 15). Of this number, 49 points are the body's own statements and 32 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 · SeatLaunchEnvironment.command (cyclomatic 80) · ×1
  • SeatLaunchEnvironment.command (cyclomatic 80) packages/daemon/src/domain/seat-launch-environment.ts:124 — SeatLaunchEnvironment.command has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · package-manifest.validateManifest (cyclomatic 80) · ×1
  • package-manifest.validateManifest (cyclomatic 80) packages/daemon/src/domain/package-manifest.ts:125 — package-manifest.validateManifest has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pi-runner.main (cyclomatic 80) · ×1
  • pi-runner.main (cyclomatic 80) REDACTED:2252 — pi-runner.main has cyclomatic complexity 80 (threshold 15). Of this number, 32 points are the body's own statements and 48 belong to 18 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 · session-transport.inspectComposerInput (cyclomatic 79) · ×1
  • session-transport.inspectComposerInput (cyclomatic 79) packages/daemon/src/domain/session-transport.ts:552 — session-transport.inspectComposerInput has cyclomatic complexity 79 (threshold 15). Of this number, 75 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 · seat.printHuman (cyclomatic 79) · ×1
  • seat.printHuman (cyclomatic 79) packages/cli/src/commands/seat.ts:267 — seat.printHuman has cyclomatic complexity 79 (threshold 15). Of this number, 75 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 · bundles.bundleRoutes.post("/create") (cyclomatic 79) · ×1
  • bundles.bundleRoutes.post("/create") (cyclomatic 79) packages/daemon/src/routes/bundles.ts:728 — bundles.bundleRoutes.post("/create") has cyclomatic complexity 79 (threshold 15). Of this number, 78 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 · RigGraph.RigGraph (cyclomatic 79) · ×1
  • RigGraph.RigGraph (cyclomatic 79) packages/ui/src/components/RigGraph.tsx:107 — RigGraph.RigGraph has cyclomatic complexity 79 (threshold 15). Most of this is not in the body itself: 14 of the 79 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 378, 295, 272, …). 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 · ps.handleNodes (cyclomatic 76) · ×1
  • ps.handleNodes (cyclomatic 76) packages/cli/src/commands/ps.ts:1362 — ps.handleNodes has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SeatRuntimeSwitchService.execute (cyclomatic 76) · ×1
  • SeatRuntimeSwitchService.execute (cyclomatic 76) packages/daemon/src/domain/seat-runtime-switch-service.ts:381 — SeatRuntimeSwitchService.execute has cyclomatic complexity 76 (threshold 15). Of this number, 60 points are the body's own statements and 16 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 · LegacyRigSpecSchema.validate (cyclomatic 75) · ×1
  • LegacyRigSpecSchema.validate (cyclomatic 75) packages/daemon/src/domain/rigspec-schema.ts:1399 — LegacyRigSpecSchema.validate has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rig.rigCommand (cyclomatic 75) · ×1
  • rig.rigCommand (cyclomatic 75) packages/cli/src/commands/rig.ts:37 — rig.rigCommand has cyclomatic complexity 75 (threshold 15). Most of this is not in the body itself: 1 of the 75 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 104, 50, 274, …). 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 · session-transport.classifyPaneActivity (cyclomatic 74) · ×1
  • session-transport.classifyPaneActivity (cyclomatic 74) packages/daemon/src/domain/session-transport.ts:797 — session-transport.classifyPaneActivity has cyclomatic complexity 74 (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 · session-transport.annotateInputBox (cyclomatic 74) · ×1
  • session-transport.annotateInputBox (cyclomatic 74) packages/daemon/src/domain/session-transport.ts:5345 — session-transport.annotateInputBox has cyclomatic complexity 74 (threshold 15). Of this number, 64 points are the body's own statements and 10 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 · WorkflowRuntime.instantiate (cyclomatic 74) · ×1
  • WorkflowRuntime.instantiate (cyclomatic 74) packages/daemon/src/domain/workflow-runtime.ts:388 — WorkflowRuntime.instantiate has cyclomatic complexity 74 (threshold 15). Of this number, 56 points are the body's own statements and 18 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 · daemon-lifecycle.startOwnedDaemon (cyclomatic 73) · ×1
  • daemon-lifecycle.startOwnedDaemon (cyclomatic 73) REDACTED:708 — daemon-lifecycle.startOwnedDaemon has cyclomatic complexity 73 (threshold 15). Of this number, 53 points are the body's own statements and 20 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 · RestoreOrchestrator.launchNodeTargets (cyclomatic 73) · ×1
  • RestoreOrchestrator.launchNodeTargets (cyclomatic 73) packages/daemon/src/domain/restore-orchestrator.ts:740 — RestoreOrchestrator.launchNodeTargets has cyclomatic complexity 73 (threshold 15). Of this number, 71 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 · InboundRouter.attemptLand (cyclomatic 72) · ×1
  • InboundRouter.attemptLand (cyclomatic 72) packages/daemon/src/domain/gateway/slack/inbound.ts:318 — InboundRouter.attemptLand has cyclomatic complexity 72 (threshold 15). Of this number, 70 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 · rig-mode.rigModeCommand (cyclomatic 72) · ×1
  • rig-mode.rigModeCommand (cyclomatic 72) packages/cli/src/commands/rig-mode.ts:214 — rig-mode.rigModeCommand has cyclomatic complexity 72 (threshold 15). Most of this is not in the body itself: 1 of the 72 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 299, 559, 458, …). 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 · BootstrapOrchestrator.executeStages (cyclomatic 72) · ×1
  • BootstrapOrchestrator.executeStages (cyclomatic 72) packages/daemon/src/domain/bootstrap-orchestrator.ts:381 — BootstrapOrchestrator.executeStages has cyclomatic complexity 72 (threshold 15). Of this number, 68 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 · RestoreOrchestrator.attemptResume (cyclomatic 71) · ×1
  • RestoreOrchestrator.attemptResume (cyclomatic 71) packages/daemon/src/domain/restore-orchestrator.ts:2790 — RestoreOrchestrator.attemptResume has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bundles.consumeAuthorBundleYaml (cyclomatic 71) · ×1
  • bundles.consumeAuthorBundleYaml (cyclomatic 71) packages/daemon/src/routes/bundles.ts:495 — bundles.consumeAuthorBundleYaml has cyclomatic complexity 71 (threshold 15). Of this number, 37 points are the body's own statements and 34 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 · FeedCard.FeedCard (cyclomatic 71) · ×1
  • FeedCard.FeedCard (cyclomatic 71) packages/ui/src/components/for-you/FeedCard.tsx:355 — FeedCard.FeedCard has cyclomatic complexity 71 (threshold 15). Of this number, 58 points are the body's own statements and 13 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 · chatroom.chatroomCommand (cyclomatic 70) · ×1
  • chatroom.chatroomCommand (cyclomatic 70) packages/cli/src/commands/chatroom.ts:57 — chatroom.chatroomCommand has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 1 of the 70 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 307, a function literal at line 180, a function literal at line 121, …). 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 · slack-delivery.deliverSinglePart.<returned closure> (cyclomatic 70) · ×1
  • slack-delivery.deliverSinglePart.<returned closure> (cyclomatic 70) packages/daemon/src/domain/gateway/slack/slack-delivery.ts:242 — slack-delivery.deliverSinglePart.<returned closure> has cyclomatic complexity 70 (threshold 15). Of this number, 64 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 · socket-inbound.startSocketInbound (cyclomatic 70) · ×1
  • socket-inbound.startSocketInbound (cyclomatic 70) packages/daemon/src/domain/gateway/slack/socket-inbound.ts:127 — socket-inbound.startSocketInbound has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 1 of the 70 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 283, 366, 329, …). 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 · PodRigInstantiator.retryFirstStart (cyclomatic 69) · ×1
  • PodRigInstantiator.retryFirstStart (cyclomatic 69) packages/daemon/src/domain/rigspec-instantiator.ts:1333 — PodRigInstantiator.retryFirstStart has cyclomatic complexity 69 (threshold 15). Of this number, 53 points are the body's own statements and 16 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 · manifest-parser.parseAtoms (cyclomatic 68) · ×1
  • manifest-parser.parseAtoms (cyclomatic 68) REDACTED:218 — manifest-parser.parseAtoms has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PassiveCeremonySource.read (cyclomatic 68) · ×1
  • PassiveCeremonySource.read (cyclomatic 68) packages/daemon/src/domain/health-passive-ceremony.ts:55 — PassiveCeremonySource.read has cyclomatic complexity 68 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StartupController.key (cyclomatic 68) · ×1
  • StartupController.key (cyclomatic 68) packages/tui/src/startup.ts:120 — StartupController.key has cyclomatic complexity 68 (threshold 15). Of this number, 66 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 · PiRuntimeAdapter.launchHarness (cyclomatic 67) · ×1
  • PiRuntimeAdapter.launchHarness (cyclomatic 67) packages/daemon/src/adapters/pi-runtime-adapter.ts:286 — PiRuntimeAdapter.launchHarness has cyclomatic complexity 67 (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 · WatchdogPolicyEngine.evaluate (cyclomatic 67) · ×1
  • WatchdogPolicyEngine.evaluate (cyclomatic 67) packages/daemon/src/domain/watchdog-policy-engine.ts:341 — WatchdogPolicyEngine.evaluate has cyclomatic complexity 67 (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 · workflow.workflowRoutes · ×1
  • workflow.workflowRoutes::errorResponse (cyclomatic 67) packages/daemon/src/routes/workflow.ts:46 — workflow.workflowRoutes::errorResponse has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tool-brand.normalizeToolBrandId (cyclomatic 67) · ×1
  • tool-brand.normalizeToolBrandId (cyclomatic 67) packages/ui/src/lib/tool-brand.ts:150 — tool-brand.normalizeToolBrandId has cyclomatic complexity 67 (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 · HerdrViewer.ensureOnce (cyclomatic 66) · ×1
  • HerdrViewer.ensureOnce (cyclomatic 66) packages/daemon/src/domain/terminal/herdr-viewer.ts:150 — HerdrViewer.ensureOnce has cyclomatic complexity 66 (threshold 15). Of this number, 58 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 · transport.transportRoutes · ×1
  • transport.transportRoutes::send (cyclomatic 66) packages/daemon/src/routes/transport.ts:36 — transport.transportRoutes::send has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · participants.validateParticipantsFile (cyclomatic 65) · ×1
  • participants.validateParticipantsFile (cyclomatic 65) packages/daemon/src/domain/gateway/participants.ts:61 — participants.validateParticipantsFile has cyclomatic complexity 65 (threshold 15). Of this number, 62 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 · project.projectCommand (cyclomatic 65) · ×1
  • project.projectCommand (cyclomatic 65) packages/cli/src/commands/project.ts:48 — project.projectCommand has cyclomatic complexity 65 (threshold 15). Most of this is not in the body itself: 6 of the 65 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 129, 83, 167, …). 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 · BootstrapOrchestrator.bootstrap (cyclomatic 65) · ×1
  • BootstrapOrchestrator.bootstrap (cyclomatic 65) packages/daemon/src/domain/bootstrap-orchestrator.ts:147 — BootstrapOrchestrator.bootstrap has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SliceIndexer.observedQueueCounts (cyclomatic 64) · ×1
  • SliceIndexer.observedQueueCounts (cyclomatic 64) packages/daemon/src/domain/slices/slice-indexer.ts:616 — SliceIndexer.observedQueueCounts has cyclomatic complexity 64 (threshold 15). Of this number, 61 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 · ClaudeCompactionEnforcer.maybeAutoCompactUnchecked (cyclomatic 63) · ×1
  • ClaudeCompactionEnforcer.maybeAutoCompactUnchecked (cyclomatic 63) packages/daemon/src/domain/claude-compaction-enforcer.ts:1326 — ClaudeCompactionEnforcer.maybeAutoCompactUnchecked has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude-compaction-enforcer.readCompactionRecord (cyclomatic 63) · ×1
  • claude-compaction-enforcer.readCompactionRecord (cyclomatic 63) packages/daemon/src/domain/claude-compaction-enforcer.ts:685 — claude-compaction-enforcer.readCompactionRecord has cyclomatic complexity 63 (threshold 15). Of this number, 62 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 · NodeLauncher.launchNode (cyclomatic 63) · ×1
  • NodeLauncher.launchNode (cyclomatic 63) packages/daemon/src/domain/node-launcher.ts:159 — NodeLauncher.launchNode has cyclomatic complexity 63 (threshold 15). Of this number, 48 points are the body's own statements and 15 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 · project-lifecycle-compiler.compileProjectLifecycle (cyclomatic 63) · ×1
  • project-lifecycle-compiler.compileProjectLifecycle (cyclomatic 63) packages/daemon/src/domain/project-lifecycle-compiler.ts:59 — project-lifecycle-compiler.compileProjectLifecycle has cyclomatic complexity 63 (threshold 15). Of this number, 47 points are the body's own statements and 16 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 · CodexInPlaceRestart.observe (cyclomatic 63) · ×1
  • CodexInPlaceRestart.observe (cyclomatic 63) packages/daemon/src/domain/seat-restart-in-place.ts:419 — CodexInPlaceRestart.observe has cyclomatic complexity 63 (threshold 15). Of this number, 62 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 · queue-erasure.eraseQueue (cyclomatic 63) · ×1
  • queue-erasure.eraseQueue (cyclomatic 63) REDACTED:573 — queue-erasure.eraseQueue has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (queue-erasure.eraseQueue::planBatch) 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 · ClaudeCompactionEnforcer.sendPreparedCompact (cyclomatic 62) · ×1
  • ClaudeCompactionEnforcer.sendPreparedCompact (cyclomatic 62) packages/daemon/src/domain/claude-compaction-enforcer.ts:1765 — ClaudeCompactionEnforcer.sendPreparedCompact has cyclomatic complexity 62 (threshold 15). Of this number, 54 points are the body's own statements and 8 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 · setup.runSetup (cyclomatic 62) · ×1
  • setup.runSetup (cyclomatic 62) packages/cli/src/commands/setup.ts:456 — setup.runSetup has cyclomatic complexity 62 (threshold 15). Of this number, 52 points are the body's own statements and 10 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 · files.filesRoutes (cyclomatic 62) · ×1
  • files.filesRoutes (cyclomatic 62) packages/daemon/src/routes/files.ts:52 — files.filesRoutes has cyclomatic complexity 62 (threshold 15). Most of this is not in the body itself: 1 of the 62 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 141, a function literal at line 209, pathSafetyErrorResponse, …). 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 · RigNode.RigNode (cyclomatic 62) · ×1
  • RigNode.RigNode (cyclomatic 62) packages/ui/src/components/RigNode.tsx:79 — RigNode.RigNode has cyclomatic complexity 62 (threshold 15). Of this number, 53 points are the body's own statements and 9 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 · ClaudeManagedLaunch.prepare (cyclomatic 61) · ×1
  • ClaudeManagedLaunch.prepare (cyclomatic 61) packages/daemon/src/domain/claude-managed-launch.ts:309 — ClaudeManagedLaunch.prepare has cyclomatic complexity 61 (threshold 15). Of this number, 44 points are the body's own statements and 17 belong to 8 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 · down.downCommand (cyclomatic 61) · ×1
  • down.downCommand (cyclomatic 61) packages/cli/src/commands/down.ts:146 — down.downCommand has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 1 of the 61 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 176, 193, 198, …). 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 · CodexRuntimeAdapter.verifyResumeLaunch (cyclomatic 61) · ×1
  • CodexRuntimeAdapter.verifyResumeLaunch (cyclomatic 61) packages/daemon/src/adapters/codex-runtime-adapter.ts:1890 — CodexRuntimeAdapter.verifyResumeLaunch has cyclomatic complexity 61 (threshold 15). Of this number, 55 points are the body's own statements and 6 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 · execution-view.readArrangement (cyclomatic 61) · ×1
  • execution-view.readArrangement (cyclomatic 61) packages/daemon/src/domain/execution-view.ts:505 — execution-view.readArrangement has cyclomatic complexity 61 (threshold 15). Of this number, 53 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 · OperatingPostureService.context (cyclomatic 61) · ×1
  • OperatingPostureService.context (cyclomatic 61) packages/daemon/src/domain/rig-mode/operating-posture.ts:75 — OperatingPostureService.context has cyclomatic complexity 61 (threshold 15). Of this number, 53 points are the body's own statements and 8 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 · input.parseText (cyclomatic 61) · ×1
  • input.parseText (cyclomatic 61) packages/tui/src/input.ts:9 — input.parseText has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FocusedTerminal.FocusedTerminal (cyclomatic 61) · ×1
  • FocusedTerminal.FocusedTerminal (cyclomatic 61) packages/ui/src/components/terminal/FocusedTerminal.tsx:168 — FocusedTerminal.FocusedTerminal has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 4 of the 61 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 211, 248, 282, …). 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 · agent-image.agentImageCommand (cyclomatic 60) · ×1
  • agent-image.agentImageCommand (cyclomatic 60) packages/cli/src/commands/agent-image.ts:98 — agent-image.agentImageCommand has cyclomatic complexity 60 (threshold 15). Most of this is not in the body itself: 1 of the 60 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 342, a function literal at line 234, a function literal at line 131, …). 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 · CodexRuntimeAdapter.prepareLaunch (cyclomatic 59) · ×1
  • CodexRuntimeAdapter.prepareLaunch (cyclomatic 59) packages/daemon/src/adapters/codex-runtime-adapter.ts:1122 — CodexRuntimeAdapter.prepareLaunch has cyclomatic complexity 59 (threshold 15). Of this number, 55 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 · SeatAttentionReconciler.clearAttention (cyclomatic 59) · ×1
  • SeatAttentionReconciler.clearAttention (cyclomatic 59) packages/daemon/src/domain/seat-attention-reconciler.ts:456 — SeatAttentionReconciler.clearAttention has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · state.computeExplorerRows (cyclomatic 59) · ×1
  • state.computeExplorerRows (cyclomatic 59) packages/tui/src/state.ts:634 — state.computeExplorerRows has cyclomatic complexity 59 (threshold 15). Of this number, 58 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-repository.isRestoreUsableSnapshotData (cyclomatic 58) · ×1
  • snapshot-repository.isRestoreUsableSnapshotData (cyclomatic 58) packages/daemon/src/domain/snapshot-repository.ts:278 — snapshot-repository.isRestoreUsableSnapshotData has cyclomatic complexity 58 (threshold 15). Of this number, 57 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 · SessionTransport.classifySendReadiness (cyclomatic 58) · ×1
  • SessionTransport.classifySendReadiness (cyclomatic 58) packages/daemon/src/domain/session-transport.ts:4475 — SessionTransport.classifySendReadiness has cyclomatic complexity 58 (threshold 15). Of this number, 57 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 · compose.compose_up (cyclomatic 58) · ×1
  • compose.compose_up (cyclomatic 58) packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:314 — compose.compose_up has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EnvironmentLifecycle.effect (cyclomatic 57) · ×1
  • EnvironmentLifecycle.effect (cyclomatic 57) packages/daemon/src/domain/environment-lifecycle.ts:89 — EnvironmentLifecycle.effect has cyclomatic complexity 57 (threshold 15). Of this number, 46 points are the body's own statements and 11 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 · CodexResumeAdapter.resume (cyclomatic 57) · ×1
  • CodexResumeAdapter.resume (cyclomatic 57) packages/daemon/src/adapters/codex-resume.ts:66 — CodexResumeAdapter.resume has cyclomatic complexity 57 (threshold 15). Of this number, 54 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 · SeatIdentityReconciler.reconcileSweep (cyclomatic 57) · ×1
  • SeatIdentityReconciler.reconcileSweep (cyclomatic 57) packages/daemon/src/domain/seat-identity-reconciler.ts:191 — SeatIdentityReconciler.reconcileSweep has cyclomatic complexity 57 (threshold 15). Of this number, 37 points are the body's own statements and 20 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 · SeatLifecycleService.launchFresh (cyclomatic 57) · ×1
  • SeatLifecycleService.launchFresh (cyclomatic 57) packages/daemon/src/domain/seat-lifecycle-service.ts:1638 — SeatLifecycleService.launchFresh has cyclomatic complexity 57 (threshold 15). Of this number, 55 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 · FeedCardQuestionAsk.FeedCardQuestionAsk (cyclomatic 57) · ×1
  • FeedCardQuestionAsk.FeedCardQuestionAsk (cyclomatic 57) packages/ui/src/components/for-you/FeedCardQuestionAsk.tsx:183 — FeedCardQuestionAsk.FeedCardQuestionAsk has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent 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 (FeedCardQuestionAsk.FeedCardQuestionAsk::refreshQueueRow) 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 · profile-resolver.resolveNodeConfig (cyclomatic 56) · ×1
  • profile-resolver.resolveNodeConfig (cyclomatic 56) packages/daemon/src/domain/profile-resolver.ts:152 — profile-resolver.resolveNodeConfig has cyclomatic complexity 56 (threshold 15). Of this number, 49 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 · status.statusCommand (cyclomatic 56) · ×1
  • status.statusCommand (cyclomatic 56) packages/cli/src/commands/status.ts:37 — status.statusCommand has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 1 of the 56 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 41, 45). 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 · exec.execCommand (cyclomatic 56) · ×1
  • exec.execCommand (cyclomatic 56) packages/cli/src/commands/exec.ts:371 — exec.execCommand has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 1 of the 56 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 464, waitForEnd, a function literal at line 564, …). 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 · watchdog.watchdogCommand (cyclomatic 56) · ×1
  • watchdog.watchdogCommand (cyclomatic 56) packages/cli/src/commands/watchdog.ts:71 — watchdog.watchdogCommand has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 1 of the 56 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 124, 276, 358, …). 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 · workflow-reconciliation.compare (cyclomatic 56) · ×1
  • workflow-reconciliation.compare (cyclomatic 56) packages/daemon/src/domain/workflow-reconciliation.ts:66 — workflow-reconciliation.compare has cyclomatic complexity 56 (threshold 15). Of this number, 53 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 · scopes.scopesRoutes (cyclomatic 56) · ×1
  • scopes.scopesRoutes (cyclomatic 56) packages/daemon/src/routes/scopes.ts:53 — scopes.scopesRoutes has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 1 of the 56 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 113, 127, 70, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · RunnerChannel.post (cyclomatic 55) · ×1
  • RunnerChannel.post (cyclomatic 55) packages/daemon/src/domain/runner-channel.ts:53 — RunnerChannel.post 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, 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 · plugin.pluginCommand (cyclomatic 55) · ×1
  • plugin.pluginCommand (cyclomatic 55) packages/cli/src/commands/plugin.ts:129 — plugin.pluginCommand has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 1 of the 55 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 205, a function literal at line 154, a function literal at line 296, …). 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 · terminal.terminalCommand (cyclomatic 55) · ×1
  • terminal.terminalCommand (cyclomatic 55) packages/cli/src/commands/terminal.ts:170 — terminal.terminalCommand has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 1 of the 55 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 211, 325, 345, …). 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 · MissionControlWriteContract.answerAsk (cyclomatic 55) · ×1
  • MissionControlWriteContract.answerAsk (cyclomatic 55) packages/daemon/src/domain/mission-control/mission-control-write-contract.ts:601 — MissionControlWriteContract.answerAsk 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, 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 · RigSpecExporter.exportPodAware (cyclomatic 55) · ×1
  • RigSpecExporter.exportPodAware (cyclomatic 55) packages/daemon/src/domain/rigspec-exporter.ts:209 — RigSpecExporter.exportPodAware has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 10 of the 55 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 245, a function literal at line 241, a function literal at line 325, …). 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 · sessions.generationRecord (cyclomatic 55) · ×1
  • sessions.generationRecord (cyclomatic 55) packages/daemon/src/routes/sessions.ts:816 — sessions.generationRecord has cyclomatic complexity 55 (threshold 15). Of this number, 53 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 · TerminalLauncher.TerminalLauncher (cyclomatic 55) · ×1
  • TerminalLauncher.TerminalLauncher (cyclomatic 55) packages/ui/src/components/topology/TerminalLauncher.tsx:239 — TerminalLauncher.TerminalLauncher has cyclomatic complexity 55 (threshold 15). Of this number, 34 points are the body's own statements and 21 belong to 7 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 · RigRepository.addNode (cyclomatic 54) · ×1
  • RigRepository.addNode (cyclomatic 54) packages/daemon/src/domain/rig-repository.ts:654 — RigRepository.addNode has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClaudeResumeAdapter.resume (cyclomatic 54) · ×1
  • ClaudeResumeAdapter.resume (cyclomatic 54) packages/daemon/src/adapters/claude-resume.ts:64 — ClaudeResumeAdapter.resume has cyclomatic complexity 54 (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 (ClaudeResumeAdapter.resume::sendClassic) 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 · daemon-lifecycle.getDaemonStatus (cyclomatic 54) · ×1
  • daemon-lifecycle.getDaemonStatus (cyclomatic 54) REDACTED:1175 — daemon-lifecycle.getDaemonStatus has cyclomatic complexity 54 (threshold 15). Of this number, 47 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 · work-install.resolveWorkPosition (cyclomatic 54) · ×1
  • work-install.resolveWorkPosition (cyclomatic 54) packages/cli/src/lib/work-install.ts:319 — work-install.resolveWorkPosition has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · restore-preconditions.validatePreRestore (cyclomatic 54) · ×1
  • restore-preconditions.validatePreRestore (cyclomatic 54) packages/daemon/src/domain/restore-preconditions.ts:12 — restore-preconditions.validatePreRestore has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.createApp (cyclomatic 54) · ×1
  • server.createApp (cyclomatic 54) packages/daemon/src/server.ts:493 — server.createApp has cyclomatic complexity 54 (threshold 15). Of this number, 26 points are the body's own statements and 28 belong to 9 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 · community-harness-presets.parsePreset (cyclomatic 53) · ×1
  • community-harness-presets.parsePreset (cyclomatic 53) packages/daemon/src/domain/community-harness-presets.ts:59 — community-harness-presets.parsePreset has cyclomatic complexity 53 (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 · send.runFanOutSend (cyclomatic 53) · ×1
  • send.runFanOutSend (cyclomatic 53) packages/cli/src/commands/send.ts:1096 — send.runFanOutSend has cyclomatic complexity 53 (threshold 15). Of this number, 43 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 · SeatIdentityReconciler.computeVerdict (cyclomatic 53) · ×1
  • SeatIdentityReconciler.computeVerdict (cyclomatic 53) packages/daemon/src/domain/seat-identity-reconciler.ts:338 — SeatIdentityReconciler.computeVerdict has cyclomatic complexity 53 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RestoreOrchestrator.restore (cyclomatic 53) · ×1
  • RestoreOrchestrator.restore (cyclomatic 53) packages/daemon/src/domain/restore-orchestrator.ts:386 — RestoreOrchestrator.restore has cyclomatic complexity 53 (threshold 15). Of this number, 46 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 · ChannelRecovery.page (cyclomatic 53) · ×1
  • ChannelRecovery.page (cyclomatic 53) packages/daemon/src/domain/gateway/slack/channel-recovery.ts:103 — ChannelRecovery.page has cyclomatic complexity 53 (threshold 15). Of this number, 49 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 · HerdrAdapter.openView (cyclomatic 53) · ×1
  • HerdrAdapter.openView (cyclomatic 53) packages/daemon/src/domain/terminal/herdr-adapter.ts:488 — HerdrAdapter.openView 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 · stream.streamRoutes (cyclomatic 53) · ×1
  • stream.streamRoutes (cyclomatic 53) packages/daemon/src/routes/stream.ts:47 — stream.streamRoutes has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 1 of the 53 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 94, 217, 175, …). 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 · render.agentDetailLines (cyclomatic 53) · ×1
  • render.agentDetailLines (cyclomatic 53) packages/tui/src/render.ts:361 — render.agentDetailLines has cyclomatic complexity 53 (threshold 15). Of this number, 51 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 · terminal-window.windowLauncher (cyclomatic 52) · ×1
  • terminal-window.windowLauncher (cyclomatic 52) packages/cli/src/terminal-window.ts:124 — terminal-window.windowLauncher has cyclomatic complexity 52 (threshold 15). Of this number, 39 points are the body's own statements and 13 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PiResumeAdapter.resume (cyclomatic 52) · ×1
  • PiResumeAdapter.resume (cyclomatic 52) packages/daemon/src/adapters/pi-resume.ts:66 — PiResumeAdapter.resume has cyclomatic complexity 52 (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 · PodRigInstantiator.materializeValidatedSpec (cyclomatic 52) · ×1
  • PodRigInstantiator.materializeValidatedSpec (cyclomatic 52) packages/daemon/src/domain/rigspec-instantiator.ts:682 — PodRigInstantiator.materializeValidatedSpec has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 15 of the 52 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 711, 754). 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 · WorkflowProjector.projectDependencyGraph (cyclomatic 52) · ×1
  • WorkflowProjector.projectDependencyGraph (cyclomatic 52) packages/daemon/src/domain/workflow-projector.ts:1244 — WorkflowProjector.projectDependencyGraph has cyclomatic complexity 52 (threshold 15). Of this number, 21 points are the body's own statements and 31 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 · SeatStructuralActivityService.pollSeat (cyclomatic 51) · ×1
  • SeatStructuralActivityService.pollSeat (cyclomatic 51) packages/daemon/src/domain/seat-structural-activity-service.ts:108 — SeatStructuralActivityService.pollSeat has cyclomatic complexity 51 (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 · grow.growCommand (cyclomatic 51) · ×1
  • grow.growCommand (cyclomatic 51) packages/cli/src/commands/grow.ts:45 — grow.growCommand has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 1 of the 51 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 60, 134). 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 · pi-runner.createRunnerInput (cyclomatic 51) · ×1
  • pi-runner.createRunnerInput (cyclomatic 51) REDACTED:484 — pi-runner.createRunnerInput has cyclomatic complexity 51 (threshold 15). Of this number, 18 points are the body's own statements and 33 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 · RigLifecycleService.removeNodeWithin (cyclomatic 51) · ×1
  • RigLifecycleService.removeNodeWithin (cyclomatic 51) packages/daemon/src/domain/rig-lifecycle-service.ts:482 — RigLifecycleService.removeNodeWithin has cyclomatic complexity 51 (threshold 15). Of this number, 45 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 · InboundRouter.attemptAction (cyclomatic 50) · ×1
  • InboundRouter.attemptAction (cyclomatic 50) packages/daemon/src/domain/gateway/slack/inbound.ts:543 — InboundRouter.attemptAction has cyclomatic complexity 50 (threshold 15). Of this number, 39 points are the body's own statements and 11 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 · EnvironmentStartup.launch (cyclomatic 50) · ×1
  • EnvironmentStartup.launch (cyclomatic 50) packages/daemon/src/domain/environment-startup.ts:151 — EnvironmentStartup.launch has cyclomatic complexity 50 (threshold 15). Of this number, 46 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 · connector.runAcpAssignment (cyclomatic 50) · ×1
  • connector.runAcpAssignment (cyclomatic 50) packages/cli/src/acp/connector.ts:79 — connector.runAcpAssignment has cyclomatic complexity 50 (threshold 15). Of this number, 20 points are the body's own statements and 30 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 · package.packageCommand (cyclomatic 50) · ×1
  • package.packageCommand (cyclomatic 50) packages/cli/src/commands/package.ts:8 — package.packageCommand has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 1 of the 50 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 126, a function literal at line 62, a function literal at line 219, …). 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 · policy.registerPermissionCommands (cyclomatic 50) · ×1
  • policy.registerPermissionCommands (cyclomatic 50) packages/cli/src/commands/policy.ts:182 — policy.registerPermissionCommands has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 1 of the 50 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 189, 235, 367, …). 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 · ClaudeCodeAdapter.verifyResumeLaunch (cyclomatic 50) · ×1
  • ClaudeCodeAdapter.verifyResumeLaunch (cyclomatic 50) packages/daemon/src/adapters/claude-code-adapter.ts:753 — ClaudeCodeAdapter.verifyResumeLaunch 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 · RigSpecCodec.serialize (cyclomatic 50) · ×1
  • RigSpecCodec.serialize (cyclomatic 50) packages/daemon/src/domain/rigspec-codec.ts:97 — RigSpecCodec.serialize has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 14 of the 50 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 152, 126). 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 · manifest-parser.parseProfiles (cyclomatic 50) · ×1
  • manifest-parser.parseProfiles (cyclomatic 50) REDACTED:439 — manifest-parser.parseProfiles 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 · relay-inbound.createRelayInboundHandler.ackOutbox (cyclomatic 50) · ×1
  • relay-inbound.createRelayInboundHandler.ackOutbox (cyclomatic 50) packages/daemon/src/domain/gateway/relay-inbound.ts:1017 — relay-inbound.createRelayInboundHandler.ackOutbox has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 10 of the 50 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1051, 1070, 1087). 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 · ThreadRecovery.page (cyclomatic 50) · ×1
  • ThreadRecovery.page (cyclomatic 50) packages/daemon/src/domain/gateway/slack/thread-recovery.ts:96 — ThreadRecovery.page has cyclomatic complexity 50 (threshold 15). Of this number, 45 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 · attention-model.attentionLines (cyclomatic 50) · ×1
  • attention-model.attentionLines (cyclomatic 50) packages/tui/src/attention/attention-model.ts:62 — attention-model.attentionLines has cyclomatic complexity 50 (threshold 15). Of this number, 47 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 · tmux-server-selection.selectTmuxServer (cyclomatic 49) · ×1
  • tmux-server-selection.selectTmuxServer (cyclomatic 49) packages/daemon/src/domain/tmux-server-selection.ts:152 — tmux-server-selection.selectTmuxServer has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · human-registry.validateHumanFragment (cyclomatic 49) · ×1
  • human-registry.validateHumanFragment (cyclomatic 49) packages/daemon/src/domain/gateway/human-registry.ts:175 — human-registry.validateHumanFragment has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · node-inventory.buildRestoreOutcomeMap (cyclomatic 49) · ×1
  • node-inventory.buildRestoreOutcomeMap (cyclomatic 49) REDACTED:524 — node-inventory.buildRestoreOutcomeMap has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ask.askCommand (cyclomatic 49) · ×1
  • ask.askCommand (cyclomatic 49) packages/cli/src/commands/ask.ts:127 — ask.askCommand has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 1 of the 49 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 · scope.buildSliceCloseCommand (cyclomatic 49) · ×1
  • scope.buildSliceCloseCommand (cyclomatic 49) packages/cli/src/commands/scope.ts:567 — scope.buildSliceCloseCommand has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 1 of the 49 points is its own statement 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.
D1 · Cyclomatic Complexity · up.formatRemoteUpFailure (cyclomatic 49) · ×1
  • up.formatRemoteUpFailure (cyclomatic 49) packages/cli/src/commands/up.ts:846 — up.formatRemoteUpFailure has cyclomatic complexity 49 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · subscription-move-report.checkMoveReport (cyclomatic 49) · ×1
  • subscription-move-report.checkMoveReport (cyclomatic 49) packages/daemon/src/domain/provider/subscription-move-report.ts:106 — subscription-move-report.checkMoveReport has cyclomatic complexity 49 (threshold 15). Of this number, 20 points are the body's own statements and 29 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 · RigTeardownOrchestrator.teardown (cyclomatic 49) · ×1
  • RigTeardownOrchestrator.teardown (cyclomatic 49) packages/daemon/src/domain/rig-teardown.ts:116 — RigTeardownOrchestrator.teardown has cyclomatic complexity 49 (threshold 15). 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, separate the cases: extract each independent branch into its 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-model.terminalLines (cyclomatic 49) · ×1
  • terminal-model.terminalLines (cyclomatic 49) packages/tui/src/terminals/terminal-model.ts:86 — terminal-model.terminalLines has cyclomatic complexity 49 (threshold 15). Of this number, 44 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 · render.renderPulseScreen (cyclomatic 49) · ×1
  • render.renderPulseScreen (cyclomatic 49) packages/tui/src/render.ts:1640 — render.renderPulseScreen has cyclomatic complexity 49 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DraftAwareDelivery.attempt (cyclomatic 48) · ×1
  • DraftAwareDelivery.attempt (cyclomatic 48) packages/daemon/src/domain/draft-aware-delivery.ts:55 — DraftAwareDelivery.attempt has cyclomatic complexity 48 (threshold 15). Of this number, 40 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 · bundle-behaviour.formatBundleBehaviour (cyclomatic 48) · ×1
  • bundle-behaviour.formatBundleBehaviour (cyclomatic 48) packages/cli/src/bundle-behaviour.ts:6 — bundle-behaviour.formatBundleBehaviour has cyclomatic complexity 48 (threshold 15). Of this number, 41 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 · seat.seatCommand · ×1
  • seat.seatCommand::runLifecycleVerb (cyclomatic 48) packages/cli/src/commands/seat.ts:878 — seat.seatCommand::runLifecycleVerb 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 · WorkflowRuntime.route (cyclomatic 48) · ×1
  • WorkflowRuntime.route (cyclomatic 48) packages/daemon/src/domain/workflow-runtime.ts:1520 — WorkflowRuntime.route has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 2 of the 48 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1550, 1563, 1661, …). 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 · queue-wake-ladder.readWakeLadderBackstop (cyclomatic 47) · ×1
  • queue-wake-ladder.readWakeLadderBackstop (cyclomatic 47) packages/daemon/src/domain/queue-wake-ladder.ts:526 — queue-wake-ladder.readWakeLadderBackstop has cyclomatic complexity 47 (threshold 15). Of this number, 45 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 · EnvironmentLifecycle.recreate (cyclomatic 47) · ×1
  • EnvironmentLifecycle.recreate (cyclomatic 47) packages/daemon/src/domain/environment-lifecycle.ts:256 — EnvironmentLifecycle.recreate has cyclomatic complexity 47 (threshold 15). Of this number, 46 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 · walk-consumption.analyzeWalkSuffix (cyclomatic 47) · ×1
  • walk-consumption.analyzeWalkSuffix (cyclomatic 47) packages/cli/src/lib/walk-consumption.ts:2 — walk-consumption.analyzeWalkSuffix 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 · skills.skillsRoutes (cyclomatic 47) · ×1
  • skills.skillsRoutes (cyclomatic 47) packages/daemon/src/routes/skills.ts:73 — skills.skillsRoutes has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 187, a function literal at line 124, a function literal at line 206, …). 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 · restore-packet.restorePacketCommand (cyclomatic 46) · ×1
  • restore-packet.restorePacketCommand (cyclomatic 46) packages/cli/src/commands/restore-packet.ts:213 — restore-packet.restorePacketCommand has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 457, 287, 378). 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 · SnapshotCapture.captureSnapshot (cyclomatic 46) · ×1
  • SnapshotCapture.captureSnapshot (cyclomatic 46) packages/daemon/src/domain/snapshot-capture.ts:63 — SnapshotCapture.captureSnapshot has cyclomatic complexity 46 (threshold 15). Of this number, 43 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 · SeatHandoverService.recover (cyclomatic 46) · ×1
  • SeatHandoverService.recover (cyclomatic 46) packages/daemon/src/domain/seat-handover-service.ts:925 — SeatHandoverService.recover has cyclomatic complexity 46 (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 · SeatHandoverService.commit (cyclomatic 46) · ×1
  • SeatHandoverService.commit (cyclomatic 46) packages/daemon/src/domain/seat-handover-service.ts:1864 — SeatHandoverService.commit has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 14 of the 46 points are its own statements and the rest belongs to one function literal inside it that branches (line 1886). 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 · rig-mode.rigModeRoutes (cyclomatic 46) · ×1
  • rig-mode.rigModeRoutes (cyclomatic 46) packages/daemon/src/routes/rig-mode.ts:121 — rig-mode.rigModeRoutes has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 189, a function literal at line 223, unset, …). 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 · render.instanceContentLines (cyclomatic 46) · ×1
  • render.instanceContentLines (cyclomatic 46) packages/tui/src/render.ts:808 — render.instanceContentLines has cyclomatic complexity 46 (threshold 15). Of this number, 39 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 · generated-file-hygiene.excludeNewGeneratedFiles (cyclomatic 45) · ×1
  • generated-file-hygiene.excludeNewGeneratedFiles (cyclomatic 45) packages/daemon/src/domain/generated-file-hygiene.ts:16 — generated-file-hygiene.excludeNewGeneratedFiles has cyclomatic complexity 45 (threshold 15). Of this number, 37 points are the body's own statements and 8 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 · skill-catalog.readOwnershipManifest (cyclomatic 45) · ×1
  • skill-catalog.readOwnershipManifest (cyclomatic 45) packages/daemon/src/domain/skill-catalog.ts:570 — skill-catalog.readOwnershipManifest has cyclomatic complexity 45 (threshold 15). Of this number, 26 points are the body's own statements and 19 belong to 4 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 · RigSpecSchema.validate (cyclomatic 45) · ×1
  • RigSpecSchema.validate (cyclomatic 45) packages/daemon/src/domain/rigspec-schema.ts:125 — RigSpecSchema.validate 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 · hosts-registry-reader.validateHostRegistry (cyclomatic 45) · ×1
  • hosts-registry-reader.validateHostRegistry (cyclomatic 45) packages/daemon/src/domain/hosts/hosts-registry-reader.ts:100 — hosts-registry-reader.validateHostRegistry 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 · SessionTransport.sendClassified (cyclomatic 45) · ×1
  • SessionTransport.sendClassified (cyclomatic 45) packages/daemon/src/domain/session-transport.ts:2858 — SessionTransport.sendClassified has cyclomatic complexity 45 (threshold 15). Of this number, 40 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 · ClaudeCompactionEnforcer.triggerManualCompactUnchecked (cyclomatic 45) · ×1
  • ClaudeCompactionEnforcer.triggerManualCompactUnchecked (cyclomatic 45) packages/daemon/src/domain/claude-compaction-enforcer.ts:1492 — ClaudeCompactionEnforcer.triggerManualCompactUnchecked has cyclomatic complexity 45 (threshold 15). Of this number, 36 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 · host-registry.validateHostRegistry (cyclomatic 45) · ×1
  • host-registry.validateHostRegistry (cyclomatic 45) packages/cli/src/host-registry.ts:165 — host-registry.validateHostRegistry 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 · queue-receipt.rowLines (cyclomatic 45) · ×1
  • queue-receipt.rowLines (cyclomatic 45) packages/cli/src/queue-receipt.ts:159 — queue-receipt.rowLines 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 · execution-view.buildExecutionView · ×1
  • execution-view.buildExecutionView::ladderOf (cyclomatic 45) packages/daemon/src/domain/execution-view.ts:996 — execution-view.buildExecutionView::ladderOf 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. This shape REPEATS in the file: one other method here (execution-view.buildExecutionView) 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 · compaction.compactionRoutes (cyclomatic 45) · ×1
  • compaction.compactionRoutes (cyclomatic 45) packages/daemon/src/routes/compaction.ts:24 — compaction.compactionRoutes has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 28, 152, 133). 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 · OutboxHandler.admitRunner (cyclomatic 44) · ×1
  • OutboxHandler.admitRunner (cyclomatic 44) packages/daemon/src/domain/outbox-handler.ts:246 — OutboxHandler.admitRunner has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 2 of the 44 points are its own statements and the rest belongs to one function literal inside it that branches (line 248). 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 · seat-launch-additions.prepareSeatLaunchAdditions (cyclomatic 44) · ×1
  • seat-launch-additions.prepareSeatLaunchAdditions (cyclomatic 44) packages/daemon/src/domain/seat-launch-additions.ts:113 — seat-launch-additions.prepareSeatLaunchAdditions has cyclomatic complexity 44 (threshold 15). Of this number, 43 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 · human-registry.setHumanField (cyclomatic 44) · ×1
  • human-registry.setHumanField (cyclomatic 44) packages/daemon/src/domain/gateway/human-registry.ts:810 — human-registry.setHumanField has cyclomatic complexity 44 (threshold 15). Of this number, 41 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 · rosters.parseRoster.members (cyclomatic 44) · ×1
  • rosters.parseRoster.members (cyclomatic 44) packages/daemon/src/domain/rosters.ts:125 — rosters.parseRoster.members 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 · QueueRepository.waitingView (cyclomatic 44) · ×1
  • QueueRepository.waitingView (cyclomatic 44) packages/daemon/src/domain/queue-repository.ts:6265 — QueueRepository.waitingView 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 · native-resume-probe.assessNativeResumeProbe (cyclomatic 44) · ×1
  • native-resume-probe.assessNativeResumeProbe (cyclomatic 44) packages/daemon/src/domain/native-resume-probe.ts:356 — native-resume-probe.assessNativeResumeProbe 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 · export.exportCommand (cyclomatic 44) · ×1
  • export.exportCommand (cyclomatic 44) packages/cli/src/commands/export.ts:59 — export.exportCommand has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to one function literal inside it that branches (line 72). 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 · codex-owned-plugin-trust.planOwnedCodexContentApproval (cyclomatic 44) · ×1
  • codex-owned-plugin-trust.planOwnedCodexContentApproval (cyclomatic 44) packages/daemon/src/domain/codex-owned-plugin-trust.ts:87 — codex-owned-plugin-trust.planOwnedCodexContentApproval has cyclomatic complexity 44 (threshold 15). Of this number, 29 points are the body's own statements and 15 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 · pi-runner.parseRunnerArgs (cyclomatic 44) · ×1
  • pi-runner.parseRunnerArgs (cyclomatic 44) REDACTED:1929 — pi-runner.parseRunnerArgs has cyclomatic complexity 44 (threshold 15). Of this number, 43 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 · manifest-parser.parseAgentImageManifest (cyclomatic 44) · ×1
  • manifest-parser.parseAgentImageManifest (cyclomatic 44) packages/daemon/src/domain/agent-images/manifest-parser.ts:19 — manifest-parser.parseAgentImageManifest has cyclomatic complexity 44 (threshold 15). Of this number, 43 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 · PodRigInstantiator.addMemberToPod (cyclomatic 44) · ×1
  • PodRigInstantiator.addMemberToPod (cyclomatic 44) packages/daemon/src/domain/rigspec-instantiator.ts:1131 — PodRigInstantiator.addMemberToPod has cyclomatic complexity 44 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · connections-projection.connectionsProjection (cyclomatic 44) · ×1
  • connections-projection.connectionsProjection (cyclomatic 44) packages/daemon/src/domain/gateway/connections-projection.ts:55 — connections-projection.connectionsProjection has cyclomatic complexity 44 (threshold 15). Of this number, 41 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 · WatchdogPolicyEngine.recordAttempt (cyclomatic 44) · ×1
  • WatchdogPolicyEngine.recordAttempt (cyclomatic 44) packages/daemon/src/domain/watchdog-policy-engine.ts:801 — WatchdogPolicyEngine.recordAttempt has cyclomatic complexity 44 (threshold 15). Of this number, 31 points are the body's own statements and 13 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 · workflow-model.workflowDetail (cyclomatic 44) · ×1
  • workflow-model.workflowDetail (cyclomatic 44) packages/tui/src/execution/workflow-model.ts:34 — workflow-model.workflowDetail 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 · SeatDeliveryGuard.beforeInput (cyclomatic 43) · ×1
  • SeatDeliveryGuard.beforeInput (cyclomatic 43) packages/daemon/src/domain/seat-delivery-guard.ts:479 — SeatDeliveryGuard.beforeInput has cyclomatic complexity 43 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SliceIndexer.ensureMembershipIndex (cyclomatic 43) · ×1
  • SliceIndexer.ensureMembershipIndex (cyclomatic 43) packages/daemon/src/domain/slices/slice-indexer.ts:1361 — SliceIndexer.ensureMembershipIndex has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · environment.environmentCommand (cyclomatic 43) · ×1
  • environment.environmentCommand (cyclomatic 43) packages/cli/src/commands/environment.ts:59 — environment.environmentCommand has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 4 of the 43 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 75, a function literal at line 84, a function literal at line 116, …). 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 · ClaimService.reconcileSession (cyclomatic 43) · ×1
  • ClaimService.reconcileSession (cyclomatic 43) packages/daemon/src/domain/claim-service.ts:489 — ClaimService.reconcileSession has cyclomatic complexity 43 (threshold 15). Of this number, 42 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 · chat.chatRoutes (cyclomatic 43) · ×1
  • chat.chatRoutes (cyclomatic 43) packages/daemon/src/routes/chat.ts:16 — chat.chatRoutes has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 1 of the 43 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 154, 28, 65, …). 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 · OutboxHandler.updateRunner (cyclomatic 42) · ×1
  • OutboxHandler.updateRunner (cyclomatic 42) packages/daemon/src/domain/outbox-handler.ts:292 — OutboxHandler.updateRunner has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to one function literal inside it that branches (line 294). 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 · seat-skill-storage.cleanSeatSkills (cyclomatic 42) · ×1
  • seat-skill-storage.cleanSeatSkills (cyclomatic 42) packages/daemon/src/domain/seat-skill-storage.ts:963 — seat-skill-storage.cleanSeatSkills has cyclomatic complexity 42 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommunityHarnessRuntimeAdapter.launchHarness (cyclomatic 42) · ×1
  • CommunityHarnessRuntimeAdapter.launchHarness (cyclomatic 42) packages/daemon/src/adapters/community-harness-runtime-adapter.ts:99 — CommunityHarnessRuntimeAdapter.launchHarness has cyclomatic complexity 42 (threshold 15). Of this number, 39 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.daemonCommand (cyclomatic 42) · ×1
  • daemon.daemonCommand (cyclomatic 42) REDACTED:174 — daemon.daemonCommand has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 200, 337, 324, …). 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 · whoami.whoamiCommand (cyclomatic 42) · ×1
  • whoami.whoamiCommand (cyclomatic 42) packages/cli/src/commands/whoami.ts:281 — whoami.whoamiCommand has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to one function literal inside it that branches (line 309). 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 · rigspec-preflight.preflightMembers (cyclomatic 42) · ×1
  • rigspec-preflight.preflightMembers (cyclomatic 42) packages/daemon/src/domain/rigspec-preflight.ts:355 — rigspec-preflight.preflightMembers 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 · open-asks.postOpenAsks (cyclomatic 42) · ×1
  • open-asks.postOpenAsks (cyclomatic 42) packages/daemon/src/domain/gateway/slack/open-asks.ts:178 — open-asks.postOpenAsks has cyclomatic complexity 42 (threshold 15). Of this number, 26 points are the body's own statements and 16 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 · stream-dispositions.validateDisposition (cyclomatic 42) · ×1
  • stream-dispositions.validateDisposition (cyclomatic 42) packages/daemon/src/domain/stream-dispositions.ts:50 — stream-dispositions.validateDisposition 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 · ProjectTreeView.ProjectTreeView (cyclomatic 42) · ×1
  • ProjectTreeView.ProjectTreeView (cyclomatic 42) packages/ui/src/components/project/ProjectTreeView.tsx:97 — ProjectTreeView.ProjectTreeView has cyclomatic complexity 42 (threshold 15). Of this number, 18 points are the body's own statements and 24 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 · migrate-telemetry-state-0.5.9.applyLibrary (cyclomatic 42) · ×1
  • migrate-telemetry-state-0.5.9.applyLibrary (cyclomatic 42) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:1055 — migrate-telemetry-state-0.5.9.applyLibrary 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 · ResumeMetadataRefresher.refresh (cyclomatic 41) · ×1
  • ResumeMetadataRefresher.refresh (cyclomatic 41) packages/daemon/src/domain/resume-metadata-refresher.ts:150 — ResumeMetadataRefresher.refresh 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 · message.buildOutboundMessage (cyclomatic 41) · ×1
  • message.buildOutboundMessage (cyclomatic 41) packages/daemon/src/domain/gateway/slack/message.ts:573 — message.buildOutboundMessage has cyclomatic complexity 41 (threshold 15). Of this number, 40 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 · SeatActivityService.observeSeat (cyclomatic 41) · ×1
  • SeatActivityService.observeSeat (cyclomatic 41) packages/daemon/src/domain/seat-activity-service.ts:178 — SeatActivityService.observeSeat 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 · SeatActivityService.arbitrate (cyclomatic 41) · ×1
  • SeatActivityService.arbitrate (cyclomatic 41) packages/daemon/src/domain/seat-activity-service.ts:936 — SeatActivityService.arbitrate 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 · add.addMemberCommand (cyclomatic 41) · ×1
  • add.addMemberCommand (cyclomatic 41) packages/cli/src/commands/add.ts:31 — add.addMemberCommand has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 1 of the 41 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 48, 99). 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 · mcp-http.grantServiceCaller (cyclomatic 41) · ×1
  • mcp-http.grantServiceCaller (cyclomatic 41) REDACTED:262 — mcp-http.grantServiceCaller 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 · host.doctorLegs (cyclomatic 41) · ×1
  • host.doctorLegs (cyclomatic 41) packages/cli/src/commands/host.ts:199 — host.doctorLegs 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 · HealthDiagnosisService.evaluateOnce (cyclomatic 41) · ×1
  • HealthDiagnosisService.evaluateOnce (cyclomatic 41) packages/daemon/src/domain/health-diagnosis.ts:106 — HealthDiagnosisService.evaluateOnce has cyclomatic complexity 41 (threshold 15). Of this number, 40 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · task-terminal-view.readTaskTerminalSnapshot (cyclomatic 41) · ×1
  • task-terminal-view.readTaskTerminalSnapshot (cyclomatic 41) packages/daemon/src/domain/terminal/task-terminal-view.ts:64 — task-terminal-view.readTaskTerminalSnapshot has cyclomatic complexity 41 (threshold 15). Of this number, 26 points are the body's own statements and 15 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 · scope-task-terminal-view.readScopedTaskTerminalView (cyclomatic 41) · ×1
  • scope-task-terminal-view.readScopedTaskTerminalView (cyclomatic 41) packages/daemon/src/domain/terminal/scope-task-terminal-view.ts:151 — scope-task-terminal-view.readScopedTaskTerminalView has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 180, 170, 204, …). 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 · up.upRoutes.post("/") (cyclomatic 41) · ×1
  • up.upRoutes.post("/") (cyclomatic 41) packages/daemon/src/routes/up.ts:197 — up.upRoutes.post("/") has cyclomatic complexity 41 (threshold 15). Of this number, 32 points are the body's own statements and 9 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 · startup.startupRoutes.post("/ · ×1
  • startup.startupRoutes.post("/:rigId/:logicalId") (cyclomatic 41) packages/daemon/src/routes/startup.ts:575 — startup.startupRoutes.post("/:rigId/:logicalId") has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 3 of the 41 points are its own statements and the rest belongs to one function literal inside it that branches (line 579). 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 · useActivityFeed.eventSummary (cyclomatic 41) · ×1
  • useActivityFeed.eventSummary (cyclomatic 41) packages/ui/src/hooks/useActivityFeed.ts:181 — useActivityFeed.eventSummary has cyclomatic complexity 41 (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 · DiscoveryPanel.DiscoveryPanel (cyclomatic 41) · ×1
  • DiscoveryPanel.DiscoveryPanel (cyclomatic 41) packages/ui/src/components/DiscoveryPanel.tsx:130 — DiscoveryPanel.DiscoveryPanel has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 3 of the 41 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 260, handleConfirm, a function literal at line 153, …). 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 · VerbActions.VerbActions (cyclomatic 41) · ×1
  • VerbActions.VerbActions (cyclomatic 41) packages/ui/src/components/mission-control/components/VerbActions.tsx:103 — VerbActions.VerbActions has cyclomatic complexity 41 (threshold 15). Of this number, 29 points are the body's own statements and 12 belong to 6 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 · migrate-telemetry-state-0.5.9.rollback (cyclomatic 41) · ×1
  • migrate-telemetry-state-0.5.9.rollback (cyclomatic 41) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:1292 — migrate-telemetry-state-0.5.9.rollback 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 · seat-skill-storage.followPackagedSeatSkills (cyclomatic 40) · ×1
  • seat-skill-storage.followPackagedSeatSkills (cyclomatic 40) packages/daemon/src/domain/seat-skill-storage.ts:646 — seat-skill-storage.followPackagedSeatSkills has cyclomatic complexity 40 (threshold 15). Of this number, 38 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 · judgments.readSliceReadiness (cyclomatic 40) · ×1
  • judgments.readSliceReadiness (cyclomatic 40) packages/daemon/src/domain/proof/judgments.ts:187 — judgments.readSliceReadiness has cyclomatic complexity 40 (threshold 15). Of this number, 20 points are the body's own statements and 20 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CommunityHarnessRuntimeAdapter.launchPreset (cyclomatic 40) · ×1
  • CommunityHarnessRuntimeAdapter.launchPreset (cyclomatic 40) packages/daemon/src/adapters/community-harness-runtime-adapter.ts:175 — CommunityHarnessRuntimeAdapter.launchPreset 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 · seat.printHumanHandoverResult (cyclomatic 40) · ×1
  • seat.printHumanHandoverResult (cyclomatic 40) packages/cli/src/commands/seat.ts:413 — seat.printHumanHandoverResult 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 · refocus.renderTrace (cyclomatic 40) · ×1
  • refocus.renderTrace (cyclomatic 40) packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs:254 — refocus.renderTrace 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 · CodexRuntimeAdapter.projectEntry (cyclomatic 40) · ×1
  • CodexRuntimeAdapter.projectEntry (cyclomatic 40) packages/daemon/src/adapters/codex-runtime-adapter.ts:1460 — CodexRuntimeAdapter.projectEntry 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 · WhoamiService.resolve (cyclomatic 40) · ×1
  • WhoamiService.resolve (cyclomatic 40) packages/daemon/src/domain/whoami-service.ts:174 — WhoamiService.resolve 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 · workflow-keepalive.makeWorkflowKeepalivePolicy.evaluate (cyclomatic 40) · ×1
  • workflow-keepalive.makeWorkflowKeepalivePolicy.evaluate (cyclomatic 40) packages/daemon/src/domain/policies/workflow-keepalive.ts:94 — workflow-keepalive.makeWorkflowKeepalivePolicy.evaluate 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 · terminal.terminalRoutes (cyclomatic 40) · ×1
  • terminal.terminalRoutes (cyclomatic 40) packages/daemon/src/routes/terminal.ts:90 — terminal.terminalRoutes has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 1 of the 40 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 122, 95, 139, …). 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 · stylize.stylizeLines (cyclomatic 40) · ×1
  • stylize.stylizeLines (cyclomatic 40) packages/tui/src/stylize.ts:131 — stylize.stylizeLines has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 2 of the 40 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 139, 229, 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 · ScopePages.MissionScopePage (cyclomatic 40) · ×1
  • ScopePages.MissionScopePage (cyclomatic 40) packages/ui/src/components/project/ScopePages.tsx:795 — ScopePages.MissionScopePage has cyclomatic complexity 40 (threshold 15). Of this number, 35 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 · SessionTransport.diagnoseProducerLink (cyclomatic 39) · ×1
  • SessionTransport.diagnoseProducerLink (cyclomatic 39) packages/daemon/src/domain/session-transport.ts:4674 — SessionTransport.diagnoseProducerLink has cyclomatic complexity 39 (threshold 15). Of this number, 29 points are the body's own statements and 10 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 · ClaudeCompactionEnforcer.noteEndedPreparation (cyclomatic 39) · ×1
  • ClaudeCompactionEnforcer.noteEndedPreparation (cyclomatic 39) packages/daemon/src/domain/claude-compaction-enforcer.ts:2235 — ClaudeCompactionEnforcer.noteEndedPreparation has cyclomatic complexity 39 (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 · ask.askLiveRunner (cyclomatic 39) · ×1
  • ask.askLiveRunner (cyclomatic 39) packages/cli/src/commands/ask.ts:11 — ask.askLiveRunner has cyclomatic complexity 39 (threshold 15). Of this number, 34 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 · bootstrap.bootstrapCommand (cyclomatic 39) · ×1
  • bootstrap.bootstrapCommand (cyclomatic 39) packages/cli/src/commands/bootstrap.ts:27 — bootstrap.bootstrapCommand has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 1 of the 39 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 47, getTarget). 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 · decisions.judge (cyclomatic 39) · ×1
  • decisions.judge (cyclomatic 39) packages/cli/src/decisions/decisions.ts:145 — decisions.judge 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 · pi-runner.mapPiEvent (cyclomatic 39) · ×1
  • pi-runner.mapPiEvent (cyclomatic 39) REDACTED:724 — pi-runner.mapPiEvent 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 · MissionControlWriteContract.actOn (cyclomatic 39) · ×1
  • MissionControlWriteContract.actOn (cyclomatic 39) packages/daemon/src/domain/mission-control/mission-control-write-contract.ts:204 — MissionControlWriteContract.actOn has cyclomatic complexity 39 (threshold 15). Of this number, 27 points are the body's own statements and 12 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 · SeatLifecycleService.readStartupContext (cyclomatic 39) · ×1
  • SeatLifecycleService.readStartupContext (cyclomatic 39) packages/daemon/src/domain/seat-lifecycle-service.ts:2187 — SeatLifecycleService.readStartupContext 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 · SeatRuntimeSwitchService.recover (cyclomatic 39) · ×1
  • SeatRuntimeSwitchService.recover (cyclomatic 39) packages/daemon/src/domain/seat-runtime-switch-service.ts:739 — SeatRuntimeSwitchService.recover 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 · watchdog-job-update.updateWatchdogJob (cyclomatic 39) · ×1
  • watchdog-job-update.updateWatchdogJob (cyclomatic 39) packages/daemon/src/domain/watchdog-job-update.ts:87 — watchdog-job-update.updateWatchdogJob 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 · rig-cmux.rigCmuxRoutes.post("/launch") (cyclomatic 39) · ×1
  • rig-cmux.rigCmuxRoutes.post("/launch") (cyclomatic 39) packages/daemon/src/routes/rig-cmux.ts:62 — rig-cmux.rigCmuxRoutes.post("/launch") 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 · RigEnvPanel.RigEnvPanel (cyclomatic 39) · ×1
  • RigEnvPanel.RigEnvPanel (cyclomatic 39) packages/ui/src/components/RigEnvPanel.tsx:10 — RigEnvPanel.RigEnvPanel has cyclomatic complexity 39 (threshold 15). Of this number, 17 points are the body's own statements and 22 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 · relay-outbound.validateRelayOutboundEnvelope (cyclomatic 38) · ×1
  • relay-outbound.validateRelayOutboundEnvelope (cyclomatic 38) packages/daemon/src/domain/gateway/relay-outbound.ts:215 — relay-outbound.validateRelayOutboundEnvelope 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 · ClaudeCompactionEnforcer.drainPendingStage (cyclomatic 38) · ×1
  • ClaudeCompactionEnforcer.drainPendingStage (cyclomatic 38) packages/daemon/src/domain/claude-compaction-enforcer.ts:1159 — ClaudeCompactionEnforcer.drainPendingStage has cyclomatic complexity 38 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · host.postureCheck (cyclomatic 38) · ×1
  • host.postureCheck (cyclomatic 38) packages/cli/src/commands/host.ts:362 — host.postureCheck has cyclomatic complexity 38 (threshold 15). Of this number, 31 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 · usage.usageCommand (cyclomatic 38) · ×1
  • usage.usageCommand (cyclomatic 38) packages/cli/src/commands/usage.ts:112 — usage.usageCommand has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 231, a function literal at line 143, a function literal at line 201, …). 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 · OmpFrameDecoder.push (cyclomatic 38) · ×1
  • OmpFrameDecoder.push (cyclomatic 38) packages/daemon/src/adapters/omp-rpc-frame.ts:92 — OmpFrameDecoder.push has cyclomatic complexity 38 (threshold 15). Of this number, 36 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 · daemon-db-path.daemonDatabaseWarnings (cyclomatic 38) · ×1
  • daemon-db-path.daemonDatabaseWarnings (cyclomatic 38) packages/daemon/src/daemon-db-path.ts:86 — daemon-db-path.daemonDatabaseWarnings has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 12 of the 38 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 107, 106, 145, …). 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 · RestoreOrchestrator.finishJoinedResume (cyclomatic 38) · ×1
  • RestoreOrchestrator.finishJoinedResume (cyclomatic 38) packages/daemon/src/domain/restore-orchestrator.ts:2647 — RestoreOrchestrator.finishJoinedResume has cyclomatic complexity 38 (threshold 15). Of this number, 31 points are the body's own statements and 7 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 · herdr-app-install.installRigMods (cyclomatic 38) · ×1
  • herdr-app-install.installRigMods (cyclomatic 38) packages/daemon/src/domain/terminal/herdr-app-install.ts:82 — herdr-app-install.installRigMods has cyclomatic complexity 38 (threshold 15). Of this number, 35 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 · watchdog-delivery-receipts.withWatchdogReceipts.deliver (cyclomatic 38) · ×1
  • watchdog-delivery-receipts.withWatchdogReceipts.deliver (cyclomatic 38) packages/daemon/src/domain/watchdog-delivery-receipts.ts:63 — watchdog-delivery-receipts.withWatchdogReceipts.deliver has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 8 of the 38 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 93, 68). 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 · bootstrap-failure-response.bootstrapFailureResponse (cyclomatic 38) · ×1
  • bootstrap-failure-response.bootstrapFailureResponse (cyclomatic 38) packages/daemon/src/routes/bootstrap-failure-response.ts:7 — bootstrap-failure-response.bootstrapFailureResponse has cyclomatic complexity 38 (threshold 15). Of this number, 16 points are the body's own statements and 22 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 · permission-stop-observation.admittedRules (cyclomatic 37) · ×1
  • permission-stop-observation.admittedRules (cyclomatic 37) packages/daemon/src/domain/permission-stop-observation.ts:24 — permission-stop-observation.admittedRules has cyclomatic complexity 37 (threshold 15). Of this number, 34 points are the body's own statements and 3 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 · agent-activity-store.normalizeRunnerObservations (cyclomatic 37) · ×1
  • agent-activity-store.normalizeRunnerObservations (cyclomatic 37) packages/daemon/src/domain/agent-activity-store.ts:730 — agent-activity-store.normalizeRunnerObservations has cyclomatic complexity 37 (threshold 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · expected-conversation.resolveExpectedConversation (cyclomatic 37) · ×1
  • expected-conversation.resolveExpectedConversation (cyclomatic 37) packages/daemon/src/domain/expected-conversation.ts:39 — expected-conversation.resolveExpectedConversation has cyclomatic complexity 37 (threshold 15). Of this number, 31 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 · tmux-control.tmuxControlExec · ×1
  • tmux-control.tmuxControlExec::exec (cyclomatic 37) packages/daemon/src/adapters/tmux-control.ts:686 — tmux-control.tmuxControlExec::exec 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 · InboundRouter.attemptBot (cyclomatic 37) · ×1
  • InboundRouter.attemptBot (cyclomatic 37) packages/daemon/src/domain/gateway/slack/inbound.ts:774 — InboundRouter.attemptBot 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 · operator-delivery-engine.makeOperatorDeliveryEngine.dispatchEscalation (cyclomatic 37) · ×1
  • operator-delivery-engine.makeOperatorDeliveryEngine.dispatchEscalation (cyclomatic 37) packages/daemon/src/domain/gateway/operator-delivery-engine.ts:155 — operator-delivery-engine.makeOperatorDeliveryEngine.dispatchEscalation has cyclomatic complexity 37 (threshold 15). Of this number, 31 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SeatActivityService.reportEvidence (cyclomatic 37) · ×1
  • SeatActivityService.reportEvidence (cyclomatic 37) packages/daemon/src/domain/seat-activity-service.ts:546 — SeatActivityService.reportEvidence 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 · queue-stuck-sweep.deliveryResolutionEvidence (cyclomatic 37) · ×1
  • queue-stuck-sweep.deliveryResolutionEvidence (cyclomatic 37) packages/daemon/src/domain/queue-stuck-sweep.ts:529 — queue-stuck-sweep.deliveryResolutionEvidence 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 · StartupOrchestrator.sendInteractiveText (cyclomatic 37) · ×1
  • StartupOrchestrator.sendInteractiveText (cyclomatic 37) packages/daemon/src/domain/startup-orchestrator.ts:1384 — StartupOrchestrator.sendInteractiveText has cyclomatic complexity 37 (threshold 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: 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 · mcp.mcpCommand (cyclomatic 37) · ×1
  • mcp.mcpCommand (cyclomatic 37) packages/cli/src/commands/mcp.ts:16 — mcp.mcpCommand has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 67, 165, 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 · stream.streamCommand (cyclomatic 37) · ×1
  • stream.streamCommand (cyclomatic 37) packages/cli/src/commands/stream.ts:112 — stream.streamCommand has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 13 function literals inside it that branch (lines 186, 336, 219, …). 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 · ClaudeCodeAdapter.projectEntry (cyclomatic 37) · ×1
  • ClaudeCodeAdapter.projectEntry (cyclomatic 37) packages/daemon/src/adapters/claude-code-adapter.ts:935 — ClaudeCodeAdapter.projectEntry 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 · bundle-types.validateLegacyBundleManifest (cyclomatic 37) · ×1
  • bundle-types.validateLegacyBundleManifest (cyclomatic 37) packages/daemon/src/domain/bundle-types.ts:635 — bundle-types.validateLegacyBundleManifest 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 · manifest-parser.parseManifest (cyclomatic 37) · ×1
  • manifest-parser.parseManifest (cyclomatic 37) REDACTED:35 — manifest-parser.parseManifest has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HealthCheckpointSource.validate (cyclomatic 37) · ×1
  • HealthCheckpointSource.validate (cyclomatic 37) packages/daemon/src/domain/health-checkpoints.ts:42 — HealthCheckpointSource.validate 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 · SeatHandoverService.finalizeWithDiscovered (cyclomatic 37) · ×1
  • SeatHandoverService.finalizeWithDiscovered (cyclomatic 37) packages/daemon/src/domain/seat-handover-service.ts:1353 — SeatHandoverService.finalizeWithDiscovered has cyclomatic complexity 37 (threshold 15). Of this number, 31 points are the body's own statements and 6 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 · execution-model.sliceDetail (cyclomatic 37) · ×1
  • execution-model.sliceDetail (cyclomatic 37) packages/tui/src/execution/execution-model.ts:650 — execution-model.sliceDetail has cyclomatic complexity 37 (threshold 15). Of this number, 34 points are the body's own statements and 3 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 · InstallPlanner.plan (cyclomatic 36) · ×1
  • InstallPlanner.plan (cyclomatic 36) packages/daemon/src/domain/install-planner.ts:73 — InstallPlanner.plan 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · relay-outbound.prepareRelayDecision (cyclomatic 36) · ×1
  • relay-outbound.prepareRelayDecision (cyclomatic 36) packages/daemon/src/domain/gateway/relay-outbound.ts:403 — relay-outbound.prepareRelayDecision has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 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 · stream-outcome.routed (cyclomatic 36) · ×1
  • stream-outcome.routed (cyclomatic 36) packages/cli/src/commands/stream-outcome.ts:51 — stream-outcome.routed 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 · SeatLifecycleService.setCwd (cyclomatic 36) · ×1
  • SeatLifecycleService.setCwd (cyclomatic 36) packages/daemon/src/domain/seat-lifecycle-service.ts:548 — SeatLifecycleService.setCwd has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude-token-usage.parseClaudeTokenUsage (cyclomatic 36) · ×1
  • claude-token-usage.parseClaudeTokenUsage (cyclomatic 36) packages/daemon/src/domain/provider/claude-token-usage.ts:16 — claude-token-usage.parseClaudeTokenUsage 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 · SliceDetailProjector.buildAcceptance (cyclomatic 36) · ×1
  • SliceDetailProjector.buildAcceptance (cyclomatic 36) packages/daemon/src/domain/slices/slice-detail-projector.ts:492 — SliceDetailProjector.buildAcceptance 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · settings-browser.safeValue (cyclomatic 36) · ×1
  • settings-browser.safeValue (cyclomatic 36) packages/daemon/src/domain/user-settings/settings-browser.ts:58 — settings-browser.safeValue has cyclomatic complexity 36 (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 · attention-model.composeHumanUpdates (cyclomatic 36) · ×1
  • attention-model.composeHumanUpdates (cyclomatic 36) packages/tui/src/attention/attention-model.ts:21 — attention-model.composeHumanUpdates has cyclomatic complexity 36 (threshold 15). Of this number, 26 points are the body's own statements and 10 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 · BootstrapWizard.BootstrapWizard (cyclomatic 36) · ×1
  • BootstrapWizard.BootstrapWizard (cyclomatic 36) packages/ui/src/components/BootstrapWizard.tsx:27 — BootstrapWizard.BootstrapWizard has cyclomatic complexity 36 (threshold 15). Of this number, 26 points are the body's own statements and 10 belong to 7 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 · HybridTopologyNodes.HybridAgentNodeInner (cyclomatic 36) · ×1
  • HybridTopologyNodes.HybridAgentNodeInner (cyclomatic 36) packages/ui/src/components/topology/HybridTopologyNodes.tsx:117 — HybridTopologyNodes.HybridAgentNodeInner has cyclomatic complexity 36 (threshold 15). Of this number, 34 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 · codex-member-permissions.validateCodexMemberPermissions (cyclomatic 35) · ×1
  • codex-member-permissions.validateCodexMemberPermissions (cyclomatic 35) packages/daemon/src/domain/codex-member-permissions.ts:45 — codex-member-permissions.validateCodexMemberPermissions has cyclomatic complexity 35 (threshold 15). Of this number, 31 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 · seat-skill-storage.followSeatSkills (cyclomatic 35) · ×1
  • seat-skill-storage.followSeatSkills (cyclomatic 35) packages/daemon/src/domain/seat-skill-storage.ts:818 — seat-skill-storage.followSeatSkills has cyclomatic complexity 35 (threshold 15). Of this number, 22 points are the body's own statements and 13 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 · queue-waiting.readWaitingView (cyclomatic 35) · ×1
  • queue-waiting.readWaitingView (cyclomatic 35) packages/daemon/src/domain/queue-waiting.ts:153 — queue-waiting.readWaitingView 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 · QueueRepository.recordHumanAnswer (cyclomatic 35) · ×1
  • QueueRepository.recordHumanAnswer (cyclomatic 35) packages/daemon/src/domain/queue-repository.ts:4669 — QueueRepository.recordHumanAnswer has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 4676). 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 · setup.setupCommand (cyclomatic 35) · ×1
  • setup.setupCommand (cyclomatic 35) packages/cli/src/commands/setup.ts:867 — setup.setupCommand has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 887, 938). 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 · PodRigInstantiator.launchFirstMaterializedNode (cyclomatic 35) · ×1
  • PodRigInstantiator.launchFirstMaterializedNode (cyclomatic 35) packages/daemon/src/domain/rigspec-instantiator.ts:926 — PodRigInstantiator.launchFirstMaterializedNode has cyclomatic complexity 35 (threshold 15). Of this number, 27 points are the body's own statements and 8 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 · ClaimService.repairMissingPane (cyclomatic 35) · ×1
  • ClaimService.repairMissingPane (cyclomatic 35) packages/daemon/src/domain/claim-service.ts:691 — ClaimService.repairMissingPane has cyclomatic complexity 35 (threshold 15). Of this number, 22 points are the body's own statements and 13 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 · slack-subsystem.makeHumanReplyResolver.<returned closure> (cyclomatic 35) · ×1
  • slack-subsystem.makeHumanReplyResolver.<returned closure> (cyclomatic 35) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:112 — slack-subsystem.makeHumanReplyResolver.<returned closure> 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 · SeatLifecycleService.setPermissions (cyclomatic 35) · ×1
  • SeatLifecycleService.setPermissions (cyclomatic 35) packages/daemon/src/domain/seat-lifecycle-service.ts:929 — SeatLifecycleService.setPermissions has cyclomatic complexity 35 (threshold 15). Of this number, 20 points are the body's own statements and 15 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 · reactive-tap.collectReactiveEventSignals (cyclomatic 35) · ×1
  • reactive-tap.collectReactiveEventSignals (cyclomatic 35) packages/daemon/src/domain/provider/reactive-tap.ts:77 — reactive-tap.collectReactiveEventSignals has cyclomatic complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScopeApproveService.approve (cyclomatic 35) · ×1
  • ScopeApproveService.approve (cyclomatic 35) packages/daemon/src/domain/scope/scope-approve.ts:198 — ScopeApproveService.approve 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 · HerdrAppProvider.open (cyclomatic 35) · ×1
  • HerdrAppProvider.open (cyclomatic 35) packages/daemon/src/domain/terminal/herdr-app-provider.ts:339 — HerdrAppProvider.open has cyclomatic complexity 35 (threshold 15). Of this number, 25 points are the body's own statements and 10 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 · rigspec.rigspecImportRoutes.post("/") (cyclomatic 35) · ×1
  • rigspec.rigspecImportRoutes.post("/") (cyclomatic 35) packages/daemon/src/routes/rigspec.ts:107 — rigspec.rigspecImportRoutes.post("/") 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 · hydrate.toAgentRow (cyclomatic 35) · ×1
  • hydrate.toAgentRow (cyclomatic 35) packages/tui/src/hydrate.ts:231 — hydrate.toAgentRow 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 · transcript-rotation.startTranscriptRotation · ×1
  • transcript-rotation.startTranscriptRotation::tick (cyclomatic 34) packages/daemon/src/domain/transcript-rotation.ts:275 — transcript-rotation.startTranscriptRotation::tick 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 · relay-outbound.createRelayOutboundTransport.deliver (cyclomatic 34) · ×1
  • relay-outbound.createRelayOutboundTransport.deliver (cyclomatic 34) packages/daemon/src/domain/gateway/relay-outbound.ts:838 — relay-outbound.createRelayOutboundTransport.deliver has cyclomatic complexity 34 (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 · ClaudeCompactionEnforcer.withDeliveryGuard (cyclomatic 34) · ×1
  • ClaudeCompactionEnforcer.withDeliveryGuard (cyclomatic 34) packages/daemon/src/domain/claude-compaction-enforcer.ts:1065 — ClaudeCompactionEnforcer.withDeliveryGuard has cyclomatic complexity 34 (threshold 15). Of this number, 21 points are the body's own statements and 13 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 · send.runHttpHostSend (cyclomatic 34) · ×1
  • send.runHttpHostSend (cyclomatic 34) packages/cli/src/commands/send.ts:940 — send.runHttpHostSend 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 · env.envCommand (cyclomatic 34) · ×1
  • env.envCommand (cyclomatic 34) packages/cli/src/commands/env.ts:9 — env.envCommand has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 49, resolveRigId, a function literal at line 107, …). 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 · bundle-source-resolver.materializePodBundle (cyclomatic 34) · ×1
  • bundle-source-resolver.materializePodBundle (cyclomatic 34) packages/daemon/src/domain/bundle-source-resolver.ts:214 — bundle-source-resolver.materializePodBundle has cyclomatic complexity 34 (threshold 15). Of this number, 30 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 · RestoreOrchestrator.reconcileNodeRuntimeTruth (cyclomatic 34) · ×1
  • RestoreOrchestrator.reconcileNodeRuntimeTruth (cyclomatic 34) packages/daemon/src/domain/restore-orchestrator.ts:2979 — RestoreOrchestrator.reconcileNodeRuntimeTruth 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 · SlackAskSettlement.settleOne (cyclomatic 34) · ×1
  • SlackAskSettlement.settleOne (cyclomatic 34) packages/daemon/src/domain/gateway/slack/settled-asks.ts:208 — SlackAskSettlement.settleOne has cyclomatic complexity 34 (threshold 15). Of this number, 31 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 · network-connector.runNetworkBindingPass (cyclomatic 34) · ×1
  • network-connector.runNetworkBindingPass (cyclomatic 34) packages/daemon/src/domain/network/network-connector.ts:77 — network-connector.runNetworkBindingPass has cyclomatic complexity 34 (threshold 15). Of this number, 33 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 · SeatHandoverService.recoveredConversation (cyclomatic 34) · ×1
  • SeatHandoverService.recoveredConversation (cyclomatic 34) packages/daemon/src/domain/seat-handover-service.ts:1159 — SeatHandoverService.recoveredConversation has cyclomatic complexity 34 (threshold 15). Of this number, 33 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 · claude-seat-switch.switchHeld (cyclomatic 34) · ×1
  • claude-seat-switch.switchHeld (cyclomatic 34) packages/daemon/src/domain/provider/claude-seat-switch.ts:92 — claude-seat-switch.switchHeld has cyclomatic complexity 34 (threshold 15). Of this number, 30 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 · provider-seat-accounts.configuredSeatAccounts (cyclomatic 34) · ×1
  • provider-seat-accounts.configuredSeatAccounts (cyclomatic 34) packages/daemon/src/domain/provider/provider-seat-accounts.ts:39 — provider-seat-accounts.configuredSeatAccounts has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 6 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 57). 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 · sessions.nodesRoutes.post("/ · ×1
  • sessions.nodesRoutes.post("/:logicalId/launch") (cyclomatic 34) packages/daemon/src/routes/sessions.ts:315 — sessions.nodesRoutes.post("/:logicalId/launch") 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 · slices.slicesRoutes (cyclomatic 34) · ×1
  • slices.slicesRoutes (cyclomatic 34) packages/daemon/src/routes/slices.ts:35 — slices.slicesRoutes has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 147, 40, 64, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PackageInstallFlow.PackageInstallFlow (cyclomatic 34) · ×1
  • PackageInstallFlow.PackageInstallFlow (cyclomatic 34) packages/ui/src/components/PackageInstallFlow.tsx:133 — PackageInstallFlow.PackageInstallFlow has cyclomatic complexity 34 (threshold 15). Of this number, 25 points are the body's own statements and 9 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 · BundleInspector.BundleInspector (cyclomatic 34) · ×1
  • BundleInspector.BundleInspector (cyclomatic 34) packages/ui/src/components/BundleInspector.tsx:7 — BundleInspector.BundleInspector 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, 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 · current-generation-record.resolveIdentityVerifiedClaudeRecord (cyclomatic 33) · ×1
  • current-generation-record.resolveIdentityVerifiedClaudeRecord (cyclomatic 33) packages/daemon/src/domain/model-divergence/current-generation-record.ts:122 — current-generation-record.resolveIdentityVerifiedClaudeRecord 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 · WatchdogJobsRepository.register (cyclomatic 33) · ×1
  • WatchdogJobsRepository.register (cyclomatic 33) packages/daemon/src/domain/watchdog-jobs-repository.ts:325 — WatchdogJobsRepository.register 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 · package-manifest.serializeManifest (cyclomatic 33) · ×1
  • package-manifest.serializeManifest (cyclomatic 33) packages/daemon/src/domain/package-manifest.ts:429 — package-manifest.serializeManifest has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 15 of the 33 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 528, 462, 471, …). 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 · human-readiness.resolveHumanDeliveryReadiness (cyclomatic 33) · ×1
  • human-readiness.resolveHumanDeliveryReadiness (cyclomatic 33) packages/daemon/src/domain/gateway/human-readiness.ts:43 — human-readiness.resolveHumanDeliveryReadiness 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 · judgments.ledger (cyclomatic 33) · ×1
  • judgments.ledger (cyclomatic 33) packages/daemon/src/domain/proof/judgments.ts:137 — judgments.ledger has cyclomatic complexity 33 (threshold 15). Of this number, 29 points are the body's own statements and 4 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 · RunnerPermissions.read (cyclomatic 33) · ×1
  • RunnerPermissions.read (cyclomatic 33) packages/daemon/src/domain/runner-permissions.ts:248 — RunnerPermissions.read 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 · QueueRepository.createInTransactionalContext (cyclomatic 33) · ×1
  • QueueRepository.createInTransactionalContext (cyclomatic 33) packages/daemon/src/domain/queue-repository.ts:2555 — QueueRepository.createInTransactionalContext 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 · TmuxAdapter.createSessionUnchecked (cyclomatic 33) · ×1
  • TmuxAdapter.createSessionUnchecked (cyclomatic 33) packages/daemon/src/adapters/tmux.ts:1757 — TmuxAdapter.createSessionUnchecked 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 · ClaudeCompactionEnforcer.deliverPreparation (cyclomatic 33) · ×1
  • ClaudeCompactionEnforcer.deliverPreparation (cyclomatic 33) packages/daemon/src/domain/claude-compaction-enforcer.ts:1706 — ClaudeCompactionEnforcer.deliverPreparation has cyclomatic complexity 33 (threshold 15). Of this number, 30 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 · scope.buildAuditCommand (cyclomatic 33) · ×1
  • scope.buildAuditCommand (cyclomatic 33) packages/cli/src/commands/scope.ts:1266 — scope.buildAuditCommand has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1271, 1447). 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 · codex-filesystem-preflight.compareFilesystem · ×1
  • codex-filesystem-preflight.compareFilesystem::at (cyclomatic 33) packages/daemon/src/domain/codex-filesystem-preflight.ts:59 — codex-filesystem-preflight.compareFilesystem::at 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. This shape REPEATS in the file: one other method here (codex-filesystem-preflight.compareFilesystem) 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 · execution-view.readLifecycleExecutions (cyclomatic 33) · ×1
  • execution-view.readLifecycleExecutions (cyclomatic 33) packages/daemon/src/domain/execution-view.ts:369 — execution-view.readLifecycleExecutions has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 11 of the 33 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 394, 442). 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 · slack-delivery.subsystemSlackDeliver · ×1
  • slack-delivery.subsystemSlackDeliver::fn (cyclomatic 33) packages/daemon/src/domain/gateway/slack/slack-delivery.ts:702 — slack-delivery.subsystemSlackDeliver::fn 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 · delivery-digest-flush.runDeliveryDigestFlush (cyclomatic 33) · ×1
  • delivery-digest-flush.runDeliveryDigestFlush (cyclomatic 33) packages/daemon/src/domain/policies/delivery-digest-flush.ts:52 — delivery-digest-flush.runDeliveryDigestFlush has cyclomatic complexity 33 (threshold 15). Of this number, 25 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 · SeatHandoverService.proveAttemptSuccessorOnce (cyclomatic 33) · ×1
  • SeatHandoverService.proveAttemptSuccessorOnce (cyclomatic 33) packages/daemon/src/domain/seat-handover-service.ts:1068 — SeatHandoverService.proveAttemptSuccessorOnce has cyclomatic complexity 33 (threshold 15). Of this number, 27 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 · shared-history-selection.listSharedHistories (cyclomatic 33) · ×1
  • shared-history-selection.listSharedHistories (cyclomatic 33) packages/daemon/src/domain/shared-history-selection.ts:39 — shared-history-selection.listSharedHistories has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · activity.recordHookActivity (cyclomatic 33) · ×1
  • activity.recordHookActivity (cyclomatic 33) packages/daemon/src/routes/activity.ts:807 — activity.recordHookActivity 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 · bundles.bundleRoutes.post("/install") (cyclomatic 33) · ×1
  • bundles.bundleRoutes.post("/install") (cyclomatic 33) packages/daemon/src/routes/bundles.ts:1134 — bundles.bundleRoutes.post("/install") has cyclomatic complexity 33 (threshold 15). Of this number, 32 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 · execution-model.overviewLines (cyclomatic 33) · ×1
  • execution-model.overviewLines (cyclomatic 33) packages/tui/src/execution/execution-model.ts:477 — execution-model.overviewLines has cyclomatic complexity 33 (threshold 15). Of this number, 31 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 · startup.startupLines (cyclomatic 33) · ×1
  • startup.startupLines (cyclomatic 33) packages/tui/src/startup.ts:257 — startup.startupLines 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 · useGlobalEvents.useGlobalEvents (cyclomatic 33) · ×1
  • useGlobalEvents.useGlobalEvents (cyclomatic 33) packages/ui/src/hooks/useGlobalEvents.ts:10 — useGlobalEvents.useGlobalEvents has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 22, 73, 18, …). 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 · ForkNowAction.ForkNowAction (cyclomatic 33) · ×1
  • ForkNowAction.ForkNowAction (cyclomatic 33) packages/ui/src/components/agent-images/ForkNowAction.tsx:31 — ForkNowAction.ForkNowAction has cyclomatic complexity 33 (threshold 15). Of this number, 20 points are the body's own statements and 13 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 · fetch-stub.route (cyclomatic 33) · ×1
  • fetch-stub.route (cyclomatic 33) packages/ui/twin/fetch-stub.ts:44 — fetch-stub.route 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 · pi-readiness.piCredentialSource (cyclomatic 32) · ×1
  • pi-readiness.piCredentialSource (cyclomatic 32) packages/daemon/src/adapters/pi-readiness.ts:68 — pi-readiness.piCredentialSource has cyclomatic complexity 32 (threshold 15). Of this number, 24 points are the body's own statements and 8 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 · ActivityGrantStore.bindingMatch (cyclomatic 32) · ×1
  • ActivityGrantStore.bindingMatch (cyclomatic 32) packages/daemon/src/domain/activity-grants.ts:212 — ActivityGrantStore.bindingMatch has cyclomatic complexity 32 (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 · judgments.recordJudgment (cyclomatic 32) · ×1
  • judgments.recordJudgment (cyclomatic 32) packages/daemon/src/domain/proof/judgments.ts:269 — judgments.recordJudgment has cyclomatic complexity 32 (threshold 15). Of this number, 30 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 · judgments.readMissionReadiness (cyclomatic 32) · ×1
  • judgments.readMissionReadiness (cyclomatic 32) packages/daemon/src/domain/proof/judgments.ts:329 — judgments.readMissionReadiness has cyclomatic complexity 32 (threshold 15). Of this number, 22 points are the body's own statements and 10 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 · session-transport.probeSessionActivity (cyclomatic 32) · ×1
  • session-transport.probeSessionActivity (cyclomatic 32) packages/daemon/src/domain/session-transport.ts:996 — session-transport.probeSessionActivity has cyclomatic complexity 32 (threshold 15). Of this number, 28 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 · native-resume-probe.buildCodexResumeDisplay (cyclomatic 32) · ×1
  • native-resume-probe.buildCodexResumeDisplay (cyclomatic 32) packages/daemon/src/domain/native-resume-probe.ts:118 — native-resume-probe.buildCodexResumeDisplay has cyclomatic complexity 32 (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 · doctor.runDoctorChecks (cyclomatic 32) · ×1
  • doctor.runDoctorChecks (cyclomatic 32) REDACTED:144 — doctor.runDoctorChecks has cyclomatic complexity 32 (threshold 15). Of this number, 25 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 · health.healthCommand · ×1
  • health.healthCommand::diagnosisRequest (cyclomatic 32) packages/cli/src/commands/health.ts:405 — health.healthCommand::diagnosisRequest 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 · workflow-render.renderInstanceShow (cyclomatic 32) · ×1
  • workflow-render.renderInstanceShow (cyclomatic 32) packages/cli/src/commands/workflow-render.ts:377 — workflow-render.renderInstanceShow 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 · CodexRuntimeAdapter.launchHarness (cyclomatic 32) · ×1
  • CodexRuntimeAdapter.launchHarness (cyclomatic 32) packages/daemon/src/adapters/codex-runtime-adapter.ts:940 — CodexRuntimeAdapter.launchHarness has cyclomatic complexity 32 (threshold 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RunnerCore.reportUsageFacts (cyclomatic 32) · ×1
  • RunnerCore.reportUsageFacts (cyclomatic 32) REDACTED:1438 — RunnerCore.reportUsageFacts has cyclomatic complexity 32 (threshold 15). Of this number, 23 points are the body's own statements and 9 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 · rehydrate-eligibility.assessSnapshotCurrentOccupants (cyclomatic 32) · ×1
  • rehydrate-eligibility.assessSnapshotCurrentOccupants (cyclomatic 32) packages/daemon/src/domain/rehydrate-eligibility.ts:20 — rehydrate-eligibility.assessSnapshotCurrentOccupants has cyclomatic complexity 32 (threshold 15). Of this number, 22 points are the body's own statements and 10 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 · seat-attention-reconciler.describeLineageFailure (cyclomatic 32) · ×1
  • seat-attention-reconciler.describeLineageFailure (cyclomatic 32) packages/daemon/src/domain/seat-attention-reconciler.ts:61 — seat-attention-reconciler.describeLineageFailure 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 · HumanModeService.apply (cyclomatic 32) · ×1
  • HumanModeService.apply (cyclomatic 32) packages/daemon/src/domain/gateway/human-operating-modes.ts:185 — HumanModeService.apply has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 212, a function literal at line 242, a function literal at line 216, …). 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 · relay-inbound.createRelayInboundHandler.handle (cyclomatic 32) · ×1
  • relay-inbound.createRelayInboundHandler.handle (cyclomatic 32) packages/daemon/src/domain/gateway/relay-inbound.ts:644 — relay-inbound.createRelayInboundHandler.handle has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 704). 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 · HealthDiagnosisService.validateProgress (cyclomatic 32) · ×1
  • HealthDiagnosisService.validateProgress (cyclomatic 32) packages/daemon/src/domain/health-diagnosis.ts:219 — HealthDiagnosisService.validateProgress has cyclomatic complexity 32 (threshold 15). Of this number, 28 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 · context-usage-threshold.makeContextUsageThresholdPolicy.evaluate (cyclomatic 32) · ×1
  • context-usage-threshold.makeContextUsageThresholdPolicy.evaluate (cyclomatic 32) packages/daemon/src/domain/policies/context-usage-threshold.ts:30 — context-usage-threshold.makeContextUsageThresholdPolicy.evaluate has cyclomatic complexity 32 (threshold 15). Of this number, 29 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 · stream-reader-actions.recordReaderAction (cyclomatic 32) · ×1
  • stream-reader-actions.recordReaderAction (cyclomatic 32) packages/daemon/src/domain/stream-reader-actions.ts:64 — stream-reader-actions.recordReaderAction 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 · bundles.bundleRoutes.post("/inspect") (cyclomatic 32) · ×1
  • bundles.bundleRoutes.post("/inspect") (cyclomatic 32) packages/daemon/src/routes/bundles.ts:951 — bundles.bundleRoutes.post("/inspect") has cyclomatic complexity 32 (threshold 15). Of this number, 25 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 · projects.projectsRoutes · ×1
  • projects.projectsRoutes::errorResponse (cyclomatic 32) packages/daemon/src/routes/projects.ts:60 — projects.projectsRoutes::errorResponse 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 · connections-model.connectionsLines (cyclomatic 32) · ×1
  • connections-model.connectionsLines (cyclomatic 32) packages/tui/src/connections/connections-model.ts:58 — connections-model.connectionsLines has cyclomatic complexity 32 (threshold 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · guest.main (cyclomatic 32) · ×1
  • guest.main (cyclomatic 32) packages/daemon/assets/openshell/guest.py:227 — guest.main 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 · node-inventory.buildInventoryItem (cyclomatic 31) · ×1
  • node-inventory.buildInventoryItem (cyclomatic 31) REDACTED:983 — node-inventory.buildInventoryItem 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 · node-inventory.attachAgentActivity (cyclomatic 31) · ×1
  • node-inventory.attachAgentActivity (cyclomatic 31) REDACTED:1824 — node-inventory.attachAgentActivity has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 1862, 1945, 1905). 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 · ps.runFanOutPs (cyclomatic 31) · ×1
  • ps.runFanOutPs (cyclomatic 31) packages/cli/src/commands/ps.ts:1899 — ps.runFanOutPs has cyclomatic complexity 31 (threshold 15). Of this number, 19 points are the body's own statements and 12 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 · attach.attachCommand (cyclomatic 31) · ×1
  • attach.attachCommand (cyclomatic 31) packages/cli/src/commands/attach.ts:47 — attach.attachCommand has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 68, getClient). 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 · fork.forkCommand.cmd (cyclomatic 31) · ×1
  • fork.forkCommand.cmd (cyclomatic 31) packages/cli/src/commands/fork.ts:55 — fork.forkCommand.cmd 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 · project-worker.runProjectWake (cyclomatic 31) · ×1
  • project-worker.runProjectWake (cyclomatic 31) packages/cli/src/commands/project-worker.ts:65 — project-worker.runProjectWake has cyclomatic complexity 31 (threshold 15). Of this number, 16 points are the body's own statements and 15 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 · restore-from-jsonl.analyze (cyclomatic 31) · ×1
  • restore-from-jsonl.analyze (cyclomatic 31) packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs:253 — restore-from-jsonl.analyze 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 · ClaudeCodeAdapter.assessManagedProbe (cyclomatic 31) · ×1
  • ClaudeCodeAdapter.assessManagedProbe (cyclomatic 31) packages/daemon/src/adapters/claude-code-adapter.ts:626 — ClaudeCodeAdapter.assessManagedProbe has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RigSpecExporter.exportLegacy (cyclomatic 31) · ×1
  • RigSpecExporter.exportLegacy (cyclomatic 31) packages/daemon/src/domain/rigspec-exporter.ts:135 — RigSpecExporter.exportLegacy has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 142, 188, 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.
D1 · Cyclomatic Complexity · runtime-switch-materials.planRuntimeSwitchMaterials (cyclomatic 31) · ×1
  • runtime-switch-materials.planRuntimeSwitchMaterials (cyclomatic 31) packages/daemon/src/domain/runtime-switch-materials.ts:76 — runtime-switch-materials.planRuntimeSwitchMaterials has cyclomatic complexity 31 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · topology-manifest.validateTopologyManifest (cyclomatic 31) · ×1
  • topology-manifest.validateTopologyManifest (cyclomatic 31) packages/daemon/src/domain/topology/topology-manifest.ts:79 — topology-manifest.validateTopologyManifest 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 · restore-check.getStartupContext (cyclomatic 31) · ×1
  • restore-check.getStartupContext (cyclomatic 31) packages/daemon/src/routes/restore-check.ts:52 — restore-check.getStartupContext has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 127, 115, 93). 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 · startup.reviewSelectedHistory (cyclomatic 31) · ×1
  • startup.reviewSelectedHistory (cyclomatic 31) packages/daemon/src/routes/startup.ts:329 — startup.reviewSelectedHistory 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 · QueueItemViewer.QueueItemViewer (cyclomatic 31) · ×1
  • QueueItemViewer.QueueItemViewer (cyclomatic 31) packages/ui/src/components/drawer-viewers/QueueItemViewer.tsx:48 — QueueItemViewer.QueueItemViewer has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Feed.Feed (cyclomatic 31) · ×1
  • Feed.Feed (cyclomatic 31) packages/ui/src/components/for-you/Feed.tsx:222 — Feed.Feed has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 7 of the 31 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 363, 497, 336, …). 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 · migrate-telemetry-state-0.5.9.managedSystemWorldState (cyclomatic 31) · ×1
  • migrate-telemetry-state-0.5.9.managedSystemWorldState (cyclomatic 31) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:645 — migrate-telemetry-state-0.5.9.managedSystemWorldState 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 · codex-thread-id.readCodexThreadIdFromLogs (cyclomatic 30) · ×1
  • codex-thread-id.readCodexThreadIdFromLogs (cyclomatic 30) REDACTED:402 — codex-thread-id.readCodexThreadIdFromLogs 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 · native-process-lineage.claudeArgvIds (cyclomatic 30) · ×1
  • native-process-lineage.claudeArgvIds (cyclomatic 30) packages/daemon/src/domain/native-process-lineage.ts:346 — native-process-lineage.claudeArgvIds 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 · native-process-lineage.observeClaudeDelivery (cyclomatic 30) · ×1
  • native-process-lineage.observeClaudeDelivery (cyclomatic 30) packages/daemon/src/domain/native-process-lineage.ts:1038 — native-process-lineage.observeClaudeDelivery has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to 3 function items inside it that branch (sample, sample::launchedAs, a function literal at line 1060). 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 · rig-repository.isStoredStartupBlock (cyclomatic 30) · ×1
  • rig-repository.isStoredStartupBlock (cyclomatic 30) packages/daemon/src/domain/rig-repository.ts:75 — rig-repository.isStoredStartupBlock has cyclomatic complexity 30 (threshold 15). Of this number, 16 points are the body's own statements and 14 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 · escalation-owner.resolveEscalationOwner (cyclomatic 30) · ×1
  • escalation-owner.resolveEscalationOwner (cyclomatic 30) packages/daemon/src/domain/escalation-owner.ts:26 — escalation-owner.resolveEscalationOwner has cyclomatic complexity 30 (threshold 15). Of this number, 17 points are the body's own statements and 13 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 · QueueRepository.deliverWakeIntent (cyclomatic 30) · ×1
  • QueueRepository.deliverWakeIntent (cyclomatic 30) packages/daemon/src/domain/queue-repository.ts:1695 — QueueRepository.deliverWakeIntent 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. This shape REPEATS in the file: one other method here (QueueRepository.deliverWakeIntent::claim) 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 · SessionTransport.doReconcileStartupReadiness (cyclomatic 30) · ×1
  • SessionTransport.doReconcileStartupReadiness (cyclomatic 30) packages/daemon/src/domain/session-transport.ts:5148 — SessionTransport.doReconcileStartupReadiness has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 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 · TmuxAdapter.scopedLaunchCommand (cyclomatic 30) · ×1
  • TmuxAdapter.scopedLaunchCommand (cyclomatic 30) packages/daemon/src/adapters/tmux.ts:1052 — TmuxAdapter.scopedLaunchCommand has cyclomatic complexity 30 (threshold 15). Of this number, 26 points are the body's own statements and 4 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 · TmuxAdapter.guardedInput (cyclomatic 30) · ×1
  • TmuxAdapter.guardedInput (cyclomatic 30) packages/daemon/src/adapters/tmux.ts:1325 — TmuxAdapter.guardedInput has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 9 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 1338). 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 · claude-team-permissions.words (cyclomatic 30) · ×1
  • claude-team-permissions.words (cyclomatic 30) packages/daemon/assets/claude-team-permissions.cjs:102 — claude-team-permissions.words has cyclomatic complexity 30 (threshold 15). Of this number, 28 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 · CodexResumeAdapter.verifyResume (cyclomatic 30) · ×1
  • CodexResumeAdapter.verifyResume (cyclomatic 30) packages/daemon/src/adapters/codex-resume.ts:187 — CodexResumeAdapter.verifyResume 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 · PsProjectionService.getEntries (cyclomatic 30) · ×1
  • PsProjectionService.getEntries (cyclomatic 30) packages/daemon/src/domain/ps-projection.ts:177 — PsProjectionService.getEntries has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 3 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 225). 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 · BootstrapOrchestrator.handlePodAwareSpec (cyclomatic 30) · ×1
  • BootstrapOrchestrator.handlePodAwareSpec (cyclomatic 30) packages/daemon/src/domain/bootstrap-orchestrator.ts:711 — BootstrapOrchestrator.handlePodAwareSpec has cyclomatic complexity 30 (threshold 15). Of this number, 26 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 · classification-sources.classificationSources (cyclomatic 30) · ×1
  • classification-sources.classificationSources (cyclomatic 30) packages/daemon/src/domain/classification-sources.ts:27 — classification-sources.classificationSources has cyclomatic complexity 30 (threshold 15). Of this number, 17 points are the body's own statements and 13 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 · HealthDiagnosisService.notifyOccurrence (cyclomatic 30) · ×1
  • HealthDiagnosisService.notifyOccurrence (cyclomatic 30) packages/daemon/src/domain/health-diagnosis.ts:246 — HealthDiagnosisService.notifyOccurrence has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CurrentModelReader.prepare (cyclomatic 30) · ×1
  • CurrentModelReader.prepare (cyclomatic 30) packages/daemon/src/domain/model-divergence/current-model-reader.ts:218 — CurrentModelReader.prepare has cyclomatic complexity 30 (threshold 15). Of this number, 17 points are the body's own statements and 13 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 · SeatRuntimeSwitchService.commit (cyclomatic 30) · ×1
  • SeatRuntimeSwitchService.commit (cyclomatic 30) packages/daemon/src/domain/seat-runtime-switch-service.ts:590 — SeatRuntimeSwitchService.commit has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to one function literal inside it that branches (line 602). 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 · StreamClassificationWorker.wake (cyclomatic 30) · ×1
  • StreamClassificationWorker.wake (cyclomatic 30) packages/daemon/src/domain/stream-classification-worker.ts:125 — StreamClassificationWorker.wake 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 · herdr-adapter.exitedSeats (cyclomatic 30) · ×1
  • herdr-adapter.exitedSeats (cyclomatic 30) packages/daemon/src/domain/terminal/herdr-adapter.ts:110 — herdr-adapter.exitedSeats has cyclomatic complexity 30 (threshold 15). Of this number, 24 points are the body's own statements and 6 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 · ScopePages.SliceScopePage (cyclomatic 30) · ×1
  • ScopePages.SliceScopePage (cyclomatic 30) packages/ui/src/components/project/ScopePages.tsx:1221 — ScopePages.SliceScopePage has cyclomatic complexity 30 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · guest.descriptor (cyclomatic 30) · ×1
  • guest.descriptor (cyclomatic 30) packages/daemon/assets/openshell/guest.py:105 — guest.descriptor 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 · native-process-lineage.claudeSessionIdentity (cyclomatic 29) · ×1
  • native-process-lineage.claudeSessionIdentity (cyclomatic 29) packages/daemon/src/domain/native-process-lineage.ts:393 — native-process-lineage.claudeSessionIdentity 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 · current-generation-record.resolveIdentityVerifiedPiRecord (cyclomatic 29) · ×1
  • current-generation-record.resolveIdentityVerifiedPiRecord (cyclomatic 29) packages/daemon/src/domain/model-divergence/current-generation-record.ts:294 — current-generation-record.resolveIdentityVerifiedPiRecord 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, 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 · NativePermissionStore.resolve (cyclomatic 29) · ×1
  • NativePermissionStore.resolve (cyclomatic 29) packages/daemon/src/domain/native-permission-store.ts:231 — NativePermissionStore.resolve 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 · EnvironmentStartup.retainedResume (cyclomatic 29) · ×1
  • EnvironmentStartup.retainedResume (cyclomatic 29) packages/daemon/src/domain/environment-startup.ts:55 — EnvironmentStartup.retainedResume 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 · SessionTransport.readAtReadableSize (cyclomatic 29) · ×1
  • SessionTransport.readAtReadableSize (cyclomatic 29) packages/daemon/src/domain/session-transport.ts:4913 — SessionTransport.readAtReadableSize has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 4925). 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 · TmuxAdapter.respawnPaneUnchecked (cyclomatic 29) · ×1
  • TmuxAdapter.respawnPaneUnchecked (cyclomatic 29) packages/daemon/src/adapters/tmux.ts:2295 — TmuxAdapter.respawnPaneUnchecked has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · native-resume-probe.currentCodexAuthRefusal (cyclomatic 29) · ×1
  • native-resume-probe.currentCodexAuthRefusal (cyclomatic 29) packages/daemon/src/domain/native-resume-probe.ts:1011 — native-resume-probe.currentCodexAuthRefusal 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 · seat-attention.checkSeatAttention (cyclomatic 29) · ×1
  • seat-attention.checkSeatAttention (cyclomatic 29) packages/cli/src/seat-attention.ts:30 — seat-attention.checkSeatAttention has cyclomatic complexity 29 (threshold 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · adopt.adoptCommand (cyclomatic 29) · ×1
  • adopt.adoptCommand (cyclomatic 29) packages/cli/src/commands/adopt.ts:79 — adopt.adoptCommand has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to one function literal inside it that branches (line 94). 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 · auth.authCommand (cyclomatic 29) · ×1
  • auth.authCommand (cyclomatic 29) packages/cli/src/commands/auth.ts:49 — auth.authCommand has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 11 function items inside it that branch (a function literal at line 113, a function literal at line 75, onHost, …). 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 · roster.rosterCommand (cyclomatic 29) · ×1
  • roster.rosterCommand (cyclomatic 29) packages/cli/src/commands/roster.ts:137 — roster.rosterCommand has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 144, 159). 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 · mcp-server.projectForExternal (cyclomatic 29) · ×1
  • mcp-server.projectForExternal (cyclomatic 29) packages/cli/src/mcp-server.ts:375 — mcp-server.projectForExternal has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · restore.restoreCommand (cyclomatic 29) · ×1
  • restore.restoreCommand (cyclomatic 29) packages/cli/src/commands/restore.ts:10 — restore.restoreCommand has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 20, 127). 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 · CodexRuntimeAdapter.ensureCodexCorePlugin (cyclomatic 29) · ×1
  • CodexRuntimeAdapter.ensureCodexCorePlugin (cyclomatic 29) packages/daemon/src/adapters/codex-runtime-adapter.ts:414 — CodexRuntimeAdapter.ensureCodexCorePlugin has cyclomatic complexity 29 (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 (CodexRuntimeAdapter.ensureCodexCorePlugin::renewContentApproval) 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 · bundle-content-routing.routeBundleContents (cyclomatic 29) · ×1
  • bundle-content-routing.routeBundleContents (cyclomatic 29) packages/daemon/src/domain/bundle-content-routing.ts:81 — bundle-content-routing.routeBundleContents has cyclomatic complexity 29 (threshold 15). Of this number, 22 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 · SessionFingerprinter.fingerprint (cyclomatic 29) · ×1
  • SessionFingerprinter.fingerprint (cyclomatic 29) packages/daemon/src/domain/session-fingerprinter.ts:73 — SessionFingerprinter.fingerprint 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 · workflow-scope.normalizeWorkflowScope (cyclomatic 29) · ×1
  • workflow-scope.normalizeWorkflowScope (cyclomatic 29) packages/daemon/src/domain/workflow-scope.ts:44 — workflow-scope.normalizeWorkflowScope 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 · human-mode-account.waitingFor (cyclomatic 29) · ×1
  • human-mode-account.waitingFor (cyclomatic 29) packages/daemon/src/domain/gateway/human-mode-account.ts:69 — human-mode-account.waitingFor has cyclomatic complexity 29 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pi-usage-entries-store.validPiProviderCharge (cyclomatic 29) · ×1
  • pi-usage-entries-store.validPiProviderCharge (cyclomatic 29) packages/daemon/src/domain/pi-usage-entries-store.ts:29 — pi-usage-entries-store.validPiProviderCharge has cyclomatic complexity 29 (threshold 15). Of this number, 22 points are the body's own statements and 7 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 · UsageWindows.project (cyclomatic 29) · ×1
  • UsageWindows.project (cyclomatic 29) packages/daemon/src/domain/provider/usage-windows.ts:256 — UsageWindows.project has cyclomatic complexity 29 (threshold 15). Of this number, 24 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 · SeatLifecycleService.setCodexProfile (cyclomatic 29) · ×1
  • SeatLifecycleService.setCodexProfile (cyclomatic 29) packages/daemon/src/domain/seat-lifecycle-service.ts:1079 — SeatLifecycleService.setCodexProfile has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 11 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1100, 1114). 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 · seat-skill-apply.applySeatSkills (cyclomatic 29) · ×1
  • seat-skill-apply.applySeatSkills (cyclomatic 29) packages/daemon/src/domain/seat-skill-apply.ts:184 — seat-skill-apply.applySeatSkills has cyclomatic complexity 29 (threshold 15). Of this number, 22 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 · herdr-live-workspace.hasLiveAttachments (cyclomatic 29) · ×1
  • herdr-live-workspace.hasLiveAttachments (cyclomatic 29) packages/daemon/src/domain/terminal/herdr-live-workspace.ts:36 — herdr-live-workspace.hasLiveAttachments has cyclomatic complexity 29 (threshold 15). Of this number, 23 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 · RexAdapter.openView (cyclomatic 29) · ×1
  • RexAdapter.openView (cyclomatic 29) packages/daemon/src/domain/terminal/rex-adapter.ts:148 — RexAdapter.openView has cyclomatic complexity 29 (threshold 15). Of this number, 25 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 · review.reviewRoutes (cyclomatic 29) · ×1
  • review.reviewRoutes (cyclomatic 29) packages/daemon/src/routes/review.ts:42 — review.reviewRoutes has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 118, 45, 98, …). 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 · usage-model.allowanceLines (cyclomatic 29) · ×1
  • usage-model.allowanceLines (cyclomatic 29) packages/tui/src/usage/usage-model.ts:66 — usage-model.allowanceLines 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 · storytelling-cards.buildStorytellingFeedItems (cyclomatic 29) · ×1
  • storytelling-cards.buildStorytellingFeedItems (cyclomatic 29) packages/ui/src/components/feed/cards/storytelling-cards.tsx:577 — storytelling-cards.buildStorytellingFeedItems 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 · permission-drift.inspectClaude (cyclomatic 28) · ×1
  • permission-drift.inspectClaude (cyclomatic 28) packages/daemon/src/domain/permission-drift.ts:164 — permission-drift.inspectClaude 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 · provider-signals.deriveUsageLimitPools (cyclomatic 28) · ×1
  • provider-signals.deriveUsageLimitPools (cyclomatic 28) packages/daemon/src/domain/provider/provider-signals.ts:270 — provider-signals.deriveUsageLimitPools has cyclomatic complexity 28 (threshold 15). Of this number, 15 points are the body's own statements and 13 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 · compose.composeSliceReview (cyclomatic 28) · ×1
  • compose.composeSliceReview (cyclomatic 28) REDACTED:1114 — compose.composeSliceReview has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to 5 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 · SeatActivityService.pollPermissionPrompt (cyclomatic 28) · ×1
  • SeatActivityService.pollPermissionPrompt (cyclomatic 28) packages/daemon/src/domain/seat-activity-service.ts:275 — SeatActivityService.pollPermissionPrompt has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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 · restore-guidance.restoreMissingGuidance (cyclomatic 28) · ×1
  • restore-guidance.restoreMissingGuidance (cyclomatic 28) packages/daemon/src/domain/restore-guidance.ts:266 — restore-guidance.restoreMissingGuidance 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 · hosted-wake.ringHostedWake (cyclomatic 28) · ×1
  • hosted-wake.ringHostedWake (cyclomatic 28) packages/daemon/src/domain/hosted-wake.ts:46 — hosted-wake.ringHostedWake 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 · ClaudeCompactionEnforcer.beginPreparation (cyclomatic 28) · ×1
  • ClaudeCompactionEnforcer.beginPreparation (cyclomatic 28) packages/daemon/src/domain/claude-compaction-enforcer.ts:1599 — ClaudeCompactionEnforcer.beginPreparation 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 · daemon-lifecycle.stopDaemon (cyclomatic 28) · ×1
  • daemon-lifecycle.stopDaemon (cyclomatic 28) REDACTED:1010 — daemon-lifecycle.stopDaemon has cyclomatic complexity 28 (threshold 15). Of this number, 26 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 · tmux-attachment.readRecordedTmuxServerArgs (cyclomatic 28) · ×1
  • tmux-attachment.readRecordedTmuxServerArgs (cyclomatic 28) packages/cli/src/tmux-attachment.ts:26 — tmux-attachment.readRecordedTmuxServerArgs 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 · roster.enrichRosterMember (cyclomatic 28) · ×1
  • roster.enrichRosterMember (cyclomatic 28) packages/cli/src/commands/roster.ts:89 — roster.enrichRosterMember has cyclomatic complexity 28 (threshold 15). Of this number, 24 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 · expand.expandCommand (cyclomatic 28) · ×1
  • expand.expandCommand (cyclomatic 28) packages/cli/src/commands/expand.ts:21 — expand.expandCommand has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to one function literal inside it that branches (line 30). 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 · queue.readBackQueueUpdate (cyclomatic 28) · ×1
  • queue.readBackQueueUpdate (cyclomatic 28) packages/cli/src/commands/queue.ts:827 — queue.readBackQueueUpdate has cyclomatic complexity 28 (threshold 15). Of this number, 15 points are the body's own statements and 13 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · scope.buildMissionCreateCommand (cyclomatic 28) · ×1
  • scope.buildMissionCreateCommand (cyclomatic 28) packages/cli/src/commands/scope.ts:1032 — scope.buildMissionCreateCommand has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to one function literal inside it that branches (line 1044). 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 · seat-runtime-home-record.observeRuntimeHome (cyclomatic 28) · ×1
  • seat-runtime-home-record.observeRuntimeHome (cyclomatic 28) packages/daemon/src/domain/seat-runtime-home-record.ts:106 — seat-runtime-home-record.observeRuntimeHome has cyclomatic complexity 28 (threshold 15). Of this number, 17 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 · bundle-archive.unpack (cyclomatic 28) · ×1
  • bundle-archive.unpack (cyclomatic 28) packages/daemon/src/domain/bundle-archive.ts:112 — bundle-archive.unpack has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · workflow-reconciliation.reviseGraph (cyclomatic 28) · ×1
  • workflow-reconciliation.reviseGraph (cyclomatic 28) packages/daemon/src/domain/workflow-reconciliation.ts:210 — workflow-reconciliation.reviseGraph has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 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 · network-connector.reportBack (cyclomatic 28) · ×1
  • network-connector.reportBack (cyclomatic 28) packages/daemon/src/domain/network/network-connector.ts:257 — network-connector.reportBack 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 · PodBundleAssembler.assemble (cyclomatic 28) · ×1
  • PodBundleAssembler.assemble (cyclomatic 28) packages/daemon/src/domain/pod-bundle-assembler.ts:69 — PodBundleAssembler.assemble has cyclomatic complexity 28 (threshold 15). Of this number, 25 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 · usage-across-hosts.readHost (cyclomatic 28) · ×1
  • usage-across-hosts.readHost (cyclomatic 28) packages/daemon/src/domain/provider/usage-across-hosts.ts:445 — usage-across-hosts.readHost 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, separate the cases: extract each independent branch into its 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-follow-policy.planFollowingTiles (cyclomatic 28) · ×1
  • terminal-follow-policy.planFollowingTiles (cyclomatic 28) packages/daemon/src/domain/terminal/terminal-follow-policy.ts:58 — terminal-follow-policy.planFollowingTiles has cyclomatic complexity 28 (threshold 15). Of this number, 23 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 · plugins.pluginsRoutes (cyclomatic 28) · ×1
  • plugins.pluginsRoutes (cyclomatic 28) packages/daemon/src/routes/plugins.ts:107 — plugins.pluginsRoutes has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 189, 147, 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 · open-window.openTerminalInWindow (cyclomatic 28) · ×1
  • open-window.openTerminalInWindow (cyclomatic 28) packages/tui/src/terminals/open-window.ts:127 — open-window.openTerminalInWindow has cyclomatic complexity 28 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProjectMetaPrimitives.eventToken (cyclomatic 28) · ×1
  • ProjectMetaPrimitives.eventToken (cyclomatic 28) packages/ui/src/components/project/ProjectMetaPrimitives.tsx:50 — ProjectMetaPrimitives.eventToken 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 · trace-to-root.main (cyclomatic 28) · ×1
  • trace-to-root.main (cyclomatic 28) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:529 — trace-to-root.main 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 · native-process-lineage.tokens (cyclomatic 27) · ×1
  • native-process-lineage.tokens (cyclomatic 27) packages/daemon/src/domain/native-process-lineage.ts:25 — native-process-lineage.tokens has cyclomatic complexity 27 (threshold 15). Of this number, 14 points are the body's own statements and 13 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 · rigspec-schema.validateWorkspaceBlock (cyclomatic 27) · ×1
  • rigspec-schema.validateWorkspaceBlock (cyclomatic 27) packages/daemon/src/domain/rigspec-schema.ts:313 — rigspec-schema.validateWorkspaceBlock 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 · EnvironmentPlatform.config (cyclomatic 27) · ×1
  • EnvironmentPlatform.config (cyclomatic 27) packages/daemon/src/domain/environment-platform.ts:74 — EnvironmentPlatform.config 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 · kernel-hook-review.makeKernelHookReviewReader.<returned closure> (cyclomatic 27) · ×1
  • kernel-hook-review.makeKernelHookReviewReader.<returned closure> (cyclomatic 27) packages/daemon/src/domain/kernel-hook-review.ts:22 — kernel-hook-review.makeKernelHookReviewReader.<returned closure> 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 · delivery-rules-engine.decideDelivery (cyclomatic 27) · ×1
  • delivery-rules-engine.decideDelivery (cyclomatic 27) packages/daemon/src/domain/gateway/delivery-rules-engine.ts:126 — delivery-rules-engine.decideDelivery 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 · community-harness-presets.shellSyntaxIn (cyclomatic 27) · ×1
  • community-harness-presets.shellSyntaxIn (cyclomatic 27) packages/daemon/src/domain/community-harness-presets.ts:134 — community-harness-presets.shellSyntaxIn 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 · queue-wake-ladder.readLadder (cyclomatic 27) · ×1
  • queue-wake-ladder.readLadder (cyclomatic 27) packages/daemon/src/domain/queue-wake-ladder.ts:269 — queue-wake-ladder.readLadder 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 · QueueRepository.recordDelegatedDecision (cyclomatic 27) · ×1
  • QueueRepository.recordDelegatedDecision (cyclomatic 27) packages/daemon/src/domain/queue-repository.ts:4904 — QueueRepository.recordDelegatedDecision has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 4919). 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 · ClaudeCompactionEnforcer.endedAttemptGate (cyclomatic 27) · ×1
  • ClaudeCompactionEnforcer.endedAttemptGate (cyclomatic 27) packages/daemon/src/domain/claude-compaction-enforcer.ts:853 — ClaudeCompactionEnforcer.endedAttemptGate 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 · compact.compactCommand (cyclomatic 27) · ×1
  • compact.compactCommand (cyclomatic 27) packages/cli/src/commands/compact.ts:21 — compact.compactCommand has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to one function literal inside it that branches (line 110). 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 · config.configCommand (cyclomatic 27) · ×1
  • config.configCommand (cyclomatic 27) packages/cli/src/commands/config.ts:55 — config.configCommand 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 255, 194, 285, …). 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 · context-install.validateContextPackManifestForInstall (cyclomatic 27) · ×1
  • context-install.validateContextPackManifestForInstall (cyclomatic 27) packages/cli/src/lib/context-install.ts:77 — context-install.validateContextPackManifestForInstall 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 · terminal-window-rex.openRexView (cyclomatic 27) · ×1
  • terminal-window-rex.openRexView (cyclomatic 27) packages/cli/src/terminal-window-rex.ts:79 — terminal-window-rex.openRexView 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 · workflow-errors.describeDaemonRejection (cyclomatic 27) · ×1
  • workflow-errors.describeDaemonRejection (cyclomatic 27) packages/cli/src/commands/workflow-errors.ts:32 — workflow-errors.describeDaemonRejection 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 · permission-stop-descriptor.buildPermissionRuleSuggestions (cyclomatic 27) · ×1
  • permission-stop-descriptor.buildPermissionRuleSuggestions (cyclomatic 27) packages/daemon/assets/plugins/openrig-core/hooks/scripts/permission-stop-descriptor.cjs:166 — permission-stop-descriptor.buildPermissionRuleSuggestions 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 · codex-network-default.decideCodexNetworkDefault (cyclomatic 27) · ×1
  • codex-network-default.decideCodexNetworkDefault (cyclomatic 27) packages/daemon/src/domain/codex-network-default.ts:46 — codex-network-default.decideCodexNetworkDefault 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 · cmux-transport.buildCommand (cyclomatic 27) · ×1
  • cmux-transport.buildCommand (cyclomatic 27) REDACTED:59 — cmux-transport.buildCommand 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 · AskService.ask (cyclomatic 27) · ×1
  • AskService.ask (cyclomatic 27) packages/daemon/src/domain/ask-service.ts:76 — AskService.ask 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 · continuity-policy-materializer.armContinuityPolicy (cyclomatic 27) · ×1
  • continuity-policy-materializer.armContinuityPolicy (cyclomatic 27) packages/daemon/src/domain/continuity-policy-materializer.ts:254 — continuity-policy-materializer.armContinuityPolicy has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 9 function items inside it that branch (matches, retireUnexpected, isCurrentShapeCandidate, …). 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 · ContextPackLibraryService.composeFromFiles (cyclomatic 27) · ×1
  • ContextPackLibraryService.composeFromFiles (cyclomatic 27) packages/daemon/src/domain/context-packs/context-pack-library-service.ts:231 — ContextPackLibraryService.composeFromFiles has cyclomatic complexity 27 (threshold 15). Of this number, 24 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 · health-detectors.evaluatePassiveCeremony (cyclomatic 27) · ×1
  • health-detectors.evaluatePassiveCeremony (cyclomatic 27) packages/daemon/src/domain/health-detectors.ts:420 — health-detectors.evaluatePassiveCeremony 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 · SeatLifecycleService.stopManagedTmuxSeat (cyclomatic 27) · ×1
  • SeatLifecycleService.stopManagedTmuxSeat (cyclomatic 27) packages/daemon/src/domain/seat-lifecycle-service.ts:2099 — SeatLifecycleService.stopManagedTmuxSeat has cyclomatic complexity 27 (threshold 15). Of this number, 22 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 · RestoreCheckService.checkStartupContext (cyclomatic 27) · ×1
  • RestoreCheckService.checkStartupContext (cyclomatic 27) packages/daemon/src/domain/restore-check-service.ts:1036 — RestoreCheckService.checkStartupContext has cyclomatic complexity 27 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · seat.seatRoutes.post("/set-runtime/ · ×1
  • seat.seatRoutes.post("/set-runtime/:seatRef") (cyclomatic 27) packages/daemon/src/routes/seat.ts:327 — seat.seatRoutes.post("/set-runtime/:seatRef") has cyclomatic complexity 27 (threshold 15). 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: 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: seat.seatLifecycleStatus (cyclomatic 31) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · config.configRoutes (cyclomatic 27) · ×1
  • config.configRoutes (cyclomatic 27) packages/daemon/src/routes/config.ts:37 — config.configRoutes 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 94, 40, 116, …). 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 · terminal-ws.registerTerminalWs (cyclomatic 27) · ×1
  • terminal-ws.registerTerminalWs (cyclomatic 27) packages/daemon/src/routes/terminal-ws.ts:42 — terminal-ws.registerTerminalWs 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 items inside it that branch (a function literal at line 66, a function literal at line 83, getRegistry, …). 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 · MarkdownViewer.parseMarkdown (cyclomatic 27) · ×1
  • MarkdownViewer.parseMarkdown (cyclomatic 27) packages/ui/src/components/markdown/MarkdownViewer.tsx:138 — MarkdownViewer.parseMarkdown 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 · TerminalPreviewPopover.TerminalPreviewPopover (cyclomatic 27) · ×1
  • TerminalPreviewPopover.TerminalPreviewPopover (cyclomatic 27) packages/ui/src/components/topology/TerminalPreviewPopover.tsx:102 — TerminalPreviewPopover.TerminalPreviewPopover has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 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 180, a function literal at line 162, a function literal at line 126, …). 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 · CompactStatusRow.CompactStatusRow (cyclomatic 27) · ×1
  • CompactStatusRow.CompactStatusRow (cyclomatic 27) packages/ui/src/components/mission-control/components/CompactStatusRow.tsx:36 — CompactStatusRow.CompactStatusRow 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, 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 · refresh-managed-plugin.classify (cyclomatic 27) · ×1
  • refresh-managed-plugin.classify (cyclomatic 27) skills/_canonical/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs:62 — refresh-managed-plugin.classify 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 · AgentActivityStore.recordRunnerObservation (cyclomatic 26) · ×1
  • AgentActivityStore.recordRunnerObservation (cyclomatic 26) packages/daemon/src/domain/agent-activity-store.ts:214 — AgentActivityStore.recordRunnerObservation has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 224). 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 · rigspec-schema.validateClaudeAdditions (cyclomatic 26) · ×1
  • rigspec-schema.validateClaudeAdditions (cyclomatic 26) packages/daemon/src/domain/rigspec-schema.ts:1258 — rigspec-schema.validateClaudeAdditions has cyclomatic complexity 26 (threshold 15). Of this number, 15 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 · human-questions.parseHumanQuestions (cyclomatic 26) · ×1
  • human-questions.parseHumanQuestions (cyclomatic 26) packages/daemon/src/domain/human-questions.ts:50 — human-questions.parseHumanQuestions 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 · QueueWakeRepository.getStatus (cyclomatic 26) · ×1
  • QueueWakeRepository.getStatus (cyclomatic 26) packages/daemon/src/domain/queue-wake-repository.ts:100 — QueueWakeRepository.getStatus 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 · SeatActivityService.rawCandidate (cyclomatic 26) · ×1
  • SeatActivityService.rawCandidate (cyclomatic 26) packages/daemon/src/domain/seat-activity-service.ts:794 — SeatActivityService.rawCandidate 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 · QueueRepository.deliverWakeIntent · ×1
  • QueueRepository.deliverWakeIntent::claim (cyclomatic 26) packages/daemon/src/domain/queue-repository.ts:1709 — QueueRepository.deliverWakeIntent::claim 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. This shape REPEATS in the file: one other method here (QueueRepository.deliverWakeIntent) 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 · SessionTransport.waitForIdle (cyclomatic 26) · ×1
  • SessionTransport.waitForIdle (cyclomatic 26) packages/daemon/src/domain/session-transport.ts:4268 — SessionTransport.waitForIdle has cyclomatic complexity 26 (threshold 15). Of this number, 20 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 · check-runner.server (cyclomatic 26) · ×1
  • check-runner.server (cyclomatic 26) docs/reference/runner-conformance/check-runner.mjs:86 — check-runner.server 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 · check-runner.submitAsk (cyclomatic 26) · ×1
  • check-runner.submitAsk (cyclomatic 26) docs/reference/runner-conformance/check-runner.mjs:146 — check-runner.submitAsk has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · local-daemon-owner.assessLocalDaemonOwner (cyclomatic 26) · ×1
  • local-daemon-owner.assessLocalDaemonOwner (cyclomatic 26) packages/cli/src/local-daemon-owner.ts:40 — local-daemon-owner.assessLocalDaemonOwner has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 58, a function literal at line 59, observe). 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 · ps.runCrossHostPs (cyclomatic 26) · ×1
  • ps.runCrossHostPs (cyclomatic 26) packages/cli/src/commands/ps.ts:1692 — ps.runCrossHostPs 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 · queue-artifact.codeResultOf (cyclomatic 26) · ×1
  • queue-artifact.codeResultOf (cyclomatic 26) packages/cli/src/queue-artifact.ts:53 — queue-artifact.codeResultOf 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 · codex-jsonl-parser.parseCodexJsonl (cyclomatic 26) · ×1
  • codex-jsonl-parser.parseCodexJsonl (cyclomatic 26) packages/cli/src/restore-packet/codex-jsonl-parser.ts:89 — codex-jsonl-parser.parseCodexJsonl 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 · scope.buildApproveCommand (cyclomatic 26) · ×1
  • scope.buildApproveCommand (cyclomatic 26) packages/cli/src/commands/scope.ts:2190 — scope.buildApproveCommand has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 2206). 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 · workflow-render.renderTraceTree (cyclomatic 26) · ×1
  • workflow-render.renderTraceTree (cyclomatic 26) packages/cli/src/commands/workflow-render.ts:178 — workflow-render.renderTraceTree 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 · claude-team-permissions.scanQuotes (cyclomatic 26) · ×1
  • claude-team-permissions.scanQuotes (cyclomatic 26) packages/daemon/assets/claude-team-permissions.cjs:8 — claude-team-permissions.scanQuotes 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 · CodexRuntimeAdapter.profileRemainsReadOnly (cyclomatic 26) · ×1
  • CodexRuntimeAdapter.profileRemainsReadOnly (cyclomatic 26) packages/daemon/src/adapters/codex-runtime-adapter.ts:1240 — CodexRuntimeAdapter.profileRemainsReadOnly 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 · codex-runtime-adapter.tomlSections (cyclomatic 26) · ×1
  • codex-runtime-adapter.tomlSections (cyclomatic 26) packages/daemon/src/adapters/codex-runtime-adapter.ts:2460 — codex-runtime-adapter.tomlSections has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function item 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 · codex-runtime-adapter.lineStartsAtDocumentLevel (cyclomatic 26) · ×1
  • codex-runtime-adapter.lineStartsAtDocumentLevel (cyclomatic 26) packages/daemon/src/adapters/codex-runtime-adapter.ts:2717 — codex-runtime-adapter.lineStartsAtDocumentLevel 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 · seat-runtime-home-record.recordRuntimeHome (cyclomatic 26) · ×1
  • seat-runtime-home-record.recordRuntimeHome (cyclomatic 26) packages/daemon/src/domain/seat-runtime-home-record.ts:194 — seat-runtime-home-record.recordRuntimeHome has cyclomatic complexity 26 (threshold 15). Of this number, 17 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 · RigInstantiator.instantiate (cyclomatic 26) · ×1
  • RigInstantiator.instantiate (cyclomatic 26) packages/daemon/src/domain/rigspec-instantiator.ts:80 — RigInstantiator.instantiate has cyclomatic complexity 26 (threshold 15). Of this number, 20 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 · EnvironmentArtifacts.export (cyclomatic 26) · ×1
  • EnvironmentArtifacts.export (cyclomatic 26) packages/daemon/src/domain/environment-artifacts.ts:48 — EnvironmentArtifacts.export has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 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 · existing-rig-restore.automaticRestoreOverrides (cyclomatic 26) · ×1
  • existing-rig-restore.automaticRestoreOverrides (cyclomatic 26) packages/daemon/src/domain/existing-rig-restore.ts:147 — existing-rig-restore.automaticRestoreOverrides has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 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 · PiCompactionService.request (cyclomatic 26) · ×1
  • PiCompactionService.request (cyclomatic 26) packages/daemon/src/domain/pi-compaction-service.ts:85 — PiCompactionService.request has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SuccessorSessionLauncher.createSuccessor (cyclomatic 26) · ×1
  • SuccessorSessionLauncher.createSuccessor (cyclomatic 26) packages/daemon/src/domain/successor-session-launcher.ts:207 — SuccessorSessionLauncher.createSuccessor 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 · project-classifier.validateClassifyInput (cyclomatic 26) · ×1
  • project-classifier.validateClassifyInput (cyclomatic 26) packages/daemon/src/domain/project-classifier.ts:406 — project-classifier.validateClassifyInput 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 · RestoreCheckService.check (cyclomatic 26) · ×1
  • RestoreCheckService.check (cyclomatic 26) packages/daemon/src/domain/restore-check-service.ts:297 — RestoreCheckService.check 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 · workflow-exception-readiness.inspectExceptionReadiness (cyclomatic 26) · ×1
  • workflow-exception-readiness.inspectExceptionReadiness (cyclomatic 26) packages/daemon/src/domain/workflow-exception-readiness.ts:30 — workflow-exception-readiness.inspectExceptionReadiness 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 · state.drillTo (cyclomatic 26) · ×1
  • state.drillTo (cyclomatic 26) packages/tui/src/state.ts:521 — state.drillTo 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 · AppShell.AppShellInner (cyclomatic 26) · ×1
  • AppShell.AppShellInner (cyclomatic 26) packages/ui/src/components/AppShell.tsx:373 — AppShell.AppShellInner has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · topology-activity.parseTopologyActivityEvent (cyclomatic 26) · ×1
  • topology-activity.parseTopologyActivityEvent (cyclomatic 26) packages/ui/src/lib/topology-activity.ts:219 — topology-activity.parseTopologyActivityEvent has cyclomatic complexity 26 (threshold 15). Of this number, 25 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 · ImportFlow.ImportFlow (cyclomatic 26) · ×1
  • ImportFlow.ImportFlow (cyclomatic 26) packages/ui/src/components/ImportFlow.tsx:67 — ImportFlow.ImportFlow has cyclomatic complexity 26 (threshold 15). Of this number, 14 points are the body's own statements and 12 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 · AgentActivityStore.getRunnerObservation (cyclomatic 25) · ×1
  • AgentActivityStore.getRunnerObservation (cyclomatic 25) packages/daemon/src/domain/agent-activity-store.ts:269 — AgentActivityStore.getRunnerObservation 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, 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 · startup-validation.validateStartupAction (cyclomatic 25) · ×1
  • startup-validation.validateStartupAction (cyclomatic 25) packages/daemon/src/domain/startup-validation.ts:62 — startup-validation.validateStartupAction 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 · rigspec-schema.normalizeSessionSource (cyclomatic 25) · ×1
  • rigspec-schema.normalizeSessionSource (cyclomatic 25) packages/daemon/src/domain/rigspec-schema.ts:1215 — rigspec-schema.normalizeSessionSource 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 · QueueRepository.retryPromptWakesOnClear (cyclomatic 25) · ×1
  • QueueRepository.retryPromptWakesOnClear (cyclomatic 25) packages/daemon/src/domain/queue-repository.ts:2066 — QueueRepository.retryPromptWakesOnClear has cyclomatic complexity 25 (threshold 15). Of this number, 20 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 · QueueRepository.retryUnroutableWakesOnReachable (cyclomatic 25) · ×1
  • QueueRepository.retryUnroutableWakesOnReachable (cyclomatic 25) packages/daemon/src/domain/queue-repository.ts:2147 — QueueRepository.retryUnroutableWakesOnReachable 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 · QueueRepository.passRunnerAnswerToDecider (cyclomatic 25) · ×1
  • QueueRepository.passRunnerAnswerToDecider (cyclomatic 25) packages/daemon/src/domain/queue-repository.ts:4488 — QueueRepository.passRunnerAnswerToDecider has cyclomatic complexity 25 (threshold 15). Of this number, 23 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 · EnvironmentLifecycle.verifyCheckpoint (cyclomatic 25) · ×1
  • EnvironmentLifecycle.verifyCheckpoint (cyclomatic 25) packages/daemon/src/domain/environment-lifecycle.ts:183 — EnvironmentLifecycle.verifyCheckpoint 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 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 · EnvironmentLifecycle.checkpoint (cyclomatic 25) · ×1
  • EnvironmentLifecycle.checkpoint (cyclomatic 25) packages/daemon/src/domain/environment-lifecycle.ts:205 — EnvironmentLifecycle.checkpoint 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 · TmuxAdapter.sendShellCommandUnchecked (cyclomatic 25) · ×1
  • TmuxAdapter.sendShellCommandUnchecked (cyclomatic 25) packages/daemon/src/adapters/tmux.ts:1982 — TmuxAdapter.sendShellCommandUnchecked 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 · ClaudeCompactionEnforcer.recordRestoreFailure (cyclomatic 25) · ×1
  • ClaudeCompactionEnforcer.recordRestoreFailure (cyclomatic 25) packages/daemon/src/domain/claude-compaction-enforcer.ts:1117 — ClaudeCompactionEnforcer.recordRestoreFailure 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 · ps.runHttpPs (cyclomatic 25) · ×1
  • ps.runHttpPs (cyclomatic 25) packages/cli/src/commands/ps.ts:1767 — ps.runHttpPs 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 · stream-consumer.applyEffect (cyclomatic 25) · ×1
  • stream-consumer.applyEffect (cyclomatic 25) packages/cli/src/decisions/stream-consumer.ts:114 — stream-consumer.applyEffect has cyclomatic complexity 25 (threshold 15). Of this number, 15 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 · queue.terminalDeliveryResult (cyclomatic 25) · ×1
  • queue.terminalDeliveryResult (cyclomatic 25) packages/cli/src/commands/queue.ts:155 — queue.terminalDeliveryResult 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 · terminal.humanOpen (cyclomatic 25) · ×1
  • terminal.humanOpen (cyclomatic 25) packages/cli/src/commands/terminal.ts:113 — terminal.humanOpen 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 · claude-team-permissions.normalize (cyclomatic 25) · ×1
  • claude-team-permissions.normalize (cyclomatic 25) packages/daemon/assets/claude-team-permissions.cjs:140 — claude-team-permissions.normalize 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 · bounded-probe-exec.boundedProbeExec.<returned closure> (cyclomatic 25) · ×1
  • bounded-probe-exec.boundedProbeExec.<returned closure> (cyclomatic 25) packages/daemon/src/adapters/bounded-probe-exec.ts:97 — bounded-probe-exec.boundedProbeExec.<returned closure> 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 16 function literals inside it that branch (lines 177, 97, 126, …). 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 · codex-filesystem-preflight.decideCodexFilesystemPolicy (cyclomatic 25) · ×1
  • codex-filesystem-preflight.decideCodexFilesystemPolicy (cyclomatic 25) packages/daemon/src/domain/codex-filesystem-preflight.ts:166 — codex-filesystem-preflight.decideCodexFilesystemPolicy 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, 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 · InstallVerifier.verify (cyclomatic 25) · ×1
  • InstallVerifier.verify (cyclomatic 25) packages/daemon/src/domain/install-verifier.ts:50 — InstallVerifier.verify 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 · RigSpecPreflight.check (cyclomatic 25) · ×1
  • RigSpecPreflight.check (cyclomatic 25) packages/daemon/src/domain/rigspec-preflight.ts:47 — RigSpecPreflight.check 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 · CmuxLayoutService.buildWorkspacePanes (cyclomatic 25) · ×1
  • CmuxLayoutService.buildWorkspacePanes (cyclomatic 25) packages/daemon/src/domain/cmux-layout-service.ts:184 — CmuxLayoutService.buildWorkspacePanes 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 · ContextMonitor.normalizeStartupStatus (cyclomatic 25) · ×1
  • ContextMonitor.normalizeStartupStatus (cyclomatic 25) packages/daemon/src/domain/context-monitor.ts:320 — ContextMonitor.normalizeStartupStatus has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · current-work.deriveWorkCandidates (cyclomatic 25) · ×1
  • current-work.deriveWorkCandidates (cyclomatic 25) packages/daemon/src/domain/current-work.ts:829 — current-work.deriveWorkCandidates 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SlackAskSettlement.desired (cyclomatic 25) · ×1
  • SlackAskSettlement.desired (cyclomatic 25) packages/daemon/src/domain/gateway/slack/settled-asks.ts:166 — SlackAskSettlement.desired has cyclomatic complexity 25 (threshold 15). Of this number, 18 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 · slack-subsystem.buildSlackGatewayWire.deliverDigestPost (cyclomatic 25) · ×1
  • slack-subsystem.buildSlackGatewayWire.deliverDigestPost (cyclomatic 25) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:970 — slack-subsystem.buildSlackGatewayWire.deliverDigestPost has cyclomatic complexity 25 (threshold 15). Of this number, 18 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 · HealthDiagnosisService.dispose (cyclomatic 25) · ×1
  • HealthDiagnosisService.dispose (cyclomatic 25) packages/daemon/src/domain/health-diagnosis.ts:184 — HealthDiagnosisService.dispose 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 · default-workspace-scaffold.ensureDefaultWorkspace (cyclomatic 25) · ×1
  • default-workspace-scaffold.ensureDefaultWorkspace (cyclomatic 25) packages/daemon/src/domain/workspace/default-workspace-scaffold.ts:121 — default-workspace-scaffold.ensureDefaultWorkspace 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 · refocus-record.readRefocusRecord (cyclomatic 25) · ×1
  • refocus-record.readRefocusRecord (cyclomatic 25) packages/daemon/src/domain/refocus-record.ts:40 — refocus-record.readRefocusRecord 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 · RigLifecycleService.shrinkPod (cyclomatic 25) · ×1
  • RigLifecycleService.shrinkPod (cyclomatic 25) packages/daemon/src/domain/rig-lifecycle-service.ts:667 — RigLifecycleService.shrinkPod 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 · StreamIntakeCoordinator.catchUp (cyclomatic 25) · ×1
  • StreamIntakeCoordinator.catchUp (cyclomatic 25) packages/daemon/src/domain/stream-intake.ts:135 — StreamIntakeCoordinator.catchUp 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 · env.envRoutes (cyclomatic 25) · ×1
  • env.envRoutes (cyclomatic 25) packages/daemon/src/routes/env.ts:14 — env.envRoutes 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 18, 74, 111). 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 · PermissionStopObservations.observe (cyclomatic 24) · ×1
  • PermissionStopObservations.observe (cyclomatic 24) packages/daemon/src/domain/permission-stop-observation.ts:93 — PermissionStopObservations.observe 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 · pi-usage-facts.extractPiUsageFacts (cyclomatic 24) · ×1
  • pi-usage-facts.extractPiUsageFacts (cyclomatic 24) packages/daemon/src/domain/pi-usage-facts.ts:119 — pi-usage-facts.extractPiUsageFacts 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 · native-process-lineage.explainNativeRejection (cyclomatic 24) · ×1
  • native-process-lineage.explainNativeRejection (cyclomatic 24) packages/daemon/src/domain/native-process-lineage.ts:781 — native-process-lineage.explainNativeRejection has cyclomatic complexity 24 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resume-token-capture.deriveResumeToken (cyclomatic 24) · ×1
  • resume-token-capture.deriveResumeToken (cyclomatic 24) packages/daemon/src/domain/resume-token-capture.ts:86 — resume-token-capture.deriveResumeToken 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 · skill-catalog.resolveSkillLoadout (cyclomatic 24) · ×1
  • skill-catalog.resolveSkillLoadout (cyclomatic 24) packages/daemon/src/domain/skill-catalog.ts:369 — skill-catalog.resolveSkillLoadout 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 · projection-planner.planProjection (cyclomatic 24) · ×1
  • projection-planner.planProjection (cyclomatic 24) packages/daemon/src/domain/projection-planner.ts:95 — projection-planner.planProjection has cyclomatic complexity 24 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChannelCoverageStore.read (cyclomatic 24) · ×1
  • ChannelCoverageStore.read (cyclomatic 24) packages/daemon/src/domain/gateway/slack/state-store.ts:318 — ChannelCoverageStore.read 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 · remote-daemon-http.remoteJsonRequest (cyclomatic 24) · ×1
  • remote-daemon-http.remoteJsonRequest (cyclomatic 24) packages/daemon/src/domain/hosts/remote-daemon-http.ts:116 — remote-daemon-http.remoteJsonRequest has cyclomatic complexity 24 (threshold 15). 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: 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 · compose.composeMissionReview (cyclomatic 24) · ×1
  • compose.composeMissionReview (cyclomatic 24) REDACTED:1297 — compose.composeMissionReview has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 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 · relay-outbound.findPendingRelayReplyRef (cyclomatic 24) · ×1
  • relay-outbound.findPendingRelayReplyRef (cyclomatic 24) packages/daemon/src/domain/gateway/relay-outbound.ts:535 — relay-outbound.findPendingRelayReplyRef 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 · session-transport.findCurrentPiDialog (cyclomatic 24) · ×1
  • session-transport.findCurrentPiDialog (cyclomatic 24) packages/daemon/src/domain/session-transport.ts:247 — session-transport.findCurrentPiDialog has cyclomatic complexity 24 (threshold 15). 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, 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 · TmuxAdapter.capturePanesContent · ×1
  • TmuxAdapter.capturePanesContent::captureChunk (cyclomatic 24) packages/daemon/src/adapters/tmux.ts:2697 — TmuxAdapter.capturePanesContent::captureChunk 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 · ClaudeCompactionEnforcer.drainPendingPreparedCompact (cyclomatic 24) · ×1
  • ClaudeCompactionEnforcer.drainPendingPreparedCompact (cyclomatic 24) packages/daemon/src/domain/claude-compaction-enforcer.ts:1010 — ClaudeCompactionEnforcer.drainPendingPreparedCompact 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, 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 · ps.parsePsControls (cyclomatic 24) · ×1
  • ps.parsePsControls (cyclomatic 24) packages/cli/src/commands/ps.ts:427 — ps.parsePsControls 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 · acp.acpCommand (cyclomatic 24) · ×1
  • acp.acpCommand (cyclomatic 24) packages/cli/src/commands/acp.ts:189 — acp.acpCommand 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 7 function items inside it that branch (a function literal at line 336, a function literal at line 225, a function literal at line 295, …). 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 · bundle-source.importGitHubBundle (cyclomatic 24) · ×1
  • bundle-source.importGitHubBundle (cyclomatic 24) packages/cli/src/lib/bundle-source.ts:272 — bundle-source.importGitHubBundle 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 · send.runCrossHostSend (cyclomatic 24) · ×1
  • send.runCrossHostSend (cyclomatic 24) packages/cli/src/commands/send.ts:828 — send.runCrossHostSend 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 · compact-plan.compactPlanCommand (cyclomatic 24) · ×1
  • compact-plan.compactPlanCommand (cyclomatic 24) packages/cli/src/commands/compact-plan.ts:434 — compact-plan.compactPlanCommand 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 one function literal inside it that branches (line 452). 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 · reconcile-session.reconcileSessionCommand (cyclomatic 24) · ×1
  • reconcile-session.reconcileSessionCommand (cyclomatic 24) packages/cli/src/commands/reconcile-session.ts:36 — reconcile-session.reconcileSessionCommand 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 one function literal inside it that branches (line 68). 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 · workflow-follow.followInstance (cyclomatic 24) · ×1
  • workflow-follow.followInstance (cyclomatic 24) packages/cli/src/commands/workflow-follow.ts:177 — workflow-follow.followInstance 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 · project-registration.registerBundleProject (cyclomatic 24) · ×1
  • project-registration.registerBundleProject (cyclomatic 24) packages/daemon/src/domain/workspace/project-registration.ts:181 — project-registration.registerBundleProject has cyclomatic complexity 24 (threshold 15). Of this number, 21 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 · seat-recap-store.writeSeatRecap (cyclomatic 24) · ×1
  • seat-recap-store.writeSeatRecap (cyclomatic 24) packages/daemon/src/domain/context-packs/seat-recap-store.ts:51 — seat-recap-store.writeSeatRecap has cyclomatic complexity 24 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · desired-claude-activity-hooks.agentResolvedAgainstRecordedRoots (cyclomatic 24) · ×1
  • desired-claude-activity-hooks.agentResolvedAgainstRecordedRoots (cyclomatic 24) packages/daemon/src/domain/desired-claude-activity-hooks.ts:26 — desired-claude-activity-hooks.agentResolvedAgainstRecordedRoots has cyclomatic complexity 24 (threshold 15). Of this number, 19 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 · HealthDiagnosisService.show (cyclomatic 24) · ×1
  • HealthDiagnosisService.show (cyclomatic 24) packages/daemon/src/domain/health-diagnosis.ts:57 — HealthDiagnosisService.show has cyclomatic complexity 24 (threshold 15). 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, 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 · PluginDiscoveryService.listPlugins (cyclomatic 24) · ×1
  • PluginDiscoveryService.listPlugins (cyclomatic 24) packages/daemon/src/domain/plugin-discovery-service.ts:208 — PluginDiscoveryService.listPlugins 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 · queue-erasure.eraseQueue · ×1
  • queue-erasure.eraseQueue::planBatch (cyclomatic 24) REDACTED:848 — queue-erasure.eraseQueue::planBatch 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 (queue-erasure.eraseQueue) 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 · index.startServer (cyclomatic 24) · ×1
  • index.startServer (cyclomatic 24) packages/daemon/src/index.ts:284 — index.startServer has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · config-model.configValue (cyclomatic 24) · ×1
  • config-model.configValue (cyclomatic 24) packages/tui/src/config/config-model.ts:115 — config-model.configValue 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 · fleet-scopes-model.fleetScopesLines (cyclomatic 24) · ×1
  • fleet-scopes-model.fleetScopesLines (cyclomatic 24) packages/tui/src/scopes/fleet-scopes-model.ts:91 — fleet-scopes-model.fleetScopesLines has cyclomatic complexity 24 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useMissionDiscovery.useMissionDiscovery (cyclomatic 24) · ×1
  • useMissionDiscovery.useMissionDiscovery (cyclomatic 24) packages/ui/src/hooks/useMissionDiscovery.ts:64 — useMissionDiscovery.useMissionDiscovery has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 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 · ProjectMetaPrimitives.queueStateToken (cyclomatic 24) · ×1
  • ProjectMetaPrimitives.queueStateToken (cyclomatic 24) packages/ui/src/components/project/ProjectMetaPrimitives.tsx:109 — ProjectMetaPrimitives.queueStateToken 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 · SeatOverviewTable.SeatOverviewTable (cyclomatic 24) · ×1
  • SeatOverviewTable.SeatOverviewTable (cyclomatic 24) packages/ui/src/components/SeatOverviewTable.tsx:79 — SeatOverviewTable.SeatOverviewTable has cyclomatic complexity 24 (threshold 15). Of this number, 21 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 · LaunchCmuxButton.LaunchCmuxButton (cyclomatic 24) · ×1
  • LaunchCmuxButton.LaunchCmuxButton (cyclomatic 24) packages/ui/src/components/topology/LaunchCmuxButton.tsx:23 — LaunchCmuxButton.LaunchCmuxButton 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 10 function items inside it that branch (showStatus, a function literal at line 85, a function literal at line 150, …). 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 · trace-to-root.render_work (cyclomatic 24) · ×1
  • trace-to-root.render_work (cyclomatic 24) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:275 — trace-to-root.render_work 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 · AgentActivityStore.getLatestForNode (cyclomatic 23) · ×1
  • AgentActivityStore.getLatestForNode (cyclomatic 23) packages/daemon/src/domain/agent-activity-store.ts:355 — AgentActivityStore.getLatestForNode 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 · pi-readiness.piCredentialEvidence (cyclomatic 23) · ×1
  • pi-readiness.piCredentialEvidence (cyclomatic 23) packages/daemon/src/adapters/pi-readiness.ts:163 — pi-readiness.piCredentialEvidence 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 · codex-rebuild-permissions.parseCodexPermissionEnvelope (cyclomatic 23) · ×1
  • codex-rebuild-permissions.parseCodexPermissionEnvelope (cyclomatic 23) packages/daemon/src/domain/codex-rebuild-permissions.ts:24 — codex-rebuild-permissions.parseCodexPermissionEnvelope 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, 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 · rigspec-schema.validateServicesBlock (cyclomatic 23) · ×1
  • rigspec-schema.validateServicesBlock (cyclomatic 23) packages/daemon/src/domain/rigspec-schema.ts:940 — rigspec-schema.validateServicesBlock 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 · seat-launch-additions.seatLaunchAdditionsAt (cyclomatic 23) · ×1
  • seat-launch-additions.seatLaunchAdditionsAt (cyclomatic 23) packages/daemon/src/domain/seat-launch-additions.ts:290 — seat-launch-additions.seatLaunchAdditionsAt 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, 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 · ClaudeResumeAdapter.verifyResume (cyclomatic 23) · ×1
  • ClaudeResumeAdapter.verifyResume (cyclomatic 23) packages/daemon/src/adapters/claude-resume.ts:204 — ClaudeResumeAdapter.verifyResume 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 · protocol.decodeGatewayMessage (cyclomatic 23) · ×1
  • protocol.decodeGatewayMessage (cyclomatic 23) packages/daemon/src/domain/gateway/protocol.ts:59 — protocol.decodeGatewayMessage 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 · bot-inbox.botInboxProblems (cyclomatic 23) · ×1
  • bot-inbox.botInboxProblems (cyclomatic 23) packages/daemon/src/domain/gateway/slack/bot-inbox.ts:35 — bot-inbox.botInboxProblems has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 46). 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 · quiet-hold-custody.quietHoldCustody (cyclomatic 23) · ×1
  • quiet-hold-custody.quietHoldCustody (cyclomatic 23) packages/daemon/src/domain/quiet-hold-custody.ts:34 — quiet-hold-custody.quietHoldCustody has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, 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 · SessionTransport.sweepHookBridgeOnce (cyclomatic 23) · ×1
  • SessionTransport.sweepHookBridgeOnce (cyclomatic 23) packages/daemon/src/domain/session-transport.ts:2944 — SessionTransport.sweepHookBridgeOnce 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 · SessionTransport.claudeDeliveryObservation (cyclomatic 23) · ×1
  • SessionTransport.claudeDeliveryObservation (cyclomatic 23) packages/daemon/src/domain/session-transport.ts:4405 — SessionTransport.claudeDeliveryObservation 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 · ClaudeCompactionEnforcer.reconcilePreparations (cyclomatic 23) · ×1
  • ClaudeCompactionEnforcer.reconcilePreparations (cyclomatic 23) packages/daemon/src/domain/claude-compaction-enforcer.ts:2016 — ClaudeCompactionEnforcer.reconcilePreparations 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 · native-resume-probe.looksLikeCodexLoginPrompt (cyclomatic 23) · ×1
  • native-resume-probe.looksLikeCodexLoginPrompt (cyclomatic 23) packages/daemon/src/domain/native-resume-probe.ts:1042 — native-resume-probe.looksLikeCodexLoginPrompt has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · daemon-start-lock.archiveIfBeforeBoot (cyclomatic 23) · ×1
  • daemon-start-lock.archiveIfBeforeBoot (cyclomatic 23) packages/cli/src/daemon-start-lock.ts:109 — daemon-start-lock.archiveIfBeforeBoot 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 · broadcast.broadcastCommand (cyclomatic 23) · ×1
  • broadcast.broadcastCommand (cyclomatic 23) packages/cli/src/commands/broadcast.ts:27 — broadcast.broadcastCommand has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to one function literal inside it that branches (line 61). 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 · mcp-server.hostedMembersOf (cyclomatic 23) · ×1
  • mcp-server.hostedMembersOf (cyclomatic 23) packages/cli/src/mcp-server.ts:215 — mcp-server.hostedMembersOf 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, separate the cases: extract each independent branch into its 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-transcript-parser.parseClaudeTranscript (cyclomatic 23) · ×1
  • claude-transcript-parser.parseClaudeTranscript (cyclomatic 23) packages/cli/src/restore-packet/claude-transcript-parser.ts:177 — claude-transcript-parser.parseClaudeTranscript 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 · pi-runner.createPaneCompositor (cyclomatic 23) · ×1
  • pi-runner.createPaneCompositor (cyclomatic 23) REDACTED:198 — pi-runner.createPaneCompositor 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 shape REPEATS in the file: one other method here (pi-runner.createPaneCompositor::paint) 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 · restore-plan-preview.buildRestorePlanPreview.nodes (cyclomatic 23) · ×1
  • restore-plan-preview.buildRestorePlanPreview.nodes (cyclomatic 23) packages/daemon/src/domain/restore-plan-preview.ts:340 — restore-plan-preview.buildRestorePlanPreview.nodes has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · connections-projection.readConnectionConfiguration (cyclomatic 23) · ×1
  • connections-projection.readConnectionConfiguration (cyclomatic 23) packages/daemon/src/domain/gateway/connections-projection.ts:12 — connections-projection.readConnectionConfiguration 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 · relay-inbound.parseInboundEnvelope (cyclomatic 23) · ×1
  • relay-inbound.parseInboundEnvelope (cyclomatic 23) packages/daemon/src/domain/gateway/relay-inbound.ts:179 — relay-inbound.parseInboundEnvelope 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 · usage-series.computeCostView (cyclomatic 23) · ×1
  • usage-series.computeCostView (cyclomatic 23) REDACTED:377 — usage-series.computeCostView 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 · health-context.healthSelectedContext (cyclomatic 23) · ×1
  • health-context.healthSelectedContext (cyclomatic 23) packages/daemon/src/domain/health-context.ts:43 — health-context.healthSelectedContext 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 (add). 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 · SuccessorSessionLauncher.startAgent (cyclomatic 23) · ×1
  • SuccessorSessionLauncher.startAgent (cyclomatic 23) packages/daemon/src/domain/successor-session-launcher.ts:447 — SuccessorSessionLauncher.startAgent 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 · CodexInPlaceRestart.restart (cyclomatic 23) · ×1
  • CodexInPlaceRestart.restart (cyclomatic 23) packages/daemon/src/domain/seat-restart-in-place.ts:295 — CodexInPlaceRestart.restart 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 · codex-usage-reader.converse (cyclomatic 23) · ×1
  • codex-usage-reader.converse (cyclomatic 23) packages/daemon/src/domain/provider/codex-usage-reader.ts:84 — codex-usage-reader.converse has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 113, 95, 103, …). 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 · usage-across-hosts.remoteRefreshLeg (cyclomatic 23) · ×1
  • usage-across-hosts.remoteRefreshLeg (cyclomatic 23) packages/daemon/src/domain/provider/usage-across-hosts.ts:594 — usage-across-hosts.remoteRefreshLeg 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 · seat.seatRoutes.post("/handover/ · ×1
  • seat.seatRoutes.post("/handover/:seatRef") (cyclomatic 23) packages/daemon/src/routes/seat.ts:385 — seat.seatRoutes.post("/handover/:seatRef") 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: seat.seatLifecycleStatus (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 · workspace.workspaceRoutes (cyclomatic 23) · ×1
  • workspace.workspaceRoutes (cyclomatic 23) packages/daemon/src/routes/workspace.ts:34 — workspace.workspaceRoutes has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 85, 37). 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 · scope-audit.scopeAuditRoutes (cyclomatic 23) · ×1
  • scope-audit.scopeAuditRoutes (cyclomatic 23) packages/daemon/src/routes/scope-audit.ts:165 — scope-audit.scopeAuditRoutes has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 201, 168, 353). 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 · telemetry.telemetryRoutes (cyclomatic 23) · ×1
  • telemetry.telemetryRoutes (cyclomatic 23) packages/daemon/src/routes/telemetry.ts:19 — telemetry.telemetryRoutes 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 37, 72, 24, …). 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 · trace-to-root.render_candidates (cyclomatic 23) · ×1
  • trace-to-root.render_candidates (cyclomatic 23) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:407 — trace-to-root.render_candidates 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 · claude-auto-mode.claudeAutoModeStatus (cyclomatic 22) · ×1
  • claude-auto-mode.claudeAutoModeStatus (cyclomatic 22) packages/daemon/src/domain/claude-auto-mode.ts:88 — claude-auto-mode.claudeAutoModeStatus 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 · effective-model-readers.newestPiModel (cyclomatic 22) · ×1
  • effective-model-readers.newestPiModel (cyclomatic 22) packages/daemon/src/domain/model-divergence/effective-model-readers.ts:292 — effective-model-readers.newestPiModel 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 · native-process-lineage.candidatesMatching (cyclomatic 22) · ×1
  • native-process-lineage.candidatesMatching (cyclomatic 22) packages/daemon/src/domain/native-process-lineage.ts:683 — native-process-lineage.candidatesMatching 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 · native-process-lineage.selectNativeProcess (cyclomatic 22) · ×1
  • native-process-lineage.selectNativeProcess (cyclomatic 22) packages/daemon/src/domain/native-process-lineage.ts:714 — native-process-lineage.selectNativeProcess 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 · ResumeMetadataRefresher.captureCodexThreadId (cyclomatic 22) · ×1
  • ResumeMetadataRefresher.captureCodexThreadId (cyclomatic 22) packages/daemon/src/domain/resume-metadata-refresher.ts:335 — ResumeMetadataRefresher.captureCodexThreadId has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (discover, report). 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 · codex-rebuild-permissions.observeCodexRebuildPermissions (cyclomatic 22) · ×1
  • codex-rebuild-permissions.observeCodexRebuildPermissions (cyclomatic 22) packages/daemon/src/domain/codex-rebuild-permissions.ts:93 — codex-rebuild-permissions.observeCodexRebuildPermissions 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, 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 · rigspec-schema.validateContinuityPolicy (cyclomatic 22) · ×1
  • rigspec-schema.validateContinuityPolicy (cyclomatic 22) packages/daemon/src/domain/rigspec-schema.ts:1156 — rigspec-schema.validateContinuityPolicy 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 · EnvironmentPlatform.project (cyclomatic 22) · ×1
  • EnvironmentPlatform.project (cyclomatic 22) packages/daemon/src/domain/environment-platform.ts:173 — EnvironmentPlatform.project 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 · channel-map.validateChannelMap (cyclomatic 22) · ×1
  • channel-map.validateChannelMap (cyclomatic 22) packages/daemon/src/domain/gateway/slack/channel-map.ts:49 — channel-map.validateChannelMap 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 · SeatStructuralActivityService.pollAllRunningTmuxSeats (cyclomatic 22) · ×1
  • SeatStructuralActivityService.pollAllRunningTmuxSeats (cyclomatic 22) packages/daemon/src/domain/seat-structural-activity-service.ts:183 — SeatStructuralActivityService.pollAllRunningTmuxSeats has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 212, 231). 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 · node-inventory.attachTerminalActivityAndWork (cyclomatic 22) · ×1
  • node-inventory.attachTerminalActivityAndWork (cyclomatic 22) REDACTED:1599 — node-inventory.attachTerminalActivityAndWork 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 one function literal inside it that branches (line 1606). 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 · session-transport.findClaudeComposer (cyclomatic 22) · ×1
  • session-transport.findClaudeComposer (cyclomatic 22) packages/daemon/src/domain/session-transport.ts:420 — session-transport.findClaudeComposer 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 · terminal-policy.parseTerminalPolicy (cyclomatic 22) · ×1
  • terminal-policy.parseTerminalPolicy (cyclomatic 22) packages/daemon/src/domain/terminal-policy.ts:20 — terminal-policy.parseTerminalPolicy 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, 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 · check-runner.launch (cyclomatic 22) · ×1
  • check-runner.launch (cyclomatic 22) docs/reference/runner-conformance/check-runner.mjs:182 — check-runner.launch has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 230, 225, 226, …). 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 · bundle-source.parseGitHubBundleLink (cyclomatic 22) · ×1
  • bundle-source.parseGitHubBundleLink (cyclomatic 22) packages/cli/src/lib/bundle-source.ts:31 — bundle-source.parseGitHubBundleLink 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, 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 · bundle-check.checkBundleFolder (cyclomatic 22) · ×1
  • bundle-check.checkBundleFolder (cyclomatic 22) packages/cli/src/lib/bundle-check.ts:32 — bundle-check.checkBundleFolder has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (bundle-check.checkBundleFolder::agent) 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 · host-bindings.loadHostBindings (cyclomatic 22) · ×1
  • host-bindings.loadHostBindings (cyclomatic 22) packages/cli/src/host-bindings.ts:46 — host-bindings.loadHostBindings 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 · reconstruction-reader.readReconstruction.materialize (cyclomatic 22) · ×1
  • reconstruction-reader.readReconstruction.materialize (cyclomatic 22) packages/cli/src/lib/reconstruction-reader.ts:243 — reconstruction-reader.readReconstruction.materialize 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 · down.confirmOwnRig (cyclomatic 22) · ×1
  • down.confirmOwnRig (cyclomatic 22) packages/cli/src/commands/down.ts:30 — down.confirmOwnRig 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 · mcp-server.namedSeats (cyclomatic 22) · ×1
  • mcp-server.namedSeats (cyclomatic 22) packages/cli/src/mcp-server.ts:865 — mcp-server.namedSeats 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 · decisions.parseTemplate (cyclomatic 22) · ×1
  • decisions.parseTemplate (cyclomatic 22) packages/cli/src/decisions/decisions.ts:81 — decisions.parseTemplate 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 · queue.waitForDeliveryOutcome (cyclomatic 22) · ×1
  • queue.waitForDeliveryOutcome (cyclomatic 22) packages/cli/src/commands/queue.ts:230 — queue.waitForDeliveryOutcome 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 · extract-surface.extractFile · ×1
  • extract-surface.extractFile::evalExpr (cyclomatic 22) packages/cli/src/release-surface/extract-surface.ts:130 — extract-surface.extractFile::evalExpr 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 · CodexRuntimeAdapter.removeCodexActivityHooks (cyclomatic 22) · ×1
  • CodexRuntimeAdapter.removeCodexActivityHooks (cyclomatic 22) packages/daemon/src/adapters/codex-runtime-adapter.ts:767 — CodexRuntimeAdapter.removeCodexActivityHooks has cyclomatic complexity 22 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bundle-types.validatePodBundleManifest (cyclomatic 22) · ×1
  • bundle-types.validatePodBundleManifest (cyclomatic 22) packages/daemon/src/domain/bundle-types.ts:487 — bundle-types.validatePodBundleManifest 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 · topology-defaults-installer.installTopologyDefaults (cyclomatic 22) · ×1
  • topology-defaults-installer.installTopologyDefaults (cyclomatic 22) packages/daemon/src/domain/topology-defaults-installer.ts:52 — topology-defaults-installer.installTopologyDefaults has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 8 function items inside it that branch (copyIfAbsent, ensureDir, section, …). 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 · PodRigInstantiator.computePodLaunchOrder (cyclomatic 22) · ×1
  • PodRigInstantiator.computePodLaunchOrder (cyclomatic 22) packages/daemon/src/domain/rigspec-instantiator.ts:1960 — PodRigInstantiator.computePodLaunchOrder 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 · current-work.evaluateCreateScope (cyclomatic 22) · ×1
  • current-work.evaluateCreateScope (cyclomatic 22) packages/daemon/src/domain/current-work.ts:486 — current-work.evaluateCreateScope 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 · health-policy.validateHealthPolicy (cyclomatic 22) · ×1
  • health-policy.validateHealthPolicy (cyclomatic 22) packages/daemon/src/domain/health-policy.ts:41 — health-policy.validateHealthPolicy 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, 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 · pi-usage-entries-store.validPiUsageFact (cyclomatic 22) · ×1
  • pi-usage-entries-store.validPiUsageFact (cyclomatic 22) packages/daemon/src/domain/pi-usage-entries-store.ts:59 — pi-usage-entries-store.validPiUsageFact has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 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 · health-context.healthAuthority (cyclomatic 22) · ×1
  • health-context.healthAuthority (cyclomatic 22) packages/daemon/src/domain/health-context.ts:90 — health-context.healthAuthority has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (belongs, 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 · fleet-scopes.readHostScopes (cyclomatic 22) · ×1
  • fleet-scopes.readHostScopes (cyclomatic 22) packages/daemon/src/domain/hosts/fleet-scopes.ts:177 — fleet-scopes.readHostScopes 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 · SeatLifecycleService.continueStartupUnchecked (cyclomatic 22) · ×1
  • SeatLifecycleService.continueStartupUnchecked (cyclomatic 22) packages/daemon/src/domain/seat-lifecycle-service.ts:1389 — SeatLifecycleService.continueStartupUnchecked 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 · SeatLifecycleService.planFresh (cyclomatic 22) · ×1
  • SeatLifecycleService.planFresh (cyclomatic 22) packages/daemon/src/domain/seat-lifecycle-service.ts:1569 — SeatLifecycleService.planFresh has cyclomatic complexity 22 (threshold 15). 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · claude-token-usage.claudeTokenUsageReader.<returned closure> (cyclomatic 22) · ×1
  • claude-token-usage.claudeTokenUsageReader.<returned closure> (cyclomatic 22) packages/daemon/src/domain/provider/claude-token-usage.ts:53 — claude-token-usage.claudeTokenUsageReader.<returned closure> 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 · claude-seat-switch.checkClaudeSeat (cyclomatic 22) · ×1
  • claude-seat-switch.checkClaudeSeat (cyclomatic 22) packages/daemon/src/domain/provider/claude-seat-switch.ts:21 — claude-seat-switch.checkClaudeSeat 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 · RestoreCheckService.validateHostInfraDeclaration (cyclomatic 22) · ×1
  • RestoreCheckService.validateHostInfraDeclaration (cyclomatic 22) packages/daemon/src/domain/restore-check-service.ts:724 — RestoreCheckService.validateHostInfraDeclaration has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 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 · RigLifecycleService.unclaimSession (cyclomatic 22) · ×1
  • RigLifecycleService.unclaimSession (cyclomatic 22) packages/daemon/src/domain/rig-lifecycle-service.ts:188 — RigLifecycleService.unclaimSession has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 3 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 · RigSpecExporter.memberStartupSource (cyclomatic 22) · ×1
  • RigSpecExporter.memberStartupSource (cyclomatic 22) packages/daemon/src/domain/rigspec-exporter.ts:63 — RigSpecExporter.memberStartupSource 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, 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 · TerminalService.followView (cyclomatic 22) · ×1
  • TerminalService.followView (cyclomatic 22) packages/daemon/src/domain/terminal/terminal-service.ts:222 — TerminalService.followView 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 · TerminalService.openView (cyclomatic 22) · ×1
  • TerminalService.openView (cyclomatic 22) packages/daemon/src/domain/terminal/terminal-service.ts:333 — TerminalService.openView 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 · TerminalService.resolveView (cyclomatic 22) · ×1
  • TerminalService.resolveView (cyclomatic 22) packages/daemon/src/domain/terminal/terminal-service.ts:533 — TerminalService.resolveView 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 · watchdog-delivery.makeWatchdogDeliver · ×1
  • watchdog-delivery.makeWatchdogDeliver::deliver (cyclomatic 22) packages/daemon/src/domain/watchdog-delivery.ts:24 — watchdog-delivery.makeWatchdogDeliver::deliver 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 · events.eventsRoute.get("/") (cyclomatic 22) · ×1
  • events.eventsRoute.get("/") (cyclomatic 22) packages/daemon/src/routes/events.ts:19 — events.eventsRoute.get("/") has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 32, 39). 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 · packages.packagesRoutes.post("/install") (cyclomatic 22) · ×1
  • packages.packagesRoutes.post("/install") (cyclomatic 22) packages/daemon/src/routes/packages.ts:182 — packages.packagesRoutes.post("/install") 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 · transcripts.transcriptRoutes (cyclomatic 22) · ×1
  • transcripts.transcriptRoutes (cyclomatic 22) packages/daemon/src/routes/transcripts.ts:155 — transcripts.transcriptRoutes 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 3 function literals inside it that branch (lines 158, 207, 274). 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 · hosts.hostsRoutes · ×1
  • hosts.hostsRoutes::settlePairRequest (cyclomatic 22) packages/daemon/src/routes/hosts.ts:292 — hosts.hostsRoutes::settlePairRequest 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 · execution-model.executionSliceStripLines (cyclomatic 22) · ×1
  • execution-model.executionSliceStripLines (cyclomatic 22) packages/tui/src/execution/execution-model.ts:853 — execution-model.executionSliceStripLines 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, 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 · reading.fileLines (cyclomatic 22) · ×1
  • reading.fileLines (cyclomatic 22) packages/tui/src/reading.ts:53 — reading.fileLines has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 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 · live-events.subscribeActivityEvents.connect (cyclomatic 22) · ×1
  • live-events.subscribeActivityEvents.connect (cyclomatic 22) packages/tui/src/live-events.ts:40 — live-events.subscribeActivityEvents.connect has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 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 · useActivityFeed.useActivityFeed (cyclomatic 22) · ×1
  • useActivityFeed.useActivityFeed (cyclomatic 22) packages/ui/src/hooks/useActivityFeed.ts:26 — useActivityFeed.useActivityFeed 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 one function literal inside it that branches (line 32). 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 · SessionPreviewPane.SessionPreviewPane (cyclomatic 22) · ×1
  • SessionPreviewPane.SessionPreviewPane (cyclomatic 22) packages/ui/src/components/preview/SessionPreviewPane.tsx:46 — SessionPreviewPane.SessionPreviewPane has cyclomatic complexity 22 (threshold 15). Of this number, 17 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 · EvidenceOpener.EvidenceOpener (cyclomatic 22) · ×1
  • EvidenceOpener.EvidenceOpener (cyclomatic 22) packages/ui/src/components/review/EvidenceOpener.tsx:58 — EvidenceOpener.EvidenceOpener 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 · migrate-telemetry-state-0.5.9.readLibraryConfig (cyclomatic 22) · ×1
  • migrate-telemetry-state-0.5.9.readLibraryConfig (cyclomatic 22) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:227 — migrate-telemetry-state-0.5.9.readLibraryConfig 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: migrate-telemetry-state-0.5.9.verificationReceipt (cyclomatic 26) 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 · rig-repository.isStoredServices (cyclomatic 21) · ×1
  • rig-repository.isStoredServices (cyclomatic 21) packages/daemon/src/domain/rig-repository.ts:135 — rig-repository.isStoredServices 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.
D1 · Cyclomatic Complexity · skill-catalog.scanCatalog (cyclomatic 21) · ×1
  • skill-catalog.scanCatalog (cyclomatic 21) packages/daemon/src/domain/skill-catalog.ts:301 — skill-catalog.scanCatalog has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 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 · InboundRouter.retryOwnDeadLetters (cyclomatic 21) · ×1
  • InboundRouter.retryOwnDeadLetters (cyclomatic 21) packages/daemon/src/domain/gateway/slack/inbound.ts:1006 — InboundRouter.retryOwnDeadLetters 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 · relay-config.evaluateRelayCandidate (cyclomatic 21) · ×1
  • relay-config.evaluateRelayCandidate (cyclomatic 21) packages/daemon/src/domain/gateway/relay-config.ts:189 — relay-config.evaluateRelayCandidate 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 · project-catalog.inferCatalogProject (cyclomatic 21) · ×1
  • project-catalog.inferCatalogProject (cyclomatic 21) packages/daemon/src/domain/workspace/project-catalog.ts:74 — project-catalog.inferCatalogProject 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 · SeatActivityService.pollAllRunningTmuxSeats (cyclomatic 21) · ×1
  • SeatActivityService.pollAllRunningTmuxSeats (cyclomatic 21) packages/daemon/src/domain/seat-activity-service.ts:400 — SeatActivityService.pollAllRunningTmuxSeats 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 · community-harness-presets.communityHarnessLabel (cyclomatic 21) · ×1
  • community-harness-presets.communityHarnessLabel (cyclomatic 21) packages/daemon/src/domain/community-harness-presets.ts:230 — community-harness-presets.communityHarnessLabel 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 · node-inventory.computeRecoveryGuidance (cyclomatic 21) · ×1
  • node-inventory.computeRecoveryGuidance (cyclomatic 21) REDACTED:285 — node-inventory.computeRecoveryGuidance 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 · node-inventory.getNodeDetail (cyclomatic 21) · ×1
  • node-inventory.getNodeDetail (cyclomatic 21) REDACTED:1271 — node-inventory.getNodeDetail 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 · queue-wake-ladder.ensureEscalationRow (cyclomatic 21) · ×1
  • queue-wake-ladder.ensureEscalationRow (cyclomatic 21) packages/daemon/src/domain/queue-wake-ladder.ts:1863 — queue-wake-ladder.ensureEscalationRow 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 · QueueRepository.performWakeSend (cyclomatic 21) · ×1
  • QueueRepository.performWakeSend (cyclomatic 21) packages/daemon/src/domain/queue-repository.ts:2207 — QueueRepository.performWakeSend 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 · SessionTransport.preWaitForIdle (cyclomatic 21) · ×1
  • SessionTransport.preWaitForIdle (cyclomatic 21) packages/daemon/src/domain/session-transport.ts:3309 — SessionTransport.preWaitForIdle 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 · queue-receipt.buildWriteReceipt (cyclomatic 21) · ×1
  • queue-receipt.buildWriteReceipt (cyclomatic 21) packages/cli/src/queue-receipt.ts:234 — queue-receipt.buildWriteReceipt has cyclomatic complexity 21 (threshold 15). Of this number, 17 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 · bundle-source.checkGitHubBundleRefs (cyclomatic 21) · ×1
  • bundle-source.checkGitHubBundleRefs (cyclomatic 21) packages/cli/src/lib/bundle-source.ts:129 — bundle-source.checkGitHubBundleRefs has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (agent, contained, a function literal at line 133). 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 · capture.runCrossHostCapture (cyclomatic 21) · ×1
  • capture.runCrossHostCapture (cyclomatic 21) packages/cli/src/commands/capture.ts:303 — capture.runCrossHostCapture 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 · scope-fs.updateMappedFrontmatter (cyclomatic 21) · ×1
  • scope-fs.updateMappedFrontmatter (cyclomatic 21) packages/cli/src/lib/scope/scope-fs.ts:197 — scope-fs.updateMappedFrontmatter 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 · work-install.resolveWorkProject (cyclomatic 21) · ×1
  • work-install.resolveWorkProject (cyclomatic 21) packages/cli/src/lib/work-install.ts:228 — work-install.resolveWorkProject 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 · mcp-server.requestsAdvisoryFor (cyclomatic 21) · ×1
  • mcp-server.requestsAdvisoryFor (cyclomatic 21) packages/cli/src/mcp-server.ts:267 — mcp-server.requestsAdvisoryFor 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 · mcp-http.startMcpHttpServer.handle (cyclomatic 21) · ×1
  • mcp-http.startMcpHttpServer.handle (cyclomatic 21) REDACTED:478 — mcp-http.startMcpHttpServer.handle 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 · network.networkCommand (cyclomatic 21) · ×1
  • network.networkCommand (cyclomatic 21) packages/cli/src/commands/network.ts:67 — network.networkCommand has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 122, finish, a function literal at line 100, …). 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 · DecisionRun.decide (cyclomatic 21) · ×1
  • DecisionRun.decide (cyclomatic 21) packages/cli/src/decisions/decisions.ts:228 — DecisionRun.decide 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 · stream-consumer.toDisposition (cyclomatic 21) · ×1
  • stream-consumer.toDisposition (cyclomatic 21) packages/cli/src/decisions/stream-consumer.ts:67 — stream-consumer.toDisposition has cyclomatic complexity 21 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · shrink.shrinkCommand (cyclomatic 21) · ×1
  • shrink.shrinkCommand (cyclomatic 21) packages/cli/src/commands/shrink.ts:29 — shrink.shrinkCommand has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 44, getClient). 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 · stream-outcome.streamOutcome (cyclomatic 21) · ×1
  • stream-outcome.streamOutcome (cyclomatic 21) packages/cli/src/commands/stream-outcome.ts:102 — stream-outcome.streamOutcome 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 · workflow-render.composeAttentionRollup (cyclomatic 21) · ×1
  • workflow-render.composeAttentionRollup (cyclomatic 21) packages/cli/src/commands/workflow-render.ts:283 — workflow-render.composeAttentionRollup 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 · activity-relay.buildOpenRigPayload (cyclomatic 21) · ×1
  • activity-relay.buildOpenRigPayload (cyclomatic 21) REDACTED:83 — activity-relay.buildOpenRigPayload 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 · ClaudeCodeAdapter.launchHarness · ×1
  • ClaudeCodeAdapter.launchHarness::sendClassic (cyclomatic 21) packages/daemon/src/adapters/claude-code-adapter.ts:391 — ClaudeCodeAdapter.launchHarness::sendClassic 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 shape REPEATS in the file: one other method here (ClaudeCodeAdapter.launchHarness) 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 · CodexRuntimeAdapter.dismissSkippableCodexUpdatePrompt (cyclomatic 21) · ×1
  • CodexRuntimeAdapter.dismissSkippableCodexUpdatePrompt (cyclomatic 21) packages/daemon/src/adapters/codex-runtime-adapter.ts:1387 — CodexRuntimeAdapter.dismissSkippableCodexUpdatePrompt 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 · codex-runtime-adapter.upsertManagedCodexConfigFragment (cyclomatic 21) · ×1
  • codex-runtime-adapter.upsertManagedCodexConfigFragment (cyclomatic 21) packages/daemon/src/adapters/codex-runtime-adapter.ts:2906 — codex-runtime-adapter.upsertManagedCodexConfigFragment has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RunnerCore.finishManagedWake (cyclomatic 21) · ×1
  • RunnerCore.finishManagedWake (cyclomatic 21) REDACTED:1168 — RunnerCore.finishManagedWake 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 · pi-runner.connectPiRunnerChannel (cyclomatic 21) · ×1
  • pi-runner.connectPiRunnerChannel (cyclomatic 21) REDACTED:2185 — pi-runner.connectPiRunnerChannel 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 · bundle-types.serializePodBundleManifest (cyclomatic 21) · ×1
  • bundle-types.serializePodBundleManifest (cyclomatic 21) packages/daemon/src/domain/bundle-types.ts:524 — bundle-types.serializePodBundleManifest 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 · current-work.deriveRole (cyclomatic 21) · ×1
  • current-work.deriveRole (cyclomatic 21) packages/daemon/src/domain/current-work.ts:64 — current-work.deriveRole has cyclomatic complexity 21 (threshold 15). Of this number, 15 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 · WorkflowInstanceStore.create (cyclomatic 21) · ×1
  • WorkflowInstanceStore.create (cyclomatic 21) packages/daemon/src/domain/workflow-instance-store.ts:137 — WorkflowInstanceStore.create 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 · SeatAttentionReconciler.getDerivedAttentionOutcome (cyclomatic 21) · ×1
  • SeatAttentionReconciler.getDerivedAttentionOutcome (cyclomatic 21) packages/daemon/src/domain/seat-attention-reconciler.ts:876 — SeatAttentionReconciler.getDerivedAttentionOutcome has cyclomatic complexity 21 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RestoreOrchestrator.stopAutomaticOccupant (cyclomatic 21) · ×1
  • RestoreOrchestrator.stopAutomaticOccupant (cyclomatic 21) packages/daemon/src/domain/restore-orchestrator.ts:1042 — RestoreOrchestrator.stopAutomaticOccupant has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 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 · fleet-scopes.remoteCounts (cyclomatic 21) · ×1
  • fleet-scopes.remoteCounts (cyclomatic 21) packages/daemon/src/domain/hosts/fleet-scopes.ts:157 — fleet-scopes.remoteCounts 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 · parked-query.diagnoseSeatParked (cyclomatic 21) · ×1
  • parked-query.diagnoseSeatParked (cyclomatic 21) packages/daemon/src/domain/parked-query.ts:128 — parked-query.diagnoseSeatParked has cyclomatic complexity 21 (threshold 15). Of this number, 16 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 · PiCompactionService.attemptState (cyclomatic 21) · ×1
  • PiCompactionService.attemptState (cyclomatic 21) packages/daemon/src/domain/pi-compaction-service.ts:218 — PiCompactionService.attemptState 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 · SeatHandoverService.deliverRebuildPrimingPacket (cyclomatic 21) · ×1
  • SeatHandoverService.deliverRebuildPrimingPacket (cyclomatic 21) packages/daemon/src/domain/seat-handover-service.ts:1607 — SeatHandoverService.deliverRebuildPrimingPacket 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 · ProgressIndexer.parseProgressFile (cyclomatic 21) · ×1
  • ProgressIndexer.parseProgressFile (cyclomatic 21) packages/daemon/src/domain/progress/progress-indexer.ts:174 — ProgressIndexer.parseProgressFile 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 · require-sender-identity.parseIdentityPrincipal (cyclomatic 21) · ×1
  • require-sender-identity.parseIdentityPrincipal (cyclomatic 21) packages/daemon/src/routes/require-sender-identity.ts:229 — require-sender-identity.parseIdentityPrincipal 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, 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 · source-watch.shallowWatches (cyclomatic 21) · ×1
  • source-watch.shallowWatches (cyclomatic 21) packages/daemon/src/domain/proof/source-watch.ts:44 — source-watch.shallowWatches 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SeatLifecycleService.setEffort (cyclomatic 21) · ×1
  • SeatLifecycleService.setEffort (cyclomatic 21) packages/daemon/src/domain/seat-lifecycle-service.ts:696 — SeatLifecycleService.setEffort 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 · rig-edge-ops.addRigEdge (cyclomatic 21) · ×1
  • rig-edge-ops.addRigEdge (cyclomatic 21) packages/daemon/src/domain/rig-edge-ops.ts:110 — rig-edge-ops.addRigEdge 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 114, 128). 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 · RigTeardownOrchestrator.recordAlreadyStoppedIntent (cyclomatic 21) · ×1
  • RigTeardownOrchestrator.recordAlreadyStoppedIntent (cyclomatic 21) packages/daemon/src/domain/rig-teardown.ts:388 — RigTeardownOrchestrator.recordAlreadyStoppedIntent 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RexAgentStatusRelay.reportNow (cyclomatic 21) · ×1
  • RexAgentStatusRelay.reportNow (cyclomatic 21) packages/daemon/src/domain/terminal/rex-agent-status.ts:141 — RexAgentStatusRelay.reportNow has cyclomatic complexity 21 (threshold 15). Of this number, 15 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 · workflow-boot-sweep.runWorkflowBootSweep (cyclomatic 21) · ×1
  • workflow-boot-sweep.runWorkflowBootSweep (cyclomatic 21) packages/daemon/src/domain/workflow-boot-sweep.ts:61 — workflow-boot-sweep.runWorkflowBootSweep 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 · rigspec.rigspecImportRoutes.post("/materialize") (cyclomatic 21) · ×1
  • rigspec.rigspecImportRoutes.post("/materialize") (cyclomatic 21) packages/daemon/src/routes/rigspec.ts:225 — rigspec.rigspecImportRoutes.post("/materialize") 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 · seat.seatRoutes.get("/status/ · ×1
  • seat.seatRoutes.get("/status/:seatRef") (cyclomatic 21) packages/daemon/src/routes/seat.ts:158 — seat.seatRoutes.get("/status/:seatRef") 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: seat.seatLifecycleStatus (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 · views.viewsRoutes (cyclomatic 21) · ×1
  • views.viewsRoutes (cyclomatic 21) packages/daemon/src/routes/views.ts:19 — views.viewsRoutes has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 113, errorResponse, a function literal at line 42, …). 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 · watchdog.watchdogRoutes · ×1
  • watchdog.watchdogRoutes::errorResponse (cyclomatic 21) packages/daemon/src/routes/watchdog.ts:44 — watchdog.watchdogRoutes::errorResponse 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 · proof.proofRoutes · ×1
  • proof.proofRoutes::target (cyclomatic 21) packages/daemon/src/routes/proof.ts:53 — proof.proofRoutes::target 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 · scope-approve.scopeApproveRoutes (cyclomatic 21) · ×1
  • scope-approve.scopeApproveRoutes (cyclomatic 21) packages/daemon/src/routes/scope-approve.ts:12 — scope-approve.scopeApproveRoutes has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 15, 51). 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 · pairing.decideOnce (cyclomatic 21) · ×1
  • pairing.decideOnce (cyclomatic 21) packages/tui/src/config/pairing.ts:82 — pairing.decideOnce has cyclomatic complexity 21 (threshold 15). 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, separate the cases: extract each independent branch into its 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.locationKey (cyclomatic 21) · ×1
  • state.locationKey (cyclomatic 21) packages/tui/src/state.ts:417 — state.locationKey has cyclomatic complexity 21 (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 · input.resolveKeyAction (cyclomatic 21) · ×1
  • input.resolveKeyAction (cyclomatic 21) packages/tui/src/input.ts:173 — input.resolveKeyAction 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 · SyntaxHighlight.tokenizeWithKeywordsAndComments (cyclomatic 21) · ×1
  • SyntaxHighlight.tokenizeWithKeywordsAndComments (cyclomatic 21) packages/ui/src/components/markdown/SyntaxHighlight.tsx:114 — SyntaxHighlight.tokenizeWithKeywordsAndComments 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 · waiter (cyclomatic 21) · ×1
  • waiter (cyclomatic 21) REDACTED:101 — waiter 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 · (anonymous) (cyclomatic 21) · ×1
  • (anonymous) (cyclomatic 21) packages/daemon/assets/claude-statusline-context.cjs:26 — (anonymous) 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 · input-read-diagnostic.inputReadDiagnostic (cyclomatic 20) · ×1
  • input-read-diagnostic.inputReadDiagnostic (cyclomatic 20) packages/daemon/src/domain/input-read-diagnostic.ts:18 — input-read-diagnostic.inputReadDiagnostic 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 · community-harness-launch-result.readLaunchResult (cyclomatic 20) · ×1
  • community-harness-launch-result.readLaunchResult (cyclomatic 20) packages/daemon/src/domain/community-harness-launch-result.ts:42 — community-harness-launch-result.readLaunchResult 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 · agent-activity-store.hookEventState (cyclomatic 20) · ×1
  • agent-activity-store.hookEventState (cyclomatic 20) packages/daemon/src/domain/agent-activity-store.ts:591 — agent-activity-store.hookEventState 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 · native-process-arguments.readNativeProcessArguments (cyclomatic 20) · ×1
  • native-process-arguments.readNativeProcessArguments (cyclomatic 20) packages/daemon/src/domain/native-process-arguments.ts:139 — native-process-arguments.readNativeProcessArguments 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 · OutboxHandler.retain (cyclomatic 20) · ×1
  • OutboxHandler.retain (cyclomatic 20) packages/daemon/src/domain/outbox-handler.ts:460 — OutboxHandler.retain 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 462). 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 · rig-repository.isStoredSessionSource (cyclomatic 20) · ×1
  • rig-repository.isStoredSessionSource (cyclomatic 20) packages/daemon/src/domain/rig-repository.ts:50 — rig-repository.isStoredSessionSource 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 · skill-catalog.resolvePluginSkills (cyclomatic 20) · ×1
  • skill-catalog.resolvePluginSkills (cyclomatic 20) packages/daemon/src/domain/skill-catalog.ts:483 — skill-catalog.resolvePluginSkills 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 · ClaudeManagedLaunch.credentialPrecedence (cyclomatic 20) · ×1
  • ClaudeManagedLaunch.credentialPrecedence (cyclomatic 20) packages/daemon/src/domain/claude-managed-launch.ts:193 — ClaudeManagedLaunch.credentialPrecedence 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 · ClaudeResumeAdapter.resume · ×1
  • ClaudeResumeAdapter.resume::sendClassic (cyclomatic 20) packages/daemon/src/adapters/claude-resume.ts:159 — ClaudeResumeAdapter.resume::sendClassic 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 (ClaudeResumeAdapter.resume) 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 · tmux-server-selection.readRecord (cyclomatic 20) · ×1
  • tmux-server-selection.readRecord (cyclomatic 20) packages/daemon/src/domain/tmux-server-selection.ts:88 — tmux-server-selection.readRecord 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 · ThreadCoverageStore.read (cyclomatic 20) · ×1
  • ThreadCoverageStore.read (cyclomatic 20) packages/daemon/src/domain/gateway/slack/state-store.ts:416 — ThreadCoverageStore.read 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 · inbound.ingestDecision (cyclomatic 20) · ×1
  • inbound.ingestDecision (cyclomatic 20) packages/daemon/src/domain/gateway/slack/inbound.ts:134 — inbound.ingestDecision 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 · compose.composeDelivered.items (cyclomatic 20) · ×1
  • compose.composeDelivered.items (cyclomatic 20) REDACTED:561 — compose.composeDelivered.items has cyclomatic complexity 20 (threshold 15). 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: 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 · lifecycle-manifest.validateMissionComposition (cyclomatic 20) · ×1
  • lifecycle-manifest.validateMissionComposition (cyclomatic 20) packages/daemon/src/domain/lifecycle-manifest.ts:30 — lifecycle-manifest.validateMissionComposition 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 45). 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 · QueueRepository.fallbackLineStart (cyclomatic 20) · ×1
  • QueueRepository.fallbackLineStart (cyclomatic 20) packages/daemon/src/domain/queue-repository.ts:5977 — QueueRepository.fallbackLineStart has cyclomatic complexity 20 (threshold 15). 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, separate the cases: extract each independent branch into its 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-transport.readInputBox (cyclomatic 20) · ×1
  • session-transport.readInputBox (cyclomatic 20) packages/daemon/src/domain/session-transport.ts:1981 — session-transport.readInputBox 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 is NOT this file's highest cyclomatic complexity: session-transport.bridgeable (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 · atomic-text-write.writeTextAtomically (cyclomatic 20) · ×1
  • atomic-text-write.writeTextAtomically (cyclomatic 20) packages/cli/src/atomic-text-write.ts:6 — atomic-text-write.writeTextAtomically 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 · broadcast.renderBroadcastResults (cyclomatic 20) · ×1
  • broadcast.renderBroadcastResults (cyclomatic 20) packages/cli/src/commands/broadcast.ts:224 — broadcast.renderBroadcastResults 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 · capture.captureCommand (cyclomatic 20) · ×1
  • capture.captureCommand (cyclomatic 20) packages/cli/src/commands/capture.ts:154 — capture.captureCommand 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 222). 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 · reconstruction-reader.parseReconstructionJson (cyclomatic 20) · ×1
  • reconstruction-reader.parseReconstructionJson (cyclomatic 20) packages/cli/src/lib/reconstruction-reader.ts:55 — reconstruction-reader.parseReconstructionJson has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (value, quoted, space). 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 · recap-seat.resolveRecapSeat (cyclomatic 20) · ×1
  • recap-seat.resolveRecapSeat (cyclomatic 20) packages/cli/src/recap-seat.ts:14 — recap-seat.resolveRecapSeat 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, 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 · destroy-helpers.executeDestroy (cyclomatic 20) · ×1
  • destroy-helpers.executeDestroy (cyclomatic 20) packages/cli/src/destroy-helpers.ts:182 — destroy-helpers.executeDestroy 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 · gateway.daemonHumanReadiness (cyclomatic 20) · ×1
  • gateway.daemonHumanReadiness (cyclomatic 20) packages/cli/src/commands/gateway.ts:91 — gateway.daemonHumanReadiness 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 · seat.runSeatHandover (cyclomatic 20) · ×1
  • seat.runSeatHandover (cyclomatic 20) packages/cli/src/commands/seat.ts:1843 — seat.runSeatHandover 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 · terminal-window.defaultWindowDeps.columns (cyclomatic 20) · ×1
  • terminal-window.defaultWindowDeps.columns (cyclomatic 20) packages/cli/src/terminal-window.ts:67 — terminal-window.defaultWindowDeps.columns has cyclomatic complexity 20 (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 · front-door.openMissionControl (cyclomatic 20) · ×1
  • front-door.openMissionControl (cyclomatic 20) packages/cli/src/front-door.ts:225 — front-door.openMissionControl 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 · activity-relay.wallClockReset (cyclomatic 20) · ×1
  • activity-relay.wallClockReset (cyclomatic 20) REDACTED:199 — activity-relay.wallClockReset 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 · ClaudeCodeAdapter.provisionManagedBootstrap (cyclomatic 20) · ×1
  • ClaudeCodeAdapter.provisionManagedBootstrap (cyclomatic 20) packages/daemon/src/adapters/claude-code-adapter.ts:1144 — ClaudeCodeAdapter.provisionManagedBootstrap 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 · codex-filesystem-preflight.compareRequirements (cyclomatic 20) · ×1
  • codex-filesystem-preflight.compareRequirements (cyclomatic 20) packages/daemon/src/domain/codex-filesystem-preflight.ts:131 — codex-filesystem-preflight.compareRequirements 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 · codex-core-plugin-install.codexCorePluginEnablement (cyclomatic 20) · ×1
  • codex-core-plugin-install.codexCorePluginEnablement (cyclomatic 20) packages/daemon/src/domain/codex-core-plugin-install.ts:42 — codex-core-plugin-install.codexCorePluginEnablement 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 · workflow-projector.readAlreadyClosedRecord (cyclomatic 20) · ×1
  • workflow-projector.readAlreadyClosedRecord (cyclomatic 20) packages/daemon/src/domain/workflow-projector.ts:235 — workflow-projector.readAlreadyClosedRecord 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, 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 · MissionControlWriteContract.resolveParked (cyclomatic 20) · ×1
  • MissionControlWriteContract.resolveParked (cyclomatic 20) packages/daemon/src/domain/mission-control/mission-control-write-contract.ts:473 — MissionControlWriteContract.resolveParked has cyclomatic complexity 20 (threshold 15). Of this number, 15 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 · relay-inbound.createRelayInboundHandler.listOutbox (cyclomatic 20) · ×1
  • relay-inbound.createRelayInboundHandler.listOutbox (cyclomatic 20) packages/daemon/src/domain/gateway/relay-inbound.ts:950 — relay-inbound.createRelayInboundHandler.listOutbox 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 · watchdog-policy-engine.parseWatchdogSpec (cyclomatic 20) · ×1
  • watchdog-policy-engine.parseWatchdogSpec (cyclomatic 20) packages/daemon/src/domain/watchdog-policy-engine.ts:939 — watchdog-policy-engine.parseWatchdogSpec 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 · seat-cwd-preparation.projectionCopyDirectory (cyclomatic 20) · ×1
  • seat-cwd-preparation.projectionCopyDirectory (cyclomatic 20) packages/daemon/src/domain/seat-cwd-preparation.ts:81 — seat-cwd-preparation.projectionCopyDirectory 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 · SeatLifecycleService.effortReport (cyclomatic 20) · ×1
  • SeatLifecycleService.effortReport (cyclomatic 20) packages/daemon/src/domain/seat-lifecycle-service.ts:760 — SeatLifecycleService.effortReport 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 · SeatLifecycleService.inPlaceTarget (cyclomatic 20) · ×1
  • SeatLifecycleService.inPlaceTarget (cyclomatic 20) packages/daemon/src/domain/seat-lifecycle-service.ts:2035 — SeatLifecycleService.inPlaceTarget 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 · queue-retention.pruneEvents (cyclomatic 20) · ×1
  • queue-retention.pruneEvents (cyclomatic 20) packages/daemon/src/domain/queue-retention.ts:458 — queue-retention.pruneEvents 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, 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 · RestoreCheckService.hasActivityRelayHook (cyclomatic 20) · ×1
  • RestoreCheckService.hasActivityRelayHook (cyclomatic 20) packages/daemon/src/domain/restore-check-service.ts:1379 — RestoreCheckService.hasActivityRelayHook 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 2 function literals inside it that branch (lines 1385, 1398). 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-audit.auditSkills.entries (cyclomatic 20) · ×1
  • skill-audit.auditSkills.entries (cyclomatic 20) packages/daemon/src/domain/skill-audit.ts:244 — skill-audit.auditSkills.entries 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 · WorkflowRuntime.reconcileStuckExceptions (cyclomatic 20) · ×1
  • WorkflowRuntime.reconcileStuckExceptions (cyclomatic 20) packages/daemon/src/domain/workflow-runtime.ts:935 — WorkflowRuntime.reconcileStuckExceptions 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 3 function literals inside it that branch (lines 937, 948, 947). 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 · WorkflowRuntime.resumeFailureOccurrence (cyclomatic 20) · ×1
  • WorkflowRuntime.resumeFailureOccurrence (cyclomatic 20) packages/daemon/src/domain/workflow-runtime.ts:1395 — WorkflowRuntime.resumeFailureOccurrence has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 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 · activity.piUsageRequest (cyclomatic 20) · ×1
  • activity.piUsageRequest (cyclomatic 20) packages/daemon/src/routes/activity.ts:288 — activity.piUsageRequest 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 · browser-boundary.browserBoundary (cyclomatic 20) · ×1
  • browser-boundary.browserBoundary (cyclomatic 20) packages/daemon/src/middleware/browser-boundary.ts:205 — browser-boundary.browserBoundary has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (acceptedTarget, knownTarget, explicitlyAllowedOrigin, …). 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 · startup.createDaemon · ×1
  • startup.createDaemon::topologyDestinationAdvisory (cyclomatic 20) packages/daemon/src/startup.ts:449 — startup.createDaemon::topologyDestinationAdvisory 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. This shape REPEATS in the file: one other method here (startup.createDaemon) 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 · scopes-model.proofEvidence (cyclomatic 20) · ×1
  • scopes-model.proofEvidence (cyclomatic 20) packages/tui/src/scopes/scopes-model.ts:207 — scopes-model.proofEvidence 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 · WorkflowTopologyGraph.WorkflowStepNode (cyclomatic 20) · ×1
  • WorkflowTopologyGraph.WorkflowStepNode (cyclomatic 20) packages/ui/src/components/workflow/WorkflowTopologyGraph.tsx:124 — WorkflowTopologyGraph.WorkflowStepNode 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 · LibraryReview.LibraryRigReviewContent (cyclomatic 20) · ×1
  • LibraryReview.LibraryRigReviewContent (cyclomatic 20) packages/ui/src/components/LibraryReview.tsx:97 — LibraryReview.LibraryRigReviewContent has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 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 · HostConfigCard.HostConfigCard (cyclomatic 20) · ×1
  • HostConfigCard.HostConfigCard (cyclomatic 20) packages/ui/src/components/dashboard/HostConfigCard.tsx:36 — HostConfigCard.HostConfigCard has cyclomatic complexity 20 (threshold 15). Of this number, 15 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 · useScopeMarkdown.useScopeMarkdown (cyclomatic 20) · ×1
  • useScopeMarkdown.useScopeMarkdown (cyclomatic 20) packages/ui/src/hooks/useScopeMarkdown.ts:115 — useScopeMarkdown.useScopeMarkdown 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 · ProofTab.ProofSliceCard (cyclomatic 20) · ×1
  • ProofTab.ProofSliceCard (cyclomatic 20) packages/ui/src/components/project/ProofTab.tsx:73 — ProofTab.ProofSliceCard 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 · useTopologyEdgeActivity.normalizeEvent (cyclomatic 20) · ×1
  • useTopologyEdgeActivity.normalizeEvent (cyclomatic 20) packages/ui/src/hooks/useTopologyEdgeActivity.ts:52 — useTopologyEdgeActivity.normalizeEvent 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 · migrate-telemetry-state-0.5.9.validateLegacySources (cyclomatic 20) · ×1
  • migrate-telemetry-state-0.5.9.validateLegacySources (cyclomatic 20) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:873 — migrate-telemetry-state-0.5.9.validateLegacySources has cyclomatic complexity 20 (threshold 15). Of this number, 18 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. This is NOT this file's highest cyclomatic complexity: migrate-telemetry-state-0.5.9.verificationReceipt (cyclomatic 26) 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 · compose.compose_progress (cyclomatic 20) · ×1
  • compose.compose_progress (cyclomatic 20) packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:493 — compose.compose_progress 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 · follow (cyclomatic 20) · ×1
  • follow (cyclomatic 20) packages/daemon/assets/herdr-app/mods/rig-strip/main.js:105 — follow 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 · pi-runner-protocol.buildPiRunnerCommand (cyclomatic 19) · ×1
  • pi-runner-protocol.buildPiRunnerCommand (cyclomatic 19) packages/daemon/src/adapters/pi-runner-protocol.ts:321 — pi-runner-protocol.buildPiRunnerCommand 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 · ActivityGrantStore.reconcileBinding (cyclomatic 19) · ×1
  • ActivityGrantStore.reconcileBinding (cyclomatic 19) packages/daemon/src/domain/activity-grants.ts:136 — ActivityGrantStore.reconcileBinding has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 138, 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.
D1 · Cyclomatic Complexity · SessionRegistry.assertAddressAvailable (cyclomatic 19) · ×1
  • SessionRegistry.assertAddressAvailable (cyclomatic 19) packages/daemon/src/domain/session-registry.ts:249 — SessionRegistry.assertAddressAvailable has cyclomatic complexity 19 (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 · seat-skill-storage.seatSkillReplay (cyclomatic 19) · ×1
  • seat-skill-storage.seatSkillReplay (cyclomatic 19) packages/daemon/src/domain/seat-skill-storage.ts:413 — seat-skill-storage.seatSkillReplay 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 · rigspec-schema.validateCrossPodEdge (cyclomatic 19) · ×1
  • rigspec-schema.validateCrossPodEdge (cyclomatic 19) packages/daemon/src/domain/rigspec-schema.ts:899 — rigspec-schema.validateCrossPodEdge 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 · rigspec-schema.validateSurfaces (cyclomatic 19) · ×1
  • rigspec-schema.validateSurfaces (cyclomatic 19) packages/daemon/src/domain/rigspec-schema.ts:1030 — rigspec-schema.validateSurfaces 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 · rigspec-schema.normalizePod.members (cyclomatic 19) · ×1
  • rigspec-schema.normalizePod.members (cyclomatic 19) packages/daemon/src/domain/rigspec-schema.ts:1320 — rigspec-schema.normalizePod.members 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 · human-registry.canonicalProjectionSnapshot (cyclomatic 19) · ×1
  • human-registry.canonicalProjectionSnapshot (cyclomatic 19) packages/daemon/src/domain/gateway/human-registry.ts:1017 — human-registry.canonicalProjectionSnapshot 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 · quiet-release.runQuietRelease (cyclomatic 19) · ×1
  • quiet-release.runQuietRelease (cyclomatic 19) packages/daemon/src/domain/policies/quiet-release.ts:247 — quiet-release.runQuietRelease 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 · queue-pickup.deriveClaimPickup (cyclomatic 19) · ×1
  • queue-pickup.deriveClaimPickup (cyclomatic 19) packages/daemon/src/domain/queue-pickup.ts:99 — queue-pickup.deriveClaimPickup 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 · slack-api.callWebApi (cyclomatic 19) · ×1
  • slack-api.callWebApi (cyclomatic 19) REDACTED:93 — slack-api.callWebApi has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 102). 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 · queue-wake-ladder.hasPickupEvidence (cyclomatic 19) · ×1
  • queue-wake-ladder.hasPickupEvidence (cyclomatic 19) packages/daemon/src/domain/queue-wake-ladder.ts:354 — queue-wake-ladder.hasPickupEvidence 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 · SessionTransport.broadcast (cyclomatic 19) · ×1
  • SessionTransport.broadcast (cyclomatic 19) packages/daemon/src/domain/session-transport.ts:5047 — SessionTransport.broadcast 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. This is NOT this file's highest cyclomatic complexity: session-transport.bridgeable (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 · session-transport.writtenFact (cyclomatic 19) · ×1
  • session-transport.writtenFact (cyclomatic 19) packages/daemon/src/domain/session-transport.ts:186 — session-transport.writtenFact has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: session-transport.bridgeable (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 · ClaudeCompactionEnforcer.getOwedRestore (cyclomatic 19) · ×1
  • ClaudeCompactionEnforcer.getOwedRestore (cyclomatic 19) packages/daemon/src/domain/claude-compaction-enforcer.ts:943 — ClaudeCompactionEnforcer.getOwedRestore 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 · ChainFollower.read (cyclomatic 19) · ×1
  • ChainFollower.read (cyclomatic 19) packages/cli/src/acp/agent-server.ts:193 — ChainFollower.read 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 · ps.compactNodeProjection (cyclomatic 19) · ×1
  • ps.compactNodeProjection (cyclomatic 19) packages/cli/src/commands/ps.ts:749 — ps.compactNodeProjection has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 750). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · bundle-check.checkBundleFolder · ×1
  • bundle-check.checkBundleFolder::agent (cyclomatic 19) packages/cli/src/lib/bundle-check.ts:100 — bundle-check.checkBundleFolder::agent 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 (bundle-check.checkBundleFolder) 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 · cross-host-target.resolveCrossHostTarget (cyclomatic 19) · ×1
  • cross-host-target.resolveCrossHostTarget (cyclomatic 19) packages/cli/src/cross-host-target.ts:60 — cross-host-target.resolveCrossHostTarget 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 · work-install.resolveWorkContextHome (cyclomatic 19) · ×1
  • work-install.resolveWorkContextHome (cyclomatic 19) packages/cli/src/lib/work-install.ts:287 — work-install.resolveWorkContextHome 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 · context-reconstruction.reconstructionCommand (cyclomatic 19) · ×1
  • context-reconstruction.reconstructionCommand (cyclomatic 19) packages/cli/src/commands/context-reconstruction.ts:16 — context-reconstruction.reconstructionCommand has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 35). 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 · edge.edgeCommand (cyclomatic 19) · ×1
  • edge.edgeCommand (cyclomatic 19) packages/cli/src/commands/edge.ts:75 — edge.edgeCommand has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 3 function items inside it that branch (run, a function literal at line 147, a function literal at line 164). 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 · restore-check.restoreCheckCommand (cyclomatic 19) · ×1
  • restore-check.restoreCheckCommand (cyclomatic 19) packages/cli/src/commands/restore-check.ts:204 — restore-check.restoreCheckCommand has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 246). 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 · front-door.probeFrontDoor (cyclomatic 19) · ×1
  • front-door.probeFrontDoor (cyclomatic 19) packages/cli/src/front-door.ts:112 — front-door.probeFrontDoor 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 · usage.providerChargeText (cyclomatic 19) · ×1
  • usage.providerChargeText (cyclomatic 19) packages/cli/src/commands/usage.ts:75 — usage.providerChargeText 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 · ClaudeCodeAdapter.project (cyclomatic 19) · ×1
  • ClaudeCodeAdapter.project (cyclomatic 19) packages/daemon/src/adapters/claude-code-adapter.ts:198 — ClaudeCodeAdapter.project 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 · ClaudeCodeAdapter.deliverStartup (cyclomatic 19) · ×1
  • ClaudeCodeAdapter.deliverStartup (cyclomatic 19) packages/daemon/src/adapters/claude-code-adapter.ts:258 — ClaudeCodeAdapter.deliverStartup 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 · ClaudeCodeAdapter.reconcileClaudeActivityHooks (cyclomatic 19) · ×1
  • ClaudeCodeAdapter.reconcileClaudeActivityHooks (cyclomatic 19) packages/daemon/src/adapters/claude-code-adapter.ts:1331 — ClaudeCodeAdapter.reconcileClaudeActivityHooks 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 · codex-filesystem-preflight.compareFilesystem (cyclomatic 19) · ×1
  • codex-filesystem-preflight.compareFilesystem (cyclomatic 19) packages/daemon/src/domain/codex-filesystem-preflight.ts:48 — codex-filesystem-preflight.compareFilesystem has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (codex-filesystem-preflight.compareFilesystem::at) 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 · RunnerCore.pumpManaged (cyclomatic 19) · ×1
  • RunnerCore.pumpManaged (cyclomatic 19) REDACTED:1144 — RunnerCore.pumpManaged 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 · pi-runner.readPiSessionEntryIds (cyclomatic 19) · ×1
  • pi-runner.readPiSessionEntryIds (cyclomatic 19) REDACTED:878 — pi-runner.readPiSessionEntryIds 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 · bundle-types.serializeLegacyBundleManifest (cyclomatic 19) · ×1
  • bundle-types.serializeLegacyBundleManifest (cyclomatic 19) packages/daemon/src/domain/bundle-types.ts:788 — bundle-types.serializeLegacyBundleManifest 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.
D1 · Cyclomatic Complexity · AgentImageLibraryService.readImageEntry (cyclomatic 19) · ×1
  • AgentImageLibraryService.readImageEntry (cyclomatic 19) packages/daemon/src/domain/agent-images/agent-image-library-service.ts:215 — AgentImageLibraryService.readImageEntry has cyclomatic complexity 19 (threshold 15). Of this number, 15 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 · AgentImageLibraryService.install (cyclomatic 19) · ×1
  • AgentImageLibraryService.install (cyclomatic 19) packages/daemon/src/domain/agent-images/agent-image-library-service.ts:308 — AgentImageLibraryService.install 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 · ClaimService.bind (cyclomatic 19) · ×1
  • ClaimService.bind (cyclomatic 19) packages/daemon/src/domain/claim-service.ts:353 — ClaimService.bind 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 · destination-successor.recordedSuccessorNotice (cyclomatic 19) · ×1
  • destination-successor.recordedSuccessorNotice (cyclomatic 19) packages/daemon/src/domain/destination-successor.ts:5 — destination-successor.recordedSuccessorNotice has cyclomatic complexity 19 (threshold 15). Of this number, 15 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 · restore-plan-preview.intendedActionFor (cyclomatic 19) · ×1
  • restore-plan-preview.intendedActionFor (cyclomatic 19) packages/daemon/src/domain/restore-plan-preview.ts:157 — restore-plan-preview.intendedActionFor 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 · HumanModeService.endAvailability (cyclomatic 19) · ×1
  • HumanModeService.endAvailability (cyclomatic 19) packages/daemon/src/domain/gateway/human-operating-modes.ts:351 — HumanModeService.endAvailability 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 · relay-inbound.resolveOfferedReplyRefContext (cyclomatic 19) · ×1
  • relay-inbound.resolveOfferedReplyRefContext (cyclomatic 19) packages/daemon/src/domain/gateway/relay-inbound.ts:328 — relay-inbound.resolveOfferedReplyRefContext 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 · rig-mode-validator.validateRecord (cyclomatic 19) · ×1
  • rig-mode-validator.validateRecord (cyclomatic 19) packages/daemon/src/domain/rig-mode/rig-mode-validator.ts:138 — rig-mode-validator.validateRecord 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 · usage-series.computeTopBurn (cyclomatic 19) · ×1
  • usage-series.computeTopBurn (cyclomatic 19) REDACTED:163 — usage-series.computeTopBurn 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 · HealthCheckpointSource.read (cyclomatic 19) · ×1
  • HealthCheckpointSource.read (cyclomatic 19) packages/daemon/src/domain/health-checkpoints.ts:125 — HealthCheckpointSource.read has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 127, 149, 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 · learned-host-bindings.loadLearnedHostBindings (cyclomatic 19) · ×1
  • learned-host-bindings.loadLearnedHostBindings (cyclomatic 19) packages/daemon/src/domain/hosts/learned-host-bindings.ts:27 — learned-host-bindings.loadLearnedHostBindings 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 · queue-erasure.eraseRigRecords (cyclomatic 19) · ×1
  • queue-erasure.eraseRigRecords (cyclomatic 19) REDACTED:1124 — queue-erasure.eraseRigRecords has cyclomatic complexity 19 (threshold 15). Of this number, 15 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 · queue-retention.pruneStreamItems (cyclomatic 19) · ×1
  • queue-retention.pruneStreamItems (cyclomatic 19) packages/daemon/src/domain/queue-retention.ts:360 — queue-retention.pruneStreamItems has cyclomatic complexity 19 (threshold 15). Of this number, 11 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 · RestoreCheckService.checkSeatReadiness (cyclomatic 19) · ×1
  • RestoreCheckService.checkSeatReadiness (cyclomatic 19) packages/daemon/src/domain/restore-check-service.ts:929 — RestoreCheckService.checkSeatReadiness 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 · RestoreCheckService.checkHooks (cyclomatic 19) · ×1
  • RestoreCheckService.checkHooks (cyclomatic 19) packages/daemon/src/domain/restore-check-service.ts:1214 — RestoreCheckService.checkHooks 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 · ReviewGatherer.attentionForTag (cyclomatic 19) · ×1
  • ReviewGatherer.attentionForTag (cyclomatic 19) packages/daemon/src/domain/review/gather.ts:517 — ReviewGatherer.attentionForTag has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 548, 568). 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 · StreamIntakeCoordinator.handleStreamItem (cyclomatic 19) · ×1
  • StreamIntakeCoordinator.handleStreamItem (cyclomatic 19) packages/daemon/src/domain/stream-intake.ts:308 — StreamIntakeCoordinator.handleStreamItem has cyclomatic complexity 19 (threshold 15). Of this number, 15 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 · view-composer.composeView (cyclomatic 19) · ×1
  • view-composer.composeView (cyclomatic 19) packages/daemon/src/domain/terminal/view-composer.ts:112 — view-composer.composeView 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 · task-terminal-view.projectTaskOwners (cyclomatic 19) · ×1
  • task-terminal-view.projectTaskOwners (cyclomatic 19) packages/daemon/src/domain/terminal/task-terminal-view.ts:171 — task-terminal-view.projectTaskOwners 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 · scope-task-terminal-view.readScopeIndex · ×1
  • scope-task-terminal-view.readScopeIndex::add (cyclomatic 19) packages/daemon/src/domain/terminal/scope-task-terminal-view.ts:42 — scope-task-terminal-view.readScopeIndex::add 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 · MultiRigLauncher.launch (cyclomatic 19) · ×1
  • MultiRigLauncher.launch (cyclomatic 19) packages/daemon/src/domain/topology/multi-rig-launcher.ts:74 — MultiRigLauncher.launch 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 2 function items inside it that branch (runEntry, a function literal at line 162). 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 · activity.evidenceFromHookActivity (cyclomatic 19) · ×1
  • activity.evidenceFromHookActivity (cyclomatic 19) packages/daemon/src/routes/activity.ts:40 — activity.evidenceFromHookActivity 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 · activity.bindToGrant (cyclomatic 19) · ×1
  • activity.bindToGrant (cyclomatic 19) packages/daemon/src/routes/activity.ts:219 — activity.bindToGrant 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 · activity.submitPermission (cyclomatic 19) · ×1
  • activity.submitPermission (cyclomatic 19) packages/daemon/src/routes/activity.ts:989 — activity.submitPermission 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 · startup.observeSeat (cyclomatic 19) · ×1
  • startup.observeSeat (cyclomatic 19) packages/daemon/src/routes/startup.ts:196 — startup.observeSeat 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 · slices.resolveSliceProjectLookup.resolveProjectId (cyclomatic 19) · ×1
  • slices.resolveSliceProjectLookup.resolveProjectId (cyclomatic 19) packages/daemon/src/routes/slices.ts:333 — slices.resolveSliceProjectLookup.resolveProjectId has cyclomatic complexity 19 (threshold 15). Of this number, 15 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 · browser-boundary.browserBoundary.<returned closure> (cyclomatic 19) · ×1
  • browser-boundary.browserBoundary.<returned closure> (cyclomatic 19) packages/daemon/src/middleware/browser-boundary.ts:285 — browser-boundary.browserBoundary.<returned closure> 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 · scopes-model.scopeIdentityLines (cyclomatic 19) · ×1
  • scopes-model.scopeIdentityLines (cyclomatic 19) packages/tui/src/scopes/scopes-model.ts:324 — scopes-model.scopeIdentityLines 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 · cost-model.providerChargeText (cyclomatic 19) · ×1
  • cost-model.providerChargeText (cyclomatic 19) packages/tui/src/cost/cost-model.ts:29 — cost-model.providerChargeText 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 · navigator.navigatorLabelsInner (cyclomatic 19) · ×1
  • navigator.navigatorLabelsInner (cyclomatic 19) packages/tui/src/navigator.ts:150 — navigator.navigatorLabelsInner has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 169, 152, 177). 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 · main.run (cyclomatic 19) · ×1
  • main.run (cyclomatic 19) packages/tui/src/main.ts:55 — main.run has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 3 other methods here (main.run::draw, main.run::executeAct, main.run::handleInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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 · ScopePages.HostScopePage (cyclomatic 19) · ×1
  • ScopePages.HostScopePage (cyclomatic 19) packages/ui/src/components/topology/ScopePages.tsx:129 — ScopePages.HostScopePage 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 · ScopePages.WorkspaceScopePage (cyclomatic 19) · ×1
  • ScopePages.WorkspaceScopePage (cyclomatic 19) packages/ui/src/components/project/ScopePages.tsx:697 — ScopePages.WorkspaceScopePage 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, 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 · migrate-telemetry-state-0.5.9.scanLegacy (cyclomatic 19) · ×1
  • migrate-telemetry-state-0.5.9.scanLegacy (cyclomatic 19) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:355 — migrate-telemetry-state-0.5.9.scanLegacy has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: migrate-telemetry-state-0.5.9.verificationReceipt (cyclomatic 26) 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 · claude-credential-precedence.settingsFileConflicts (cyclomatic 18) · ×1
  • claude-credential-precedence.settingsFileConflicts (cyclomatic 18) packages/daemon/src/domain/claude-credential-precedence.ts:52 — claude-credential-precedence.settingsFileConflicts 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 · PermissionStopObservations.read (cyclomatic 18) · ×1
  • PermissionStopObservations.read (cyclomatic 18) packages/daemon/src/domain/permission-stop-observation.ts:131 — PermissionStopObservations.read 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 · codex-thread-id.readLoggedThreadsIncrementally (cyclomatic 18) · ×1
  • codex-thread-id.readLoggedThreadsIncrementally (cyclomatic 18) REDACTED:362 — codex-thread-id.readLoggedThreadsIncrementally has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 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 · seat-effort.readNativeEffort (cyclomatic 18) · ×1
  • seat-effort.readNativeEffort (cyclomatic 18) packages/daemon/src/domain/seat-effort.ts:193 — seat-effort.readNativeEffort 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 · effective-model-readers.piSeatPinReadings (cyclomatic 18) · ×1
  • effective-model-readers.piSeatPinReadings (cyclomatic 18) packages/daemon/src/domain/model-divergence/effective-model-readers.ts:225 — effective-model-readers.piSeatPinReadings 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 · SettingsStore.writeConfig (cyclomatic 18) · ×1
  • SettingsStore.writeConfig (cyclomatic 18) packages/daemon/src/domain/user-settings/settings-store.ts:1381 — SettingsStore.writeConfig 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: settings-store.getDefaultValue (cyclomatic 99) 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 · agent-manifest.validatePluginResources (cyclomatic 18) · ×1
  • agent-manifest.validatePluginResources (cyclomatic 18) packages/daemon/src/domain/agent-manifest.ts:513 — agent-manifest.validatePluginResources 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 · native-permission-store.resolveLaunchOverrideFromFacts (cyclomatic 18) · ×1
  • native-permission-store.resolveLaunchOverrideFromFacts (cyclomatic 18) packages/daemon/src/domain/native-permission-store.ts:80 — native-permission-store.resolveLaunchOverrideFromFacts 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 · OpenShellPodmanObserver.capture (cyclomatic 18) · ×1
  • OpenShellPodmanObserver.capture (cyclomatic 18) packages/daemon/src/adapters/openshell-podman-observer.ts:38 — OpenShellPodmanObserver.capture has cyclomatic complexity 18 (threshold 15). 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, 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 · slack-api.postChatMessage (cyclomatic 18) · ×1
  • slack-api.postChatMessage (cyclomatic 18) REDACTED:505 — slack-api.postChatMessage 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 · host-usage-rollup.rollupClaude (cyclomatic 18) · ×1
  • host-usage-rollup.rollupClaude (cyclomatic 18) packages/daemon/src/domain/provider/host-usage-rollup.ts:105 — host-usage-rollup.rollupClaude has cyclomatic complexity 18 (threshold 15). Of this number, 15 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 · SliceIndexer.missionIdAliasesForCounting (cyclomatic 18) · ×1
  • SliceIndexer.missionIdAliasesForCounting (cyclomatic 18) packages/daemon/src/domain/slices/slice-indexer.ts:919 — SliceIndexer.missionIdAliasesForCounting 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 · SliceIndexer.missionIdAliases (cyclomatic 18) · ×1
  • SliceIndexer.missionIdAliases (cyclomatic 18) packages/daemon/src/domain/slices/slice-indexer.ts:971 — SliceIndexer.missionIdAliases 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 · SliceIndexer.scanProofPacket · ×1
  • SliceIndexer.scanProofPacket::walk (cyclomatic 18) packages/daemon/src/domain/slices/slice-indexer.ts:1590 — SliceIndexer.scanProofPacket::walk 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 · restore-guidance.seatGuidance (cyclomatic 18) · ×1
  • restore-guidance.seatGuidance (cyclomatic 18) packages/daemon/src/domain/restore-guidance.ts:103 — restore-guidance.seatGuidance 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 · persisted-restore-posture.resolvePersistedRestorePosture (cyclomatic 18) · ×1
  • persisted-restore-posture.resolvePersistedRestorePosture (cyclomatic 18) packages/daemon/src/domain/permission-policy/persisted-restore-posture.ts:68 — persisted-restore-posture.resolvePersistedRestorePosture 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 · queue-wake-ladder.refusedWatchdogJobs (cyclomatic 18) · ×1
  • queue-wake-ladder.refusedWatchdogJobs (cyclomatic 18) packages/daemon/src/domain/queue-wake-ladder.ts:1156 — queue-wake-ladder.refusedWatchdogJobs has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1175, 1179). 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 · relay-outbound.decodeRelayReplyRef (cyclomatic 18) · ×1
  • relay-outbound.decodeRelayReplyRef (cyclomatic 18) packages/daemon/src/domain/gateway/relay-outbound.ts:169 — relay-outbound.decodeRelayReplyRef 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 · QueueRepository.drainPendingWakeIntents (cyclomatic 18) · ×1
  • QueueRepository.drainPendingWakeIntents (cyclomatic 18) packages/daemon/src/domain/queue-repository.ts:1941 — QueueRepository.drainPendingWakeIntents has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 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 · QueueRepository.listRows (cyclomatic 18) · ×1
  • QueueRepository.listRows (cyclomatic 18) packages/daemon/src/domain/queue-repository.ts:5110 — QueueRepository.listRows 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 · queue-repository.listablePullOutboxKeys (cyclomatic 18) · ×1
  • queue-repository.listablePullOutboxKeys (cyclomatic 18) packages/daemon/src/domain/queue-repository.ts:6456 — queue-repository.listablePullOutboxKeys 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 · session-transport.styledTextLines (cyclomatic 18) · ×1
  • session-transport.styledTextLines (cyclomatic 18) packages/daemon/src/domain/session-transport.ts:514 — session-transport.styledTextLines has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 516). 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: session-transport.bridgeable (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 · ConfigStore.reset (cyclomatic 18) · ×1
  • ConfigStore.reset (cyclomatic 18) packages/cli/src/config-store.ts:1743 — ConfigStore.reset 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 · model-observation.modelObservation (cyclomatic 18) · ×1
  • model-observation.modelObservation (cyclomatic 18) packages/cli/src/lib/model-observation.ts:15 — model-observation.modelObservation 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 · run-on-host.runOnSshHost (cyclomatic 18) · ×1
  • run-on-host.runOnSshHost (cyclomatic 18) packages/cli/src/lib/run-on-host.ts:44 — run-on-host.runOnSshHost 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 · send.classifyDeliveryEffect (cyclomatic 18) · ×1
  • send.classifyDeliveryEffect (cyclomatic 18) packages/cli/src/commands/send.ts:691 — send.classifyDeliveryEffect 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 · capture.renderCapture (cyclomatic 18) · ×1
  • capture.renderCapture (cyclomatic 18) packages/cli/src/commands/capture.ts:106 — capture.renderCapture has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (note). 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 · reconstruction-reader.readReconstruction (cyclomatic 18) · ×1
  • reconstruction-reader.readReconstruction (cyclomatic 18) packages/cli/src/lib/reconstruction-reader.ts:232 — reconstruction-reader.readReconstruction 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 · mcp-server.mapResult (cyclomatic 18) · ×1
  • mcp-server.mapResult (cyclomatic 18) packages/cli/src/mcp-server.ts:903 — mcp-server.mapResult 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 · release.releaseCommand (cyclomatic 18) · ×1
  • release.releaseCommand (cyclomatic 18) packages/cli/src/commands/release.ts:8 — release.releaseCommand has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 26, getClient). 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 · remove.removeCommand (cyclomatic 18) · ×1
  • remove.removeCommand (cyclomatic 18) packages/cli/src/commands/remove.ts:8 — remove.removeCommand has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 23, getClient). 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 · requirements.requirementsCommand (cyclomatic 18) · ×1
  • requirements.requirementsCommand (cyclomatic 18) packages/cli/src/commands/requirements.ts:8 — requirements.requirementsCommand has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 22, getTarget). 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 · progress-edit.addProgressRow (cyclomatic 18) · ×1
  • progress-edit.addProgressRow (cyclomatic 18) packages/cli/src/lib/scope/progress-edit.ts:104 — progress-edit.addProgressRow 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 · stream-outcome.work (cyclomatic 18) · ×1
  • stream-outcome.work (cyclomatic 18) packages/cli/src/commands/stream-outcome.ts:29 — stream-outcome.work 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 · activity-relay.claudeLimitResetAt (cyclomatic 18) · ×1
  • activity-relay.claudeLimitResetAt (cyclomatic 18) REDACTED:177 — activity-relay.claudeLimitResetAt 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 · refocus.process.stdout.write() (cyclomatic 18) · ×1
  • refocus.process.stdout.write() (cyclomatic 18) packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs:664 — refocus.process.stdout.write() 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 · precompact-hook.readClaudeCompactionMessage (cyclomatic 18) · ×1
  • precompact-hook.readClaudeCompactionMessage (cyclomatic 18) packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs:167 — precompact-hook.readClaudeCompactionMessage 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 · ClaudeCodeAdapter.provisionContextCollector (cyclomatic 18) · ×1
  • ClaudeCodeAdapter.provisionContextCollector (cyclomatic 18) packages/daemon/src/adapters/claude-code-adapter.ts:1268 — ClaudeCodeAdapter.provisionContextCollector 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 · OpenRouterChargeLookup.lookUp (cyclomatic 18) · ×1
  • OpenRouterChargeLookup.lookUp (cyclomatic 18) packages/daemon/src/adapters/pi-openrouter-charge.ts:201 — OpenRouterChargeLookup.lookUp 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 · codex-auth.copyOntoFresh (cyclomatic 18) · ×1
  • codex-auth.copyOntoFresh (cyclomatic 18) packages/daemon/src/domain/codex-auth.ts:139 — codex-auth.copyOntoFresh 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 · LegacyRigSpecCodec.serialize (cyclomatic 18) · ×1
  • LegacyRigSpecCodec.serialize (cyclomatic 18) packages/daemon/src/domain/rigspec-codec.ts:245 — LegacyRigSpecCodec.serialize has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 250). 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 · PodRigInstantiator.persistedMember (cyclomatic 18) · ×1
  • PodRigInstantiator.persistedMember (cyclomatic 18) packages/daemon/src/domain/rigspec-instantiator.ts:2283 — PodRigInstantiator.persistedMember 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 · BootstrapOrchestrator.buildServicePrelaunchHook (cyclomatic 18) · ×1
  • BootstrapOrchestrator.buildServicePrelaunchHook (cyclomatic 18) packages/daemon/src/domain/bootstrap-orchestrator.ts:911 — BootstrapOrchestrator.buildServicePrelaunchHook has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 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 · ClaimService.createAndBindToPod (cyclomatic 18) · ×1
  • ClaimService.createAndBindToPod (cyclomatic 18) packages/daemon/src/domain/claim-service.ts:790 — ClaimService.createAndBindToPod 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 · current-work.deriveCurrentWork (cyclomatic 18) · ×1
  • current-work.deriveCurrentWork (cyclomatic 18) packages/daemon/src/domain/current-work.ts:606 — current-work.deriveCurrentWork 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 · current-work.frontmatterIntent (cyclomatic 18) · ×1
  • current-work.frontmatterIntent (cyclomatic 18) packages/daemon/src/domain/current-work.ts:760 — current-work.frontmatterIntent 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 · restore-plan-preview.tokenStateFor (cyclomatic 18) · ×1
  • restore-plan-preview.tokenStateFor (cyclomatic 18) packages/daemon/src/domain/restore-plan-preview.ts:107 — restore-plan-preview.tokenStateFor 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 · finite-telemetry.decode (cyclomatic 18) · ×1
  • finite-telemetry.decode (cyclomatic 18) packages/daemon/src/domain/finite-telemetry.ts:65 — finite-telemetry.decode 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 · HumanModeService.endQuiet (cyclomatic 18) · ×1
  • HumanModeService.endQuiet (cyclomatic 18) packages/daemon/src/domain/gateway/human-operating-modes.ts:405 — HumanModeService.endQuiet has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 422, 441). 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 · open-asks.deliveryFact (cyclomatic 18) · ×1
  • open-asks.deliveryFact (cyclomatic 18) packages/daemon/src/domain/gateway/slack/open-asks.ts:129 — open-asks.deliveryFact 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 · thread-routing.makeThreadRouteResolver.<returned closure> (cyclomatic 18) · ×1
  • thread-routing.makeThreadRouteResolver.<returned closure> (cyclomatic 18) packages/daemon/src/domain/gateway/slack/thread-routing.ts:43 — thread-routing.makeThreadRouteResolver.<returned closure> 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 · slack-subsystem.buildSlackGatewayWire.deriveReplyToChoice (cyclomatic 18) · ×1
  • slack-subsystem.buildSlackGatewayWire.deriveReplyToChoice (cyclomatic 18) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:533 — slack-subsystem.buildSlackGatewayWire.deriveReplyToChoice 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 · guidance-projection.readGuidanceProjection (cyclomatic 18) · ×1
  • guidance-projection.readGuidanceProjection (cyclomatic 18) packages/daemon/src/domain/guidance-projection.ts:39 — guidance-projection.readGuidanceProjection 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 · HealthCheckpointSource.submit (cyclomatic 18) · ×1
  • HealthCheckpointSource.submit (cyclomatic 18) packages/daemon/src/domain/health-checkpoints.ts:88 — HealthCheckpointSource.submit 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 · KernelBootTracker.getStatus (cyclomatic 18) · ×1
  • KernelBootTracker.getStatus (cyclomatic 18) packages/daemon/src/domain/kernel-boot-tracker.ts:168 — KernelBootTracker.getStatus 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 · SeatLifecycleService.stopSeatChecked (cyclomatic 18) · ×1
  • SeatLifecycleService.stopSeatChecked (cyclomatic 18) packages/daemon/src/domain/seat-lifecycle-service.ts:1248 — SeatLifecycleService.stopSeatChecked 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, 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 · seat-lifecycle-service.effortSummary (cyclomatic 18) · ×1
  • seat-lifecycle-service.effortSummary (cyclomatic 18) packages/daemon/src/domain/seat-lifecycle-service.ts:2583 — seat-lifecycle-service.effortSummary 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 · skill-audit.isSelfReferential (cyclomatic 18) · ×1
  • skill-audit.isSelfReferential (cyclomatic 18) packages/daemon/src/domain/skill-audit.ts:53 — skill-audit.isSelfReferential 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 · HerdrViewer.forgetClosed (cyclomatic 18) · ×1
  • HerdrViewer.forgetClosed (cyclomatic 18) packages/daemon/src/domain/terminal/herdr-viewer.ts:285 — HerdrViewer.forgetClosed has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 286). 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 · HerdrAppProvider.reconcileState (cyclomatic 18) · ×1
  • HerdrAppProvider.reconcileState (cyclomatic 18) packages/daemon/src/domain/terminal/herdr-app-provider.ts:290 — HerdrAppProvider.reconcileState 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 · scope-task-terminal-view.selectMission (cyclomatic 18) · ×1
  • scope-task-terminal-view.selectMission (cyclomatic 18) packages/daemon/src/domain/terminal/scope-task-terminal-view.ts:123 — scope-task-terminal-view.selectMission 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 · UpCommandRouter.autoDetect (cyclomatic 18) · ×1
  • UpCommandRouter.autoDetect (cyclomatic 18) packages/daemon/src/domain/up-command-router.ts:134 — UpCommandRouter.autoDetect 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 · watchdog-delivery-receipts.withWatchdogReceipts · ×1
  • watchdog-delivery-receipts.withWatchdogReceipts::reconcile (cyclomatic 18) packages/daemon/src/domain/watchdog-delivery-receipts.ts:29 — watchdog-delivery-receipts.withWatchdogReceipts::reconcile 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 · frontmatter-validator.validateFile (cyclomatic 18) · ×1
  • frontmatter-validator.validateFile (cyclomatic 18) packages/daemon/src/domain/workspace/frontmatter-validator.ts:143 — frontmatter-validator.validateFile 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 · sessions.nodesRoutes.post("/launch-subset") (cyclomatic 18) · ×1
  • sessions.nodesRoutes.post("/launch-subset") (cyclomatic 18) packages/daemon/src/routes/sessions.ts:409 — sessions.nodesRoutes.post("/launch-subset") 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 · packages.packagesRoutes.post("/plan") (cyclomatic 18) · ×1
  • packages.packagesRoutes.post("/plan") (cyclomatic 18) packages/daemon/src/routes/packages.ts:106 — packages.packagesRoutes.post("/plan") 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, 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 · usage-model.seatLines (cyclomatic 18) · ×1
  • usage-model.seatLines (cyclomatic 18) packages/tui/src/usage/usage-model.ts:129 — usage-model.seatLines 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 · SubscriptionToggleList.SubscriptionToggleList (cyclomatic 18) · ×1
  • SubscriptionToggleList.SubscriptionToggleList (cyclomatic 18) packages/ui/src/components/for-you/SubscriptionToggleList.tsx:65 — SubscriptionToggleList.SubscriptionToggleList has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 83, 153, 114). 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 · SyntaxHighlight.tokenize (cyclomatic 18) · ×1
  • SyntaxHighlight.tokenize (cyclomatic 18) packages/ui/src/components/markdown/SyntaxHighlight.tsx:102 — SyntaxHighlight.tokenize 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 · BundleInstallFlow.BundleInstallFlow (cyclomatic 18) · ×1
  • BundleInstallFlow.BundleInstallFlow (cyclomatic 18) packages/ui/src/components/BundleInstallFlow.tsx:9 — BundleInstallFlow.BundleInstallFlow has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 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 · useMissionControlAction.postAction (cyclomatic 18) · ×1
  • useMissionControlAction.postAction (cyclomatic 18) packages/ui/src/components/mission-control/hooks/useMissionControlAction.ts:82 — useMissionControlAction.postAction 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 · FeedCardQuestionAsk.FeedCardQuestionAsk · ×1
  • FeedCardQuestionAsk.FeedCardQuestionAsk::refreshQueueRow (cyclomatic 18) packages/ui/src/components/for-you/FeedCardQuestionAsk.tsx:296 — FeedCardQuestionAsk.FeedCardQuestionAsk::refreshQueueRow 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. This shape REPEATS in the file: one other method here (FeedCardQuestionAsk.FeedCardQuestionAsk) 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 · SliceReviewTab.SliceReviewTab (cyclomatic 18) · ×1
  • SliceReviewTab.SliceReviewTab (cyclomatic 18) packages/ui/src/components/review/SliceReviewTab.tsx:227 — SliceReviewTab.SliceReviewTab 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 · startup-submission-evidence.composerRegion (cyclomatic 17) · ×1
  • startup-submission-evidence.composerRegion (cyclomatic 17) packages/daemon/src/domain/startup-submission-evidence.ts:35 — startup-submission-evidence.composerRegion 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 · connection-contract.readWakeOutcome (cyclomatic 17) · ×1
  • connection-contract.readWakeOutcome (cyclomatic 17) packages/daemon/src/domain/connection-contract.ts:160 — connection-contract.readWakeOutcome 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 · native-process-arguments.readNativeProcessLaunch (cyclomatic 17) · ×1
  • native-process-arguments.readNativeProcessLaunch (cyclomatic 17) packages/daemon/src/domain/native-process-arguments.ts:187 — native-process-arguments.readNativeProcessLaunch 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 · native-process-lineage.findExactNativeResumeProcess (cyclomatic 17) · ×1
  • native-process-lineage.findExactNativeResumeProcess (cyclomatic 17) packages/daemon/src/domain/native-process-lineage.ts:515 — native-process-lineage.findExactNativeResumeProcess 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 · SeatDeliveryGuard.custody (cyclomatic 17) · ×1
  • SeatDeliveryGuard.custody (cyclomatic 17) packages/daemon/src/domain/seat-delivery-guard.ts:335 — SeatDeliveryGuard.custody 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 4 function items inside it that branch (acquire, validate, acquire::run, …). 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 · seat-skill-storage.writeSeatSkillCatalog (cyclomatic 17) · ×1
  • seat-skill-storage.writeSeatSkillCatalog (cyclomatic 17) packages/daemon/src/domain/seat-skill-storage.ts:1090 — seat-skill-storage.writeSeatSkillCatalog 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 · EnvironmentPlatform.create (cyclomatic 17) · ×1
  • EnvironmentPlatform.create (cyclomatic 17) packages/daemon/src/domain/environment-platform.ts:128 — EnvironmentPlatform.create 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 · InboundRouter.summaryOf (cyclomatic 17) · ×1
  • InboundRouter.summaryOf (cyclomatic 17) packages/daemon/src/domain/gateway/slack/inbound.ts:264 — InboundRouter.summaryOf 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 · queue-access.personFacingBody (cyclomatic 17) · ×1
  • queue-access.personFacingBody (cyclomatic 17) packages/daemon/src/domain/gateway/slack/queue-access.ts:117 — queue-access.personFacingBody 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 · queue-stuck-sweep.polledBacklogText (cyclomatic 17) · ×1
  • queue-stuck-sweep.polledBacklogText (cyclomatic 17) packages/daemon/src/domain/queue-stuck-sweep.ts:722 — queue-stuck-sweep.polledBacklogText has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 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 · relay-outbound.postRelayEnvelope (cyclomatic 17) · ×1
  • relay-outbound.postRelayEnvelope (cyclomatic 17) packages/daemon/src/domain/gateway/relay-outbound.ts:605 — relay-outbound.postRelayEnvelope 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 · RunnerPermissions.submit (cyclomatic 17) · ×1
  • RunnerPermissions.submit (cyclomatic 17) packages/daemon/src/domain/runner-permissions.ts:174 — RunnerPermissions.submit has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · QueueRepository.classifyOwnerNotification (cyclomatic 17) · ×1
  • QueueRepository.classifyOwnerNotification (cyclomatic 17) packages/daemon/src/domain/queue-repository.ts:1435 — QueueRepository.classifyOwnerNotification 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 · QueueRepository.answersForAsk (cyclomatic 17) · ×1
  • QueueRepository.answersForAsk (cyclomatic 17) packages/daemon/src/domain/queue-repository.ts:2374 — QueueRepository.answersForAsk has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2392, 2385, 2400). 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 · QueueRepository.create (cyclomatic 17) · ×1
  • QueueRepository.create (cyclomatic 17) packages/daemon/src/domain/queue-repository.ts:2417 — QueueRepository.create has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QueueRepository.currentDeliveryEpisode (cyclomatic 17) · ×1
  • QueueRepository.currentDeliveryEpisode (cyclomatic 17) packages/daemon/src/domain/queue-repository.ts:5710 — QueueRepository.currentDeliveryEpisode has cyclomatic complexity 17 (threshold 15). Of this number, 15 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 · StartupOrchestrator.fail (cyclomatic 17) · ×1
  • StartupOrchestrator.fail (cyclomatic 17) packages/daemon/src/domain/startup-orchestrator.ts:1121 — StartupOrchestrator.fail 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 · native-resume-probe.claudeCurrentRows (cyclomatic 17) · ×1
  • native-resume-probe.claudeCurrentRows (cyclomatic 17) packages/daemon/src/domain/native-resume-probe.ts:652 — native-resume-probe.claudeCurrentRows 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, 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 · check-runner.parseArgs (cyclomatic 17) · ×1
  • check-runner.parseArgs (cyclomatic 17) docs/reference/runner-conformance/check-runner.mjs:32 — check-runner.parseArgs 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 · daemon-lifecycle.waitForKernelReady (cyclomatic 17) · ×1
  • daemon-lifecycle.waitForKernelReady (cyclomatic 17) REDACTED:1520 — daemon-lifecycle.waitForKernelReady 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 · ps.parseFilter (cyclomatic 17) · ×1
  • ps.parseFilter (cyclomatic 17) packages/cli/src/commands/ps.ts:310 — ps.parseFilter 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 · queue-receipt.rowReceipt (cyclomatic 17) · ×1
  • queue-receipt.rowReceipt (cyclomatic 17) packages/cli/src/queue-receipt.ts:118 — queue-receipt.rowReceipt 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 · whoami.runCrossHostWhoami (cyclomatic 17) · ×1
  • whoami.runCrossHostWhoami (cyclomatic 17) packages/cli/src/commands/whoami.ts:474 — whoami.runCrossHostWhoami 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 · whoami.runFanOutWhoami (cyclomatic 17) · ×1
  • whoami.runFanOutWhoami (cyclomatic 17) packages/cli/src/commands/whoami.ts:586 — whoami.runFanOutWhoami has cyclomatic complexity 17 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bundle-configuration.stageConfiguration (cyclomatic 17) · ×1
  • bundle-configuration.stageConfiguration (cyclomatic 17) packages/cli/src/lib/bundle-configuration.ts:168 — bundle-configuration.stageConfiguration 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 · scope-fs.resolveMissionsRoot (cyclomatic 17) · ×1
  • scope-fs.resolveMissionsRoot (cyclomatic 17) packages/cli/src/lib/scope/scope-fs.ts:313 — scope-fs.resolveMissionsRoot 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 · context-git.addGitContext (cyclomatic 17) · ×1
  • context-git.addGitContext (cyclomatic 17) packages/cli/src/lib/context-git.ts:184 — context-git.addGitContext 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 · down.showAgentsBeforeDown (cyclomatic 17) · ×1
  • down.showAgentsBeforeDown (cyclomatic 17) packages/cli/src/commands/down.ts:112 — down.showAgentsBeforeDown has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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 · runtime-detect.detectRuntime (cyclomatic 17) · ×1
  • runtime-detect.detectRuntime (cyclomatic 17) packages/cli/src/restore-packet/runtime-detect.ts:42 — runtime-detect.detectRuntime 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 · capability-delta.capabilityDeltaExpiryFindings (cyclomatic 17) · ×1
  • capability-delta.capabilityDeltaExpiryFindings (cyclomatic 17) packages/cli/src/lib/scope/capability-delta.ts:26 — capability-delta.capabilityDeltaExpiryFindings 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 · terminal-window.openTerminalWindow · ×1
  • terminal-window.openTerminalWindow::measureWindow (cyclomatic 17) packages/cli/src/terminal-window.ts:272 — terminal-window.openTerminalWindow::measureWindow 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 shape REPEATS in the file: one other method here (terminal-window.openTerminalWindow) 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-relay.settingsRelayReports (cyclomatic 17) · ×1
  • activity-relay.settingsRelayReports (cyclomatic 17) REDACTED:446 — activity-relay.settingsRelayReports has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 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-activity-hooks.deriveRelayEvents (cyclomatic 17) · ×1
  • claude-activity-hooks.deriveRelayEvents (cyclomatic 17) packages/daemon/src/domain/claude-activity-hooks.ts:62 — claude-activity-hooks.deriveRelayEvents has cyclomatic complexity 17 (threshold 15). Of this number, 15 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 · claude-owned-settings.cleanupOwnedClaudeCwd (cyclomatic 17) · ×1
  • claude-owned-settings.cleanupOwnedClaudeCwd (cyclomatic 17) packages/daemon/src/domain/claude-owned-settings.ts:112 — claude-owned-settings.cleanupOwnedClaudeCwd 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 · ClaudeCodeAdapter.paneOccupant (cyclomatic 17) · ×1
  • ClaudeCodeAdapter.paneOccupant (cyclomatic 17) packages/daemon/src/adapters/claude-code-adapter.ts:724 — ClaudeCodeAdapter.paneOccupant 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 · CodexRuntimeAdapter.deliverStartup (cyclomatic 17) · ×1
  • CodexRuntimeAdapter.deliverStartup (cyclomatic 17) packages/daemon/src/adapters/codex-runtime-adapter.ts:857 — CodexRuntimeAdapter.deliverStartup 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 · PodRigInstantiator.launchExistingTerminalMember (cyclomatic 17) · ×1
  • PodRigInstantiator.launchExistingTerminalMember (cyclomatic 17) packages/daemon/src/domain/rigspec-instantiator.ts:2975 — PodRigInstantiator.launchExistingTerminalMember 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 · profile-source-resolver.makeProfileReadFile.<returned closure> (cyclomatic 17) · ×1
  • profile-source-resolver.makeProfileReadFile.<returned closure> (cyclomatic 17) packages/daemon/src/domain/context-packs/profile-source-resolver.ts:130 — profile-source-resolver.makeProfileReadFile.<returned closure> has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · current-restore-snapshot.currentRestoreSnapshot (cyclomatic 17) · ×1
  • current-restore-snapshot.currentRestoreSnapshot (cyclomatic 17) packages/daemon/src/domain/current-restore-snapshot.ts:9 — current-restore-snapshot.currentRestoreSnapshot 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 · restore-orchestrator.snapshotLaunchOutcome (cyclomatic 17) · ×1
  • restore-orchestrator.snapshotLaunchOutcome (cyclomatic 17) packages/daemon/src/domain/restore-orchestrator.ts:194 — restore-orchestrator.snapshotLaunchOutcome 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 · feed-perspective.feedPerspective (cyclomatic 17) · ×1
  • feed-perspective.feedPerspective (cyclomatic 17) packages/daemon/src/domain/feed-perspective.ts:14 — feed-perspective.feedPerspective 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 · FileWriteService.writeAtomic (cyclomatic 17) · ×1
  • FileWriteService.writeAtomic (cyclomatic 17) packages/daemon/src/domain/files/file-write-service.ts:114 — FileWriteService.writeAtomic 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 · slack-recovery.threadOrder (cyclomatic 17) · ×1
  • slack-recovery.threadOrder (cyclomatic 17) packages/daemon/src/domain/gateway/slack/slack-recovery.ts:277 — slack-recovery.threadOrder 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 3 function items inside it that branch (a function literal at line 282, stalledAt, scannedAt). 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 · health-detectors.selectContextEpisodeEvidence (cyclomatic 17) · ×1
  • health-detectors.selectContextEpisodeEvidence (cyclomatic 17) packages/daemon/src/domain/health-detectors.ts:324 — health-detectors.selectContextEpisodeEvidence 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 · instance-initialization.ensureOpenRigInstance (cyclomatic 17) · ×1
  • instance-initialization.ensureOpenRigInstance (cyclomatic 17) packages/daemon/src/domain/instance-initialization.ts:41 — instance-initialization.ensureOpenRigInstance 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 · MissionControlAuditBrowse.query (cyclomatic 17) · ×1
  • MissionControlAuditBrowse.query (cyclomatic 17) packages/daemon/src/domain/mission-control/audit-browse.ts:78 — MissionControlAuditBrowse.query 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 · NetworkInstallationStore.replace (cyclomatic 17) · ×1
  • NetworkInstallationStore.replace (cyclomatic 17) packages/daemon/src/domain/network/network-installations.ts:171 — NetworkInstallationStore.replace 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 · NetworkInstallationStore.setParticipants (cyclomatic 17) · ×1
  • NetworkInstallationStore.setParticipants (cyclomatic 17) packages/daemon/src/domain/network/network-installations.ts:323 — NetworkInstallationStore.setParticipants 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 · CodexInPlaceRestart.incomplete (cyclomatic 17) · ×1
  • CodexInPlaceRestart.incomplete (cyclomatic 17) packages/daemon/src/domain/seat-restart-in-place.ts:752 — CodexInPlaceRestart.incomplete 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 · SeatLifecycleService.cleanSeat (cyclomatic 17) · ×1
  • SeatLifecycleService.cleanSeat (cyclomatic 17) packages/daemon/src/domain/seat-lifecycle-service.ts:1289 — SeatLifecycleService.cleanSeat 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 · claude-seat-switch.effortNote (cyclomatic 17) · ×1
  • claude-seat-switch.effortNote (cyclomatic 17) packages/daemon/src/domain/provider/claude-seat-switch.ts:194 — claude-seat-switch.effortNote 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 · ClaudeUsageWindows.project (cyclomatic 17) · ×1
  • ClaudeUsageWindows.project (cyclomatic 17) packages/daemon/src/domain/provider/claude-usage-windows.ts:255 — ClaudeUsageWindows.project 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 · codex-usage-windows.normalizeCodexUsage (cyclomatic 17) · ×1
  • codex-usage-windows.normalizeCodexUsage (cyclomatic 17) packages/daemon/src/domain/provider/codex-usage-windows.ts:55 — codex-usage-windows.normalizeCodexUsage 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 · RestoreCheckService.checkRestorePreconditions (cyclomatic 17) · ×1
  • RestoreCheckService.checkRestorePreconditions (cyclomatic 17) packages/daemon/src/domain/restore-check-service.ts:474 — RestoreCheckService.checkRestorePreconditions has cyclomatic complexity 17 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StreamIntakeCoordinator.drain (cyclomatic 17) · ×1
  • StreamIntakeCoordinator.drain (cyclomatic 17) packages/daemon/src/domain/stream-intake.ts:254 — StreamIntakeCoordinator.drain 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 · rex-adapter.exitedTiles (cyclomatic 17) · ×1
  • rex-adapter.exitedTiles (cyclomatic 17) packages/daemon/src/domain/terminal/rex-adapter.ts:37 — rex-adapter.exitedTiles has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (check, a function literal at line 50, unconfirmed). 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 · TerminalService.resolveComposed (cyclomatic 17) · ×1
  • TerminalService.resolveComposed (cyclomatic 17) packages/daemon/src/domain/terminal/terminal-service.ts:369 — TerminalService.resolveComposed 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 · activity.activityRoutes.get("/parked") (cyclomatic 17) · ×1
  • activity.activityRoutes.get("/parked") (cyclomatic 17) packages/daemon/src/routes/activity.ts:1118 — activity.activityRoutes.get("/parked") has cyclomatic complexity 17 (threshold 15). Of this number, 15 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 · bootstrap.bootstrapRoutes.post("/apply") (cyclomatic 17) · ×1
  • bootstrap.bootstrapRoutes.post("/apply") (cyclomatic 17) packages/daemon/src/routes/bootstrap.ts:77 — bootstrap.bootstrapRoutes.post("/apply") 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · seat.setPermissionsHandler (cyclomatic 17) · ×1
  • seat.setPermissionsHandler (cyclomatic 17) packages/daemon/src/routes/seat.ts:506 — seat.setPermissionsHandler 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: seat.seatLifecycleStatus (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 · scopes-model.proofProvenanceLines (cyclomatic 17) · ×1
  • scopes-model.proofProvenanceLines (cyclomatic 17) packages/tui/src/scopes/scopes-model.ts:167 — scopes-model.proofProvenanceLines 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 · pairing.pairingLines (cyclomatic 17) · ×1
  • pairing.pairingLines (cyclomatic 17) packages/tui/src/config/pairing.ts:36 — pairing.pairingLines 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 · activity-visuals.getActivityStateWithSource (cyclomatic 17) · ×1
  • activity-visuals.getActivityStateWithSource (cyclomatic 17) packages/ui/src/lib/activity-visuals.ts:80 — activity-visuals.getActivityStateWithSource 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 · RuntimeMark.ToolMark (cyclomatic 17) · ×1
  • RuntimeMark.ToolMark (cyclomatic 17) packages/ui/src/components/graphics/RuntimeMark.tsx:406 — RuntimeMark.ToolMark 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 · StoryGraph.StoryGraph (cyclomatic 17) · ×1
  • StoryGraph.StoryGraph (cyclomatic 17) packages/ui/src/components/project/StoryGraph.tsx:119 — StoryGraph.StoryGraph has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 205, 225, 191, …). 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 · MissionReviewTab.BoardRowExpansion (cyclomatic 17) · ×1
  • MissionReviewTab.BoardRowExpansion (cyclomatic 17) packages/ui/src/components/review/MissionReviewTab.tsx:49 — MissionReviewTab.BoardRowExpansion has cyclomatic complexity 17 (threshold 15). Of this number, 11 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 · WorkflowInstancePage.ExceptionBanner (cyclomatic 17) · ×1
  • WorkflowInstancePage.ExceptionBanner (cyclomatic 17) packages/ui/src/components/workflow/WorkflowInstancePage.tsx:69 — WorkflowInstancePage.ExceptionBanner 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 · graph-layout.applyTreeLayout (cyclomatic 17) · ×1
  • graph-layout.applyTreeLayout (cyclomatic 17) packages/ui/src/lib/graph-layout.ts:49 — graph-layout.applyTreeLayout 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 · trace-to-root.render_held_and_next (cyclomatic 17) · ×1
  • trace-to-root.render_held_and_next (cyclomatic 17) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:378 — trace-to-root.render_held_and_next 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 · claude-permission-rules.validateClaudePermissionRules (cyclomatic 16) · ×1
  • claude-permission-rules.validateClaudePermissionRules (cyclomatic 16) packages/daemon/src/domain/claude-permission-rules.ts:9 — claude-permission-rules.validateClaudePermissionRules 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 · composer-prompts.composerContainsOwnedText (cyclomatic 16) · ×1
  • composer-prompts.composerContainsOwnedText (cyclomatic 16) REDACTED:160 — composer-prompts.composerContainsOwnedText 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 · ContextUsageStore.runnerUsage (cyclomatic 16) · ×1
  • ContextUsageStore.runnerUsage (cyclomatic 16) packages/daemon/src/domain/context-usage-store.ts:353 — ContextUsageStore.runnerUsage 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 · pi-runner-protocol.buildPiChildEnv (cyclomatic 16) · ×1
  • pi-runner-protocol.buildPiChildEnv (cyclomatic 16) packages/daemon/src/adapters/pi-runner-protocol.ts:232 — pi-runner-protocol.buildPiChildEnv 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 · native-process-executable.readNativeExecutablePaths (cyclomatic 16) · ×1
  • native-process-executable.readNativeExecutablePaths (cyclomatic 16) packages/daemon/src/domain/native-process-executable.ts:23 — native-process-executable.readNativeExecutablePaths has cyclomatic complexity 16 (threshold 15). Of this number, 14 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 · ResumeMetadataRefresher.captureClaudeSessionId (cyclomatic 16) · ×1
  • ResumeMetadataRefresher.captureClaudeSessionId (cyclomatic 16) packages/daemon/src/domain/resume-metadata-refresher.ts:282 — ResumeMetadataRefresher.captureClaudeSessionId 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 · SettingsStore.reset (cyclomatic 16) · ×1
  • SettingsStore.reset (cyclomatic 16) packages/daemon/src/domain/user-settings/settings-store.ts:1528 — SettingsStore.reset has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: settings-store.getDefaultValue (cyclomatic 99) 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 · claude-theme-menu.currentClaudeThemeMenu (cyclomatic 16) · ×1
  • claude-theme-menu.currentClaudeThemeMenu (cyclomatic 16) packages/daemon/src/domain/claude-theme-menu.ts:4 — claude-theme-menu.currentClaudeThemeMenu has cyclomatic complexity 16 (threshold 15). Of this number, 14 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 · claude-continuation-launch.continuationArguments (cyclomatic 16) · ×1
  • claude-continuation-launch.continuationArguments (cyclomatic 16) packages/daemon/src/domain/claude-continuation-launch.ts:13 — claude-continuation-launch.continuationArguments 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 · seat-skill-storage.recordedSeatSkillFiles (cyclomatic 16) · ×1
  • seat-skill-storage.recordedSeatSkillFiles (cyclomatic 16) packages/daemon/src/domain/seat-skill-storage.ts:920 — seat-skill-storage.recordedSeatSkillFiles has cyclomatic complexity 16 (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 · rigspec-schema.validatePod (cyclomatic 16) · ×1
  • rigspec-schema.validatePod (cyclomatic 16) packages/daemon/src/domain/rigspec-schema.ts:431 — rigspec-schema.validatePod 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 · seat-launch-additions.carrySeatLaunchAdditions (cyclomatic 16) · ×1
  • seat-launch-additions.carrySeatLaunchAdditions (cyclomatic 16) packages/daemon/src/domain/seat-launch-additions.ts:426 — seat-launch-additions.carrySeatLaunchAdditions 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 · HumanQuietStore.quietStateFor (cyclomatic 16) · ×1
  • HumanQuietStore.quietStateFor (cyclomatic 16) packages/daemon/src/domain/gateway/human-quiet-windows.ts:122 — HumanQuietStore.quietStateFor 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 · human-registry.parseBindingSpec (cyclomatic 16) · ×1
  • human-registry.parseBindingSpec (cyclomatic 16) packages/daemon/src/domain/gateway/human-registry.ts:614 — human-registry.parseBindingSpec 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 · message.richInline (cyclomatic 16) · ×1
  • message.richInline (cyclomatic 16) packages/daemon/src/domain/gateway/slack/message.ts:346 — message.richInline 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 · queue-transition-log.formatRelayOwnerNotificationAccepted (cyclomatic 16) · ×1
  • queue-transition-log.formatRelayOwnerNotificationAccepted (cyclomatic 16) packages/daemon/src/domain/queue-transition-log.ts:74 — queue-transition-log.formatRelayOwnerNotificationAccepted 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 · compose.deriveWorkflowExceptions (cyclomatic 16) · ×1
  • compose.deriveWorkflowExceptions (cyclomatic 16) REDACTED:828 — compose.deriveWorkflowExceptions 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 · SliceIndexer.walkSliceLocations (cyclomatic 16) · ×1
  • SliceIndexer.walkSliceLocations (cyclomatic 16) packages/daemon/src/domain/slices/slice-indexer.ts:824 — SliceIndexer.walkSliceLocations has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SliceIndexer.matchQitems (cyclomatic 16) · ×1
  • SliceIndexer.matchQitems (cyclomatic 16) packages/daemon/src/domain/slices/slice-indexer.ts:1242 — SliceIndexer.matchQitems 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · fresh-occupant-relation.readReadyFreshLaunchFences (cyclomatic 16) · ×1
  • fresh-occupant-relation.readReadyFreshLaunchFences (cyclomatic 16) packages/daemon/src/domain/fresh-occupant-relation.ts:44 — fresh-occupant-relation.readReadyFreshLaunchFences 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 · QueueRepository.classifyWakeResult (cyclomatic 16) · ×1
  • QueueRepository.classifyWakeResult (cyclomatic 16) packages/daemon/src/domain/queue-repository.ts:1395 — QueueRepository.classifyWakeResult 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 · QueueRepository.closeCrossHostHandoffSource (cyclomatic 16) · ×1
  • QueueRepository.closeCrossHostHandoffSource (cyclomatic 16) packages/daemon/src/domain/queue-repository.ts:3174 — QueueRepository.closeCrossHostHandoffSource has cyclomatic complexity 16 (threshold 15). Of this number, 9 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 · QueueRepository.recordWatchdogWakeAttempt (cyclomatic 16) · ×1
  • QueueRepository.recordWatchdogWakeAttempt (cyclomatic 16) packages/daemon/src/domain/queue-repository.ts:4363 — QueueRepository.recordWatchdogWakeAttempt 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 (a function literal at line 4408, recordFired). 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 · StartupOrchestrator.executeActions (cyclomatic 16) · ×1
  • StartupOrchestrator.executeActions (cyclomatic 16) packages/daemon/src/domain/startup-orchestrator.ts:1166 — StartupOrchestrator.executeActions has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · session-transport.countEnvelopeOccurrences (cyclomatic 16) · ×1
  • session-transport.countEnvelopeOccurrences (cyclomatic 16) packages/daemon/src/domain/session-transport.ts:1274 — session-transport.countEnvelopeOccurrences 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. This is NOT this file's highest cyclomatic complexity: session-transport.bridgeable (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 · session-transport.claudeSeatIdle (cyclomatic 16) · ×1
  • session-transport.claudeSeatIdle (cyclomatic 16) packages/daemon/src/domain/session-transport.ts:1891 — session-transport.claudeSeatIdle 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, 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: session-transport.bridgeable (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 · TmuxAdapter.seatScopeStart (cyclomatic 16) · ×1
  • TmuxAdapter.seatScopeStart (cyclomatic 16) packages/daemon/src/adapters/tmux.ts:964 — TmuxAdapter.seatScopeStart 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 · TmuxAdapter.createProbeSession (cyclomatic 16) · ×1
  • TmuxAdapter.createProbeSession (cyclomatic 16) packages/daemon/src/adapters/tmux.ts:1277 — TmuxAdapter.createProbeSession 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 · native-resume-probe.insideClaudeTrustDialog (cyclomatic 16) · ×1
  • native-resume-probe.insideClaudeTrustDialog (cyclomatic 16) packages/daemon/src/domain/native-resume-probe.ts:831 — native-resume-probe.insideClaudeTrustDialog has cyclomatic complexity 16 (threshold 15). Of this number, 14 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 · fake-acp-agent.handle (cyclomatic 16) · ×1
  • fake-acp-agent.handle (cyclomatic 16) docs/reference/runner-conformance/fake-acp-agent.mjs:112 — fake-acp-agent.handle 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 · agent-server.serveAcpAgent · ×1
  • agent-server.serveAcpAgent::askPerson (cyclomatic 16) packages/cli/src/acp/agent-server.ts:276 — agent-server.serveAcpAgent::askPerson 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 · host-registry.updateHostEntry (cyclomatic 16) · ×1
  • host-registry.updateHostEntry (cyclomatic 16) packages/cli/src/host-registry.ts:445 — host-registry.updateHostEntry 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-lifecycle.liveStartReservation (cyclomatic 16) · ×1
  • daemon-lifecycle.liveStartReservation (cyclomatic 16) REDACTED:1143 — daemon-lifecycle.liveStartReservation 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 · doctor.listenerOwnerCheck (cyclomatic 16) · ×1
  • doctor.listenerOwnerCheck (cyclomatic 16) REDACTED:72 — doctor.listenerOwnerCheck 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 · doctor.doctorCommand (cyclomatic 16) · ×1
  • doctor.doctorCommand (cyclomatic 16) REDACTED:618 — doctor.doctorCommand 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 3 function literals inside it that branch (lines 626, 639, 630). 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 · roster.readRosterInventory (cyclomatic 16) · ×1
  • roster.readRosterInventory (cyclomatic 16) packages/cli/src/commands/roster.ts:50 — roster.readRosterInventory 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 · queue.emitHandoffScopeAdvisories (cyclomatic 16) · ×1
  • queue.emitHandoffScopeAdvisories (cyclomatic 16) packages/cli/src/commands/queue.ts:922 — queue.emitHandoffScopeAdvisories 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 · scope.buildSliceMoveCommand (cyclomatic 16) · ×1
  • scope.buildSliceMoveCommand (cyclomatic 16) packages/cli/src/commands/scope.ts:827 — scope.buildSliceMoveCommand 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 2 function literals inside it that branch (lines 834, 852). 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 · seat.printRestartReport (cyclomatic 16) · ×1
  • seat.printRestartReport (cyclomatic 16) packages/cli/src/commands/seat.ts:2063 — seat.printRestartReport 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 · claude-team-permissions.decide (cyclomatic 16) · ×1
  • claude-team-permissions.decide (cyclomatic 16) packages/daemon/assets/claude-team-permissions.cjs:209 — claude-team-permissions.decide 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 · refocus.readConfiguredContent (cyclomatic 16) · ×1
  • refocus.readConfiguredContent (cyclomatic 16) packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs:85 — refocus.readConfiguredContent 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 · refocus.renderRole (cyclomatic 16) · ×1
  • refocus.renderRole (cyclomatic 16) packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs:201 — refocus.renderRole has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, 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 · cmux-transport.normalizePayload (cyclomatic 16) · ×1
  • cmux-transport.normalizePayload (cyclomatic 16) REDACTED:178 — cmux-transport.normalizePayload 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 · codex-owned-plugin-trust.codexPluginContentHash · ×1
  • codex-owned-plugin-trust.codexPluginContentHash::visit (cyclomatic 16) packages/daemon/src/domain/codex-owned-plugin-trust.ts:31 — codex-owned-plugin-trust.codexPluginContentHash::visit 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 · CodexRuntimeAdapter.ensureCodexCorePlugin · ×1
  • CodexRuntimeAdapter.ensureCodexCorePlugin::renewContentApproval (cyclomatic 16) packages/daemon/src/adapters/codex-runtime-adapter.ts:485 — CodexRuntimeAdapter.ensureCodexCorePlugin::renewContentApproval 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. This shape REPEATS in the file: one other method here (CodexRuntimeAdapter.ensureCodexCorePlugin) 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 · CodexRuntimeAdapter.proveResumedProcess (cyclomatic 16) · ×1
  • CodexRuntimeAdapter.proveResumedProcess (cyclomatic 16) packages/daemon/src/adapters/codex-runtime-adapter.ts:1858 — CodexRuntimeAdapter.proveResumedProcess 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 · pi-runner.createPaneCompositor · ×1
  • pi-runner.createPaneCompositor::paint (cyclomatic 16) REDACTED:266 — pi-runner.createPaneCompositor::paint 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. This shape REPEATS in the file: one other method here (pi-runner.createPaneCompositor) 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. This is NOT this file's highest cyclomatic complexity: RunnerCore.acceptRunnerRequest (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · pi-runner.resolveActivityEndpoint (cyclomatic 16) · ×1
  • pi-runner.resolveActivityEndpoint (cyclomatic 16) REDACTED:2004 — pi-runner.resolveActivityEndpoint 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: RunnerCore.acceptRunnerRequest (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · stub-runner.resolveStubActivityEndpoint (cyclomatic 16) · ×1
  • stub-runner.resolveStubActivityEndpoint (cyclomatic 16) REDACTED:273 — stub-runner.resolveStubActivityEndpoint 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 · bundle-types.validatePluginsBlock (cyclomatic 16) · ×1
  • bundle-types.validatePluginsBlock (cyclomatic 16) packages/daemon/src/domain/bundle-types.ts:147 — bundle-types.validatePluginsBlock has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: bundle-types.normalizeBundleSource (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 · bundle-types.normalizeLegacyBundleManifest (cyclomatic 16) · ×1
  • bundle-types.normalizeLegacyBundleManifest (cyclomatic 16) packages/daemon/src/domain/bundle-types.ts:724 — bundle-types.normalizeLegacyBundleManifest 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. This is NOT this file's highest cyclomatic complexity: bundle-types.normalizeBundleSource (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 · bundle-context-packs-router.routeContextPacks (cyclomatic 16) · ×1
  • bundle-context-packs-router.routeContextPacks (cyclomatic 16) packages/daemon/src/domain/bundle-context-packs-router.ts:119 — bundle-context-packs-router.routeContextPacks 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 · compaction-restore-notice.recoveryRecipient (cyclomatic 16) · ×1
  • compaction-restore-notice.recoveryRecipient (cyclomatic 16) packages/daemon/src/domain/compaction-restore-notice.ts:13 — compaction-restore-notice.recoveryRecipient 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 · WorkflowInstanceStore.listFiltered (cyclomatic 16) · ×1
  • WorkflowInstanceStore.listFiltered (cyclomatic 16) packages/daemon/src/domain/workflow-instance-store.ts:360 — WorkflowInstanceStore.listFiltered 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 · WorkflowInstanceStore.updateFrontier (cyclomatic 16) · ×1
  • WorkflowInstanceStore.updateFrontier (cyclomatic 16) packages/daemon/src/domain/workflow-instance-store.ts:387 — WorkflowInstanceStore.updateFrontier 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 · execution-view.isValidGitRef (cyclomatic 16) · ×1
  • execution-view.isValidGitRef (cyclomatic 16) packages/daemon/src/domain/execution-view.ts:311 — execution-view.isValidGitRef 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 · existing-rig-restore.joinAutomaticRestore (cyclomatic 16) · ×1
  • existing-rig-restore.joinAutomaticRestore (cyclomatic 16) packages/daemon/src/domain/existing-rig-restore.ts:254 — existing-rig-restore.joinAutomaticRestore 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, 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 · MissionControlWriteContract.recordAnswer (cyclomatic 16) · ×1
  • MissionControlWriteContract.recordAnswer (cyclomatic 16) packages/daemon/src/domain/mission-control/mission-control-write-contract.ts:763 — MissionControlWriteContract.recordAnswer has cyclomatic complexity 16 (threshold 15). Of this number, 11 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 · health-detectors.evaluateCoordination (cyclomatic 16) · ×1
  • health-detectors.evaluateCoordination (cyclomatic 16) packages/daemon/src/domain/health-detectors.ts:378 — health-detectors.evaluateCoordination 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 · fleet-scopes.aggregateFleetScopes (cyclomatic 16) · ×1
  • fleet-scopes.aggregateFleetScopes (cyclomatic 16) packages/daemon/src/domain/hosts/fleet-scopes.ts:258 — fleet-scopes.aggregateFleetScopes has cyclomatic complexity 16 (threshold 15). 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 items inside it that branch (worker, a function literal at line 279). 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 · hosts-registry-writer.updateHostEntry (cyclomatic 16) · ×1
  • hosts-registry-writer.updateHostEntry (cyclomatic 16) packages/daemon/src/domain/hosts/hosts-registry-writer.ts:132 — hosts-registry-writer.updateHostEntry 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 · ViewProjector.runBuiltIn (cyclomatic 16) · ×1
  • ViewProjector.runBuiltIn (cyclomatic 16) packages/daemon/src/domain/view-projector.ts:186 — ViewProjector.runBuiltIn 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 · plugin-discovery-service.extractHookIdentities (cyclomatic 16) · ×1
  • plugin-discovery-service.extractHookIdentities (cyclomatic 16) packages/daemon/src/domain/plugin-discovery-service.ts:704 — plugin-discovery-service.extractHookIdentities 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 · mode-scheduled-end.runModeScheduledEnd (cyclomatic 16) · ×1
  • mode-scheduled-end.runModeScheduledEnd (cyclomatic 16) packages/daemon/src/domain/policies/mode-scheduled-end.ts:51 — mode-scheduled-end.runModeScheduledEnd 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 · mode-scheduled-end.recipientFor (cyclomatic 16) · ×1
  • mode-scheduled-end.recipientFor (cyclomatic 16) packages/daemon/src/domain/policies/mode-scheduled-end.ts:107 — mode-scheduled-end.recipientFor 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, 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 · CodexInPlaceRestart.stopUnderShell (cyclomatic 16) · ×1
  • CodexInPlaceRestart.stopUnderShell (cyclomatic 16) packages/daemon/src/domain/seat-restart-in-place.ts:651 — CodexInPlaceRestart.stopUnderShell 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 3 function items inside it that branch (gone, wait, a function literal at line 674). 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 · SeatLifecycleService.setPolicy (cyclomatic 16) · ×1
  • SeatLifecycleService.setPolicy (cyclomatic 16) packages/daemon/src/domain/seat-lifecycle-service.ts:1138 — SeatLifecycleService.setPolicy 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 · queue-retention.runQueueRetentionSweep (cyclomatic 16) · ×1
  • queue-retention.runQueueRetentionSweep (cyclomatic 16) packages/daemon/src/domain/queue-retention.ts:559 — queue-retention.runQueueRetentionSweep 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 · RestoreCheckService.buildRecovery (cyclomatic 16) · ×1
  • RestoreCheckService.buildRecovery (cyclomatic 16) packages/daemon/src/domain/restore-check-service.ts:1587 — RestoreCheckService.buildRecovery has cyclomatic complexity 16 (threshold 15). Of this number, 14 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 · RestoreCheckService.checkSharedConversations (cyclomatic 16) · ×1
  • RestoreCheckService.checkSharedConversations (cyclomatic 16) packages/daemon/src/domain/restore-check-service.ts:1752 — RestoreCheckService.checkSharedConversations 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 · RestoreCheckService.buildRigRollup (cyclomatic 16) · ×1
  • RestoreCheckService.buildRigRollup (cyclomatic 16) packages/daemon/src/domain/restore-check-service.ts:1798 — RestoreCheckService.buildRigRollup 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 · fleet-compose.readHostComposedRig (cyclomatic 16) · ×1
  • fleet-compose.readHostComposedRig (cyclomatic 16) packages/daemon/src/domain/review/fleet-compose.ts:255 — fleet-compose.readHostComposedRig 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 · RigLifecycleService.releaseRig · ×1
  • RigLifecycleService.releaseRig::release (cyclomatic 16) packages/daemon/src/domain/rig-lifecycle-service.ts:362 — RigLifecycleService.releaseRig::release 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 · SeatSwitchClientService.switchClient (cyclomatic 16) · ×1
  • SeatSwitchClientService.switchClient (cyclomatic 16) packages/daemon/src/domain/seat-switch-client-service.ts:97 — SeatSwitchClientService.switchClient 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 · SliceDetailProjector.buildStory (cyclomatic 16) · ×1
  • SliceDetailProjector.buildStory (cyclomatic 16) packages/daemon/src/domain/slices/slice-detail-projector.ts:343 — SliceDetailProjector.buildStory 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 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 · herdr-live-workspace.findLiveHerdrWorkspace (cyclomatic 16) · ×1
  • herdr-live-workspace.findLiveHerdrWorkspace (cyclomatic 16) packages/daemon/src/domain/terminal/herdr-live-workspace.ts:113 — herdr-live-workspace.findLiveHerdrWorkspace 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 5 function items inside it that branch (a function literal at line 123, a function literal at line 125, a function literal at line 120, …). 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 · HerdrAdapter.reuseLiveWorkspace (cyclomatic 16) · ×1
  • HerdrAdapter.reuseLiveWorkspace (cyclomatic 16) packages/daemon/src/domain/terminal/herdr-adapter.ts:706 — HerdrAdapter.reuseLiveWorkspace 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 · HerdrAppProvider.endVerified (cyclomatic 16) · ×1
  • HerdrAppProvider.endVerified (cyclomatic 16) packages/daemon/src/domain/terminal/herdr-app-provider.ts:665 — HerdrAppProvider.endVerified 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 · TerminalFollowing.constructor (cyclomatic 16) · ×1
  • TerminalFollowing.constructor (cyclomatic 16) packages/daemon/src/domain/terminal/terminal-following.ts:22 — TerminalFollowing.constructor 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, 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 · TerminalService.renderFollowing (cyclomatic 16) · ×1
  • TerminalService.renderFollowing (cyclomatic 16) packages/daemon/src/domain/terminal/terminal-service.ts:251 — TerminalService.renderFollowing has cyclomatic complexity 16 (threshold 15). 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: 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 · frontmatter-validator.validateWorkspaceFrontmatter (cyclomatic 16) · ×1
  • frontmatter-validator.validateWorkspaceFrontmatter (cyclomatic 16) packages/daemon/src/domain/workspace/frontmatter-validator.ts:79 — frontmatter-validator.validateWorkspaceFrontmatter has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function 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.
D1 · Cyclomatic Complexity · activity.recordPromptObservation (cyclomatic 16) · ×1
  • activity.recordPromptObservation (cyclomatic 16) packages/daemon/src/routes/activity.ts:1226 — activity.recordPromptObservation 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 · network.networkRoutes (cyclomatic 16) · ×1
  • network.networkRoutes (cyclomatic 16) packages/daemon/src/routes/network.ts:13 — network.networkRoutes 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 6 function items inside it that branch (a function literal at line 42, a function literal at line 62, a function literal at line 53, …). 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 · mission-control.missionControlRoutes · ×1
  • mission-control.missionControlRoutes::errorResponse (cyclomatic 16) packages/daemon/src/routes/mission-control.ts:226 — mission-control.missionControlRoutes::errorResponse 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 · terminal.readFollowControls (cyclomatic 16) · ×1
  • terminal.readFollowControls (cyclomatic 16) packages/daemon/src/routes/terminal.ts:27 — terminal.readFollowControls has cyclomatic complexity 16 (threshold 15). Of this number, 14 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 · terminal.readOpenBody (cyclomatic 16) · ×1
  • terminal.readOpenBody (cyclomatic 16) packages/daemon/src/routes/terminal.ts:71 — terminal.readOpenBody 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 · execution-model.stateWord (cyclomatic 16) · ×1
  • execution-model.stateWord (cyclomatic 16) packages/tui/src/execution/execution-model.ts:276 — execution-model.stateWord 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 · detail.wrapDetailLines (cyclomatic 16) · ×1
  • detail.wrapDetailLines (cyclomatic 16) packages/tui/src/detail.ts:35 — detail.wrapDetailLines 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 2 function literals inside it that branch (lines 43, 39). 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 · stylize.paintContent (cyclomatic 16) · ×1
  • stylize.paintContent (cyclomatic 16) packages/tui/src/stylize.ts:92 — stylize.paintContent 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 · useActivityFeed.eventColor (cyclomatic 16) · ×1
  • useActivityFeed.eventColor (cyclomatic 16) packages/ui/src/hooks/useActivityFeed.ts:161 — useActivityFeed.eventColor 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 · HotPotatoEdge.HotPotatoEdge (cyclomatic 16) · ×1
  • HotPotatoEdge.HotPotatoEdge (cyclomatic 16) packages/ui/src/components/topology/HotPotatoEdge.tsx:8 — HotPotatoEdge.HotPotatoEdge 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 · LaunchRecoveryModal.LaunchRecoveryModal (cyclomatic 16) · ×1
  • LaunchRecoveryModal.LaunchRecoveryModal (cyclomatic 16) packages/ui/src/components/LaunchRecoveryModal.tsx:105 — LaunchRecoveryModal.LaunchRecoveryModal has cyclomatic complexity 16 (threshold 15). Of this number, 12 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 · HostMultiRigGraph.HostMultiRigGraph (cyclomatic 16) · ×1
  • HostMultiRigGraph.HostMultiRigGraph (cyclomatic 16) packages/ui/src/components/topology/HostMultiRigGraph.tsx:87 — HostMultiRigGraph.HostMultiRigGraph 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 5 function items inside it that branch (onNodeClick, a function literal at line 134, a function literal at line 272, …). 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 · AgentsBandView.AgentsBandView (cyclomatic 16) · ×1
  • AgentsBandView.AgentsBandView (cyclomatic 16) packages/ui/src/components/review/AgentsBandView.tsx:105 — AgentsBandView.AgentsBandView has cyclomatic complexity 16 (threshold 15). Of this number, 13 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 · MissionReviewTab.MissionReviewTab (cyclomatic 16) · ×1
  • MissionReviewTab.MissionReviewTab (cyclomatic 16) packages/ui/src/components/review/MissionReviewTab.tsx:293 — MissionReviewTab.MissionReviewTab has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DocsTab.DocsTab (cyclomatic 16) · ×1
  • DocsTab.DocsTab (cyclomatic 16) packages/ui/src/components/slices/tabs/DocsTab.tsx:23 — DocsTab.DocsTab 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, 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 · graph-layout.layoutSingleColumn (cyclomatic 16) · ×1
  • graph-layout.layoutSingleColumn (cyclomatic 16) packages/ui/src/lib/graph-layout.ts:231 — graph-layout.layoutSingleColumn has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 4 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 · compose.blocking_state (cyclomatic 16) · ×1
  • compose.blocking_state (cyclomatic 16) packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:141 — compose.blocking_state 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 · trace-to-root.intent (cyclomatic 16) · ×1
  • trace-to-root.intent (cyclomatic 16) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:112 — trace-to-root.intent has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · mcp-server.createMcpServer (cognitive 913) · ×1
  • mcp-server.createMcpServer (cognitive 913) packages/cli/src/mcp-server.ts:982 — mcp-server.createMcpServer has cognitive complexity 913 (threshold 15). Drivers by points: if/else 223 (419 pts), ternaries 128 (282 pts), boolean chains 107, error handling 45 (96 pts), loops 4 (9 pts) (nesting depth added 406). Of this number, 48 points are the body's own statements and 865 belong to 73 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 · bundle-behaviour.describeBundleBehaviour (cognitive 577) · ×1
  • bundle-behaviour.describeBundleBehaviour (cognitive 577) packages/daemon/src/domain/bundle-behaviour.ts:110 — bundle-behaviour.describeBundleBehaviour has cognitive complexity 577 (threshold 15). Drivers by points: ternaries 64 (306 pts), if/else 62 (167 pts), loops 20 (48 pts), boolean chains 46, error handling 4 (10 pts) (nesting depth added 381). Of this number, 499 points are the body's own statements and 78 belong to 16 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 · render.contentLines (cognitive 505) · ×1
  • render.contentLines (cognitive 505) packages/tui/src/render.ts:962 — render.contentLines has cognitive complexity 505 (threshold 15). Drivers by points: ternaries 66 (221 pts), if/else 89 (208 pts), boolean chains 40, loops 8 (31 pts), error handling 1 (5 pts) (nesting depth added 301). Of this number, 474 points are the body's own statements and 31 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 · up.upCommand (cognitive 428) · ×1
  • up.upCommand (cognitive 428) packages/cli/src/commands/up.ts:101 — up.upCommand has cognitive complexity 428 (threshold 15). Drivers by points: if/else 105 (191 pts), ternaries 35 (103 pts), loops 25 (69 pts), boolean chains 49, error handling 9 (16 pts) (nesting depth added 205). None of this is in the body itself: all 428 points belong to 9 function literals inside it that branch (lines 154, 380, 365, …). 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 · StartupOrchestrator.startNodeWithWarnings (cognitive 427) · ×1
  • StartupOrchestrator.startNodeWithWarnings (cognitive 427) packages/daemon/src/domain/startup-orchestrator.ts:347 — StartupOrchestrator.startNodeWithWarnings has cognitive complexity 427 (threshold 15). Drivers by points: if/else 101 (201 pts), ternaries 43 (87 pts), boolean chains 61, error handling 22 (54 pts), loops 10 (24 pts) (nesting depth added 190). Of this number, 406 points are the body's own statements and 21 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 · queue-wake-ladder.advancePromptRefusals (cognitive 388) · ×1
  • queue-wake-ladder.advancePromptRefusals (cognitive 388) packages/daemon/src/domain/queue-wake-ladder.ts:1256 — queue-wake-ladder.advancePromptRefusals has cognitive complexity 388 (threshold 15). Drivers by points: if/else 95 (244 pts), boolean chains 62, ternaries 16 (49 pts), loops 14 (27 pts), error handling 4 (6 pts) (nesting depth added 197). Of this number, 359 points are the body's own statements and 29 belong to 14 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 · RestoreOrchestrator.postLaunchRestore (cognitive 382) · ×1
  • RestoreOrchestrator.postLaunchRestore (cognitive 382) packages/daemon/src/domain/restore-orchestrator.ts:1947 — RestoreOrchestrator.postLaunchRestore has cognitive complexity 382 (threshold 15). Drivers by points: if/else 73 (195 pts), ternaries 39 (133 pts), boolean chains 62, error handling 8 (27 pts), loops 4 (12 pts) (nesting depth added 243). 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 (RestoreOrchestrator.postLaunchRestore::effortForRestore) 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 · SessionTransport.sendUnguarded (cognitive 362) · ×1
  • SessionTransport.sendUnguarded (cognitive 362) packages/daemon/src/domain/session-transport.ts:3444 — SessionTransport.sendUnguarded has cognitive complexity 362 (threshold 15). Drivers by points: if/else 93 (156 pts), ternaries 65 (131 pts), boolean chains 57, error handling 12 (18 pts) (nesting depth added 135). Of this number, 278 points are the body's own statements and 84 belong to 23 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 · queue.queueCommand (cognitive 321) · ×1
  • queue.queueCommand (cognitive 321) packages/cli/src/commands/queue.ts:1299 — queue.queueCommand has cognitive complexity 321 (threshold 15). Drivers by points: if/else 140 (172 pts), ternaries 56 (83 pts), boolean chains 40, error handling 11 (19 pts), loops 5, match/switch 1 (2 pts) (nesting depth added 68). None of this is in the body itself: all 321 points belong to 40 function literals inside it that branch (lines 1458, 1336, 2381, …). 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 · workflow.workflowRoutes · ×1
  • workflow.workflowRoutes::errorResponse (cognitive 314) packages/daemon/src/routes/workflow.ts:46 — workflow.workflowRoutes::errorResponse has cognitive complexity 314 (threshold 15). Drivers by points: ternaries 33 (289 pts), boolean chains 18, if/else 7 (nesting depth added 256). 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.contextCommand (cognitive 312) · ×1
  • context.contextCommand (cognitive 312) REDACTED:241 — context.contextCommand has cognitive complexity 312 (threshold 15). Drivers by points: if/else 111 (172 pts), ternaries 32 (65 pts), loops 25 (45 pts), error handling 15 (17 pts), boolean chains 13 (nesting depth added 116). Most of this is not in the body itself: 3 of the 312 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 276, a function literal at line 892, a function literal at line 723, …). 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 · queue-stuck-sweep.runStuckSweep (cognitive 308) · ×1
  • queue-stuck-sweep.runStuckSweep (cognitive 308) packages/daemon/src/domain/queue-stuck-sweep.ts:804 — queue-stuck-sweep.runStuckSweep has cognitive complexity 308 (threshold 15). Drivers by points: if/else 148 (273 pts), boolean chains 121, ternaries 63 (121 pts), loops 21 (27 pts), error handling 12 (20 pts), match/switch 1 (nesting depth added 197). To reduce it, split the body into named stages: move each independent 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: 4 other methods here (queue-stuck-sweep.runStuckSweep::undeliveredCandidate, queue-stuck-sweep.runStuckSweep::unclaimedCandidate, queue-stuck-sweep.runStuckSweep::custodyCandidate, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 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 · attention.attentionRoutes (cognitive 296) · ×1
  • attention.attentionRoutes (cognitive 296) packages/daemon/src/routes/attention.ts:19 — attention.attentionRoutes has cognitive complexity 296 (threshold 15). Drivers by points: ternaries 54 (152 pts), if/else 30 (62 pts), boolean chains 44, error handling 9 (20 pts), loops 8 (18 pts) (nesting depth added 151). None of this is in the body itself: all 296 points belong to 24 function literals inside it that branch (lines 21, 117, 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.
D2 · Cognitive Complexity · hydrate.hydrateSnapshot (cognitive 277) · ×1
  • hydrate.hydrateSnapshot (cognitive 277) packages/tui/src/hydrate.ts:392 — hydrate.hydrateSnapshot has cognitive complexity 277 (threshold 15). Drivers by points: ternaries 93 (144 pts), boolean chains 66, if/else 34 (53 pts), loops 5 (9 pts), error handling 3 (5 pts) (nesting depth added 76). Of this number, 227 points are the body's own statements and 50 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 · start.startCommand (cognitive 261) · ×1
  • start.startCommand (cognitive 261) packages/cli/src/commands/start.ts:181 — start.startCommand has cognitive complexity 261 (threshold 15). Drivers by points: if/else 70 (142 pts), ternaries 19 (55 pts), loops 11 (32 pts), error handling 8 (17 pts), boolean chains 15 (nesting depth added 138). None of this is in the body itself: all 261 points belong to one function literal inside it that branches (line 210). 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 · agent-manifest.validateAgentSpec (cognitive 254) · ×1
  • agent-manifest.validateAgentSpec (cognitive 254) packages/daemon/src/domain/agent-manifest.ts:151 — agent-manifest.validateAgentSpec has cognitive complexity 254 (threshold 15). Drivers by points: if/else 47 (176 pts), boolean chains 39, loops 8 (32 pts), ternaries 2 (7 pts) (nesting depth added 158). Of this number, 239 points are the body's own statements and 15 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · activity.postHook (cognitive 230) · ×1
  • activity.postHook (cognitive 230) packages/daemon/src/routes/activity.ts:396 — activity.postHook has cognitive complexity 230 (threshold 15). Drivers by points: if/else 57 (110 pts), boolean chains 50, ternaries 18 (50 pts), error handling 8 (20 pts) (nesting depth added 97). Of this number, 218 points are the body's own statements and 12 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 · queue-wake-ladder.runWakeLadderTick (cognitive 219) · ×1
  • queue-wake-ladder.runWakeLadderTick (cognitive 219) packages/daemon/src/domain/queue-wake-ladder.ts:671 — queue-wake-ladder.runWakeLadderTick has cognitive complexity 219 (threshold 15). Drivers by points: if/else 48 (128 pts), ternaries 13 (36 pts), boolean chains 29, loops 10 (22 pts), error handling 3 (4 pts) (nesting depth added 116). Of this number, 212 points are the body's own statements and 7 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 · gateway.gatewayCommand (cognitive 204) · ×1
  • gateway.gatewayCommand (cognitive 204) packages/cli/src/commands/gateway.ts:166 — gateway.gatewayCommand has cognitive complexity 204 (threshold 15). Drivers by points: if/else 68 (84 pts), ternaries 57 (83 pts), loops 17 (20 pts), boolean chains 14, error handling 2 (3 pts) (nesting depth added 46). None of this is in the body itself: all 204 points belong to 33 function items inside it that branch (a function literal at line 579, a function literal at line 759, a function literal at line 192, …). 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 · package-manifest.validateManifest (cognitive 200) · ×1
  • package-manifest.validateManifest (cognitive 200) packages/daemon/src/domain/package-manifest.ts:125 — package-manifest.validateManifest has cognitive complexity 200 (threshold 15). Drivers by points: if/else 49 (141 pts), loops 11 (40 pts), boolean chains 19 (nesting depth added 121). 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 · slack.slackCommand (cognitive 198) · ×1
  • slack.slackCommand (cognitive 198) packages/cli/src/commands/slack.ts:188 — slack.slackCommand has cognitive complexity 198 (threshold 15). Drivers by points: if/else 49 (86 pts), ternaries 29 (66 pts), loops 13 (26 pts), boolean chains 12, error handling 8 (nesting depth added 87). None of this is in the body itself: all 198 points belong to 16 function items inside it that branch (a function literal at line 241, a function literal at line 381, a function literal at line 355, …). 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 · FeedCardQuestionAsk.FeedCardQuestionAsk (cognitive 198) · ×1
  • FeedCardQuestionAsk.FeedCardQuestionAsk (cognitive 198) packages/ui/src/components/for-you/FeedCardQuestionAsk.tsx:183 — FeedCardQuestionAsk.FeedCardQuestionAsk has cognitive complexity 198 (threshold 15). Drivers by points: ternaries 54 (112 pts), boolean chains 46, if/else 30 (37 pts), error handling 2, loops 1 (nesting depth added 65). Of this number, 86 points are the body's own statements and 112 belong to 20 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 · watchdog.watchdogRoutes · ×1
  • watchdog.watchdogRoutes::errorResponse (cognitive 191) packages/daemon/src/routes/watchdog.ts:44 — watchdog.watchdogRoutes::errorResponse has cognitive complexity 191 (threshold 15). Drivers by points: ternaries 19 (190 pts), if/else 1 (nesting depth added 171). 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 · launch.launchCommand (cognitive 190) · ×1
  • launch.launchCommand (cognitive 190) packages/cli/src/commands/launch.ts:70 — launch.launchCommand has cognitive complexity 190 (threshold 15). Drivers by points: if/else 64 (113 pts), ternaries 14 (36 pts), boolean chains 23, loops 6 (13 pts), error handling 2 (5 pts) (nesting depth added 81). None of this is in the body itself: all 190 points belong to 7 function items inside it that branch (a function literal at line 93, a function literal at line 249, a function literal at line 273, …). 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 · walk.walkCommand (cognitive 187) · ×1
  • walk.walkCommand (cognitive 187) packages/cli/src/commands/walk.ts:54 — walk.walkCommand has cognitive complexity 187 (threshold 15). Drivers by points: if/else 61 (136 pts), ternaries 9 (22 pts), boolean chains 12, error handling 4 (9 pts), loops 4 (8 pts) (nesting depth added 97). None of this is in the body itself: all 187 points belong to 7 function items inside it that branch (a function literal at line 96, a function literal at line 263, resolveProfilePieces, …). 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 · SessionTransport.sendClassifiedInput (cognitive 182) · ×1
  • SessionTransport.sendClassifiedInput (cognitive 182) packages/daemon/src/domain/session-transport.ts:3046 — SessionTransport.sendClassifiedInput has cognitive complexity 182 (threshold 15). Drivers by points: if/else 49 (86 pts), ternaries 22 (50 pts), boolean chains 35, error handling 3 (7 pts), loops 3 (4 pts) (nesting depth added 70). Of this number, 85 points are the body's own statements and 97 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 · input.parseText (cognitive 182) · ×1
  • input.parseText (cognitive 182) packages/tui/src/input.ts:9 — input.parseText has cognitive complexity 182 (threshold 15). Drivers by points: if/else 26 (86 pts), ternaries 15 (80 pts), boolean chains 15, loops 1 (nesting depth added 125). 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 · SeatHandoverService.handover (cognitive 180) · ×1
  • SeatHandoverService.handover (cognitive 180) packages/daemon/src/domain/seat-handover-service.ts:400 — SeatHandoverService.handover has cognitive complexity 180 (threshold 15). Drivers by points: if/else 50 (79 pts), ternaries 33 (70 pts), boolean chains 23, error handling 4 (6 pts), match/switch 1 (2 pts) (nesting depth added 69). Of this number, 172 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 · terminal-window.openTerminalWindow (cognitive 179) · ×1
  • terminal-window.openTerminalWindow (cognitive 179) packages/cli/src/terminal-window.ts:221 — terminal-window.openTerminalWindow has cognitive complexity 179 (threshold 15). Drivers by points: if/else 53 (94 pts), ternaries 37 (72 pts), boolean chains 41, loops 5 (9 pts), error handling 4 (8 pts) (nesting depth added 84). To reduce it, split the body into named stages: move each independent 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 (terminal-window.openTerminalWindow::measureWindow) 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 · RestoreOrchestrator.restoreNodeWithCompensation (cognitive 178) · ×1
  • RestoreOrchestrator.restoreNodeWithCompensation (cognitive 178) packages/daemon/src/domain/restore-orchestrator.ts:1274 — RestoreOrchestrator.restoreNodeWithCompensation has cognitive complexity 178 (threshold 15). Drivers by points: if/else 53 (95 pts), ternaries 28 (35 pts), boolean chains 32, loops 3 (9 pts), error handling 2 (7 pts) (nesting depth added 60). Of this number, 175 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 · context-packs.contextPacksRoutes (cognitive 177) · ×1
  • context-packs.contextPacksRoutes (cognitive 177) packages/daemon/src/routes/context-packs.ts:62 — context-packs.contextPacksRoutes has cognitive complexity 177 (threshold 15). Drivers by points: if/else 63 (95 pts), ternaries 17 (43 pts), boolean chains 24, error handling 12 (13 pts), loops 2 (nesting depth added 59). None of this is in the body itself: all 177 points belong to 16 function items inside it that branch (a function literal at line 351, a function literal at line 99, a function literal at line 166, …). 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 · LegacyRigSpecSchema.validate (cognitive 170) · ×1
  • LegacyRigSpecSchema.validate (cognitive 170) packages/daemon/src/domain/rigspec-schema.ts:1399 — LegacyRigSpecSchema.validate has cognitive complexity 170 (threshold 15). Drivers by points: if/else 42 (114 pts), error handling 7 (28 pts), boolean chains 20, loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 97). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · finite-telemetry.readTelemetryPage (cognitive 170) · ×1
  • finite-telemetry.readTelemetryPage (cognitive 170) packages/daemon/src/domain/finite-telemetry.ts:114 — finite-telemetry.readTelemetryPage has cognitive complexity 170 (threshold 15). Drivers by points: if/else 36 (64 pts), ternaries 29 (53 pts), boolean chains 42, loops 4 (11 pts) (nesting depth added 59). Of this number, 26 points are the body's own statements and 144 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 · HerdrFollowView.apply (cognitive 170) · ×1
  • HerdrFollowView.apply (cognitive 170) packages/daemon/src/domain/terminal/herdr-follow-view.ts:47 — HerdrFollowView.apply has cognitive complexity 170 (threshold 15). Drivers by points: if/else 59 (102 pts), boolean chains 22, ternaries 13 (22 pts), loops 13 (14 pts), error handling 6 (10 pts) (nesting depth added 57). Of this number, 133 points are the body's own statements and 37 belong to 13 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.computeExplorerRows (cognitive 170) · ×1
  • state.computeExplorerRows (cognitive 170) packages/tui/src/state.ts:634 — state.computeExplorerRows has cognitive complexity 170 (threshold 15). Drivers by points: if/else 20 (61 pts), ternaries 13 (58 pts), loops 11 (43 pts), boolean chains 8 (nesting depth added 118). Of this number, 169 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 · startup.applySelectedHistory (cognitive 154) · ×1
  • startup.applySelectedHistory (cognitive 154) packages/daemon/src/routes/startup.ts:382 — startup.applySelectedHistory has cognitive complexity 154 (threshold 15). Drivers by points: ternaries 38 (75 pts), if/else 32 (42 pts), boolean chains 32, error handling 3 (4 pts), loops 1 (nesting depth added 48). Most of this is not in the body itself: 11 of the 154 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 397, 495, 402, …). 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 · provider.providerRoutes (cognitive 154) · ×1
  • provider.providerRoutes (cognitive 154) packages/daemon/src/routes/provider.ts:143 — provider.providerRoutes has cognitive complexity 154 (threshold 15). Drivers by points: if/else 51 (57 pts), boolean chains 50, ternaries 29 (40 pts), error handling 5, loops 2 (nesting depth added 17). Most of this is not in the body itself: 2 of the 154 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 366, a function literal at line 264, a function literal at line 188, …). 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 · QueueRepository.updateInTransactionalContext (cognitive 150) · ×1
  • QueueRepository.updateInTransactionalContext (cognitive 150) packages/daemon/src/domain/queue-repository.ts:3628 — QueueRepository.updateInTransactionalContext has cognitive complexity 150 (threshold 15). Drivers by points: if/else 50 (74 pts), boolean chains 49, ternaries 15 (27 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RunnerCore.handleResponse (cognitive 148) · ×1
  • RunnerCore.handleResponse (cognitive 148) REDACTED:1254 — RunnerCore.handleResponse has cognitive complexity 148 (threshold 15). Drivers by points: if/else 43 (89 pts), ternaries 15 (37 pts), boolean chains 22 (nesting depth added 68). 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 · host.hostCommand (cognitive 147) · ×1
  • host.hostCommand (cognitive 147) packages/cli/src/commands/host.ts:558 — host.hostCommand has cognitive complexity 147 (threshold 15). Drivers by points: if/else 61 (76 pts), ternaries 19 (44 pts), boolean chains 12, error handling 8 (10 pts), loops 5 (nesting depth added 42). Most of this is not in the body itself: 3 of the 147 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 766, 603, 706, …). 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 · RunnerCore.handleEvent (cognitive 147) · ×1
  • RunnerCore.handleEvent (cognitive 147) REDACTED:1594 — RunnerCore.handleEvent has cognitive complexity 147 (threshold 15). Drivers by points: if/else 49 (77 pts), boolean chains 42, ternaries 11 (27 pts), loops 1 (nesting depth added 44). Of this number, 143 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 · PodRigInstantiator.launchExistingAgentMember (cognitive 147) · ×1
  • PodRigInstantiator.launchExistingAgentMember (cognitive 147) packages/daemon/src/domain/rigspec-instantiator.ts:2477 — PodRigInstantiator.launchExistingAgentMember has cognitive complexity 147 (threshold 15). Drivers by points: ternaries 35 (60 pts), if/else 35 (47 pts), boolean chains 24, error handling 6 (11 pts), loops 2 (5 pts) (nesting depth added 45). Of this number, 132 points are the body's own statements and 15 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 · parked-owner-consumer.makeParkedOwnerConsumerPolicy.evaluate (cognitive 144) · ×1
  • parked-owner-consumer.makeParkedOwnerConsumerPolicy.evaluate (cognitive 144) packages/daemon/src/domain/policies/parked-owner-consumer.ts:202 — parked-owner-consumer.makeParkedOwnerConsumerPolicy.evaluate has cognitive complexity 144 (threshold 15). Drivers by points: if/else 26 (52 pts), boolean chains 31, ternaries 11 (30 pts), error handling 9 (22 pts), loops 4 (9 pts) (nesting depth added 63). Of this number, 136 points are the body's own statements and 8 belong to 8 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 · PassiveCeremonySource.read (cognitive 144) · ×1
  • PassiveCeremonySource.read (cognitive 144) packages/daemon/src/domain/health-passive-ceremony.ts:55 — PassiveCeremonySource.read has cognitive complexity 144 (threshold 15). Drivers by points: if/else 31 (82 pts), ternaries 11 (35 pts), boolean chains 13, loops 6 (10 pts), error handling 1 (4 pts) (nesting depth added 82). Of this number, 137 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 · seat.printHuman (cognitive 143) · ×1
  • seat.printHuman (cognitive 143) packages/cli/src/commands/seat.ts:267 — seat.printHuman has cognitive complexity 143 (threshold 15). Drivers by points: if/else 45 (71 pts), ternaries 23 (54 pts), loops 6 (14 pts), boolean chains 4 (nesting depth added 65). Of this number, 135 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 · startup.createDaemon (cognitive 143) · ×1
  • startup.createDaemon (cognitive 143) packages/daemon/src/startup.ts:344 — startup.createDaemon has cognitive complexity 143 (threshold 15). Drivers by points: if/else 78 (104 pts), ternaries 61 (99 pts), error handling 43 (57 pts), boolean chains 55, loops 17 (22 pts) (nesting depth added 83). To reduce it, split the body into named stages: move each independent 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 (startup.createDaemon::topologyDestinationAdvisory) 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 · render.renderBody (cognitive 143) · ×1
  • render.renderBody (cognitive 143) packages/tui/src/render.ts:1925 — render.renderBody has cognitive complexity 143 (threshold 15). Drivers by points: ternaries 44 (77 pts), if/else 23 (38 pts), boolean chains 22, loops 4 (6 pts) (nesting depth added 50). Of this number, 139 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 · WorkflowValidator.validate (cognitive 141) · ×1
  • WorkflowValidator.validate (cognitive 141) packages/daemon/src/domain/workflow-validator.ts:60 — WorkflowValidator.validate has cognitive complexity 141 (threshold 15). Drivers by points: if/else 50 (86 pts), loops 12 (21 pts), boolean chains 19, ternaries 7 (15 pts) (nesting depth added 53). Of this number, 47 points are the body's own statements and 94 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 · slack-subsystem.buildSlackGatewayWire.engineDeliver (cognitive 141) · ×1
  • slack-subsystem.buildSlackGatewayWire.engineDeliver (cognitive 141) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:1038 — slack-subsystem.buildSlackGatewayWire.engineDeliver has cognitive complexity 141 (threshold 15). Drivers by points: if/else 34 (64 pts), ternaries 19 (49 pts), boolean chains 20, error handling 4 (8 pts) (nesting depth added 64). Of this number, 140 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 · bundle.bundleCommand (cognitive 140) · ×1
  • bundle.bundleCommand (cognitive 140) packages/cli/src/commands/bundle.ts:65 — bundle.bundleCommand has cognitive complexity 140 (threshold 15). Drivers by points: if/else 62 (83 pts), ternaries 18 (26 pts), loops 11 (15 pts), error handling 6 (10 pts), boolean chains 6 (nesting depth added 37). None of this is in the body itself: all 140 points belong to 7 function items inside it that branch (a function literal at line 93, a function literal at line 286, a function literal at line 221, …). 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 · proof.proofCommand (cognitive 138) · ×1
  • proof.proofCommand (cognitive 138) packages/cli/src/commands/proof.ts:138 — proof.proofCommand has cognitive complexity 138 (threshold 15). Drivers by points: if/else 45 (67 pts), ternaries 28 (39 pts), boolean chains 15, loops 6 (11 pts), error handling 5 (6 pts) (nesting depth added 39). None of this is in the body itself: all 138 points belong to 10 function items inside it that branch (a function literal at line 247, a function literal at line 206, a function literal at line 188, …). 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 · settings-browser.settingsBrowser (cognitive 135) · ×1
  • settings-browser.settingsBrowser (cognitive 135) packages/daemon/src/domain/user-settings/settings-browser.ts:117 — settings-browser.settingsBrowser has cognitive complexity 135 (threshold 15). Drivers by points: ternaries 37 (81 pts), if/else 14 (23 pts), loops 9 (14 pts), boolean chains 13, error handling 3 (4 pts) (nesting depth added 59). Of this number, 73 points are the body's own statements and 62 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 · attention-model.attentionLines (cognitive 135) · ×1
  • attention-model.attentionLines (cognitive 135) packages/tui/src/attention/attention-model.ts:62 — attention-model.attentionLines has cognitive complexity 135 (threshold 15). Drivers by points: if/else 24 (60 pts), ternaries 11 (46 pts), loops 5 (19 pts), boolean chains 10 (nesting depth added 85). Of this number, 133 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · manifest-parser.parseAtoms (cognitive 134) · ×1
  • manifest-parser.parseAtoms (cognitive 134) REDACTED:218 — manifest-parser.parseAtoms has cognitive complexity 134 (threshold 15). Drivers by points: if/else 30 (77 pts), ternaries 7 (19 pts), loops 8 (16 pts), boolean chains 13, error handling 3 (9 pts) (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · slack-subsystem.buildSlackGatewayWire (cognitive 134) · ×1
  • slack-subsystem.buildSlackGatewayWire (cognitive 134) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:303 — slack-subsystem.buildSlackGatewayWire has cognitive complexity 134 (threshold 15). Drivers by points: if/else 32 (60 pts), ternaries 18 (30 pts), boolean chains 23, error handling 6 (13 pts), loops 3 (8 pts) (nesting depth added 52). Of this number, 44 points are the body's own statements and 90 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 · RestoreOrchestrator.attemptResume (cognitive 133) · ×1
  • RestoreOrchestrator.attemptResume (cognitive 133) packages/daemon/src/domain/restore-orchestrator.ts:2790 — RestoreOrchestrator.attemptResume has cognitive complexity 133 (threshold 15). Drivers by points: if/else 26 (56 pts), ternaries 25 (56 pts), boolean chains 10, loops 4 (10 pts), error handling 1 (nesting depth added 67). 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 · gateway.gatewayRoutes (cognitive 133) · ×1
  • gateway.gatewayRoutes (cognitive 133) packages/daemon/src/routes/gateway.ts:54 — gateway.gatewayRoutes has cognitive complexity 133 (threshold 15). Drivers by points: if/else 54 (68 pts), ternaries 26 (38 pts), boolean chains 23, error handling 3, loops 1 (nesting depth added 26). Most of this is not in the body itself: 1 of the 133 points is its own statement and the rest belongs to 29 function items inside it that branch (a function literal at line 296, a function literal at line 196, a function literal at line 250, …). 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 · BootstrapOrchestrator.bootstrap (cognitive 131) · ×1
  • BootstrapOrchestrator.bootstrap (cognitive 131) packages/daemon/src/domain/bootstrap-orchestrator.ts:147 — BootstrapOrchestrator.bootstrap has cognitive complexity 131 (threshold 15). Drivers by points: if/else 28 (75 pts), ternaries 7 (24 pts), boolean chains 18, error handling 6 (14 pts) (nesting depth added 72). 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 · agent-images.agentImagesRoutes (cognitive 131) · ×1
  • agent-images.agentImagesRoutes (cognitive 131) packages/daemon/src/routes/agent-images.ts:124 — agent-images.agentImagesRoutes has cognitive complexity 131 (threshold 15). Drivers by points: ternaries 33 (63 pts), if/else 32 (42 pts), boolean chains 15, error handling 8 (10 pts), loops 1 (nesting depth added 42). None of this is in the body itself: all 131 points belong to 10 function literals inside it that branch (lines 192, 140, 336, …). 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 · execution-view.buildExecutionView (cognitive 130) · ×1
  • execution-view.buildExecutionView (cognitive 130) packages/daemon/src/domain/execution-view.ts:751 — execution-view.buildExecutionView has cognitive complexity 130 (threshold 15). Drivers by points: ternaries 66 (96 pts), if/else 45 (82 pts), boolean chains 38, loops 13 (18 pts), error handling 5 (11 pts) (nesting depth added 78). To reduce it, split the body into named stages: move each independent 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 (execution-view.buildExecutionView::ladderOf) 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 · setup.runSetup (cognitive 129) · ×1
  • setup.runSetup (cognitive 129) packages/cli/src/commands/setup.ts:456 — setup.runSetup has cognitive complexity 129 (threshold 15). Drivers by points: ternaries 17 (53 pts), if/else 27 (36 pts), error handling 10 (25 pts), boolean chains 11, loops 2 (4 pts) (nesting depth added 62). Of this number, 119 points are the body's own statements and 10 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 · permission-account.planPermissionAccount (cognitive 127) · ×1
  • permission-account.planPermissionAccount (cognitive 127) packages/daemon/src/domain/permission-account.ts:55 — permission-account.planPermissionAccount has cognitive complexity 127 (threshold 15). Drivers by points: ternaries 41 (81 pts), if/else 17 (24 pts), boolean chains 18, error handling 2 (4 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · slack-delivery.deliverSinglePart.<returned closure> (cognitive 126) · ×1
  • slack-delivery.deliverSinglePart.<returned closure> (cognitive 126) packages/daemon/src/domain/gateway/slack/slack-delivery.ts:242 — slack-delivery.deliverSinglePart.<returned closure> has cognitive complexity 126 (threshold 15). Drivers by points: if/else 39 (66 pts), error handling 10 (22 pts), ternaries 10 (22 pts), boolean chains 16 (nesting depth added 51). Of this number, 120 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 · skill-catalog.reconcileSkillLoadout (cognitive 125) · ×1
  • skill-catalog.reconcileSkillLoadout (cognitive 125) packages/daemon/src/domain/skill-catalog.ts:861 — skill-catalog.reconcileSkillLoadout has cognitive complexity 125 (threshold 15). Drivers by points: if/else 33 (63 pts), boolean chains 19, loops 14 (17 pts), error handling 8 (15 pts), ternaries 9 (11 pts) (nesting depth added 42). Of this number, 115 points are the body's own statements and 10 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 · manifest-parser.parseProfiles (cognitive 125) · ×1
  • manifest-parser.parseProfiles (cognitive 125) REDACTED:439 — manifest-parser.parseProfiles has cognitive complexity 125 (threshold 15). Drivers by points: if/else 26 (82 pts), loops 9 (31 pts), boolean chains 12 (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BootstrapOrchestrator.executeStages (cognitive 123) · ×1
  • BootstrapOrchestrator.executeStages (cognitive 123) packages/daemon/src/domain/bootstrap-orchestrator.ts:381 — BootstrapOrchestrator.executeStages has cognitive complexity 123 (threshold 15). Drivers by points: if/else 34 (62 pts), loops 14 (26 pts), ternaries 13 (22 pts), boolean chains 13 (nesting depth added 49). Of this number, 119 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 · rigspec-schema.validateMember (cognitive 122) · ×1
  • rigspec-schema.validateMember (cognitive 122) packages/daemon/src/domain/rigspec-schema.ts:488 — rigspec-schema.validateMember has cognitive complexity 122 (threshold 15). Drivers by points: if/else 64 (90 pts), boolean chains 15, error handling 7 (14 pts), ternaries 1 (2 pts), loops 1 (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 · import.importCommand (cognitive 122) · ×1
  • import.importCommand (cognitive 122) packages/cli/src/commands/import.ts:40 — import.importCommand has cognitive complexity 122 (threshold 15). Drivers by points: if/else 38 (69 pts), boolean chains 20, ternaries 10 (17 pts), loops 4 (11 pts), error handling 3 (5 pts) (nesting depth added 47). None of this is in the body itself: all 122 points belong to one function literal inside it that branches (line 59). 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 · compose.compose_up (cognitive 122) · ×1
  • compose.compose_up (cognitive 122) packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:314 — compose.compose_up has cognitive complexity 122 (threshold 15). Drivers by points: if/else 25 (67 pts), ternaries 11 (28 pts), boolean chains 14, loops 7 (13 pts) (nesting depth added 65). 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 · rig.rigCommand (cognitive 119) · ×1
  • rig.rigCommand (cognitive 119) packages/cli/src/commands/rig.ts:37 — rig.rigCommand has cognitive complexity 119 (threshold 15). Drivers by points: if/else 34 (51 pts), ternaries 13 (26 pts), loops 12 (24 pts), boolean chains 11, error handling 6 (7 pts) (nesting depth added 43). None of this is in the body itself: all 119 points belong to 4 function literals inside it that branch (lines 104, 50, 220, …). 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 · seat-attention-reconciler.rebindAndVerifyPaneIdentity (cognitive 118) · ×1
  • seat-attention-reconciler.rebindAndVerifyPaneIdentity (cognitive 118) packages/daemon/src/domain/seat-attention-reconciler.ts:134 — seat-attention-reconciler.rebindAndVerifyPaneIdentity has cognitive complexity 118 (threshold 15). Drivers by points: ternaries 26 (71 pts), boolean chains 23, if/else 13 (20 pts), error handling 3 (4 pts) (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · WorkflowRuntime.instantiate (cognitive 118) · ×1
  • WorkflowRuntime.instantiate (cognitive 118) packages/daemon/src/domain/workflow-runtime.ts:388 — WorkflowRuntime.instantiate has cognitive complexity 118 (threshold 15). Drivers by points: if/else 38 (70 pts), ternaries 13 (23 pts), boolean chains 12, loops 7 (10 pts), error handling 2 (3 pts) (nesting depth added 46). Of this number, 93 points are the body's own statements and 25 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 · CodexRuntimeAdapter.verifyResumeLaunch (cognitive 116) · ×1
  • CodexRuntimeAdapter.verifyResumeLaunch (cognitive 116) packages/daemon/src/adapters/codex-runtime-adapter.ts:1890 — CodexRuntimeAdapter.verifyResumeLaunch has cognitive complexity 116 (threshold 15). Drivers by points: if/else 27 (65 pts), ternaries 20 (38 pts), boolean chains 12, loops 1 (nesting depth added 56). Of this number, 109 points are the body's own statements and 7 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 · work-install.resolveWorkPosition (cognitive 115) · ×1
  • work-install.resolveWorkPosition (cognitive 115) packages/cli/src/lib/work-install.ts:319 — work-install.resolveWorkPosition has cognitive complexity 115 (threshold 15). Drivers by points: if/else 35 (78 pts), ternaries 5 (19 pts), boolean chains 11, error handling 2 (6 pts), loops 1 (nesting depth added 61). 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 · session-transport.inspectComposerInput (cognitive 114) · ×1
  • session-transport.inspectComposerInput (cognitive 114) packages/daemon/src/domain/session-transport.ts:552 — session-transport.inspectComposerInput has cognitive complexity 114 (threshold 15). Drivers by points: if/else 27 (62 pts), boolean chains 25, ternaries 9 (18 pts), loops 4 (9 pts) (nesting depth added 49). Of this number, 110 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 · project.projectCommand (cognitive 114) · ×1
  • project.projectCommand (cognitive 114) packages/cli/src/commands/project.ts:48 — project.projectCommand has cognitive complexity 114 (threshold 15). Drivers by points: if/else 25 (46 pts), ternaries 17 (42 pts), error handling 7 (15 pts), boolean chains 7, loops 4 (nesting depth added 54). Most of this is not in the body itself: 7 of the 114 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 129, 83, 167, …). 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 · SeatRuntimeSwitchService.setRuntime (cognitive 114) · ×1
  • SeatRuntimeSwitchService.setRuntime (cognitive 114) packages/daemon/src/domain/seat-runtime-switch-service.ts:200 — SeatRuntimeSwitchService.setRuntime has cognitive complexity 114 (threshold 15). Drivers by points: if/else 33 (44 pts), ternaries 17 (31 pts), boolean chains 27, error handling 7 (11 pts), loops 1 (nesting depth added 29). Of this number, 112 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 · daemon-lifecycle.startOwnedDaemon (cognitive 112) · ×1
  • daemon-lifecycle.startOwnedDaemon (cognitive 112) REDACTED:708 — daemon-lifecycle.startOwnedDaemon has cognitive complexity 112 (threshold 15). Drivers by points: if/else 36 (66 pts), ternaries 8 (18 pts), boolean chains 13, error handling 7 (13 pts), loops 2 (nesting depth added 46). Of this number, 81 points are the body's own statements and 31 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 · rigspec-preflight.preflightMembers (cognitive 112) · ×1
  • rigspec-preflight.preflightMembers (cognitive 112) packages/daemon/src/domain/rigspec-preflight.ts:355 — rigspec-preflight.preflightMembers has cognitive complexity 112 (threshold 15). Drivers by points: if/else 21 (68 pts), ternaries 4 (18 pts), loops 7 (16 pts), boolean chains 6, error handling 1 (4 pts) (nesting depth added 73). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · participants.validateParticipantsFile (cognitive 111) · ×1
  • participants.validateParticipantsFile (cognitive 111) packages/daemon/src/domain/gateway/participants.ts:61 — participants.validateParticipantsFile has cognitive complexity 111 (threshold 15). Drivers by points: if/else 46 (91 pts), boolean chains 11, loops 4 (6 pts), ternaries 2 (3 pts) (nesting depth added 48). Of this number, 108 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 · workflow.workflowCommand (cognitive 111) · ×1
  • workflow.workflowCommand (cognitive 111) packages/cli/src/commands/workflow.ts:163 — workflow.workflowCommand has cognitive complexity 111 (threshold 15). Drivers by points: if/else 36 (40 pts), ternaries 26 (40 pts), boolean chains 18, loops 11 (13 pts) (nesting depth added 20). None of this is in the body itself: all 111 points belong to 19 function literals inside it that branch (lines 461, 688, 574, …). 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 · workflow-guidance.readWorkflowGuidance (cognitive 111) · ×1
  • workflow-guidance.readWorkflowGuidance (cognitive 111) packages/daemon/src/domain/workflow-guidance.ts:35 — workflow-guidance.readWorkflowGuidance has cognitive complexity 111 (threshold 15). Drivers by points: if/else 31 (56 pts), ternaries 17 (30 pts), loops 7 (10 pts), boolean chains 9, error handling 3 (6 pts) (nesting depth added 44). Of this number, 108 points are the body's own statements and 3 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 · RestoreOrchestrator.launchNodeTargets (cognitive 111) · ×1
  • RestoreOrchestrator.launchNodeTargets (cognitive 111) packages/daemon/src/domain/restore-orchestrator.ts:740 — RestoreOrchestrator.launchNodeTargets has cognitive complexity 111 (threshold 15). Drivers by points: if/else 22 (43 pts), ternaries 16 (36 pts), boolean chains 18, loops 5 (8 pts), error handling 2 (6 pts) (nesting depth added 48). Of this number, 109 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 · export.exportCommand (cognitive 110) · ×1
  • export.exportCommand (cognitive 110) packages/cli/src/commands/export.ts:59 — export.exportCommand has cognitive complexity 110 (threshold 15). Drivers by points: if/else 18 (48 pts), ternaries 6 (24 pts), loops 6 (20 pts), boolean chains 9, error handling 3 (9 pts) (nesting depth added 68). None of this is in the body itself: all 110 points belong to one function literal inside it that branches (line 72). 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 · rig-mode.rigModeCommand (cognitive 110) · ×1
  • rig-mode.rigModeCommand (cognitive 110) packages/cli/src/commands/rig-mode.ts:214 — rig-mode.rigModeCommand has cognitive complexity 110 (threshold 15). Drivers by points: if/else 61 (76 pts), ternaries 13 (27 pts), boolean chains 4, loops 2, error handling 1 (nesting depth added 29). None of this is in the body itself: all 110 points belong to 8 function literals inside it that branch (lines 299, 559, 458, …). 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 · SliceIndexer.observedQueueCounts (cognitive 108) · ×1
  • SliceIndexer.observedQueueCounts (cognitive 108) packages/daemon/src/domain/slices/slice-indexer.ts:616 — SliceIndexer.observedQueueCounts has cognitive complexity 108 (threshold 15). Drivers by points: if/else 34 (65 pts), loops 15 (27 pts), boolean chains 9, ternaries 3 (7 pts) (nesting depth added 47). Of this number, 105 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 · send.sendCommand (cognitive 108) · ×1
  • send.sendCommand (cognitive 108) packages/cli/src/commands/send.ts:239 — send.sendCommand has cognitive complexity 108 (threshold 15). Drivers by points: if/else 45 (63 pts), ternaries 10 (19 pts), boolean chains 17, loops 2 (6 pts), error handling 2 (3 pts) (nesting depth added 32). None of this is in the body itself: all 108 points belong to 2 function literals inside it that branch (lines 363, 563). 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.reduce (cognitive 108) · ×1
  • state.reduce (cognitive 108) packages/tui/src/state.ts:124 — state.reduce has cognitive complexity 108 (threshold 15). Drivers by points: if/else 24 (48 pts), ternaries 20 (41 pts), boolean chains 18, match/switch 1 (nesting depth added 45). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HerdrAdapter.openView (cognitive 106) · ×1
  • HerdrAdapter.openView (cognitive 106) packages/daemon/src/domain/terminal/herdr-adapter.ts:488 — HerdrAdapter.openView has cognitive complexity 106 (threshold 15). Drivers by points: if/else 26 (43 pts), ternaries 7 (21 pts), loops 8 (19 pts), error handling 8 (18 pts), boolean chains 5 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chatroom.chatroomCommand (cognitive 105) · ×1
  • chatroom.chatroomCommand (cognitive 105) packages/cli/src/commands/chatroom.ts:57 — chatroom.chatroomCommand has cognitive complexity 105 (threshold 15). Drivers by points: if/else 46 (71 pts), error handling 10 (15 pts), loops 5 (9 pts), boolean chains 8, ternaries 2 (nesting depth added 34). None of this is in the body itself: all 105 points belong to 7 function items inside it that branch (a function literal at line 307, a function literal at line 180, a function literal at line 121, …). 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 · scope.buildSliceCloseCommand (cognitive 105) · ×1
  • scope.buildSliceCloseCommand (cognitive 105) packages/cli/src/commands/scope.ts:567 — scope.buildSliceCloseCommand has cognitive complexity 105 (threshold 15). Drivers by points: ternaries 16 (44 pts), if/else 17 (37 pts), error handling 8 (18 pts), boolean chains 6 (nesting depth added 58). None of this is in the body itself: all 105 points belong 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 · ps.handleNodes (cognitive 104) · ×1
  • ps.handleNodes (cognitive 104) packages/cli/src/commands/ps.ts:1362 — ps.handleNodes has cognitive complexity 104 (threshold 15). Drivers by points: if/else 28 (44 pts), ternaries 18 (35 pts), loops 9 (13 pts), boolean chains 12 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · execution-view.readArrangement (cognitive 104) · ×1
  • execution-view.readArrangement (cognitive 104) packages/daemon/src/domain/execution-view.ts:505 — execution-view.readArrangement has cognitive complexity 104 (threshold 15). Drivers by points: if/else 25 (50 pts), ternaries 13 (27 pts), boolean chains 15, loops 5 (11 pts), error handling 1 (nesting depth added 45). Of this number, 92 points are the body's own statements and 12 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 · bundles.bundleRoutes.post("/create") (cognitive 103) · ×1
  • bundles.bundleRoutes.post("/create") (cognitive 103) packages/daemon/src/routes/bundles.ts:728 — bundles.bundleRoutes.post("/create") has cognitive complexity 103 (threshold 15). Drivers by points: if/else 34 (55 pts), ternaries 19 (26 pts), boolean chains 11, loops 5 (10 pts), error handling 1 (nesting depth added 33). Of this number, 102 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 · OperatingPostureService.context (cognitive 102) · ×1
  • OperatingPostureService.context (cognitive 102) packages/daemon/src/domain/rig-mode/operating-posture.ts:75 — OperatingPostureService.context has cognitive complexity 102 (threshold 15). Drivers by points: if/else 36 (79 pts), boolean chains 15, loops 3 (6 pts), error handling 1 (2 pts) (nesting depth added 47). Of this number, 94 points are the body's own statements and 8 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 · WorkflowProjector.projectStep (cognitive 100) · ×1
  • WorkflowProjector.projectStep (cognitive 100) packages/daemon/src/domain/workflow-projector.ts:301 — WorkflowProjector.projectStep has cognitive complexity 100 (threshold 15). Drivers by points: if/else 48 (57 pts), boolean chains 25, ternaries 13 (18 pts) (nesting depth added 14). Of this number, 43 points are the body's own statements and 57 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 · workflow-model.workflowDetail (cognitive 100) · ×1
  • workflow-model.workflowDetail (cognitive 100) packages/tui/src/execution/workflow-model.ts:34 — workflow-model.workflowDetail has cognitive complexity 100 (threshold 15). Drivers by points: if/else 20 (45 pts), ternaries 15 (36 pts), loops 8 (18 pts), boolean chains 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ps.psCommand (cognitive 98) · ×1
  • ps.psCommand (cognitive 98) packages/cli/src/commands/ps.ts:949 — ps.psCommand has cognitive complexity 98 (threshold 15). Drivers by points: if/else 40 (50 pts), ternaries 19 (22 pts), boolean chains 18, loops 4 (8 pts) (nesting depth added 17). None of this is in the body itself: all 98 points belong to 2 function literals inside it that branch (lines 1066, 1276). 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 · down.downCommand (cognitive 98) · ×1
  • down.downCommand (cognitive 98) packages/cli/src/commands/down.ts:146 — down.downCommand has cognitive complexity 98 (threshold 15). Drivers by points: if/else 43 (63 pts), ternaries 7 (14 pts), boolean chains 11, loops 5 (10 pts) (nesting depth added 32). None of this is in the body itself: all 98 points belong to 5 function literals inside it that branch (lines 176, 193, 198, …). 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 · profile-resolver.resolveNodeConfig (cognitive 97) · ×1
  • profile-resolver.resolveNodeConfig (cognitive 97) packages/daemon/src/domain/profile-resolver.ts:152 — profile-resolver.resolveNodeConfig has cognitive complexity 97 (threshold 15). Drivers by points: if/else 25 (52 pts), ternaries 13 (22 pts), loops 6 (11 pts), boolean chains 9, error handling 1 (3 pts) (nesting depth added 43). Of this number, 84 points are the body's own statements and 13 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 · daemon-lifecycle.getDaemonStatus (cognitive 97) · ×1
  • daemon-lifecycle.getDaemonStatus (cognitive 97) REDACTED:1175 — daemon-lifecycle.getDaemonStatus has cognitive complexity 97 (threshold 15). Drivers by points: ternaries 17 (43 pts), if/else 13 (30 pts), boolean chains 15, error handling 5 (9 pts) (nesting depth added 47). Of this number, 90 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 · RigGraph.RigGraph (cognitive 97) · ×1
  • RigGraph.RigGraph (cognitive 97) packages/ui/src/components/RigGraph.tsx:107 — RigGraph.RigGraph has cognitive complexity 97 (threshold 15). Drivers by points: if/else 31 (40 pts), ternaries 15 (32 pts), boolean chains 22, loops 2, error handling 1 (nesting depth added 26). Most of this is not in the body itself: 10 of the 97 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 378, 295, 272, …). 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 · SeatLaunchEnvironment.command (cognitive 96) · ×1
  • SeatLaunchEnvironment.command (cognitive 96) packages/daemon/src/domain/seat-launch-environment.ts:124 — SeatLaunchEnvironment.command has cognitive complexity 96 (threshold 15). Drivers by points: ternaries 24 (42 pts), if/else 20 (28 pts), boolean chains 24, error handling 1, 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 · ClaudeCodeAdapter.launchHarness (cognitive 96) · ×1
  • ClaudeCodeAdapter.launchHarness (cognitive 96) packages/daemon/src/adapters/claude-code-adapter.ts:325 — ClaudeCodeAdapter.launchHarness has cognitive complexity 96 (threshold 15). Drivers by points: ternaries 39 (54 pts), if/else 32 (45 pts), boolean chains 18, error handling 4 (8 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ClaudeCodeAdapter.launchHarness::sendClassic) 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 · pi-runner.main (cognitive 96) · ×1
  • pi-runner.main (cognitive 96) REDACTED:2252 — pi-runner.main has cognitive complexity 96 (threshold 15). Drivers by points: if/else 29 (37 pts), ternaries 19 (28 pts), boolean chains 18, error handling 9 (13 pts) (nesting depth added 21). Of this number, 35 points are the body's own statements and 61 belong to 18 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 · project-lifecycle-compiler.compileProjectLifecycle (cognitive 95) · ×1
  • project-lifecycle-compiler.compileProjectLifecycle (cognitive 95) packages/daemon/src/domain/project-lifecycle-compiler.ts:59 — project-lifecycle-compiler.compileProjectLifecycle has cognitive complexity 95 (threshold 15). Drivers by points: if/else 40 (68 pts), boolean chains 10, loops 4 (8 pts), ternaries 7, error handling 2 (nesting depth added 32). Of this number, 76 points are the body's own statements and 19 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 · bundle-behaviour.formatBundleBehaviour (cognitive 94) · ×1
  • bundle-behaviour.formatBundleBehaviour (cognitive 94) packages/cli/src/bundle-behaviour.ts:6 — bundle-behaviour.formatBundleBehaviour has cognitive complexity 94 (threshold 15). Drivers by points: ternaries 16 (40 pts), if/else 12 (23 pts), loops 7 (19 pts), boolean chains 12 (nesting depth added 47). Of this number, 81 points are the body's own statements and 13 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 · policy.registerPermissionCommands (cognitive 94) · ×1
  • policy.registerPermissionCommands (cognitive 94) packages/cli/src/commands/policy.ts:182 — policy.registerPermissionCommands has cognitive complexity 94 (threshold 15). Drivers by points: if/else 38 (60 pts), ternaries 8 (16 pts), loops 5 (13 pts), boolean chains 4, error handling 1 (nesting depth added 38). None of this is in the body itself: all 94 points belong to 6 function literals inside it that branch (lines 189, 235, 367, …). 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 · RigSpecSchema.validate (cognitive 93) · ×1
  • RigSpecSchema.validate (cognitive 93) packages/daemon/src/domain/rigspec-schema.ts:125 — RigSpecSchema.validate has cognitive complexity 93 (threshold 15). Drivers by points: if/else 33 (68 pts), loops 5 (15 pts), boolean chains 9, ternaries 1 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · terminal-window.windowLauncher (cognitive 92) · ×1
  • terminal-window.windowLauncher (cognitive 92) packages/cli/src/terminal-window.ts:124 — terminal-window.windowLauncher has cognitive complexity 92 (threshold 15). Drivers by points: ternaries 21 (54 pts), if/else 12 (18 pts), boolean chains 14, error handling 2 (5 pts), loops 1 (nesting depth added 42). Of this number, 58 points are the body's own statements and 34 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · session-transport.annotateInputBox (cognitive 91) · ×1
  • session-transport.annotateInputBox (cognitive 91) packages/daemon/src/domain/session-transport.ts:5345 — session-transport.annotateInputBox has cognitive complexity 91 (threshold 15). Drivers by points: ternaries 17 (35 pts), if/else 21 (29 pts), boolean chains 24, loops 2 (3 pts) (nesting depth added 27). Of this number, 81 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 · queue-erasure.eraseQueue (cognitive 91) · ×1
  • queue-erasure.eraseQueue (cognitive 91) REDACTED:573 — queue-erasure.eraseQueue has cognitive complexity 91 (threshold 15). Drivers by points: if/else 60 (105 pts), ternaries 23 (40 pts), boolean chains 31, loops 19 (30 pts), error handling 4 (7 pts) (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (queue-erasure.eraseQueue::page, queue-erasure.eraseQueue::planBatch) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · SeatRuntimeSwitchService.execute (cognitive 90) · ×1
  • SeatRuntimeSwitchService.execute (cognitive 90) packages/daemon/src/domain/seat-runtime-switch-service.ts:381 — SeatRuntimeSwitchService.execute has cognitive complexity 90 (threshold 15). Drivers by points: ternaries 27 (40 pts), if/else 18 (25 pts), boolean chains 17, error handling 4 (5 pts), loops 3 (nesting depth added 21). Of this number, 74 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 · render.instanceContentLines (cognitive 89) · ×1
  • render.instanceContentLines (cognitive 89) packages/tui/src/render.ts:808 — render.instanceContentLines has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 17 (41 pts), if/else 18 (36 pts), loops 4 (8 pts), boolean chains 4 (nesting depth added 46). Of this number, 80 points are the body's own statements and 9 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 · ResumeMetadataRefresher.refresh (cognitive 87) · ×1
  • ResumeMetadataRefresher.refresh (cognitive 87) packages/daemon/src/domain/resume-metadata-refresher.ts:150 — ResumeMetadataRefresher.refresh has cognitive complexity 87 (threshold 15). Drivers by points: if/else 18 (62 pts), ternaries 6 (13 pts), boolean chains 8, error handling 1 (3 pts), loops 1 (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClaudeCompactionEnforcer.recoverAfterRestart (cognitive 87) · ×1
  • ClaudeCompactionEnforcer.recoverAfterRestart (cognitive 87) packages/daemon/src/domain/claude-compaction-enforcer.ts:2113 — ClaudeCompactionEnforcer.recoverAfterRestart has cognitive complexity 87 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 24, ternaries 13 (24 pts), loops 2 (3 pts), error handling 1 (2 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 · ask.askCommand (cognitive 86) · ×1
  • ask.askCommand (cognitive 86) packages/cli/src/commands/ask.ts:127 — ask.askCommand has cognitive complexity 86 (threshold 15). Drivers by points: if/else 29 (52 pts), ternaries 5 (14 pts), boolean chains 11, loops 3 (9 pts) (nesting depth added 38). None of this is in the body itself: all 86 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 · RigTeardownOrchestrator.teardown (cognitive 86) · ×1
  • RigTeardownOrchestrator.teardown (cognitive 86) packages/daemon/src/domain/rig-teardown.ts:116 — RigTeardownOrchestrator.teardown has cognitive complexity 86 (threshold 15). Drivers by points: if/else 29 (51 pts), error handling 6 (13 pts), boolean chains 12, ternaries 3 (8 pts), loops 2 (nesting depth added 34). Of this number, 85 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 · FeedCard.FeedCard (cognitive 86) · ×1
  • FeedCard.FeedCard (cognitive 86) packages/ui/src/components/for-you/FeedCard.tsx:355 — FeedCard.FeedCard has cognitive complexity 86 (threshold 15). Drivers by points: ternaries 33 (53 pts), boolean chains 22, if/else 11 (nesting depth added 20). Of this number, 73 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · seat-skill-storage.followPackagedSeatSkills (cognitive 85) · ×1
  • seat-skill-storage.followPackagedSeatSkills (cognitive 85) packages/daemon/src/domain/seat-skill-storage.ts:646 — seat-skill-storage.followPackagedSeatSkills has cognitive complexity 85 (threshold 15). Drivers by points: if/else 22 (52 pts), error handling 6 (12 pts), loops 5 (12 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 44). Of this number, 82 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 · hosts-registry-reader.validateHostRegistry (cognitive 85) · ×1
  • hosts-registry-reader.validateHostRegistry (cognitive 85) packages/daemon/src/domain/hosts/hosts-registry-reader.ts:100 — hosts-registry-reader.validateHostRegistry has cognitive complexity 85 (threshold 15). Drivers by points: if/else 21 (48 pts), ternaries 7 (21 pts), boolean chains 15, loops 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · host-registry.validateHostRegistry (cognitive 85) · ×1
  • host-registry.validateHostRegistry (cognitive 85) packages/cli/src/host-registry.ts:165 — host-registry.validateHostRegistry has cognitive complexity 85 (threshold 15). Drivers by points: if/else 21 (48 pts), ternaries 7 (21 pts), boolean chains 15, loops 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch 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-repository.isRestoreUsableSnapshotData (cognitive 84) · ×1
  • snapshot-repository.isRestoreUsableSnapshotData (cognitive 84) packages/daemon/src/domain/snapshot-repository.ts:278 — snapshot-repository.isRestoreUsableSnapshotData has cognitive complexity 84 (threshold 15). Drivers by points: if/else 30 (62 pts), boolean chains 18, loops 3 (4 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 · PodRigInstantiator.instantiateOnce (cognitive 84) · ×1
  • PodRigInstantiator.instantiateOnce (cognitive 84) packages/daemon/src/domain/rigspec-instantiator.ts:1478 — PodRigInstantiator.instantiateOnce has cognitive complexity 84 (threshold 15). Drivers by points: if/else 36 (70 pts), error handling 12 (26 pts), ternaries 10 (21 pts), loops 11 (17 pts), boolean chains 10 (nesting depth added 65). To reduce it, split the body into named stages: move each independent 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 (PodRigInstantiator.instantiateOnce::cleanup) 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 · status.statusCommand (cognitive 83) · ×1
  • status.statusCommand (cognitive 83) packages/cli/src/commands/status.ts:37 — status.statusCommand has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 19 (38 pts), if/else 20 (25 pts), boolean chains 10, loops 3 (7 pts), error handling 2 (3 pts) (nesting depth added 29). None of this is in the body itself: all 83 points belong to 2 function literals inside it that branch (lines 41, 45). 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 · grow.growCommand (cognitive 83) · ×1
  • grow.growCommand (cognitive 83) packages/cli/src/commands/grow.ts:45 — grow.growCommand has cognitive complexity 83 (threshold 15). Drivers by points: if/else 21 (30 pts), ternaries 12 (30 pts), loops 6 (14 pts), boolean chains 8, error handling 1 (nesting depth added 35). None of this is in the body itself: all 83 points belong to 2 function literals inside it that branch (lines 60, 134). 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 · terminal-model.terminalLines (cognitive 83) · ×1
  • terminal-model.terminalLines (cognitive 83) packages/tui/src/terminals/terminal-model.ts:86 — terminal-model.terminalLines has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 13 (35 pts), if/else 19 (29 pts), loops 5 (10 pts), boolean chains 9 (nesting depth added 37). Of this number, 73 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 · roster.rosterCommand (cognitive 82) · ×1
  • roster.rosterCommand (cognitive 82) packages/cli/src/commands/roster.ts:137 — roster.rosterCommand has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 11 (36 pts), if/else 12 (28 pts), loops 5 (16 pts), boolean chains 2 (nesting depth added 52). Most of this is not in the body itself: 11 of the 82 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 144, 159). 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 · transport.transportRoutes · ×1
  • transport.transportRoutes::send (cognitive 82) packages/daemon/src/routes/transport.ts:36 — transport.transportRoutes::send has cognitive complexity 82 (threshold 15). Drivers by points: if/else 22 (31 pts), ternaries 13 (24 pts), boolean chains 16, error handling 4 (11 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 · SliceIndexer.ensureMembershipIndex (cognitive 81) · ×1
  • SliceIndexer.ensureMembershipIndex (cognitive 81) packages/daemon/src/domain/slices/slice-indexer.ts:1361 — SliceIndexer.ensureMembershipIndex has cognitive complexity 81 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 11 (22 pts), boolean chains 12, ternaries 4 (9 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EnvironmentLifecycle.effect (cognitive 81) · ×1
  • EnvironmentLifecycle.effect (cognitive 81) packages/daemon/src/domain/environment-lifecycle.ts:89 — EnvironmentLifecycle.effect has cognitive complexity 81 (threshold 15). Drivers by points: if/else 32 (52 pts), ternaries 9 (15 pts), boolean chains 12, error handling 2 (nesting depth added 26). Of this number, 69 points are the body's own statements and 12 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 · agent-image.agentImageCommand (cognitive 81) · ×1
  • agent-image.agentImageCommand (cognitive 81) packages/cli/src/commands/agent-image.ts:98 — agent-image.agentImageCommand has cognitive complexity 81 (threshold 15). Drivers by points: if/else 39 (48 pts), loops 6 (14 pts), error handling 9, ternaries 6 (8 pts), boolean chains 2 (nesting depth added 19). None of this is in the body itself: all 81 points belong to 10 function items inside it that branch (a function literal at line 342, a function literal at line 234, a function literal at line 131, …). 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 · subscription-move-report.checkMoveReport (cognitive 80) · ×1
  • subscription-move-report.checkMoveReport (cognitive 80) packages/daemon/src/domain/provider/subscription-move-report.ts:106 — subscription-move-report.checkMoveReport has cognitive complexity 80 (threshold 15). Drivers by points: if/else 34 (59 pts), boolean chains 11, ternaries 3 (7 pts), loops 2 (3 pts) (nesting depth added 30). Of this number, 24 points are the body's own statements and 56 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 · sessions.generationRecord (cognitive 80) · ×1
  • sessions.generationRecord (cognitive 80) packages/daemon/src/routes/sessions.ts:816 — sessions.generationRecord has cognitive complexity 80 (threshold 15). Drivers by points: if/else 22 (37 pts), ternaries 9 (18 pts), error handling 5 (11 pts), boolean chains 9, loops 2 (5 pts) (nesting depth added 33). Of this number, 76 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 · files.filesRoutes (cognitive 80) · ×1
  • files.filesRoutes (cognitive 80) packages/daemon/src/routes/files.ts:52 — files.filesRoutes has cognitive complexity 80 (threshold 15). Drivers by points: if/else 27 (34 pts), ternaries 16 (32 pts), boolean chains 9, error handling 5 (nesting depth added 23). None of this is in the body itself: all 80 points belong to 9 function items inside it that branch (a function literal at line 141, a function literal at line 209, pathSafetyErrorResponse, …). 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 · hydrate.toAgentRow (cognitive 80) · ×1
  • hydrate.toAgentRow (cognitive 80) packages/tui/src/hydrate.ts:231 — hydrate.toAgentRow has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 17 (66 pts), boolean chains 14 (nesting depth added 49). 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 · ClaudeCodeAdapter.verifyResumeLaunch (cognitive 79) · ×1
  • ClaudeCodeAdapter.verifyResumeLaunch (cognitive 79) packages/daemon/src/adapters/claude-code-adapter.ts:753 — ClaudeCodeAdapter.verifyResumeLaunch has cognitive complexity 79 (threshold 15). Drivers by points: if/else 23 (47 pts), boolean chains 17, ternaries 5 (14 pts), loops 1 (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 · SeatAttentionReconciler.clearAttention (cognitive 79) · ×1
  • SeatAttentionReconciler.clearAttention (cognitive 79) packages/daemon/src/domain/seat-attention-reconciler.ts:456 — SeatAttentionReconciler.clearAttention has cognitive complexity 79 (threshold 15). Drivers by points: if/else 21 (35 pts), ternaries 13 (25 pts), boolean chains 14, error handling 2 (5 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 · rigspec.rigspecImportRoutes.post("/") (cognitive 79) · ×1
  • rigspec.rigspecImportRoutes.post("/") (cognitive 79) packages/daemon/src/routes/rigspec.ts:107 — rigspec.rigspecImportRoutes.post("/") has cognitive complexity 79 (threshold 15). Drivers by points: ternaries 19 (62 pts), if/else 9 (13 pts), boolean chains 2, error handling 2 (nesting depth added 47). 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 · PiRuntimeAdapter.launchHarness (cognitive 78) · ×1
  • PiRuntimeAdapter.launchHarness (cognitive 78) packages/daemon/src/adapters/pi-runtime-adapter.ts:286 — PiRuntimeAdapter.launchHarness has cognitive complexity 78 (threshold 15). Drivers by points: if/else 24 (30 pts), ternaries 16 (23 pts), boolean chains 15, error handling 6 (10 pts) (nesting depth added 17). 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 · SessionTransport.sendClassified (cognitive 78) · ×1
  • SessionTransport.sendClassified (cognitive 78) packages/daemon/src/domain/session-transport.ts:2858 — SessionTransport.sendClassified has cognitive complexity 78 (threshold 15). Drivers by points: if/else 18 (34 pts), ternaries 10 (20 pts), boolean chains 10, error handling 3 (7 pts), loops 4 (7 pts) (nesting depth added 33). Of this number, 70 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · native-resume-probe.assessNativeResumeProbe (cognitive 78) · ×1
  • native-resume-probe.assessNativeResumeProbe (cognitive 78) packages/daemon/src/domain/native-resume-probe.ts:356 — native-resume-probe.assessNativeResumeProbe has cognitive complexity 78 (threshold 15). Drivers by points: if/else 26 (51 pts), ternaries 4 (15 pts), boolean chains 12 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · connector.runAcpAssignment (cognitive 77) · ×1
  • connector.runAcpAssignment (cognitive 77) packages/cli/src/acp/connector.ts:79 — connector.runAcpAssignment has cognitive complexity 77 (threshold 15). Drivers by points: if/else 25 (42 pts), ternaries 10 (18 pts), boolean chains 10, error handling 3 (4 pts), loops 2 (3 pts) (nesting depth added 27). Of this number, 28 points are the body's own statements and 49 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 · package.packageCommand (cognitive 77) · ×1
  • package.packageCommand (cognitive 77) packages/cli/src/commands/package.ts:8 — package.packageCommand has cognitive complexity 77 (threshold 15). Drivers by points: if/else 29 (32 pts), loops 13 (30 pts), boolean chains 8, ternaries 2 (7 pts) (nesting depth added 25). None of this is in the body itself: all 77 points belong to 6 function items inside it that branch (a function literal at line 126, a function literal at line 62, a function literal at line 22, …). 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 · SnapshotCapture.captureSnapshot (cognitive 76) · ×1
  • SnapshotCapture.captureSnapshot (cognitive 76) packages/daemon/src/domain/snapshot-capture.ts:63 — SnapshotCapture.captureSnapshot has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 14 (30 pts), if/else 13 (28 pts), boolean chains 8, loops 3 (6 pts), error handling 2 (4 pts) (nesting depth added 36). Of this number, 70 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PodRigInstantiator.materializeValidatedSpec (cognitive 76) · ×1
  • PodRigInstantiator.materializeValidatedSpec (cognitive 76) packages/daemon/src/domain/rigspec-instantiator.ts:682 — PodRigInstantiator.materializeValidatedSpec has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (38 pts), ternaries 7 (16 pts), loops 9 (13 pts), boolean chains 8, error handling 1 (nesting depth added 30). Of this number, 21 points are the body's own statements and 55 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 · restore-preconditions.validatePreRestore (cognitive 76) · ×1
  • restore-preconditions.validatePreRestore (cognitive 76) packages/daemon/src/domain/restore-preconditions.ts:12 — restore-preconditions.validatePreRestore has cognitive complexity 76 (threshold 15). Drivers by points: if/else 26 (47 pts), boolean chains 15, loops 5 (7 pts), ternaries 5 (7 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 · network-connector.runNetworkBindingPass (cognitive 76) · ×1
  • network-connector.runNetworkBindingPass (cognitive 76) packages/daemon/src/domain/network/network-connector.ts:77 — network-connector.runNetworkBindingPass has cognitive complexity 76 (threshold 15). Drivers by points: if/else 17 (42 pts), ternaries 4 (12 pts), error handling 4 (9 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 42). Of this number, 75 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 · projects.projectsRoutes · ×1
  • projects.projectsRoutes::errorResponse (cognitive 76) packages/daemon/src/routes/projects.ts:60 — projects.projectsRoutes::errorResponse has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 16 (70 pts), boolean chains 3, if/else 3 (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RigRepository.addNode (cognitive 75) · ×1
  • RigRepository.addNode (cognitive 75) packages/daemon/src/domain/rig-repository.ts:654 — RigRepository.addNode has cognitive complexity 75 (threshold 15). Drivers by points: if/else 42 (61 pts), boolean chains 8, ternaries 3 (6 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 · SeatIdentityReconciler.reconcileSweep (cognitive 75) · ×1
  • SeatIdentityReconciler.reconcileSweep (cognitive 75) packages/daemon/src/domain/seat-identity-reconciler.ts:191 — SeatIdentityReconciler.reconcileSweep has cognitive complexity 75 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 15, ternaries 9 (10 pts), error handling 5 (9 pts), loops 3 (4 pts) (nesting depth added 22). Of this number, 55 points are the body's own statements and 20 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 · InboundRouter.attemptAction (cognitive 74) · ×1
  • InboundRouter.attemptAction (cognitive 74) packages/daemon/src/domain/gateway/slack/inbound.ts:543 — InboundRouter.attemptAction has cognitive complexity 74 (threshold 15). Drivers by points: if/else 25 (39 pts), ternaries 9 (19 pts), boolean chains 8, error handling 5 (8 pts) (nesting depth added 27). Of this number, 63 points are the body's own statements and 11 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 · health.healthCommand · ×1
  • health.healthCommand::diagnosisRequest (cognitive 73) packages/cli/src/commands/health.ts:405 — health.healthCommand::diagnosisRequest has cognitive complexity 73 (threshold 15). Drivers by points: if/else 14 (35 pts), ternaries 8 (28 pts), loops 2 (6 pts), boolean chains 4 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · restore-from-jsonl.analyze (cognitive 73) · ×1
  • restore-from-jsonl.analyze (cognitive 73) packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs:253 — restore-from-jsonl.analyze has cognitive complexity 73 (threshold 15). Drivers by points: if/else 17 (42 pts), loops 8 (26 pts), boolean chains 5 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · host.doctorLegs (cognitive 72) · ×1
  • host.doctorLegs (cognitive 72) packages/cli/src/commands/host.ts:199 — host.doctorLegs has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (33 pts), ternaries 8 (22 pts), boolean chains 10, error handling 4 (7 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · workflow-reconciliation.compare (cognitive 72) · ×1
  • workflow-reconciliation.compare (cognitive 72) packages/daemon/src/domain/workflow-reconciliation.ts:66 — workflow-reconciliation.compare has cognitive complexity 72 (threshold 15). Drivers by points: if/else 25 (42 pts), loops 12 (14 pts), boolean chains 12, ternaries 2 (3 pts), error handling 1 (nesting depth added 20). Of this number, 68 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 · scope-task-terminal-view.readScopedTaskTerminalView (cognitive 72) · ×1
  • scope-task-terminal-view.readScopedTaskTerminalView (cognitive 72) packages/daemon/src/domain/terminal/scope-task-terminal-view.ts:151 — scope-task-terminal-view.readScopedTaskTerminalView has cognitive complexity 72 (threshold 15). Drivers by points: if/else 22 (46 pts), ternaries 5 (10 pts), boolean chains 9, loops 3 (5 pts), error handling 1 (2 pts) (nesting depth added 32). Most of this is not in the body itself: 10 of the 72 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 180, 170, 204, …). 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 · mcp-http.grantServiceCaller (cognitive 71) · ×1
  • mcp-http.grantServiceCaller (cognitive 71) REDACTED:262 — mcp-http.grantServiceCaller has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 14 (50 pts), boolean chains 10, if/else 9, error handling 2 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · restore-packet.restorePacketCommand (cognitive 71) · ×1
  • restore-packet.restorePacketCommand (cognitive 71) packages/cli/src/commands/restore-packet.ts:213 — restore-packet.restorePacketCommand has cognitive complexity 71 (threshold 15). Drivers by points: if/else 29 (37 pts), ternaries 5 (11 pts), boolean chains 9, loops 5 (9 pts), error handling 4 (5 pts) (nesting depth added 19). None of this is in the body itself: all 71 points belong to 3 function literals inside it that branch (lines 457, 287, 378). 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 · CodexRuntimeAdapter.ensureCodexCorePlugin (cognitive 71) · ×1
  • CodexRuntimeAdapter.ensureCodexCorePlugin (cognitive 71) packages/daemon/src/adapters/codex-runtime-adapter.ts:414 — CodexRuntimeAdapter.ensureCodexCorePlugin has cognitive complexity 71 (threshold 15). Drivers by points: if/else 26 (30 pts), boolean chains 25, error handling 8, loops 6, ternaries 2 (nesting depth added 4). Of this number, 28 points are the body's own statements and 43 belong to 12 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 · connections-projection.connectionsProjection (cognitive 71) · ×1
  • connections-projection.connectionsProjection (cognitive 71) packages/daemon/src/domain/gateway/connections-projection.ts:55 — connections-projection.connectionsProjection has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 26 (61 pts), boolean chains 9, error handling 1 (nesting depth added 35). 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, 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 · SeatLifecycleService.launchFresh (cognitive 71) · ×1
  • SeatLifecycleService.launchFresh (cognitive 71) packages/daemon/src/domain/seat-lifecycle-service.ts:1638 — SeatLifecycleService.launchFresh has cognitive complexity 71 (threshold 15). Drivers by points: if/else 26 (34 pts), ternaries 11 (22 pts), boolean chains 11, error handling 1 (3 pts), loops 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 · render.agentDetailLines (cognitive 71) · ×1
  • render.agentDetailLines (cognitive 71) packages/tui/src/render.ts:361 — render.agentDetailLines has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 41 (61 pts), boolean chains 10 (nesting depth added 20). Of this number, 67 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 · InboundRouter.attemptLand (cognitive 70) · ×1
  • InboundRouter.attemptLand (cognitive 70) packages/daemon/src/domain/gateway/slack/inbound.ts:318 — InboundRouter.attemptLand has cognitive complexity 70 (threshold 15). Drivers by points: boolean chains 23, if/else 16 (19 pts), ternaries 10 (16 pts), error handling 6 (12 pts) (nesting depth added 15). Of this number, 68 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 · seat.printHumanHandoverResult (cognitive 70) · ×1
  • seat.printHumanHandoverResult (cognitive 70) packages/cli/src/commands/seat.ts:413 — seat.printHumanHandoverResult has cognitive complexity 70 (threshold 15). Drivers by points: if/else 29 (45 pts), ternaries 7 (15 pts), loops 4 (7 pts), boolean chains 3 (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 · DraftAwareDelivery.attempt (cognitive 69) · ×1
  • DraftAwareDelivery.attempt (cognitive 69) packages/daemon/src/domain/draft-aware-delivery.ts:55 — DraftAwareDelivery.attempt has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 16 (37 pts), if/else 10 (13 pts), boolean chains 9, loops 3 (6 pts), error handling 3 (4 pts) (nesting depth added 28). Of this number, 54 points are the body's own statements and 15 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 · plugin.pluginCommand (cognitive 69) · ×1
  • plugin.pluginCommand (cognitive 69) packages/cli/src/commands/plugin.ts:129 — plugin.pluginCommand has cognitive complexity 69 (threshold 15). Drivers by points: if/else 33 (45 pts), loops 7 (9 pts), boolean chains 6, ternaries 4 (6 pts), error handling 3 (nesting depth added 16). None of this is in the body itself: all 69 points belong to 5 function items inside it that branch (a function literal at line 205, a function literal at line 154, a function literal at line 296, …). 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 · pi-runner.createPaneCompositor (cognitive 69) · ×1
  • pi-runner.createPaneCompositor (cognitive 69) REDACTED:198 — pi-runner.createPaneCompositor has cognitive complexity 69 (threshold 15). Drivers by points: if/else 30 (35 pts), boolean chains 16, ternaries 13 (14 pts), loops 4 (nesting depth added 6). Of this number, 21 points are the body's own statements and 48 belong to 12 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 · HerdrViewer.ensureOnce (cognitive 69) · ×1
  • HerdrViewer.ensureOnce (cognitive 69) packages/daemon/src/domain/terminal/herdr-viewer.ts:150 — HerdrViewer.ensureOnce has cognitive complexity 69 (threshold 15). Drivers by points: if/else 28 (40 pts), boolean chains 16, error handling 5 (9 pts), ternaries 3 (4 pts) (nesting depth added 17). Of this number, 63 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 · daemon.daemonCommand (cognitive 68) · ×1
  • daemon.daemonCommand (cognitive 68) REDACTED:174 — daemon.daemonCommand has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (31 pts), ternaries 10 (21 pts), loops 4 (10 pts), boolean chains 3, error handling 2, match/switch 1 (nesting depth added 28). None of this is in the body itself: all 68 points belong to 4 function literals inside it that branch (lines 200, 337, 401, …). 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 · SliceDetailProjector.buildAcceptance (cognitive 68) · ×1
  • SliceDetailProjector.buildAcceptance (cognitive 68) packages/daemon/src/domain/slices/slice-detail-projector.ts:492 — SliceDetailProjector.buildAcceptance has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (45 pts), loops 6 (11 pts), boolean chains 6, ternaries 5 (6 pts) (nesting depth added 32). Of this number, 64 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 · ScopePages.MissionScopePage (cognitive 68) · ×1
  • ScopePages.MissionScopePage (cognitive 68) packages/ui/src/components/project/ScopePages.tsx:795 — ScopePages.MissionScopePage has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 24 (55 pts), boolean chains 11, if/else 1 (2 pts) (nesting depth added 32). Of this number, 61 points are the body's own statements and 7 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 · walk-consumption.analyzeWalkSuffix (cognitive 67) · ×1
  • walk-consumption.analyzeWalkSuffix (cognitive 67) packages/cli/src/lib/walk-consumption.ts:2 — walk-consumption.analyzeWalkSuffix has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (40 pts), boolean chains 15, ternaries 3 (6 pts), loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 29). Of this number, 57 points are the body's own statements and 10 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 · NodeLauncher.launchNode (cognitive 67) · ×1
  • NodeLauncher.launchNode (cognitive 67) packages/daemon/src/domain/node-launcher.ts:159 — NodeLauncher.launchNode has cognitive complexity 67 (threshold 15). Drivers by points: if/else 25 (28 pts), ternaries 15 (19 pts), boolean chains 16, error handling 2, loops 1 (2 pts) (nesting depth added 8). Of this number, 53 points are the body's own statements and 14 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 · execution-view.buildExecutionView · ×1
  • execution-view.buildExecutionView::ladderOf (cognitive 67) packages/daemon/src/domain/execution-view.ts:996 — execution-view.buildExecutionView::ladderOf has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 20 (32 pts), if/else 11 (22 pts), boolean chains 7, loops 4 (6 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. This shape REPEATS in the file: one other method here (execution-view.buildExecutionView) 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 · provider-seat-accounts.configuredSeatAccounts (cognitive 67) · ×1
  • provider-seat-accounts.configuredSeatAccounts (cognitive 67) packages/daemon/src/domain/provider/provider-seat-accounts.ts:39 — provider-seat-accounts.configuredSeatAccounts has cognitive complexity 67 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 11 (29 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 34). Most of this is not in the body itself: 8 of the 67 points are its own statements and the rest belongs to one function literal inside it that branches (line 57). 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 · render.renderPulseScreen (cognitive 67) · ×1
  • render.renderPulseScreen (cognitive 67) packages/tui/src/render.ts:1640 — render.renderPulseScreen has cognitive complexity 67 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 14 (20 pts), boolean chains 11, loops 5 (7 pts) (nesting depth added 23). Of this number, 66 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 · bootstrap.bootstrapCommand (cognitive 66) · ×1
  • bootstrap.bootstrapCommand (cognitive 66) packages/cli/src/commands/bootstrap.ts:27 — bootstrap.bootstrapCommand has cognitive complexity 66 (threshold 15). Drivers by points: if/else 22 (33 pts), loops 7 (20 pts), ternaries 6 (9 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 28). None of this is in the body itself: all 66 points belong to 2 function items inside it that branch (a function literal at line 47, getTarget). 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 · exec.execCommand (cognitive 66) · ×1
  • exec.execCommand (cognitive 66) packages/cli/src/commands/exec.ts:371 — exec.execCommand has cognitive complexity 66 (threshold 15). Drivers by points: if/else 31 (42 pts), ternaries 10 (15 pts), boolean chains 7, loops 2 (nesting depth added 16). None of this is in the body itself: all 66 points belong to 9 function items inside it that branch (a function literal at line 464, waitForEnd, a function literal at line 553, …). 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 · PluginDiscoveryService.listPlugins (cognitive 66) · ×1
  • PluginDiscoveryService.listPlugins (cognitive 66) packages/daemon/src/domain/plugin-discovery-service.ts:208 — PluginDiscoveryService.listPlugins has cognitive complexity 66 (threshold 15). Drivers by points: if/else 15 (45 pts), loops 8 (21 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · task-terminal-view.readTaskTerminalSnapshot (cognitive 66) · ×1
  • task-terminal-view.readTaskTerminalSnapshot (cognitive 66) packages/daemon/src/domain/terminal/task-terminal-view.ts:64 — task-terminal-view.readTaskTerminalSnapshot has cognitive complexity 66 (threshold 15). Drivers by points: if/else 21 (42 pts), loops 10 (14 pts), boolean chains 6, error handling 2 (3 pts), ternaries 1 (nesting depth added 26). Of this number, 48 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 · send.runFanOutSend (cognitive 65) · ×1
  • send.runFanOutSend (cognitive 65) packages/cli/src/commands/send.ts:1096 — send.runFanOutSend has cognitive complexity 65 (threshold 15). Drivers by points: if/else 24 (33 pts), ternaries 10 (18 pts), boolean chains 10, loops 2 (3 pts), error handling 1 (nesting depth added 18). Of this number, 53 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 · RestoreOrchestrator.restore (cognitive 65) · ×1
  • RestoreOrchestrator.restore (cognitive 65) packages/daemon/src/domain/restore-orchestrator.ts:386 — RestoreOrchestrator.restore has cognitive complexity 65 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 15, ternaries 8 (10 pts), loops 5 (6 pts), error handling 2 (nesting depth added 13). Of this number, 58 points are the body's own statements and 7 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 · open-asks.postOpenAsks (cognitive 65) · ×1
  • open-asks.postOpenAsks (cognitive 65) packages/daemon/src/domain/gateway/slack/open-asks.ts:178 — open-asks.postOpenAsks has cognitive complexity 65 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 9 (24 pts), boolean chains 9, error handling 4, loops 4 (nesting depth added 26). Of this number, 48 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 · refocus-record.readRefocusRecord (cognitive 65) · ×1
  • refocus-record.readRefocusRecord (cognitive 65) packages/daemon/src/domain/refocus-record.ts:40 — refocus-record.readRefocusRecord has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 12 (43 pts), if/else 10 (17 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · sessions.nodesRoutes.post("/ · ×1
  • sessions.nodesRoutes.post("/:logicalId/launch") (cognitive 65) packages/daemon/src/routes/sessions.ts:315 — sessions.nodesRoutes.post("/:logicalId/launch") has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 9 (32 pts), if/else 16 (31 pts), boolean chains 2 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CodexInPlaceRestart.observe (cognitive 64) · ×1
  • CodexInPlaceRestart.observe (cognitive 64) packages/daemon/src/domain/seat-restart-in-place.ts:419 — CodexInPlaceRestart.observe has cognitive complexity 64 (threshold 15). Drivers by points: if/else 29 (37 pts), boolean chains 12, ternaries 9 (10 pts), error handling 2 (4 pts), loops 1 (nesting depth added 11). Of this number, 63 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 · WorkflowRuntime.route (cognitive 64) · ×1
  • WorkflowRuntime.route (cognitive 64) packages/daemon/src/domain/workflow-runtime.ts:1520 — WorkflowRuntime.route has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 17 (30 pts), if/else 19 (27 pts), boolean chains 7 (nesting depth added 21). Most of this is not in the body itself: 1 of the 64 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 1550, 1563, 1661, …). 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 · DiscoveryPanel.DiscoveryPanel (cognitive 64) · ×1
  • DiscoveryPanel.DiscoveryPanel (cognitive 64) packages/ui/src/components/DiscoveryPanel.tsx:130 — DiscoveryPanel.DiscoveryPanel has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 16 (42 pts), if/else 11 (12 pts), boolean chains 10 (nesting depth added 27). Most of this is not in the body itself: 2 of the 64 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 260, handleConfirm, a function literal at line 163, …). 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 · trace-to-root.render_work (cognitive 64) · ×1
  • trace-to-root.render_work (cognitive 64) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:275 — trace-to-root.render_work has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (43 pts), ternaries 4 (14 pts), error handling 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · human-registry.validateHumanFragment (cognitive 63) · ×1
  • human-registry.validateHumanFragment (cognitive 63) packages/daemon/src/domain/gateway/human-registry.ts:175 — human-registry.validateHumanFragment has cognitive complexity 63 (threshold 15). Drivers by points: if/else 31 (45 pts), boolean chains 11, ternaries 3 (5 pts), loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · human-registry.setHumanField (cognitive 63) · ×1
  • human-registry.setHumanField (cognitive 63) packages/daemon/src/domain/gateway/human-registry.ts:810 — human-registry.setHumanField has cognitive complexity 63 (threshold 15). Drivers by points: if/else 27 (38 pts), ternaries 9 (16 pts), boolean chains 9 (nesting depth added 18). Of this number, 60 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 · seat.seatCommand · ×1
  • seat.seatCommand::runLifecycleVerb (cognitive 63) packages/cli/src/commands/seat.ts:878 — seat.seatCommand::runLifecycleVerb has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 10 (35 pts), if/else 10 (13 pts), boolean chains 12, loops 1 (2 pts), error handling 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · relay-inbound.createRelayInboundHandler.ackOutbox (cognitive 63) · ×1
  • relay-inbound.createRelayInboundHandler.ackOutbox (cognitive 63) packages/daemon/src/domain/gateway/relay-inbound.ts:1017 — relay-inbound.createRelayInboundHandler.ackOutbox has cognitive complexity 63 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 16, error handling 8 (11 pts), ternaries 4 (8 pts), loops 2 (4 pts) (nesting depth added 16). Most of this is not in the body itself: 7 of the 63 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1051, 1070, 1087). 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 · up.formatRemoteUpFailure (cognitive 62) · ×1
  • up.formatRemoteUpFailure (cognitive 62) packages/cli/src/commands/up.ts:846 — up.formatRemoteUpFailure has cognitive complexity 62 (threshold 15). Drivers by points: if/else 18 (32 pts), ternaries 8 (14 pts), boolean chains 13, loops 2 (3 pts) (nesting depth added 21). Of this number, 61 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 · SeatHandoverService.recoveredConversation (cognitive 62) · ×1
  • SeatHandoverService.recoveredConversation (cognitive 62) packages/daemon/src/domain/seat-handover-service.ts:1159 — SeatHandoverService.recoveredConversation has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 21 (49 pts), if/else 8 (9 pts), boolean chains 4 (nesting depth added 29). Of this number, 61 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 · RigLifecycleService.removeNodeWithin (cognitive 62) · ×1
  • RigLifecycleService.removeNodeWithin (cognitive 62) packages/daemon/src/domain/rig-lifecycle-service.ts:482 — RigLifecycleService.removeNodeWithin has cognitive complexity 62 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 15, ternaries 8 (12 pts), loops 3 (6 pts) (nesting depth added 16). Of this number, 57 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 · connections-model.connectionsLines (cognitive 62) · ×1
  • connections-model.connectionsLines (cognitive 62) packages/tui/src/connections/connections-model.ts:58 — connections-model.connectionsLines has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 13 (29 pts), loops 9 (18 pts), if/else 8 (14 pts), boolean chains 1 (nesting depth added 31). Of this number, 61 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 · queue-receipt.rowLines (cognitive 61) · ×1
  • queue-receipt.rowLines (cognitive 61) packages/cli/src/queue-receipt.ts:159 — queue-receipt.rowLines has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 13 (29 pts), if/else 21, boolean chains 9, loops 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 · CodexResumeAdapter.resume (cognitive 61) · ×1
  • CodexResumeAdapter.resume (cognitive 61) packages/daemon/src/adapters/codex-resume.ts:66 — CodexResumeAdapter.resume has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 25 (35 pts), if/else 12 (16 pts), boolean chains 8, error handling 1 (2 pts) (nesting depth added 15). Of this number, 59 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 · HealthDiagnosisService.evaluateOnce (cognitive 61) · ×1
  • HealthDiagnosisService.evaluateOnce (cognitive 61) packages/daemon/src/domain/health-diagnosis.ts:106 — HealthDiagnosisService.evaluateOnce has cognitive complexity 61 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 12, ternaries 4 (11 pts), error handling 1 (4 pts), loops 1 (nesting depth added 27). Of this number, 60 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 · SeatRuntimeSwitchService.recover (cognitive 61) · ×1
  • SeatRuntimeSwitchService.recover (cognitive 61) packages/daemon/src/domain/seat-runtime-switch-service.ts:739 — SeatRuntimeSwitchService.recover has cognitive complexity 61 (threshold 15). Drivers by points: if/else 16 (24 pts), ternaries 7 (21 pts), boolean chains 8, error handling 3 (6 pts), loops 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamClassificationWorker.wake (cognitive 61) · ×1
  • StreamClassificationWorker.wake (cognitive 61) packages/daemon/src/domain/stream-classification-worker.ts:125 — StreamClassificationWorker.wake has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (39 pts), ternaries 3 (10 pts), error handling 4 (9 pts), boolean chains 2, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · compaction.compactionRoutes (cognitive 61) · ×1
  • compaction.compactionRoutes (cognitive 61) packages/daemon/src/routes/compaction.ts:24 — compaction.compactionRoutes has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 17 (32 pts), if/else 20 (23 pts), boolean chains 6 (nesting depth added 18). None of this is in the body itself: all 61 points belong to 3 function literals inside it that branch (lines 28, 152, 133). 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 · rig-cmux.rigCmuxRoutes.post("/launch") (cognitive 61) · ×1
  • rig-cmux.rigCmuxRoutes.post("/launch") (cognitive 61) packages/daemon/src/routes/rig-cmux.ts:62 — rig-cmux.rigCmuxRoutes.post("/launch") has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 8 (11 pts), boolean chains 8, ternaries 4 (6 pts), error handling 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scopes.scopesRoutes (cognitive 61) · ×1
  • scopes.scopesRoutes (cognitive 61) packages/daemon/src/routes/scopes.ts:53 — scopes.scopesRoutes has cognitive complexity 61 (threshold 15). Drivers by points: if/else 29 (35 pts), boolean chains 10, error handling 6 (7 pts), ternaries 6 (7 pts), loops 2 (nesting depth added 8). None of this is in the body itself: all 61 points belong to 10 function literals inside it that branch (lines 160, 113, 70, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · rig-repository.isStoredRigSpec (cognitive 60) · ×1
  • rig-repository.isStoredRigSpec (cognitive 60) packages/daemon/src/domain/rig-repository.ts:151 — rig-repository.isStoredRigSpec has cognitive complexity 60 (threshold 15). Drivers by points: boolean chains 41, if/else 17 (19 pts) (nesting depth added 2). Of this number, 25 points are the body's own statements and 35 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.
D2 · Cognitive Complexity · seat-skill-storage.cleanSeatSkills (cognitive 60) · ×1
  • seat-skill-storage.cleanSeatSkills (cognitive 60) packages/daemon/src/domain/seat-skill-storage.ts:963 — seat-skill-storage.cleanSeatSkills has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (31 pts), error handling 6 (11 pts), loops 8 (11 pts), boolean chains 7 (nesting depth added 21). Of this number, 51 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 · EnvironmentStartup.launch (cognitive 60) · ×1
  • EnvironmentStartup.launch (cognitive 60) packages/daemon/src/domain/environment-startup.ts:151 — EnvironmentStartup.launch has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (33 pts), boolean chains 11, ternaries 6 (7 pts), error handling 3 (6 pts), loops 2 (3 pts) (nesting depth added 18). Of this number, 55 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 · scope.buildAuditCommand (cognitive 60) · ×1
  • scope.buildAuditCommand (cognitive 60) packages/cli/src/commands/scope.ts:1266 — scope.buildAuditCommand has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (34 pts), loops 7 (12 pts), ternaries 5 (10 pts), boolean chains 3, error handling 1 (nesting depth added 24). None of this is in the body itself: all 60 points belong to 2 function literals inside it that branch (lines 1271, 1447). 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 · terminal.terminalCommand (cognitive 60) · ×1
  • terminal.terminalCommand (cognitive 60) packages/cli/src/commands/terminal.ts:170 — terminal.terminalCommand has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (25 pts), ternaries 16 (22 pts), boolean chains 11, error handling 1, loops 1 (nesting depth added 11). None of this is in the body itself: all 60 points belong to 5 function literals inside it that branch (lines 211, 345, 306, …). 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 · SessionFingerprinter.fingerprint (cognitive 60) · ×1
  • SessionFingerprinter.fingerprint (cognitive 60) packages/daemon/src/domain/session-fingerprinter.ts:73 — SessionFingerprinter.fingerprint has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 6 (14 pts), ternaries 3 (12 pts), boolean chains 4 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StartupController.key (cognitive 60) · ×1
  • StartupController.key (cognitive 60) packages/tui/src/startup.ts:120 — StartupController.key has cognitive complexity 60 (threshold 15). Drivers by points: if/else 29 (35 pts), boolean chains 18, ternaries 4 (7 pts) (nesting depth added 9). Of this number, 56 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 · RigNode.RigNode (cognitive 60) · ×1
  • RigNode.RigNode (cognitive 60) packages/ui/src/components/RigNode.tsx:79 — RigNode.RigNode has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 27 (35 pts), boolean chains 19, if/else 5, error handling 1 (nesting depth added 8). Of this number, 52 points are the body's own statements and 8 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 · tmux-server-selection.selectTmuxServer (cognitive 59) · ×1
  • tmux-server-selection.selectTmuxServer (cognitive 59) packages/daemon/src/domain/tmux-server-selection.ts:152 — tmux-server-selection.selectTmuxServer has cognitive complexity 59 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 16, ternaries 9 (14 pts), error handling 3 (6 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 · SessionTransport.classifySendReadiness (cognitive 59) · ×1
  • SessionTransport.classifySendReadiness (cognitive 59) packages/daemon/src/domain/session-transport.ts:4475 — SessionTransport.classifySendReadiness has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 16, ternaries 7 (15 pts), error handling 1 (nesting depth added 22). Of this number, 58 points are the body's own statements and 1 belongs to one function item 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 · seat-attention.checkSeatAttention (cognitive 59) · ×1
  • seat-attention.checkSeatAttention (cognitive 59) packages/cli/src/seat-attention.ts:30 — seat-attention.checkSeatAttention has cognitive complexity 59 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 8 (15 pts), ternaries 3 (10 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 32). Of this number, 56 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 · bundle-source-resolver.materializePodBundle (cognitive 59) · ×1
  • bundle-source-resolver.materializePodBundle (cognitive 59) packages/daemon/src/domain/bundle-source-resolver.ts:214 — bundle-source-resolver.materializePodBundle has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 7 (12 pts), boolean chains 6, ternaries 3 (5 pts), error handling 2 (4 pts) (nesting depth added 26). Of this number, 53 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 · stylize.stylizeLines (cognitive 59) · ×1
  • stylize.stylizeLines (cognitive 59) packages/tui/src/stylize.ts:131 — stylize.stylizeLines has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (27 pts), ternaries 7 (23 pts), boolean chains 6, loops 1 (3 pts) (nesting depth added 26). Most of this is not in the body itself: 1 of the 59 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 139, 229, 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 · InstallPlanner.plan (cognitive 58) · ×1
  • InstallPlanner.plan (cognitive 58) packages/daemon/src/domain/install-planner.ts:73 — InstallPlanner.plan has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (29 pts), ternaries 5 (11 pts), loops 7 (10 pts), boolean chains 8 (nesting depth added 23). Of this number, 56 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 · node-inventory.buildRestoreOutcomeMap (cognitive 58) · ×1
  • node-inventory.buildRestoreOutcomeMap (cognitive 58) REDACTED:524 — node-inventory.buildRestoreOutcomeMap has cognitive complexity 58 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 7 (15 pts), boolean chains 9, loops 5 (9 pts), error handling 1 (2 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeCompactionEnforcer.maybeAutoCompactUnchecked (cognitive 58) · ×1
  • ClaudeCompactionEnforcer.maybeAutoCompactUnchecked (cognitive 58) packages/daemon/src/domain/claude-compaction-enforcer.ts:1326 — ClaudeCompactionEnforcer.maybeAutoCompactUnchecked has cognitive complexity 58 (threshold 15). Drivers by points: if/else 29 (36 pts), boolean chains 13, ternaries 4 (9 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 · CodexRuntimeAdapter.prepareLaunch (cognitive 58) · ×1
  • CodexRuntimeAdapter.prepareLaunch (cognitive 58) packages/daemon/src/adapters/codex-runtime-adapter.ts:1122 — CodexRuntimeAdapter.prepareLaunch has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 25 (32 pts), boolean chains 16, if/else 7 (8 pts), error handling 1 (2 pts) (nesting depth added 9). Of this number, 54 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.
D2 · Cognitive Complexity · SeatIdentityReconciler.computeVerdict (cognitive 58) · ×1
  • SeatIdentityReconciler.computeVerdict (cognitive 58) packages/daemon/src/domain/seat-identity-reconciler.ts:338 — SeatIdentityReconciler.computeVerdict has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (30 pts), ternaries 8 (14 pts), boolean chains 12, error handling 1 (2 pts) (nesting depth added 19). Of this number, 57 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 · stream.streamRoutes (cognitive 58) · ×1
  • stream.streamRoutes (cognitive 58) packages/daemon/src/routes/stream.ts:47 — stream.streamRoutes has cognitive complexity 58 (threshold 15). Drivers by points: if/else 27 (34 pts), boolean chains 12, ternaries 6, error handling 3 (4 pts), loops 2 (nesting depth added 8). None of this is in the body itself: all 58 points belong to 11 function literals inside it that branch (lines 94, 217, 175, …). 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 · ProjectTreeView.ProjectTreeView (cognitive 58) · ×1
  • ProjectTreeView.ProjectTreeView (cognitive 58) packages/ui/src/components/project/ProjectTreeView.tsx:97 — ProjectTreeView.ProjectTreeView has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 25 (38 pts), if/else 6 (10 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 18). Of this number, 22 points are the body's own statements and 36 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 · TerminalLauncher.TerminalLauncher (cognitive 58) · ×1
  • TerminalLauncher.TerminalLauncher (cognitive 58) packages/ui/src/components/topology/TerminalLauncher.tsx:239 — TerminalLauncher.TerminalLauncher has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 33 (43 pts), boolean chains 11, if/else 4 (nesting depth added 10). Of this number, 34 points are the body's own statements and 24 belong to 7 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 · generated-file-hygiene.excludeNewGeneratedFiles (cognitive 57) · ×1
  • generated-file-hygiene.excludeNewGeneratedFiles (cognitive 57) packages/daemon/src/domain/generated-file-hygiene.ts:16 — generated-file-hygiene.excludeNewGeneratedFiles has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (25 pts), ternaries 9 (13 pts), boolean chains 12, loops 3 (4 pts), error handling 3 (nesting depth added 14). Of this number, 49 points are the body's own statements and 8 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 · projection-planner.planProjection (cognitive 57) · ×1
  • projection-planner.planProjection (cognitive 57) packages/daemon/src/domain/projection-planner.ts:95 — projection-planner.planProjection has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (43 pts), ternaries 2 (6 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 33). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session-transport.classifyPaneActivity (cognitive 57) · ×1
  • session-transport.classifyPaneActivity (cognitive 57) packages/daemon/src/domain/session-transport.ts:797 — session-transport.classifyPaneActivity has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 21, if/else 17 (18 pts), ternaries 15 (18 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.
D2 · Cognitive Complexity · whoami.whoamiCommand (cognitive 57) · ×1
  • whoami.whoamiCommand (cognitive 57) packages/cli/src/commands/whoami.ts:281 — whoami.whoamiCommand has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (32 pts), ternaries 5 (10 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 13). None of this is in the body itself: all 57 points belong to one function literal inside it that branches (line 309). 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 · doctor.runDoctorChecks (cognitive 57) · ×1
  • doctor.runDoctorChecks (cognitive 57) REDACTED:144 — doctor.runDoctorChecks has cognitive complexity 57 (threshold 15). Drivers by points: if/else 21 (30 pts), ternaries 7 (16 pts), error handling 4 (7 pts), boolean chains 4 (nesting depth added 21). Of this number, 42 points are the body's own statements and 15 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 · workflow-follow.followInstance (cognitive 57) · ×1
  • workflow-follow.followInstance (cognitive 57) packages/cli/src/commands/workflow-follow.ts:177 — workflow-follow.followInstance has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (33 pts), ternaries 4 (12 pts), loops 3 (6 pts), error handling 2 (4 pts), boolean chains 2 (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 · CodexRuntimeAdapter.projectEntry (cognitive 57) · ×1
  • CodexRuntimeAdapter.projectEntry (cognitive 57) packages/daemon/src/adapters/codex-runtime-adapter.ts:1460 — CodexRuntimeAdapter.projectEntry has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 12, ternaries 6 (11 pts), error handling 1 (2 pts), 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 · WhoamiService.resolve (cognitive 57) · ×1
  • WhoamiService.resolve (cognitive 57) packages/daemon/src/domain/whoami-service.ts:174 — WhoamiService.resolve has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (35 pts), ternaries 10 (12 pts), boolean chains 5, loops 4 (5 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 · WatchdogPolicyEngine.recordAttempt (cognitive 57) · ×1
  • WatchdogPolicyEngine.recordAttempt (cognitive 57) packages/daemon/src/domain/watchdog-policy-engine.ts:801 — WatchdogPolicyEngine.recordAttempt has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 19 (36 pts), if/else 12, boolean chains 9 (nesting depth added 17). Of this number, 45 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 · claude-token-usage.parseClaudeTokenUsage (cognitive 57) · ×1
  • claude-token-usage.parseClaudeTokenUsage (cognitive 57) packages/daemon/src/domain/provider/claude-token-usage.ts:16 — claude-token-usage.parseClaudeTokenUsage has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 9 (23 pts), if/else 10 (22 pts), boolean chains 6, loops 3 (4 pts), 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 · rig-mode.rigModeRoutes (cognitive 57) · ×1
  • rig-mode.rigModeRoutes (cognitive 57) packages/daemon/src/routes/rig-mode.ts:121 — rig-mode.rigModeRoutes has cognitive complexity 57 (threshold 15). Drivers by points: if/else 25 (32 pts), error handling 6 (13 pts), boolean chains 10, ternaries 2 (nesting depth added 14). None of this is in the body itself: all 57 points belong to 7 function items inside it that branch (a function literal at line 189, a function literal at line 223, unset, …). 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 · migrate-telemetry-state-0.5.9.applyLibrary (cognitive 57) · ×1
  • migrate-telemetry-state-0.5.9.applyLibrary (cognitive 57) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:1055 — migrate-telemetry-state-0.5.9.applyLibrary has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 15 (19 pts), boolean chains 8, loops 3 (5 pts), error handling 3 (nesting depth added 17). Of this number, 56 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 · SeatDeliveryGuard.beforeInput (cognitive 56) · ×1
  • SeatDeliveryGuard.beforeInput (cognitive 56) packages/daemon/src/domain/seat-delivery-guard.ts:479 — SeatDeliveryGuard.beforeInput has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 14, ternaries 4 (10 pts) (nesting depth added 20). Of this number, 54 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 · ClaudeResumeAdapter.resume (cognitive 56) · ×1
  • ClaudeResumeAdapter.resume (cognitive 56) packages/daemon/src/adapters/claude-resume.ts:64 — ClaudeResumeAdapter.resume has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (32 pts), ternaries 26 (30 pts), boolean chains 16, error handling 3 (6 pts) (nesting depth added 16). 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 (ClaudeResumeAdapter.resume::sendClassic) 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 · community-harness-presets.parsePreset (cognitive 56) · ×1
  • community-harness-presets.parsePreset (cognitive 56) packages/daemon/src/domain/community-harness-presets.ts:59 — community-harness-presets.parsePreset has cognitive complexity 56 (threshold 15). Drivers by points: if/else 26 (32 pts), boolean chains 18, ternaries 3 (4 pts), error handling 1, loops 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 · ClaudeCompactionEnforcer.triggerManualCompactUnchecked (cognitive 56) · ×1
  • ClaudeCompactionEnforcer.triggerManualCompactUnchecked (cognitive 56) packages/daemon/src/domain/claude-compaction-enforcer.ts:1492 — ClaudeCompactionEnforcer.triggerManualCompactUnchecked has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (29 pts), ternaries 5 (9 pts), boolean chains 8, error handling 2 (6 pts), loops 3 (4 pts) (nesting depth added 19). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bundle-types.validateLegacyBundleManifest (cognitive 56) · ×1
  • bundle-types.validateLegacyBundleManifest (cognitive 56) packages/daemon/src/domain/bundle-types.ts:635 — bundle-types.validateLegacyBundleManifest has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 14, loops 2 (5 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 · manifest-parser.parseAgentImageManifest (cognitive 56) · ×1
  • manifest-parser.parseAgentImageManifest (cognitive 56) packages/daemon/src/domain/agent-images/manifest-parser.ts:19 — manifest-parser.parseAgentImageManifest has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 15, ternaries 11 (15 pts), loops 1 (2 pts), error handling 1 (nesting depth added 15). Of this number, 55 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 · WatchdogPolicyEngine.evaluate (cognitive 56) · ×1
  • WatchdogPolicyEngine.evaluate (cognitive 56) packages/daemon/src/domain/watchdog-policy-engine.ts:341 — WatchdogPolicyEngine.evaluate has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (27 pts), boolean chains 19, ternaries 10 (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 · bundles.consumeAuthorBundleYaml (cognitive 56) · ×1
  • bundles.consumeAuthorBundleYaml (cognitive 56) packages/daemon/src/routes/bundles.ts:495 — bundles.consumeAuthorBundleYaml has cognitive complexity 56 (threshold 15). Drivers by points: if/else 34 (61 pts), boolean chains 19, loops 9 (15 pts), error handling 4 (11 pts), ternaries 1 (2 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent 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 (bundles.consumeAuthorBundleYaml::assertNoSymlinkEscapeInTree) 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 · up.upRoutes.post("/") (cognitive 56) · ×1
  • up.upRoutes.post("/") (cognitive 56) packages/daemon/src/routes/up.ts:197 — up.upRoutes.post("/") has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (32 pts), ternaries 9 (13 pts), boolean chains 7, error handling 3 (4 pts) (nesting depth added 17). Of this number, 42 points are the body's own statements and 14 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 · MarkdownViewer.parseMarkdown (cognitive 56) · ×1
  • MarkdownViewer.parseMarkdown (cognitive 56) packages/ui/src/components/markdown/MarkdownViewer.tsx:138 — MarkdownViewer.parseMarkdown has cognitive complexity 56 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 6 (16 pts), boolean chains 6, ternaries 1 (4 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 · SeatActivityService.observeSeat (cognitive 55) · ×1
  • SeatActivityService.observeSeat (cognitive 55) packages/daemon/src/domain/seat-activity-service.ts:178 — SeatActivityService.observeSeat has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 9 (22 pts), if/else 11 (21 pts), boolean chains 10, error handling 1 (2 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 · relay-outbound.validateRelayOutboundEnvelope (cognitive 55) · ×1
  • relay-outbound.validateRelayOutboundEnvelope (cognitive 55) packages/daemon/src/domain/gateway/relay-outbound.ts:215 — relay-outbound.validateRelayOutboundEnvelope has cognitive complexity 55 (threshold 15). Drivers by points: if/else 24 (41 pts), boolean chains 8, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PiResumeAdapter.resume (cognitive 55) · ×1
  • PiResumeAdapter.resume (cognitive 55) packages/daemon/src/adapters/pi-resume.ts:66 — PiResumeAdapter.resume has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 14 (20 pts), error handling 7 (12 pts), if/else 12, boolean chains 11 (nesting depth added 11). 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 · current-work.deriveWorkCandidates (cognitive 55) · ×1
  • current-work.deriveWorkCandidates (cognitive 55) packages/daemon/src/domain/current-work.ts:829 — current-work.deriveWorkCandidates has cognitive complexity 55 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 6 (19 pts), loops 4 (9 pts), boolean chains 3 (nesting depth added 31). Of this number, 54 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PodBundleAssembler.assemble (cognitive 55) · ×1
  • PodBundleAssembler.assemble (cognitive 55) packages/daemon/src/domain/pod-bundle-assembler.ts:69 — PodBundleAssembler.assemble has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 6 (14 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 29). Of this number, 48 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 · skills.skillsRoutes (cognitive 55) · ×1
  • skills.skillsRoutes (cognitive 55) packages/daemon/src/routes/skills.ts:73 — skills.skillsRoutes has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (23 pts), ternaries 17 (23 pts), error handling 5, boolean chains 2, loops 2 (nesting depth added 9). None of this is in the body itself: all 55 points belong to 9 function items inside it that branch (a function literal at line 124, a function literal at line 187, a function literal at line 206, …). 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 · HybridTopologyNodes.HybridAgentNodeInner (cognitive 55) · ×1
  • HybridTopologyNodes.HybridAgentNodeInner (cognitive 55) packages/ui/src/components/topology/HybridTopologyNodes.tsx:117 — HybridTopologyNodes.HybridAgentNodeInner has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 22 (40 pts), boolean chains 11, if/else 2 (4 pts) (nesting depth added 20). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · seat-launch-additions.prepareSeatLaunchAdditions (cognitive 54) · ×1
  • seat-launch-additions.prepareSeatLaunchAdditions (cognitive 54) packages/daemon/src/domain/seat-launch-additions.ts:113 — seat-launch-additions.prepareSeatLaunchAdditions has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (22 pts), ternaries 8 (12 pts), boolean chains 7, error handling 4 (7 pts), loops 5 (6 pts) (nesting depth added 14). Of this number, 53 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 · QueueRepository.waitingView (cognitive 53) · ×1
  • QueueRepository.waitingView (cognitive 53) packages/daemon/src/domain/queue-repository.ts:6265 — QueueRepository.waitingView has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 10 (23 pts), if/else 9 (17 pts), boolean chains 13 (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 · SessionTransport.diagnoseProducerLink (cognitive 53) · ×1
  • SessionTransport.diagnoseProducerLink (cognitive 53) packages/daemon/src/domain/session-transport.ts:4674 — SessionTransport.diagnoseProducerLink has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 12 (16 pts), error handling 3 (6 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 19). Of this number, 29 points are the body's own statements and 24 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 · setup.setupCommand (cognitive 53) · ×1
  • setup.setupCommand (cognitive 53) packages/cli/src/commands/setup.ts:867 — setup.setupCommand has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 6 (16 pts), loops 7 (8 pts), boolean chains 7 (nesting depth added 19). None of this is in the body itself: all 53 points belong to 2 function literals inside it that branch (lines 887, 938). 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 · PodRigInstantiator.addMemberToPod (cognitive 53) · ×1
  • PodRigInstantiator.addMemberToPod (cognitive 53) packages/daemon/src/domain/rigspec-instantiator.ts:1131 — PodRigInstantiator.addMemberToPod has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 14 (27 pts), if/else 15 (17 pts), boolean chains 8, loops 1 (nesting depth added 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MissionControlWriteContract.answerAsk (cognitive 53) · ×1
  • MissionControlWriteContract.answerAsk (cognitive 53) packages/daemon/src/domain/mission-control/mission-control-write-contract.ts:601 — MissionControlWriteContract.answerAsk has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 11 (18 pts), boolean chains 16, error handling 1 (nesting depth added 11). 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 · reactive-tap.collectReactiveEventSignals (cognitive 53) · ×1
  • reactive-tap.collectReactiveEventSignals (cognitive 53) packages/daemon/src/domain/provider/reactive-tap.ts:77 — reactive-tap.collectReactiveEventSignals has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (42 pts), boolean chains 7, ternaries 1 (3 pts), loops 1 (nesting depth added 24). 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 · rosters.parseRoster.members (cognitive 52) · ×1
  • rosters.parseRoster.members (cognitive 52) packages/daemon/src/domain/rosters.ts:125 — rosters.parseRoster.members has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 24 (40 pts), boolean chains 11, if/else 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 · workflow-render.renderInstanceShow (cognitive 52) · ×1
  • workflow-render.renderInstanceShow (cognitive 52) packages/cli/src/commands/workflow-render.ts:377 — workflow-render.renderInstanceShow has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 8 (22 pts), if/else 15 (19 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RigSpecPreflight.check (cognitive 52) · ×1
  • RigSpecPreflight.check (cognitive 52) packages/daemon/src/domain/rigspec-preflight.ts:47 — RigSpecPreflight.check has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (37 pts), error handling 3 (9 pts), loops 4, boolean chains 2 (nesting depth added 25). 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 · WorkflowProjector.projectDependencyGraph (cognitive 52) · ×1
  • WorkflowProjector.projectDependencyGraph (cognitive 52) packages/daemon/src/domain/workflow-projector.ts:1244 — WorkflowProjector.projectDependencyGraph has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 17 (24 pts), if/else 13 (15 pts), boolean chains 12, loops 1 (nesting depth added 9). Of this number, 20 points are the body's own statements and 32 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 · ChannelRecovery.page (cognitive 52) · ×1
  • ChannelRecovery.page (cognitive 52) packages/daemon/src/domain/gateway/slack/channel-recovery.ts:103 — ChannelRecovery.page has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 15, ternaries 2, loops 1 (nesting depth added 12). Of this number, 51 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 · server.createApp (cognitive 52) · ×1
  • server.createApp (cognitive 52) packages/daemon/src/server.ts:493 — server.createApp has cognitive complexity 52 (threshold 15). Drivers by points: if/else 33, ternaries 10, boolean chains 8, loops 1. Of this number, 25 points are the body's own statements and 27 belong to 9 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 · startup.startupLines (cognitive 52) · ×1
  • startup.startupLines (cognitive 52) packages/tui/src/startup.ts:257 — startup.startupLines has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (26 pts), ternaries 7 (20 pts), boolean chains 6 (nesting depth added 23). Of this number, 44 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 · RunnerChannel.post (cognitive 51) · ×1
  • RunnerChannel.post (cognitive 51) packages/daemon/src/domain/runner-channel.ts:53 — RunnerChannel.post has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 19, error handling 1, loops 1 (nesting depth added 10). 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 · ClaudeCompactionEnforcer.sendPreparedCompact (cognitive 51) · ×1
  • ClaudeCompactionEnforcer.sendPreparedCompact (cognitive 51) packages/daemon/src/domain/claude-compaction-enforcer.ts:1765 — ClaudeCompactionEnforcer.sendPreparedCompact has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 21, if/else 11 (16 pts), ternaries 8 (13 pts), error handling 1 (nesting depth added 10). Of this number, 43 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 · ClaudeCodeAdapter.projectEntry (cognitive 51) · ×1
  • ClaudeCodeAdapter.projectEntry (cognitive 51) packages/daemon/src/adapters/claude-code-adapter.ts:935 — ClaudeCodeAdapter.projectEntry has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 7 (12 pts), boolean chains 11, error handling 1 (2 pts), loops 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 · SlackAskSettlement.settleOne (cognitive 51) · ×1
  • SlackAskSettlement.settleOne (cognitive 51) packages/daemon/src/domain/gateway/slack/settled-asks.ts:208 — SlackAskSettlement.settleOne has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 7, ternaries 3 (6 pts), loops 1 (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 · network-connector.reportBack (cognitive 51) · ×1
  • network-connector.reportBack (cognitive 51) packages/daemon/src/domain/network/network-connector.ts:257 — network-connector.reportBack has cognitive complexity 51 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 6 (14 pts), boolean chains 7, error handling 2 (5 pts), loops 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 · context-usage-threshold.makeContextUsageThresholdPolicy.evaluate (cognitive 51) · ×1
  • context-usage-threshold.makeContextUsageThresholdPolicy.evaluate (cognitive 51) packages/daemon/src/domain/policies/context-usage-threshold.ts:30 — context-usage-threshold.makeContextUsageThresholdPolicy.evaluate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 12 (22 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 19). Of this number, 45 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 · RigSpecExporter.exportPodAware (cognitive 51) · ×1
  • RigSpecExporter.exportPodAware (cognitive 51) packages/daemon/src/domain/rigspec-exporter.ts:209 — RigSpecExporter.exportPodAware has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (25 pts), ternaries 13, boolean chains 10, error handling 1 (2 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 51 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 245, a function literal at line 241, a function literal at line 325, …). 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 · guest.main (cognitive 51) · ×1
  • guest.main (cognitive 51) packages/daemon/assets/openshell/guest.py:227 — guest.main has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 7, error handling 1 (4 pts), loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scanQuotes (cognitive 51) · ×1
  • scanQuotes (cognitive 51) packages/daemon/assets/claude-team-permissions.cjs:8 — scanQuotes has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (38 pts), boolean chains 6, ternaries 2 (6 pts), 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 · words (cognitive 51) · ×1
  • words (cognitive 51) packages/daemon/assets/claude-team-permissions.cjs:102 — words has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 8, loops 2 (4 pts), ternaries 1 (4 pts) (nesting depth added 20). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeCompactionEnforcer.drainPendingStage (cognitive 50) · ×1
  • ClaudeCompactionEnforcer.drainPendingStage (cognitive 50) packages/daemon/src/domain/claude-compaction-enforcer.ts:1159 — ClaudeCompactionEnforcer.drainPendingStage has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 13, ternaries 3 (nesting depth added 13). Of this number, 48 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 · watchdog.watchdogCommand (cognitive 50) · ×1
  • watchdog.watchdogCommand (cognitive 50) packages/cli/src/commands/watchdog.ts:71 — watchdog.watchdogCommand has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 14 (20 pts), boolean chains 14, if/else 12, error handling 2 (4 pts) (nesting depth added 8). None of this is in the body itself: all 50 points belong to 6 function literals inside it that branch (lines 124, 358, 276, …). 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 · codex-runtime-adapter.lineStartsAtDocumentLevel (cognitive 50) · ×1
  • codex-runtime-adapter.lineStartsAtDocumentLevel (cognitive 50) packages/daemon/src/adapters/codex-runtime-adapter.ts:2717 — codex-runtime-adapter.lineStartsAtDocumentLevel has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (36 pts), boolean chains 7, loops 3 (7 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 · PodRigInstantiator.retryFirstStart (cognitive 50) · ×1
  • PodRigInstantiator.retryFirstStart (cognitive 50) packages/daemon/src/domain/rigspec-instantiator.ts:1333 — PodRigInstantiator.retryFirstStart has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (24 pts), boolean chains 14, ternaries 6 (9 pts), error handling 2, loops 1 (nesting depth added 4). Of this number, 37 points are the body's own statements and 13 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 · execution-view.readLifecycleExecutions (cognitive 50) · ×1
  • execution-view.readLifecycleExecutions (cognitive 50) packages/daemon/src/domain/execution-view.ts:369 — execution-view.readLifecycleExecutions has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 16 (33 pts), boolean chains 9, if/else 4 (7 pts), loops 1 (nesting depth added 20). Of this number, 16 points are the body's own statements and 34 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 · ThreadRecovery.page (cognitive 50) · ×1
  • ThreadRecovery.page (cognitive 50) packages/daemon/src/domain/gateway/slack/thread-recovery.ts:96 — ThreadRecovery.page has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 12, ternaries 4, loops 1 (nesting depth added 12). Of this number, 49 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 · rigspec-schema.validateClaudeAdditions (cognitive 49) · ×1
  • rigspec-schema.validateClaudeAdditions (cognitive 49) packages/daemon/src/domain/rigspec-schema.ts:1258 — rigspec-schema.validateClaudeAdditions has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (27 pts), ternaries 4 (13 pts), boolean chains 7, loops 2 (nesting depth added 22). Of this number, 24 points are the body's own statements and 25 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 · restore-guidance.restoreMissingGuidance (cognitive 49) · ×1
  • restore-guidance.restoreMissingGuidance (cognitive 49) packages/daemon/src/domain/restore-guidance.ts:266 — restore-guidance.restoreMissingGuidance has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (32 pts), error handling 5 (9 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (2 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 · ClaimService.reconcileSession (cognitive 49) · ×1
  • ClaimService.reconcileSession (cognitive 49) packages/daemon/src/domain/claim-service.ts:489 — ClaimService.reconcileSession has cognitive complexity 49 (threshold 15). Drivers by points: if/else 25 (35 pts), boolean chains 6, error handling 5 (6 pts), loops 1, ternaries 1 (nesting depth added 11). 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 · herdr-app-install.installRigMods (cognitive 49) · ×1
  • herdr-app-install.installRigMods (cognitive 49) packages/daemon/src/domain/terminal/herdr-app-install.ts:82 — herdr-app-install.installRigMods has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 7 (13 pts), boolean chains 9, ternaries 2 (5 pts), error handling 1 (nesting depth added 18). Of this number, 47 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 · resume-token-capture.deriveResumeToken (cognitive 48) · ×1
  • resume-token-capture.deriveResumeToken (cognitive 48) packages/daemon/src/domain/resume-token-capture.ts:86 — resume-token-capture.deriveResumeToken has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (35 pts), ternaries 3 (9 pts), boolean chains 2, error handling 1 (2 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 · seat-skill-storage.followSeatSkills (cognitive 48) · ×1
  • seat-skill-storage.followSeatSkills (cognitive 48) packages/daemon/src/domain/seat-skill-storage.ts:818 — seat-skill-storage.followSeatSkills has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (26 pts), error handling 5 (7 pts), loops 6 (7 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 16). Of this number, 31 points are the body's own statements and 17 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 · CommunityHarnessRuntimeAdapter.launchPreset (cognitive 48) · ×1
  • CommunityHarnessRuntimeAdapter.launchPreset (cognitive 48) packages/daemon/src/adapters/community-harness-runtime-adapter.ts:175 — CommunityHarnessRuntimeAdapter.launchPreset has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (22 pts), error handling 7 (13 pts), ternaries 5 (10 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 · TmuxAdapter.createSessionUnchecked (cognitive 48) · ×1
  • TmuxAdapter.createSessionUnchecked (cognitive 48) packages/daemon/src/adapters/tmux.ts:1757 — TmuxAdapter.createSessionUnchecked has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 9 (17 pts), boolean chains 3, error handling 3, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · host.postureCheck (cognitive 48) · ×1
  • host.postureCheck (cognitive 48) packages/cli/src/commands/host.ts:362 — host.postureCheck has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (22 pts), ternaries 8 (13 pts), boolean chains 9, error handling 2, loops 1 (2 pts) (nesting depth added 8). Of this number, 41 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, 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 · pi-runner.connectPiRunnerChannel (cognitive 48) · ×1
  • pi-runner.connectPiRunnerChannel (cognitive 48) REDACTED:2185 — pi-runner.connectPiRunnerChannel has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 3 (6 pts), boolean chains 2, error handling 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 · PodRigInstantiator.computePodLaunchOrder (cognitive 48) · ×1
  • PodRigInstantiator.computePodLaunchOrder (cognitive 48) packages/daemon/src/domain/rigspec-instantiator.ts:1960 — PodRigInstantiator.computePodLaunchOrder has cognitive complexity 48 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 8 (14 pts), ternaries 4 (10 pts), boolean chains 1 (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 · bundle-content-routing.routeBundleContents (cognitive 48) · ×1
  • bundle-content-routing.routeBundleContents (cognitive 48) packages/daemon/src/domain/bundle-content-routing.ts:81 — bundle-content-routing.routeBundleContents has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 5, error handling 4 (5 pts), loops 1 (4 pts) (nesting depth added 22). Of this number, 36 points are the body's own statements and 12 belong to 4 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 · relay-inbound.createRelayInboundHandler.handle (cognitive 48) · ×1
  • relay-inbound.createRelayInboundHandler.handle (cognitive 48) packages/daemon/src/domain/gateway/relay-inbound.ts:644 — relay-inbound.createRelayInboundHandler.handle has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (26 pts), error handling 5 (10 pts), ternaries 4 (9 pts), boolean chains 3 (nesting depth added 20). Most of this is not in the body itself: 5 of the 48 points are its own statements and the rest belongs to one function literal inside it that branches (line 704). 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 · watchdog-delivery-receipts.withWatchdogReceipts.deliver (cognitive 48) · ×1
  • watchdog-delivery-receipts.withWatchdogReceipts.deliver (cognitive 48) packages/daemon/src/domain/watchdog-delivery-receipts.ts:63 — watchdog-delivery-receipts.withWatchdogReceipts.deliver has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 11 (16 pts), boolean chains 9, loops 3, error handling 1 (nesting depth added 16). Most of this is not in the body itself: 6 of the 48 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 93, 68). 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 · FocusedTerminal.FocusedTerminal (cognitive 48) · ×1
  • FocusedTerminal.FocusedTerminal (cognitive 48) packages/ui/src/components/terminal/FocusedTerminal.tsx:168 — FocusedTerminal.FocusedTerminal has cognitive complexity 48 (threshold 15). Drivers by points: if/else 24 (25 pts), boolean chains 15, ternaries 4 (5 pts), error handling 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 48 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 211, 248, 394, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · agent-activity-store.normalizeRunnerObservations (cognitive 47) · ×1
  • agent-activity-store.normalizeRunnerObservations (cognitive 47) packages/daemon/src/domain/agent-activity-store.ts:730 — agent-activity-store.normalizeRunnerObservations has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 12, loops 1 (2 pts), ternaries 1 (nesting depth added 17). Of this number, 46 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 · native-process-lineage.claudeArgvIds (cognitive 47) · ×1
  • native-process-lineage.claudeArgvIds (cognitive 47) packages/daemon/src/domain/native-process-lineage.ts:346 — native-process-lineage.claudeArgvIds has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 7, loops 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 · ClaudeManagedLaunch.prepare (cognitive 47) · ×1
  • ClaudeManagedLaunch.prepare (cognitive 47) packages/daemon/src/domain/claude-managed-launch.ts:309 — ClaudeManagedLaunch.prepare has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 19 (23 pts), boolean chains 14, if/else 8, error handling 1 (2 pts) (nesting depth added 5). Of this number, 32 points are the body's own statements and 15 belong to 8 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 · InboundRouter.attemptBot (cognitive 47) · ×1
  • InboundRouter.attemptBot (cognitive 47) packages/daemon/src/domain/gateway/slack/inbound.ts:774 — InboundRouter.attemptBot has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (21 pts), ternaries 10 (16 pts), boolean chains 9, 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 · queue-stuck-sweep.deliveryResolutionEvidence (cognitive 47) · ×1
  • queue-stuck-sweep.deliveryResolutionEvidence (cognitive 47) packages/daemon/src/domain/queue-stuck-sweep.ts:529 — queue-stuck-sweep.deliveryResolutionEvidence has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 11, error handling 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queue.waitForDeliveryOutcome (cognitive 47) · ×1
  • queue.waitForDeliveryOutcome (cognitive 47) packages/cli/src/commands/queue.ts:230 — queue.waitForDeliveryOutcome has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 4 (15 pts), boolean chains 6, error handling 1 (2 pts), 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 · refocus.renderTrace (cognitive 47) · ×1
  • refocus.renderTrace (cognitive 47) packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs:254 — refocus.renderTrace has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 13, ternaries 4 (5 pts), loops 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 · PsProjectionService.getEntries (cognitive 47) · ×1
  • PsProjectionService.getEntries (cognitive 47) packages/daemon/src/domain/ps-projection.ts:177 — PsProjectionService.getEntries has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 12 (21 pts), if/else 7 (16 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 19). Most of this is not in the body itself: 2 of the 47 points are its own statements and the rest belongs to one function literal inside it that branches (line 225). 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 · SeatHandoverService.recover (cognitive 47) · ×1
  • SeatHandoverService.recover (cognitive 47) packages/daemon/src/domain/seat-handover-service.ts:925 — SeatHandoverService.recover has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 19 (26 pts), boolean chains 14, if/else 7 (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 · runtime-switch-materials.planRuntimeSwitchMaterials (cognitive 47) · ×1
  • runtime-switch-materials.planRuntimeSwitchMaterials (cognitive 47) packages/daemon/src/domain/runtime-switch-materials.ts:76 — runtime-switch-materials.planRuntimeSwitchMaterials has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 9 (16 pts), boolean chains 4, loops 2, error handling 1 (nesting depth added 18). Of this number, 40 points are the body's own statements and 7 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 · workflow-boot-sweep.runWorkflowBootSweep (cognitive 47) · ×1
  • workflow-boot-sweep.runWorkflowBootSweep (cognitive 47) packages/daemon/src/domain/workflow-boot-sweep.ts:61 — workflow-boot-sweep.runWorkflowBootSweep has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (24 pts), ternaries 3 (9 pts), loops 4 (7 pts), error handling 1 (4 pts), boolean chains 3 (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 · guest.descriptor (cognitive 47) · ×1
  • guest.descriptor (cognitive 47) packages/daemon/assets/openshell/guest.py:105 — guest.descriptor has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 9, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codex-thread-id.readCodexThreadIdFromLogs (cognitive 46) · ×1
  • codex-thread-id.readCodexThreadIdFromLogs (cognitive 46) REDACTED:402 — codex-thread-id.readCodexThreadIdFromLogs has cognitive complexity 46 (threshold 15). Drivers by points: loops 8 (16 pts), ternaries 8 (13 pts), if/else 6 (9 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 18). Of this number, 44 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 · operator-delivery-engine.makeOperatorDeliveryEngine.dispatchEscalation (cognitive 46) · ×1
  • operator-delivery-engine.makeOperatorDeliveryEngine.dispatchEscalation (cognitive 46) packages/daemon/src/domain/gateway/operator-delivery-engine.ts:155 — operator-delivery-engine.makeOperatorDeliveryEngine.dispatchEscalation has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 9 (15 pts), error handling 5 (6 pts), boolean chains 3 (nesting depth added 12). Of this number, 39 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queue-wake-ladder.readWakeLadderBackstop (cognitive 46) · ×1
  • queue-wake-ladder.readWakeLadderBackstop (cognitive 46) packages/daemon/src/domain/queue-wake-ladder.ts:526 — queue-wake-ladder.readWakeLadderBackstop has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 14 (21 pts), boolean chains 14, if/else 10 (11 pts) (nesting depth added 8). Of this number, 44 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 · CommunityHarnessRuntimeAdapter.launchHarness (cognitive 46) · ×1
  • CommunityHarnessRuntimeAdapter.launchHarness (cognitive 46) packages/daemon/src/adapters/community-harness-runtime-adapter.ts:99 — CommunityHarnessRuntimeAdapter.launchHarness has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 11 (16 pts), boolean chains 10, error handling 3 (4 pts) (nesting depth added 10). Of this number, 42 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 · destroy-helpers.executeDestroy (cognitive 46) · ×1
  • destroy-helpers.executeDestroy (cognitive 46) packages/cli/src/destroy-helpers.ts:182 — destroy-helpers.executeDestroy has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 3 (8 pts), loops 3 (7 pts), error handling 2 (5 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · slack-delivery.subsystemSlackDeliver · ×1
  • slack-delivery.subsystemSlackDeliver::fn (cognitive 46) packages/daemon/src/domain/gateway/slack/slack-delivery.ts:702 — slack-delivery.subsystemSlackDeliver::fn has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 7 (12 pts), error handling 6 (8 pts), boolean chains 5, 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 · task-terminal-view.projectTaskOwners (cognitive 46) · ×1
  • task-terminal-view.projectTaskOwners (cognitive 46) packages/daemon/src/domain/terminal/task-terminal-view.ts:171 — task-terminal-view.projectTaskOwners has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 11 (35 pts), if/else 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 28). 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, 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 · migrate-telemetry-state-0.5.9.rollback (cognitive 46) · ×1
  • migrate-telemetry-state-0.5.9.rollback (cognitive 46) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:1292 — migrate-telemetry-state-0.5.9.rollback has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 10, ternaries 3 (5 pts), loops 3, error handling 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · native-process-lineage.claudeSessionIdentity (cognitive 45) · ×1
  • native-process-lineage.claudeSessionIdentity (cognitive 45) packages/daemon/src/domain/native-process-lineage.ts:393 — native-process-lineage.claudeSessionIdentity has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutboxHandler.updateRunner (cognitive 45) · ×1
  • OutboxHandler.updateRunner (cognitive 45) packages/daemon/src/domain/outbox-handler.ts:292 — OutboxHandler.updateRunner has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 7 (17 pts), boolean chains 13, if/else 10 (12 pts), loops 2 (3 pts) (nesting depth added 13). None of this is in the body itself: all 45 points belong to one function literal inside it that branches (line 294). 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 · human-questions.parseHumanQuestions (cognitive 45) · ×1
  • human-questions.parseHumanQuestions (cognitive 45) packages/daemon/src/domain/human-questions.ts:50 — human-questions.parseHumanQuestions has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 7, loops 2 (3 pts), ternaries 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 · community-harness-presets.shellSyntaxIn (cognitive 45) · ×1
  • community-harness-presets.shellSyntaxIn (cognitive 45) packages/daemon/src/domain/community-harness-presets.ts:134 — community-harness-presets.shellSyntaxIn has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 7, loops 1, ternaries 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 · QueueRepository.deliverWakeIntent (cognitive 45) · ×1
  • QueueRepository.deliverWakeIntent (cognitive 45) packages/daemon/src/domain/queue-repository.ts:1695 — QueueRepository.deliverWakeIntent has cognitive complexity 45 (threshold 15). Drivers by points: if/else 34 (55 pts), ternaries 16 (29 pts), boolean chains 12, loops 6 (9 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (QueueRepository.deliverWakeIntent::claim) 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 · ps.runFanOutPs (cognitive 45) · ×1
  • ps.runFanOutPs (cognitive 45) packages/cli/src/commands/ps.ts:1899 — ps.runFanOutPs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (26 pts), ternaries 6 (12 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 14). Of this number, 31 points are the body's own statements and 14 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 · HumanModeService.apply (cognitive 45) · ×1
  • HumanModeService.apply (cognitive 45) packages/daemon/src/domain/gateway/human-operating-modes.ts:185 — HumanModeService.apply has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 6 (13 pts), boolean chains 8, error handling 3 (5 pts) (nesting depth added 14). Most of this is not in the body itself: 10 of the 45 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 212, a function literal at line 242, a function literal at line 216, …). 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 · stream-reader-actions.recordReaderAction (cognitive 45) · ×1
  • stream-reader-actions.recordReaderAction (cognitive 45) packages/daemon/src/domain/stream-reader-actions.ts:64 — stream-reader-actions.recordReaderAction has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 6 (14 pts), boolean chains 10, loops 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 · HerdrAppProvider.open (cognitive 45) · ×1
  • HerdrAppProvider.open (cognitive 45) packages/daemon/src/domain/terminal/herdr-app-provider.ts:339 — HerdrAppProvider.open has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 14 (19 pts), if/else 13 (18 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 11). Of this number, 35 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 · topology-manifest.validateTopologyManifest (cognitive 45) · ×1
  • topology-manifest.validateTopologyManifest (cognitive 45) packages/daemon/src/domain/topology/topology-manifest.ts:79 — topology-manifest.validateTopologyManifest has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 7, loops 3 (4 pts), ternaries 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 · watchdog-job-update.updateWatchdogJob (cognitive 45) · ×1
  • watchdog-job-update.updateWatchdogJob (cognitive 45) packages/daemon/src/domain/watchdog-job-update.ts:87 — watchdog-job-update.updateWatchdogJob has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 14, ternaries 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · startup.startupRoutes.post("/ · ×1
  • startup.startupRoutes.post("/:rigId/:logicalId") (cognitive 45) packages/daemon/src/routes/startup.ts:575 — startup.startupRoutes.post("/:rigId/:logicalId") has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (20 pts), ternaries 7 (13 pts), boolean chains 12 (nesting depth added 10). Most of this is not in the body itself: 2 of the 45 points are its own statements and the rest belongs to one function literal inside it that branches (line 579). 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 · trace-to-root.main (cognitive 45) · ×1
  • trace-to-root.main (cognitive 45) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:529 — trace-to-root.main has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 6 (18 pts), boolean chains 5 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · rigspec-schema.validateSurfaces (cognitive 44) · ×1
  • rigspec-schema.validateSurfaces (cognitive 44) packages/daemon/src/domain/rigspec-schema.ts:1030 — rigspec-schema.validateSurfaces has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 2 (6 pts), boolean chains 5 (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 · config.configCommand (cognitive 44) · ×1
  • config.configCommand (cognitive 44) packages/cli/src/commands/config.ts:55 — config.configCommand has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 5 (12 pts), error handling 5 (6 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 14). None of this is in the body itself: all 44 points belong to 5 function literals inside it that branch (lines 255, 285, 194, …). 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 · environment.environmentCommand (cognitive 44) · ×1
  • environment.environmentCommand (cognitive 44) packages/cli/src/commands/environment.ts:59 — environment.environmentCommand has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 7 (10 pts), boolean chains 8, loops 3 (5 pts), error handling 1 (nesting depth added 13). Most of this is not in the body itself: 5 of the 44 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 75, a function literal at line 116, client, …). 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 · terminal.humanOpen (cognitive 44) · ×1
  • terminal.humanOpen (cognitive 44) packages/cli/src/commands/terminal.ts:113 — terminal.humanOpen has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 10 (26 pts), loops 6 (8 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CodexRuntimeAdapter.launchHarness (cognitive 44) · ×1
  • CodexRuntimeAdapter.launchHarness (cognitive 44) packages/daemon/src/adapters/codex-runtime-adapter.ts:940 — CodexRuntimeAdapter.launchHarness has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (31 pts), ternaries 6 (9 pts), boolean chains 4 (nesting depth added 13). Of this number, 42 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 · slack-subsystem.buildSlackGatewayWire.deriveReplyToChoice (cognitive 44) · ×1
  • slack-subsystem.buildSlackGatewayWire.deriveReplyToChoice (cognitive 44) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:533 — slack-subsystem.buildSlackGatewayWire.deriveReplyToChoice has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (37 pts), ternaries 3 (5 pts), boolean chains 1, loops 1 (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 · SeatHandoverService.commit (cognitive 44) · ×1
  • SeatHandoverService.commit (cognitive 44) packages/daemon/src/domain/seat-handover-service.ts:1864 — SeatHandoverService.commit has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 15 (17 pts), boolean chains 8, error handling 2 (nesting depth added 6). Of this number, 16 points are the body's own statements and 28 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 · fetch-stub.route (cognitive 44) · ×1
  • fetch-stub.route (cognitive 44) packages/ui/twin/fetch-stub.ts:44 — fetch-stub.route has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (26 pts), ternaries 8 (17 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentActivityStore.getLatestForNode (cognitive 43) · ×1
  • AgentActivityStore.getLatestForNode (cognitive 43) packages/daemon/src/domain/agent-activity-store.ts:355 — AgentActivityStore.getLatestForNode has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 3 (10 pts), ternaries 4 (7 pts), boolean chains 3 (nesting depth added 21). Of this number, 41 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionTransport.sweepHookBridgeOnce (cognitive 43) · ×1
  • SessionTransport.sweepHookBridgeOnce (cognitive 43) packages/daemon/src/domain/session-transport.ts:2944 — SessionTransport.sweepHookBridgeOnce has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (22 pts), ternaries 3 (12 pts), boolean chains 6, loops 2 (3 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 · session-transport.probeSessionActivity (cognitive 43) · ×1
  • session-transport.probeSessionActivity (cognitive 43) packages/daemon/src/domain/session-transport.ts:996 — session-transport.probeSessionActivity has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 11 (14 pts), boolean chains 6, error handling 3 (4 pts) (nesting depth added 13). Of this number, 37 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 · add.addMemberCommand (cognitive 43) · ×1
  • add.addMemberCommand (cognitive 43) packages/cli/src/commands/add.ts:31 — add.addMemberCommand has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 11, ternaries 6 (7 pts), loops 2 (4 pts), error handling 2 (nesting depth added 5). None of this is in the body itself: all 43 points belong to 2 function literals inside it that branch (lines 48, 99). 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 · ask.askLiveRunner (cognitive 43) · ×1
  • ask.askLiveRunner (cognitive 43) packages/cli/src/commands/ask.ts:11 — ask.askLiveRunner has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 12, error handling 2, ternaries 1 (2 pts), loops 1 (nesting depth added 11). Of this number, 37 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 · compact.compactCommand (cognitive 43) · ×1
  • compact.compactCommand (cognitive 43) packages/cli/src/commands/compact.ts:21 — compact.compactCommand has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 10 (23 pts), if/else 13 (18 pts), boolean chains 2 (nesting depth added 18). None of this is in the body itself: all 43 points belong to one function literal inside it that branches (line 110). 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 · usage.usageCommand (cognitive 43) · ×1
  • usage.usageCommand (cognitive 43) packages/cli/src/commands/usage.ts:112 — usage.usageCommand has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24, ternaries 7 (13 pts), loops 5, boolean chains 1 (nesting depth added 6). None of this is in the body itself: all 43 points belong to 6 function items inside it that branch (a function literal at line 231, a function literal at line 143, a function literal at line 201, …). 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 · RestoreCheckService.check (cognitive 43) · ×1
  • RestoreCheckService.check (cognitive 43) packages/daemon/src/domain/restore-check-service.ts:297 — RestoreCheckService.check has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 3 (8 pts), boolean chains 5, loops 3 (4 pts), error handling 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RigLifecycleService.shrinkPod (cognitive 43) · ×1
  • RigLifecycleService.shrinkPod (cognitive 43) packages/daemon/src/domain/rig-lifecycle-service.ts:667 — RigLifecycleService.shrinkPod has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 10 (16 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 19). Of this number, 41 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScopeApproveService.approve (cognitive 43) · ×1
  • ScopeApproveService.approve (cognitive 43) packages/daemon/src/domain/scope/scope-approve.ts:198 — ScopeApproveService.approve has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 16 (21 pts), if/else 10 (13 pts), boolean chains 8, error handling 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 · bundles.bundleRoutes.post("/install") (cognitive 43) · ×1
  • bundles.bundleRoutes.post("/install") (cognitive 43) packages/daemon/src/routes/bundles.ts:1134 — bundles.bundleRoutes.post("/install") has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 10 (16 pts), boolean chains 5, error handling 3 (4 pts) (nesting depth added 12). Of this number, 42 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 · expected-conversation.resolveExpectedConversation (cognitive 42) · ×1
  • expected-conversation.resolveExpectedConversation (cognitive 42) packages/daemon/src/domain/expected-conversation.ts:39 — expected-conversation.resolveExpectedConversation has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (26 pts), ternaries 5 (7 pts), boolean chains 6, error handling 2 (3 pts) (nesting depth added 11). Of this number, 32 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 · NativePermissionStore.resolve (cognitive 42) · ×1
  • NativePermissionStore.resolve (cognitive 42) packages/daemon/src/domain/native-permission-store.ts:231 — NativePermissionStore.resolve has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 7 (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 · SeatStructuralActivityService.pollSeat (cognitive 42) · ×1
  • SeatStructuralActivityService.pollSeat (cognitive 42) packages/daemon/src/domain/seat-structural-activity-service.ts:108 — SeatStructuralActivityService.pollSeat has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 18, ternaries 14 (15 pts), if/else 6 (7 pts), error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · relay-outbound.createRelayOutboundTransport.deliver (cognitive 42) · ×1
  • relay-outbound.createRelayOutboundTransport.deliver (cognitive 42) packages/daemon/src/domain/gateway/relay-outbound.ts:838 — relay-outbound.createRelayOutboundTransport.deliver has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 6 (11 pts), boolean chains 8, loops 2 (3 pts), ternaries 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 · mcp.mcpCommand (cognitive 42) · ×1
  • mcp.mcpCommand (cognitive 42) packages/cli/src/commands/mcp.ts:16 — mcp.mcpCommand has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 11, ternaries 4 (6 pts), error handling 4, loops 1 (nesting depth added 5). None of this is in the body itself: all 42 points belong to 6 function literals inside it that branch (lines 67, 165, 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 · codex-jsonl-parser.parseCodexJsonl (cognitive 42) · ×1
  • codex-jsonl-parser.parseCodexJsonl (cognitive 42) packages/cli/src/restore-packet/codex-jsonl-parser.ts:89 — codex-jsonl-parser.parseCodexJsonl has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 5 (14 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 21). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexResumeAdapter.verifyResume (cognitive 42) · ×1
  • CodexResumeAdapter.verifyResume (cognitive 42) packages/daemon/src/adapters/codex-resume.ts:187 — CodexResumeAdapter.verifyResume has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 8, ternaries 4 (8 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 · codex-owned-plugin-trust.planOwnedCodexContentApproval (cognitive 42) · ×1
  • codex-owned-plugin-trust.planOwnedCodexContentApproval (cognitive 42) packages/daemon/src/domain/codex-owned-plugin-trust.ts:87 — codex-owned-plugin-trust.planOwnedCodexContentApproval has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 13, loops 4 (5 pts), ternaries 4 (5 pts), error handling 1 (nesting depth added 7). Of this number, 31 points are the body's own statements and 11 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 · pi-runner.mapPiEvent (cognitive 42) · ×1
  • pi-runner.mapPiEvent (cognitive 42) REDACTED:724 — pi-runner.mapPiEvent has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 18 (38 pts), boolean chains 3, match/switch 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 · seat-runtime-home-record.observeRuntimeHome (cognitive 42) · ×1
  • seat-runtime-home-record.observeRuntimeHome (cognitive 42) packages/daemon/src/domain/seat-runtime-home-record.ts:106 — seat-runtime-home-record.observeRuntimeHome has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 9 (14 pts), boolean chains 4, error handling 3, loops 1 (nesting depth added 15). Of this number, 26 points are the body's own statements and 16 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BootstrapOrchestrator.handlePodAwareSpec (cognitive 42) · ×1
  • BootstrapOrchestrator.handlePodAwareSpec (cognitive 42) packages/daemon/src/domain/bootstrap-orchestrator.ts:711 — BootstrapOrchestrator.handlePodAwareSpec has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 11 (18 pts), if/else 10 (13 pts), boolean chains 6, error handling 3 (5 pts) (nesting depth added 12). Of this number, 35 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 · human-mode-account.waitingFor (cognitive 42) · ×1
  • human-mode-account.waitingFor (cognitive 42) packages/daemon/src/domain/gateway/human-mode-account.ts:69 — human-mode-account.waitingFor has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 8, loops 3, ternaries 2 (3 pts) (nesting depth added 15). Of this number, 36 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 · scope-approve.scopeApproveRoutes (cognitive 42) · ×1
  • scope-approve.scopeApproveRoutes (cognitive 42) packages/daemon/src/routes/scope-approve.ts:12 — scope-approve.scopeApproveRoutes has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 11 (32 pts), if/else 6 (7 pts), boolean chains 2, error handling 1 (nesting depth added 22). None of this is in the body itself: all 42 points belong to 2 function literals inside it that branch (lines 15, 51). 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 · execution-model.sliceDetail (cognitive 42) · ×1
  • execution-model.sliceDetail (cognitive 42) packages/tui/src/execution/execution-model.ts:650 — execution-model.sliceDetail has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 20 (25 pts), boolean chains 11, if/else 3, loops 2 (3 pts) (nesting depth added 6). Of this number, 39 points are the body's own statements and 3 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 · usage-model.allowanceLines (cognitive 42) · ×1
  • usage-model.allowanceLines (cognitive 42) packages/tui/src/usage/usage-model.ts:66 — usage-model.allowanceLines has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 11 (14 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 14). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutboxHandler.admitRunner (cognitive 41) · ×1
  • OutboxHandler.admitRunner (cognitive 41) packages/daemon/src/domain/outbox-handler.ts:246 — OutboxHandler.admitRunner has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 16, if/else 13 (15 pts), ternaries 4 (8 pts), loops 2 (nesting depth added 6). Most of this is not in the body itself: 1 of the 41 points is its own statement and the rest belongs to one function literal inside it that branches (line 248). 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 · tmux-control.tmuxControlExec · ×1
  • tmux-control.tmuxControlExec::exec (cognitive 41) packages/daemon/src/adapters/tmux-control.ts:686 — tmux-control.tmuxControlExec::exec has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 12, if/else 7 (12 pts), error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · judgments.readMissionReadiness (cognitive 41) · ×1
  • judgments.readMissionReadiness (cognitive 41) packages/daemon/src/domain/proof/judgments.ts:329 — judgments.readMissionReadiness has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 11 (20 pts), if/else 7 (9 pts), boolean chains 7, loops 3 (4 pts), error handling 1 (nesting depth added 12). Of this number, 31 points are the body's own statements and 10 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 · RunnerPermissions.read (cognitive 41) · ×1
  • RunnerPermissions.read (cognitive 41) packages/daemon/src/domain/runner-permissions.ts:248 — RunnerPermissions.read has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 10, ternaries 5 (10 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 · ChainFollower.read (cognitive 41) · ×1
  • ChainFollower.read (cognitive 41) packages/cli/src/acp/agent-server.ts:193 — ChainFollower.read has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 5 (13 pts), loops 3 (7 pts), boolean chains 5 (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 · send.runHttpHostSend (cognitive 41) · ×1
  • send.runHttpHostSend (cognitive 41) packages/cli/src/commands/send.ts:940 — send.runHttpHostSend has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 10 (15 pts), boolean chains 8 (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 · env.envCommand (cognitive 41) · ×1
  • env.envCommand (cognitive 41) packages/cli/src/commands/env.ts:9 — env.envCommand has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (21 pts), ternaries 5 (11 pts), boolean chains 4, error handling 3, loops 1 (2 pts) (nesting depth added 8). None of this is in the body itself: all 41 points belong to 5 function items inside it that branch (a function literal at line 49, resolveRigId, a function literal at line 107, …). 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 · stream-outcome.routed (cognitive 41) · ×1
  • stream-outcome.routed (cognitive 41) packages/cli/src/commands/stream-outcome.ts:51 — stream-outcome.routed has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 14 (23 pts), boolean chains 9, if/else 8 (9 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 · InstallVerifier.verify (cognitive 41) · ×1
  • InstallVerifier.verify (cognitive 41) packages/daemon/src/domain/install-verifier.ts:50 — InstallVerifier.verify has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (23 pts), ternaries 3 (9 pts), boolean chains 8, 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 · RigInstantiator.instantiate (cognitive 41) · ×1
  • RigInstantiator.instantiate (cognitive 41) packages/daemon/src/domain/rigspec-instantiator.ts:80 — RigInstantiator.instantiate has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 5 (7 pts), ternaries 4 (7 pts), error handling 4, boolean chains 1 (nesting depth added 14). Of this number, 29 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 · manifest-parser.parseManifest (cognitive 41) · ×1
  • manifest-parser.parseManifest (cognitive 41) REDACTED:35 — manifest-parser.parseManifest has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 10 (12 pts), boolean chains 10, error handling 1, loops 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 · workflow-scope.normalizeWorkflowScope (cognitive 41) · ×1
  • workflow-scope.normalizeWorkflowScope (cognitive 41) packages/daemon/src/domain/workflow-scope.ts:44 — workflow-scope.normalizeWorkflowScope has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 7, ternaries 3, loops 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 · UsageWindows.project (cognitive 41) · ×1
  • UsageWindows.project (cognitive 41) packages/daemon/src/domain/provider/usage-windows.ts:256 — UsageWindows.project has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 15 (30 pts), boolean chains 8, if/else 2, loops 1 (nesting depth added 15). Of this number, 32 points are the body's own statements and 9 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 · herdr-live-workspace.hasLiveAttachments (cognitive 41) · ×1
  • herdr-live-workspace.hasLiveAttachments (cognitive 41) packages/daemon/src/domain/terminal/herdr-live-workspace.ts:36 — herdr-live-workspace.hasLiveAttachments has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (7 pts), boolean chains 6, ternaries 3 (5 pts), error handling 1 (nesting depth added 18). Of this number, 37 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 · RexAdapter.openView (cognitive 41) · ×1
  • RexAdapter.openView (cognitive 41) packages/daemon/src/domain/terminal/rex-adapter.ts:148 — RexAdapter.openView has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 8 (14 pts), error handling 3 (5 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 12). Of this number, 34 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 · workflow-exception-readiness.inspectExceptionReadiness (cognitive 41) · ×1
  • workflow-exception-readiness.inspectExceptionReadiness (cognitive 41) packages/daemon/src/domain/workflow-exception-readiness.ts:30 — workflow-exception-readiness.inspectExceptionReadiness has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 12 (28 pts), if/else 3 (6 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 20). 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 · bundles.bundleRoutes.post("/inspect") (cognitive 41) · ×1
  • bundles.bundleRoutes.post("/inspect") (cognitive 41) packages/daemon/src/routes/bundles.ts:951 — bundles.bundleRoutes.post("/inspect") has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 15 (26 pts), if/else 6 (7 pts), boolean chains 4, error handling 4 (nesting depth added 12). Of this number, 35 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 · seat.seatRoutes.get("/status/ · ×1
  • seat.seatRoutes.get("/status/:seatRef") (cognitive 41) packages/daemon/src/routes/seat.ts:158 — seat.seatRoutes.get("/status/:seatRef") has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 11 (32 pts), boolean chains 4, if/else 3, error handling 1 (2 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 · state.drillTo (cognitive 41) · ×1
  • state.drillTo (cognitive 41) packages/tui/src/state.ts:521 — state.drillTo has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (9 pts), ternaries 3 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 21). 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 · SyntaxHighlight.tokenizeWithKeywordsAndComments (cognitive 41) · ×1
  • SyntaxHighlight.tokenizeWithKeywordsAndComments (cognitive 41) packages/ui/src/components/markdown/SyntaxHighlight.tsx:114 — SyntaxHighlight.tokenizeWithKeywordsAndComments has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 4 (12 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codex-member-permissions.validateCodexMemberPermissions (cognitive 40) · ×1
  • codex-member-permissions.validateCodexMemberPermissions (cognitive 40) packages/daemon/src/domain/codex-member-permissions.ts:45 — codex-member-permissions.validateCodexMemberPermissions has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 9, loops 3 (4 pts), ternaries 1 (nesting depth added 11). Of this number, 38 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 · rigspec-schema.validateContinuityPolicy (cognitive 40) · ×1
  • rigspec-schema.validateContinuityPolicy (cognitive 40) packages/daemon/src/domain/rigspec-schema.ts:1156 — rigspec-schema.validateContinuityPolicy has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 3 (9 pts), boolean chains 5 (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 · SeatActivityService.arbitrate (cognitive 40) · ×1
  • SeatActivityService.arbitrate (cognitive 40) packages/daemon/src/domain/seat-activity-service.ts:936 — SeatActivityService.arbitrate has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 15, ternaries 8 (13 pts), if/else 10 (12 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 · queue-wake-ladder.readLadder (cognitive 40) · ×1
  • queue-wake-ladder.readLadder (cognitive 40) packages/daemon/src/domain/queue-wake-ladder.ts:269 — queue-wake-ladder.readLadder has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 8, 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 · ClaudeCodeAdapter.deliverStartup (cognitive 40) · ×1
  • ClaudeCodeAdapter.deliverStartup (cognitive 40) packages/daemon/src/adapters/claude-code-adapter.ts:258 — ClaudeCodeAdapter.deliverStartup has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (27 pts), ternaries 3 (6 pts), error handling 3 (4 pts), match/switch 1 (2 pts), 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 · CodexRuntimeAdapter.profileRemainsReadOnly (cognitive 40) · ×1
  • CodexRuntimeAdapter.profileRemainsReadOnly (cognitive 40) packages/daemon/src/adapters/codex-runtime-adapter.ts:1240 — CodexRuntimeAdapter.profileRemainsReadOnly has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 6, loops 3, 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 · bundle-archive.unpack (cognitive 40) · ×1
  • bundle-archive.unpack (cognitive 40) packages/daemon/src/domain/bundle-archive.ts:112 — bundle-archive.unpack has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 3 (8 pts), boolean chains 5, loops 2 (4 pts), error handling 1 (3 pts) (nesting depth added 14). Of this number, 33 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 · ProgressIndexer.parseProgressFile (cognitive 40) · ×1
  • ProgressIndexer.parseProgressFile (cognitive 40) packages/daemon/src/domain/progress/progress-indexer.ts:174 — ProgressIndexer.parseProgressFile has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (28 pts), ternaries 2 (7 pts), boolean chains 3, error handling 1, loops 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 · SeatLifecycleService.setPermissions (cognitive 40) · ×1
  • SeatLifecycleService.setPermissions (cognitive 40) packages/daemon/src/domain/seat-lifecycle-service.ts:929 — SeatLifecycleService.setPermissions has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (23 pts), ternaries 6 (7 pts), boolean chains 5, error handling 3 (5 pts) (nesting depth added 8). Of this number, 23 points are the body's own statements and 17 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 · view-composer.composeView (cognitive 40) · ×1
  • view-composer.composeView (cognitive 40) packages/daemon/src/domain/terminal/view-composer.ts:112 — view-composer.composeView has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 10 (21 pts), if/else 7 (18 pts), loops 1 (nesting depth added 22). Of this number, 39 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 · chat.chatRoutes (cognitive 40) · ×1
  • chat.chatRoutes (cognitive 40) packages/daemon/src/routes/chat.ts:16 — chat.chatRoutes has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (27 pts), boolean chains 11, loops 2 (nesting depth added 4). None of this is in the body itself: all 40 points belong to 7 function literals inside it that branch (lines 154, 28, 65, …). 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 · attention-model.composeHumanUpdates (cognitive 40) · ×1
  • attention-model.composeHumanUpdates (cognitive 40) packages/tui/src/attention/attention-model.ts:21 — attention-model.composeHumanUpdates has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 11 (25 pts), boolean chains 8, if/else 4 (6 pts), loops 1 (nesting depth added 16). Of this number, 37 points are the body's own statements and 3 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 · message.buildOutboundMessage (cognitive 39) · ×1
  • message.buildOutboundMessage (cognitive 39) packages/daemon/src/domain/gateway/slack/message.ts:573 — message.buildOutboundMessage has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 15 (17 pts), boolean chains 12, if/else 10 (nesting depth added 2). Of this number, 38 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 · expand.expandCommand (cognitive 39) · ×1
  • expand.expandCommand (cognitive 39) packages/cli/src/commands/expand.ts:21 — expand.expandCommand has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 4 (10 pts), boolean chains 6, loops 3 (6 pts), error handling 2 (nesting depth added 11). None of this is in the body itself: all 39 points belong to one function literal inside it that branches (line 30). 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 · restore.restoreCommand (cognitive 39) · ×1
  • restore.restoreCommand (cognitive 39) packages/cli/src/commands/restore.ts:10 — restore.restoreCommand has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (26 pts), loops 5 (7 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 10). None of this is in the body itself: all 39 points belong to 2 function literals inside it that branch (lines 20, 127). 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 · workflow-render.composeAttentionRollup (cognitive 39) · ×1
  • workflow-render.composeAttentionRollup (cognitive 39) packages/cli/src/commands/workflow-render.ts:283 — workflow-render.composeAttentionRollup has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 7 (20 pts), if/else 10 (16 pts), boolean chains 2, loops 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 · claude-team-permissions.normalize (cognitive 39) · ×1
  • claude-team-permissions.normalize (cognitive 39) packages/daemon/assets/claude-team-permissions.cjs:140 — claude-team-permissions.normalize has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 8, loops 2 (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 · seat-recap-store.writeSeatRecap (cognitive 39) · ×1
  • seat-recap-store.writeSeatRecap (cognitive 39) packages/daemon/src/domain/context-packs/seat-recap-store.ts:51 — seat-recap-store.writeSeatRecap has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 6 (14 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 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 · MissionControlWriteContract.actOn (cognitive 39) · ×1
  • MissionControlWriteContract.actOn (cognitive 39) packages/daemon/src/domain/mission-control/mission-control-write-contract.ts:204 — MissionControlWriteContract.actOn has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 12, if/else 9 (10 pts), error handling 2 (3 pts) (nesting depth added 7). Of this number, 23 points are the body's own statements and 16 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 · usage-series.computeCostView (cognitive 39) · ×1
  • usage-series.computeCostView (cognitive 39) REDACTED:377 — usage-series.computeCostView has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 7 (15 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 17). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HealthCheckpointSource.validate (cognitive 39) · ×1
  • HealthCheckpointSource.validate (cognitive 39) packages/daemon/src/domain/health-checkpoints.ts:42 — HealthCheckpointSource.validate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 14, ternaries 2 (5 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 · delivery-digest-flush.runDeliveryDigestFlush (cognitive 39) · ×1
  • delivery-digest-flush.runDeliveryDigestFlush (cognitive 39) packages/daemon/src/domain/policies/delivery-digest-flush.ts:52 — delivery-digest-flush.runDeliveryDigestFlush has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (22 pts), ternaries 3 (6 pts), boolean chains 5, loops 3 (4 pts), error handling 2 (nesting depth added 10). Of this number, 33 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 · workflow-keepalive.makeWorkflowKeepalivePolicy.evaluate (cognitive 39) · ×1
  • workflow-keepalive.makeWorkflowKeepalivePolicy.evaluate (cognitive 39) packages/daemon/src/domain/policies/workflow-keepalive.ts:94 — workflow-keepalive.makeWorkflowKeepalivePolicy.evaluate has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 13, if/else 11 (12 pts), boolean chains 8, error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 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 · SeatLifecycleService.setCwd (cognitive 39) · ×1
  • SeatLifecycleService.setCwd (cognitive 39) packages/daemon/src/domain/seat-lifecycle-service.ts:548 — SeatLifecycleService.setCwd has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 5, error handling 4 (5 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 8). Of this number, 34 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 · StreamIntakeCoordinator.catchUp (cognitive 39) · ×1
  • StreamIntakeCoordinator.catchUp (cognitive 39) packages/daemon/src/domain/stream-intake.ts:135 — StreamIntakeCoordinator.catchUp has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (23 pts), error handling 5 (7 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · review.reviewRoutes (cognitive 39) · ×1
  • review.reviewRoutes (cognitive 39) packages/daemon/src/routes/review.ts:42 — review.reviewRoutes has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (28 pts), ternaries 2 (5 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 10). None of this is in the body itself: all 39 points belong to 6 function literals inside it that branch (lines 118, 45, 98, …). 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 · scope-audit.scopeAuditRoutes (cognitive 39) · ×1
  • scope-audit.scopeAuditRoutes (cognitive 39) packages/daemon/src/routes/scope-audit.ts:165 — scope-audit.scopeAuditRoutes has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (27 pts), ternaries 3 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). None of this is in the body itself: all 39 points belong to 3 function literals inside it that branch (lines 201, 168, 353). 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 · execution-model.overviewLines (cognitive 39) · ×1
  • execution-model.overviewLines (cognitive 39) packages/tui/src/execution/execution-model.ts:477 — execution-model.overviewLines has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 19 (26 pts), boolean chains 6, if/else 5, loops 2 (nesting depth added 7). Of this number, 38 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 · QueueItemViewer.QueueItemViewer (cognitive 39) · ×1
  • QueueItemViewer.QueueItemViewer (cognitive 39) packages/ui/src/components/drawer-viewers/QueueItemViewer.tsx:48 — QueueItemViewer.QueueItemViewer has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 21 (30 pts), boolean chains 8, if/else 1 (nesting depth added 9). Of this number, 34 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rigspec-schema.validateWorkspaceBlock (cognitive 38) · ×1
  • rigspec-schema.validateWorkspaceBlock (cognitive 38) packages/daemon/src/domain/rigspec-schema.ts:313 — rigspec-schema.validateWorkspaceBlock has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 11, loops 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 · queue-waiting.readWaitingView (cognitive 38) · ×1
  • queue-waiting.readWaitingView (cognitive 38) packages/daemon/src/domain/queue-waiting.ts:153 — queue-waiting.readWaitingView has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 7 (12 pts), boolean chains 6, error handling 3 (5 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 · human-readiness.resolveHumanDeliveryReadiness (cognitive 38) · ×1
  • human-readiness.resolveHumanDeliveryReadiness (cognitive 38) packages/daemon/src/domain/gateway/human-readiness.ts:43 — human-readiness.resolveHumanDeliveryReadiness has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 6 (12 pts), boolean chains 7, error handling 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 · provider-signals.deriveUsageLimitPools (cognitive 38) · ×1
  • provider-signals.deriveUsageLimitPools (cognitive 38) packages/daemon/src/domain/provider/provider-signals.ts:270 — provider-signals.deriveUsageLimitPools has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 9 (17 pts), if/else 6 (10 pts), boolean chains 8, loops 3 (nesting depth added 12). Of this number, 26 points are the body's own statements and 12 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 · node-inventory.computeRecoveryGuidance (cognitive 38) · ×1
  • node-inventory.computeRecoveryGuidance (cognitive 38) REDACTED:285 — node-inventory.computeRecoveryGuidance has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (27 pts), ternaries 5 (10 pts), boolean chains 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 · QueueRepository.recordHumanAnswer (cognitive 38) · ×1
  • QueueRepository.recordHumanAnswer (cognitive 38) packages/daemon/src/domain/queue-repository.ts:4669 — QueueRepository.recordHumanAnswer has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 14, if/else 12, ternaries 6 (10 pts), error handling 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 8 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 4676). 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 · EnvironmentLifecycle.recreate (cognitive 38) · ×1
  • EnvironmentLifecycle.recreate (cognitive 38) packages/daemon/src/domain/environment-lifecycle.ts:256 — EnvironmentLifecycle.recreate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 7, ternaries 3, error handling 1 (2 pts) (nesting depth added 7). 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: 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 · TmuxAdapter.scopedLaunchCommand (cognitive 38) · ×1
  • TmuxAdapter.scopedLaunchCommand (cognitive 38) packages/daemon/src/adapters/tmux.ts:1052 — TmuxAdapter.scopedLaunchCommand has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (26 pts), ternaries 5, boolean chains 4, error handling 2 (3 pts) (nesting depth added 7). Of this number, 34 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, 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 · adopt.adoptCommand (cognitive 38) · ×1
  • adopt.adoptCommand (cognitive 38) packages/cli/src/commands/adopt.ts:79 — adopt.adoptCommand has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (22 pts), loops 3 (5 pts), ternaries 4 (5 pts), boolean chains 3, error handling 3 (nesting depth added 8). None of this is in the body itself: all 38 points belong to one function literal inside it that branches (line 94). 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 · claude-transcript-parser.parseClaudeTranscript (cognitive 38) · ×1
  • claude-transcript-parser.parseClaudeTranscript (cognitive 38) packages/cli/src/restore-packet/claude-transcript-parser.ts:177 — claude-transcript-parser.parseClaudeTranscript has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 4 (10 pts), loops 4 (7 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 18). 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 · workflow-render.renderTraceTree (cognitive 38) · ×1
  • workflow-render.renderTraceTree (cognitive 38) packages/cli/src/commands/workflow-render.ts:178 — workflow-render.renderTraceTree has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 10 (18 pts), if/else 8 (12 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codex-core-plugin-install.codexCorePluginEnablement (cognitive 38) · ×1
  • codex-core-plugin-install.codexCorePluginEnablement (cognitive 38) packages/daemon/src/domain/codex-core-plugin-install.ts:42 — codex-core-plugin-install.codexCorePluginEnablement has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 2, error handling 1 (2 pts), ternaries 1 (2 pts), loops 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 · daemon-db-path.daemonDatabaseWarnings (cognitive 38) · ×1
  • daemon-db-path.daemonDatabaseWarnings (cognitive 38) packages/daemon/src/daemon-db-path.ts:86 — daemon-db-path.daemonDatabaseWarnings has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 7 (9 pts), boolean chains 7, error handling 4 (7 pts), loops 2 (nesting depth added 9). Most of this is not in the body itself: 11 of the 38 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 107, 145, 149, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · seat-attention-reconciler.describeLineageFailure (cognitive 38) · ×1
  • seat-attention-reconciler.describeLineageFailure (cognitive 38) packages/daemon/src/domain/seat-attention-reconciler.ts:61 — seat-attention-reconciler.describeLineageFailure has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 12 (19 pts), if/else 8 (15 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RestoreOrchestrator.finishJoinedResume (cognitive 38) · ×1
  • RestoreOrchestrator.finishJoinedResume (cognitive 38) packages/daemon/src/domain/restore-orchestrator.ts:2647 — RestoreOrchestrator.finishJoinedResume has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 15, ternaries 3 (5 pts) (nesting depth added 8). Of this number, 32 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 · RigTeardownOrchestrator.recordAlreadyStoppedIntent (cognitive 38) · ×1
  • RigTeardownOrchestrator.recordAlreadyStoppedIntent (cognitive 38) packages/daemon/src/domain/rig-teardown.ts:388 — RigTeardownOrchestrator.recordAlreadyStoppedIntent has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (nesting depth added 17). Of this number, 31 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 · terminal-follow-policy.planFollowingTiles (cognitive 38) · ×1
  • terminal-follow-policy.planFollowingTiles (cognitive 38) packages/daemon/src/domain/terminal/terminal-follow-policy.ts:58 — terminal-follow-policy.planFollowingTiles has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 9, ternaries 1 (3 pts), loops 2 (nesting depth added 12). Of this number, 33 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 · storytelling-cards.buildStorytellingFeedItems (cognitive 38) · ×1
  • storytelling-cards.buildStorytellingFeedItems (cognitive 38) packages/ui/src/components/feed/cards/storytelling-cards.tsx:577 — storytelling-cards.buildStorytellingFeedItems has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 8 (17 pts), boolean chains 9, if/else 5 (7 pts), loops 5 (nesting depth added 11). 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 · RigEnvPanel.RigEnvPanel (cognitive 38) · ×1
  • RigEnvPanel.RigEnvPanel (cognitive 38) packages/ui/src/components/RigEnvPanel.tsx:10 — RigEnvPanel.RigEnvPanel has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 14, if/else 11, ternaries 7 (11 pts), error handling 2 (nesting depth added 4). Of this number, 17 points are the body's own statements and 21 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 · ClaudeResumeAdapter.verifyResume (cognitive 37) · ×1
  • ClaudeResumeAdapter.verifyResume (cognitive 37) packages/daemon/src/adapters/claude-resume.ts:204 — ClaudeResumeAdapter.verifyResume has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 4 (11 pts), boolean chains 3, 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 · StartupOrchestrator.sendInteractiveText (cognitive 37) · ×1
  • StartupOrchestrator.sendInteractiveText (cognitive 37) packages/daemon/src/domain/startup-orchestrator.ts:1384 — StartupOrchestrator.sendInteractiveText has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (23 pts), ternaries 4 (7 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 7). Of this number, 34 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 · TmuxAdapter.guardedInput (cognitive 37) · ×1
  • TmuxAdapter.guardedInput (cognitive 37) packages/daemon/src/adapters/tmux.ts:1325 — TmuxAdapter.guardedInput has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 11, ternaries 2 (3 pts), error handling 2 (nesting depth added 11). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to one function literal inside it that branches (line 1338). 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 · TmuxAdapter.capturePanesContent · ×1
  • TmuxAdapter.capturePanesContent::captureChunk (cognitive 37) packages/daemon/src/adapters/tmux.ts:2697 — TmuxAdapter.capturePanesContent::captureChunk has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (2 pts), error handling 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 · mcp-http.startMcpHttpServer.handle (cognitive 37) · ×1
  • mcp-http.startMcpHttpServer.handle (cognitive 37) REDACTED:478 — mcp-http.startMcpHttpServer.handle has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 4 (13 pts), error handling 2 (4 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 · project-worker.runProjectWake (cognitive 37) · ×1
  • project-worker.runProjectWake (cognitive 37) packages/cli/src/commands/project-worker.ts:65 — project-worker.runProjectWake has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 11, ternaries 7, error handling 1 (nesting depth added 8). Most of this is not in the body itself: 14 of the 37 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 107, suffix, a function literal at line 102, …). 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 · decisions.judge (cognitive 37) · ×1
  • decisions.judge (cognitive 37) packages/cli/src/decisions/decisions.ts:145 — decisions.judge has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 12, ternaries 8 (12 pts), if/else 9 (11 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 · workflow-follow.consumeStream (cognitive 37) · ×1
  • workflow-follow.consumeStream (cognitive 37) packages/cli/src/commands/workflow-follow.ts:285 — workflow-follow.consumeStream has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (29 pts), error handling 2 (4 pts), loops 2 (3 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 · CodexRuntimeAdapter.removeCodexActivityHooks (cognitive 37) · ×1
  • CodexRuntimeAdapter.removeCodexActivityHooks (cognitive 37) packages/daemon/src/adapters/codex-runtime-adapter.ts:767 — CodexRuntimeAdapter.removeCodexActivityHooks has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 5 (9 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 17). Of this number, 31 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 · CmuxLayoutService.buildWorkspacePanes (cognitive 37) · ×1
  • CmuxLayoutService.buildWorkspacePanes (cognitive 37) packages/daemon/src/domain/cmux-layout-service.ts:184 — CmuxLayoutService.buildWorkspacePanes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 6 (9 pts), boolean chains 5, ternaries 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · slack-subsystem.makeHumanReplyResolver.<returned closure> (cognitive 37) · ×1
  • slack-subsystem.makeHumanReplyResolver.<returned closure> (cognitive 37) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:112 — slack-subsystem.makeHumanReplyResolver.<returned closure> has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 11, ternaries 7 (10 pts), error handling 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 · SuccessorSessionLauncher.createSuccessor (cognitive 37) · ×1
  • SuccessorSessionLauncher.createSuccessor (cognitive 37) packages/daemon/src/domain/successor-session-launcher.ts:207 — SuccessorSessionLauncher.createSuccessor has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 14 (24 pts), if/else 7 (8 pts), error handling 2 (3 pts), boolean chains 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 · rigspec.rigspecImportRoutes.post("/materialize") (cognitive 37) · ×1
  • rigspec.rigspecImportRoutes.post("/materialize") (cognitive 37) packages/daemon/src/routes/rigspec.ts:225 — rigspec.rigspecImportRoutes.post("/materialize") has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 11 (29 pts), if/else 6, boolean chains 1, error handling 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · fleet-scopes-model.fleetScopesLines (cognitive 37) · ×1
  • fleet-scopes-model.fleetScopesLines (cognitive 37) packages/tui/src/scopes/fleet-scopes-model.ts:91 — fleet-scopes-model.fleetScopesLines has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 5 (11 pts), loops 5 (8 pts), boolean chains 4 (nesting depth added 13). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HotPotatoEdge.HotPotatoEdge (cognitive 37) · ×1
  • HotPotatoEdge.HotPotatoEdge (cognitive 37) packages/ui/src/components/topology/HotPotatoEdge.tsx:8 — HotPotatoEdge.HotPotatoEdge has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 15 (37 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 · session-transport.styledTextLines (cognitive 36) · ×1
  • session-transport.styledTextLines (cognitive 36) packages/daemon/src/domain/session-transport.ts:514 — session-transport.styledTextLines has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (15 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 20). None of this is in the body itself: all 36 points belong to one function literal inside it that branches (line 516). 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 · TmuxAdapter.seatScopeStart (cognitive 36) · ×1
  • TmuxAdapter.seatScopeStart (cognitive 36) packages/daemon/src/adapters/tmux.ts:964 — TmuxAdapter.seatScopeStart has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 6 (19 pts), if/else 5 (10 pts), error handling 2 (5 pts), boolean chains 1, 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 · scope-fs.updateMappedFrontmatter (cognitive 36) · ×1
  • scope-fs.updateMappedFrontmatter (cognitive 36) packages/cli/src/lib/scope/scope-fs.ts:197 — scope-fs.updateMappedFrontmatter has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 5 (14 pts), boolean chains 7, loops 1 (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 · roster.enrichRosterMember (cognitive 36) · ×1
  • roster.enrichRosterMember (cognitive 36) packages/cli/src/commands/roster.ts:89 — roster.enrichRosterMember has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 20 (29 pts), boolean chains 7 (nesting depth added 9). Of this number, 32 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 · mcp-server.hostedMembersOf (cognitive 36) · ×1
  • mcp-server.hostedMembersOf (cognitive 36) packages/cli/src/mcp-server.ts:215 — mcp-server.hostedMembersOf has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 9 (20 pts), if/else 7 (10 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 14). Of this number, 32 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 · stream.streamCommand (cognitive 36) · ×1
  • stream.streamCommand (cognitive 36) packages/cli/src/commands/stream.ts:112 — stream.streamCommand has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14, ternaries 12 (14 pts), boolean chains 7, error handling 1 (nesting depth added 2). None of this is in the body itself: all 36 points belong to 13 function literals inside it that branch (lines 186, 336, 219, …). 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 · ContextPackLibraryService.composeFromFiles (cognitive 36) · ×1
  • ContextPackLibraryService.composeFromFiles (cognitive 36) packages/daemon/src/domain/context-packs/context-pack-library-service.ts:231 — ContextPackLibraryService.composeFromFiles has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (23 pts), error handling 6 (7 pts), boolean chains 3, loops 2, ternaries 1 (nesting depth added 10). Of this number, 33 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 · SeatHandoverService.finalizeWithDiscovered (cognitive 36) · ×1
  • SeatHandoverService.finalizeWithDiscovered (cognitive 36) packages/daemon/src/domain/seat-handover-service.ts:1353 — SeatHandoverService.finalizeWithDiscovered has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 12, error handling 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 4). Of this number, 31 points are the body's own statements and 5 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 · live-events.subscribeActivityEvents.connect (cognitive 36) · ×1
  • live-events.subscribeActivityEvents.connect (cognitive 36) packages/tui/src/live-events.ts:40 — live-events.subscribeActivityEvents.connect has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2, error handling 2 (nesting depth added 16). Of this number, 24 points are the body's own statements and 12 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 · Feed.Feed (cognitive 36) · ×1
  • Feed.Feed (cognitive 36) packages/ui/src/components/for-you/Feed.tsx:222 — Feed.Feed has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 15 (21 pts), if/else 9 (11 pts), boolean chains 3, loops 1 (nesting depth added 8). Most of this is not in the body itself: 6 of the 36 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 363, 497, 315, …). 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 · ScopePages.SliceScopePage (cognitive 36) · ×1
  • ScopePages.SliceScopePage (cognitive 36) packages/ui/src/components/project/ScopePages.tsx:1221 — ScopePages.SliceScopePage has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 15 (27 pts), boolean chains 7, if/else 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 · compose.blocking_state (cognitive 36) · ×1
  • compose.blocking_state (cognitive 36) packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:141 — compose.blocking_state has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4 (14 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · compose.compose_progress (cognitive 36) · ×1
  • compose.compose_progress (cognitive 36) packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:493 — compose.compose_progress has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 5 (13 pts), loops 6 (8 pts), boolean chains 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 · effective-model-readers.newestPiModel (cognitive 35) · ×1
  • effective-model-readers.newestPiModel (cognitive 35) packages/daemon/src/domain/model-divergence/effective-model-readers.ts:292 — effective-model-readers.newestPiModel has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 5 (11 pts), boolean chains 5, error handling 1 (2 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 · native-process-lineage.explainNativeRejection (cognitive 35) · ×1
  • native-process-lineage.explainNativeRejection (cognitive 35) packages/daemon/src/domain/native-process-lineage.ts:781 — native-process-lineage.explainNativeRejection has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 13). Of this number, 33 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 · WatchdogJobsRepository.register (cognitive 35) · ×1
  • WatchdogJobsRepository.register (cognitive 35) packages/daemon/src/domain/watchdog-jobs-repository.ts:325 — WatchdogJobsRepository.register has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 8 (13 pts), boolean chains 9 (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 · rigspec-schema.normalizeSessionSource (cognitive 35) · ×1
  • rigspec-schema.normalizeSessionSource (cognitive 35) packages/daemon/src/domain/rigspec-schema.ts:1215 — rigspec-schema.normalizeSessionSource has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 4 (8 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · escalation-owner.resolveEscalationOwner (cognitive 35) · ×1
  • escalation-owner.resolveEscalationOwner (cognitive 35) packages/daemon/src/domain/escalation-owner.ts:26 — escalation-owner.resolveEscalationOwner has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (20 pts), ternaries 5 (7 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 6). Of this number, 17 points are the body's own statements and 18 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 · persisted-restore-posture.resolvePersistedRestorePosture (cognitive 35) · ×1
  • persisted-restore-posture.resolvePersistedRestorePosture (cognitive 35) packages/daemon/src/domain/permission-policy/persisted-restore-posture.ts:68 — persisted-restore-posture.resolvePersistedRestorePosture has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (25 pts), error handling 3 (8 pts), boolean chains 2 (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 · relay-outbound.prepareRelayDecision (cognitive 35) · ×1
  • relay-outbound.prepareRelayDecision (cognitive 35) packages/daemon/src/domain/gateway/relay-outbound.ts:403 — relay-outbound.prepareRelayDecision has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 8 (11 pts), boolean chains 9 (nesting depth added 9). Of this number, 34 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 · QueueRepository.createInTransactionalContext (cognitive 35) · ×1
  • QueueRepository.createInTransactionalContext (cognitive 35) packages/daemon/src/domain/queue-repository.ts:2555 — QueueRepository.createInTransactionalContext has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 7, ternaries 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SessionTransport.waitForIdle (cognitive 35) · ×1
  • SessionTransport.waitForIdle (cognitive 35) packages/daemon/src/domain/session-transport.ts:4268 — SessionTransport.waitForIdle has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 8, ternaries 6 (8 pts), loops 1 (nesting depth added 11). Of this number, 28 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 · TmuxAdapter.sendShellCommandUnchecked (cognitive 35) · ×1
  • TmuxAdapter.sendShellCommandUnchecked (cognitive 35) packages/daemon/src/adapters/tmux.ts:1982 — TmuxAdapter.sendShellCommandUnchecked has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 5 (7 pts), error handling 3 (6 pts), boolean chains 5 (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 · reconstruction-reader.readReconstruction.materialize (cognitive 35) · ×1
  • reconstruction-reader.readReconstruction.materialize (cognitive 35) packages/cli/src/lib/reconstruction-reader.ts:243 — reconstruction-reader.readReconstruction.materialize has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 4 (10 pts), ternaries 2 (5 pts), boolean chains 3, error handling 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 · context-reconstruction.reconstructionCommand (cognitive 35) · ×1
  • context-reconstruction.reconstructionCommand (cognitive 35) packages/cli/src/commands/context-reconstruction.ts:16 — context-reconstruction.reconstructionCommand has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 5 (11 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 19). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 35). 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 · queue.terminalDeliveryResult (cognitive 35) · ×1
  • queue.terminalDeliveryResult (cognitive 35) packages/cli/src/commands/queue.ts:155 — queue.terminalDeliveryResult has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 18 (30 pts), boolean chains 5 (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 · CodexRuntimeAdapter.deliverStartup (cognitive 35) · ×1
  • CodexRuntimeAdapter.deliverStartup (cognitive 35) packages/daemon/src/adapters/codex-runtime-adapter.ts:857 — CodexRuntimeAdapter.deliverStartup has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (23 pts), ternaries 3 (6 pts), error handling 2 (3 pts), match/switch 1 (2 pts), loops 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 · CodexRuntimeAdapter.dismissSkippableCodexUpdatePrompt (cognitive 35) · ×1
  • CodexRuntimeAdapter.dismissSkippableCodexUpdatePrompt (cognitive 35) packages/daemon/src/adapters/codex-runtime-adapter.ts:1387 — CodexRuntimeAdapter.dismissSkippableCodexUpdatePrompt has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 4, ternaries 1 (3 pts), loops 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 · RunnerCore.reportUsageFacts (cognitive 35) · ×1
  • RunnerCore.reportUsageFacts (cognitive 35) REDACTED:1438 — RunnerCore.reportUsageFacts has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 5 (10 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 10). Of this number, 24 points are the body's own statements and 11 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 · health-context.healthSelectedContext (cognitive 35) · ×1
  • health-context.healthSelectedContext (cognitive 35) packages/daemon/src/domain/health-context.ts:43 — health-context.healthSelectedContext has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (22 pts), error handling 2 (4 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 15). Of this number, 20 points are the body's own statements and 15 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 · SeatHandoverService.proveAttemptSuccessorOnce (cognitive 35) · ×1
  • SeatHandoverService.proveAttemptSuccessorOnce (cognitive 35) packages/daemon/src/domain/seat-handover-service.ts:1068 — SeatHandoverService.proveAttemptSuccessorOnce has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 8 (9 pts), boolean chains 6, error handling 1 (nesting depth added 10). Of this number, 31 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 · claude-seat-switch.switchHeld (cognitive 35) · ×1
  • claude-seat-switch.switchHeld (cognitive 35) packages/daemon/src/domain/provider/claude-seat-switch.ts:92 — claude-seat-switch.switchHeld has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 13 (21 pts), if/else 10 (11 pts), boolean chains 2, error handling 1 (nesting depth added 9). Of this number, 30 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 · seat-skill-apply.applySeatSkills (cognitive 35) · ×1
  • seat-skill-apply.applySeatSkills (cognitive 35) packages/daemon/src/domain/seat-skill-apply.ts:184 — seat-skill-apply.applySeatSkills has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 11, boolean chains 5, error handling 3 (4 pts) (nesting depth added 9). Of this number, 28 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 · events.eventsRoute.get("/") (cognitive 35) · ×1
  • events.eventsRoute.get("/") (cognitive 35) packages/daemon/src/routes/events.ts:19 — events.eventsRoute.get("/") has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 6 (9 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 13). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 32, 39). 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 · execution-model.executionContentLines (cognitive 35) · ×1
  • execution-model.executionContentLines (cognitive 35) packages/tui/src/execution/execution-model.ts:812 — execution-model.executionContentLines has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 6 (27 pts), if/else 4 (6 pts), boolean chains 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · permission-stop-observation.admittedRules (cognitive 34) · ×1
  • permission-stop-observation.admittedRules (cognitive 34) packages/daemon/src/domain/permission-stop-observation.ts:24 — permission-stop-observation.admittedRules has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, ternaries 2 (5 pts), loops 2 (3 pts), error handling 1 (nesting depth added 12). Of this number, 33 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 · current-generation-record.resolveIdentityVerifiedClaudeRecord (cognitive 34) · ×1
  • current-generation-record.resolveIdentityVerifiedClaudeRecord (cognitive 34) packages/daemon/src/domain/model-divergence/current-generation-record.ts:122 — current-generation-record.resolveIdentityVerifiedClaudeRecord has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 6, ternaries 3 (5 pts), 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 · startup-validation.validateStartupAction (cognitive 34) · ×1
  • startup-validation.validateStartupAction (cognitive 34) packages/daemon/src/domain/startup-validation.ts:62 — startup-validation.validateStartupAction has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 6, loops 1 (3 pts), 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 · protocol.decodeGatewayMessage (cognitive 34) · ×1
  • protocol.decodeGatewayMessage (cognitive 34) packages/daemon/src/domain/gateway/protocol.ts:59 — protocol.decodeGatewayMessage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 3, ternaries 1 (2 pts), error handling 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 · SliceIndexer.walkSliceLocations (cognitive 34) · ×1
  • SliceIndexer.walkSliceLocations (cognitive 34) packages/daemon/src/domain/slices/slice-indexer.ts:824 — SliceIndexer.walkSliceLocations has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (7 pts), error handling 2 (6 pts), boolean chains 3 (nesting depth added 19). Of this number, 29 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 · SliceIndexer.missionIdAliasesForCounting (cognitive 34) · ×1
  • SliceIndexer.missionIdAliasesForCounting (cognitive 34) packages/daemon/src/domain/slices/slice-indexer.ts:919 — SliceIndexer.missionIdAliasesForCounting has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (22 pts), error handling 2 (4 pts), loops 3 (4 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 · TmuxAdapter.respawnPaneUnchecked (cognitive 34) · ×1
  • TmuxAdapter.respawnPaneUnchecked (cognitive 34) packages/daemon/src/adapters/tmux.ts:2295 — TmuxAdapter.respawnPaneUnchecked has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6, loops 2 (4 pts), ternaries 3 (4 pts), error handling 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ClaudeCompactionEnforcer.beginPreparation (cognitive 34) · ×1
  • ClaudeCompactionEnforcer.beginPreparation (cognitive 34) packages/daemon/src/domain/claude-compaction-enforcer.ts:1599 — ClaudeCompactionEnforcer.beginPreparation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 8, error handling 3 (6 pts), ternaries 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 · attach.attachCommand (cognitive 34) · ×1
  • attach.attachCommand (cognitive 34) packages/cli/src/commands/attach.ts:47 — attach.attachCommand has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 7, ternaries 3 (nesting depth added 3). None of this is in the body itself: all 34 points belong to 2 function items inside it that branch (a function literal at line 68, getClient). 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 · PodRigInstantiator.launchFirstMaterializedNode (cognitive 34) · ×1
  • PodRigInstantiator.launchFirstMaterializedNode (cognitive 34) packages/daemon/src/domain/rigspec-instantiator.ts:926 — PodRigInstantiator.launchFirstMaterializedNode has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15, ternaries 9 (11 pts), boolean chains 7, error handling 1 (nesting depth added 2). 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: 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 · SeatAttentionReconciler.getDerivedAttentionOutcome (cognitive 34) · ×1
  • SeatAttentionReconciler.getDerivedAttentionOutcome (cognitive 34) packages/daemon/src/domain/seat-attention-reconciler.ts:876 — SeatAttentionReconciler.getDerivedAttentionOutcome has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 5, ternaries 2 (5 pts), error handling 1 (2 pts), loops 1 (nesting depth added 15). Of this number, 33 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 · PiCompactionService.attemptState (cognitive 34) · ×1
  • PiCompactionService.attemptState (cognitive 34) packages/daemon/src/domain/pi-compaction-service.ts:218 — PiCompactionService.attemptState has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 16 (30 pts), if/else 3, boolean chains 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 · plugin-discovery-service.extractHookIdentities (cognitive 34) · ×1
  • plugin-discovery-service.extractHookIdentities (cognitive 34) packages/daemon/src/domain/plugin-discovery-service.ts:704 — plugin-discovery-service.extractHookIdentities has cognitive complexity 34 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 4 (12 pts), loops 3 (6 pts), boolean chains 3, error handling 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 · codex-usage-reader.converse (cognitive 34) · ×1
  • codex-usage-reader.converse (cognitive 34) packages/daemon/src/domain/provider/codex-usage-reader.ts:84 — codex-usage-reader.converse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 3 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 14). None of this is in the body itself: all 34 points belong to 4 function literals inside it that branch (lines 113, 106, 95, …). 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 · activity.recordHookActivity (cognitive 34) · ×1
  • activity.recordHookActivity (cognitive 34) packages/daemon/src/routes/activity.ts:807 — activity.recordHookActivity has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 8 (12 pts), boolean chains 8 (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 · slices.slicesRoutes (cognitive 34) · ×1
  • slices.slicesRoutes (cognitive 34) packages/daemon/src/routes/slices.ts:35 — slices.slicesRoutes has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 8, error handling 1 (2 pts), ternaries 2 (nesting depth added 2). None of this is in the body itself: all 34 points belong to 7 function literals inside it that branch (lines 147, 40, 64, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · pairing.pairingLines (cognitive 34) · ×1
  • pairing.pairingLines (cognitive 34) packages/tui/src/config/pairing.ts:36 — pairing.pairingLines has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 7 (23 pts), if/else 6 (8 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · channel-map.validateChannelMap (cognitive 33) · ×1
  • channel-map.validateChannelMap (cognitive 33) packages/daemon/src/domain/gateway/slack/channel-map.ts:49 — channel-map.validateChannelMap has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 6, ternaries 1 (3 pts), 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 · judgments.recordJudgment (cognitive 33) · ×1
  • judgments.recordJudgment (cognitive 33) packages/daemon/src/domain/proof/judgments.ts:269 — judgments.recordJudgment has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 8, error handling 1, ternaries 1 (nesting depth added 5). Of this number, 32 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 · QueueRepository.retryPromptWakesOnClear (cognitive 33) · ×1
  • QueueRepository.retryPromptWakesOnClear (cognitive 33) packages/daemon/src/domain/queue-repository.ts:2066 — QueueRepository.retryPromptWakesOnClear has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 6 (9 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 9). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session-transport.hasExpectedStagedText (cognitive 33) · ×1
  • session-transport.hasExpectedStagedText (cognitive 33) packages/daemon/src/domain/session-transport.ts:1375 — session-transport.hasExpectedStagedText has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (7 pts), boolean chains 4 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClaudeCompactionEnforcer.withDeliveryGuard (cognitive 33) · ×1
  • ClaudeCompactionEnforcer.withDeliveryGuard (cognitive 33) packages/daemon/src/domain/claude-compaction-enforcer.ts:1065 — ClaudeCompactionEnforcer.withDeliveryGuard has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 13, ternaries 6 (11 pts), if/else 5 (8 pts), error handling 1 (nesting depth added 8). Of this number, 22 points are the body's own statements and 11 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 · compact-plan.compactPlanCommand (cognitive 33) · ×1
  • compact-plan.compactPlanCommand (cognitive 33) packages/cli/src/commands/compact-plan.ts:434 — compact-plan.compactPlanCommand has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 4 (6 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 10). None of this is in the body itself: all 33 points belong to one function literal inside it that branches (line 452). 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 · fork.forkCommand.cmd (cognitive 33) · ×1
  • fork.forkCommand.cmd (cognitive 33) packages/cli/src/commands/fork.ts:55 — fork.forkCommand.cmd has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 5, ternaries 4, 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, 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 · pi-runner.parseRunnerArgs (cognitive 33) · ×1
  • pi-runner.parseRunnerArgs (cognitive 33) REDACTED:1929 — pi-runner.parseRunnerArgs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 7, match/switch 1 (2 pts), loops 1 (nesting depth added 9). Of this number, 31 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 · project-registration.registerBundleProject (cognitive 33) · ×1
  • project-registration.registerBundleProject (cognitive 33) packages/daemon/src/domain/workspace/project-registration.ts:181 — project-registration.registerBundleProject has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 6, ternaries 3 (4 pts), error handling 1 (3 pts) (nesting depth added 9). Of this number, 30 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 · RestoreOrchestrator.reconcileNodeRuntimeTruth (cognitive 33) · ×1
  • RestoreOrchestrator.reconcileNodeRuntimeTruth (cognitive 33) packages/daemon/src/domain/restore-orchestrator.ts:2979 — RestoreOrchestrator.reconcileNodeRuntimeTruth has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (17 pts), ternaries 6 (7 pts), boolean chains 6, error handling 2 (3 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.
D2 · Cognitive Complexity · default-workspace-scaffold.ensureDefaultWorkspace (cognitive 33) · ×1
  • default-workspace-scaffold.ensureDefaultWorkspace (cognitive 33) packages/daemon/src/domain/workspace/default-workspace-scaffold.ts:121 — default-workspace-scaffold.ensureDefaultWorkspace has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 5 (7 pts), boolean chains 6, loops 4 (6 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 · plugin-discovery-service.removeObsoleteLabRefocusCommands (cognitive 33) · ×1
  • plugin-discovery-service.removeObsoleteLabRefocusCommands (cognitive 33) packages/daemon/src/domain/plugin-discovery-service.ts:640 — plugin-discovery-service.removeObsoleteLabRefocusCommands has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (26 pts), ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 19). Of this number, 30 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 · stream-dispositions.validateDisposition (cognitive 33) · ×1
  • stream-dispositions.validateDisposition (cognitive 33) packages/daemon/src/domain/stream-dispositions.ts:50 — stream-dispositions.validateDisposition has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 14, if/else 13, ternaries 4 (6 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 · CodexInPlaceRestart.restart (cognitive 33) · ×1
  • CodexInPlaceRestart.restart (cognitive 33) packages/daemon/src/domain/seat-restart-in-place.ts:295 — CodexInPlaceRestart.restart has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 7 (13 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 · SeatLifecycleService.readStartupContext (cognitive 33) · ×1
  • SeatLifecycleService.readStartupContext (cognitive 33) packages/daemon/src/domain/seat-lifecycle-service.ts:2187 — SeatLifecycleService.readStartupContext has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 6 (10 pts), boolean chains 4, loops 3, error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage-across-hosts.readHost (cognitive 33) · ×1
  • usage-across-hosts.readHost (cognitive 33) packages/daemon/src/domain/provider/usage-across-hosts.ts:445 — usage-across-hosts.readHost has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 8, ternaries 4 (nesting depth added 7). Of this number, 32 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 · shared-history-selection.listSharedHistories (cognitive 33) · ×1
  • shared-history-selection.listSharedHistories (cognitive 33) packages/daemon/src/domain/shared-history-selection.ts:39 — shared-history-selection.listSharedHistories has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 10, ternaries 3 (4 pts), loops 2 (nesting depth added 6). Of this number, 32 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 · herdr-adapter.exitedSeats (cognitive 33) · ×1
  • herdr-adapter.exitedSeats (cognitive 33) packages/daemon/src/domain/terminal/herdr-adapter.ts:110 — herdr-adapter.exitedSeats has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 7, loops 6 (7 pts), error handling 1 (nesting depth added 6). Of this number, 28 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 · settings-browser.safeValue (cognitive 33) · ×1
  • settings-browser.safeValue (cognitive 33) packages/daemon/src/domain/user-settings/settings-browser.ts:58 — settings-browser.safeValue has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 11, ternaries 2 (4 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · plugins.pluginsRoutes (cognitive 33) · ×1
  • plugins.pluginsRoutes (cognitive 33) packages/daemon/src/routes/plugins.ts:107 — plugins.pluginsRoutes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 10 (14 pts), error handling 3, boolean chains 1 (nesting depth added 6). None of this is in the body itself: all 33 points belong to 7 function literals inside it that branch (lines 189, 147, 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 · terminal.terminalRoutes (cognitive 33) · ×1
  • terminal.terminalRoutes (cognitive 33) packages/daemon/src/routes/terminal.ts:90 — terminal.terminalRoutes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15, ternaries 10 (12 pts), boolean chains 5, error handling 1 (nesting depth added 2). None of this is in the body itself: all 33 points belong to 7 function literals inside it that branch (lines 95, 139, 122, …). 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 · topology-activity.parseTopologyActivityEvent (cognitive 33) · ×1
  • topology-activity.parseTopologyActivityEvent (cognitive 33) packages/ui/src/lib/topology-activity.ts:219 — topology-activity.parseTopologyActivityEvent has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 6 (12 pts), boolean chains 6 (nesting depth added 8). Of this number, 32 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 · EvidenceOpener.EvidenceOpener (cognitive 33) · ×1
  • EvidenceOpener.EvidenceOpener (cognitive 33) packages/ui/src/components/review/EvidenceOpener.tsx:58 — EvidenceOpener.EvidenceOpener has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 9 (19 pts), if/else 9 (11 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pi-readiness.piCredentialEvidence (cognitive 32) · ×1
  • pi-readiness.piCredentialEvidence (cognitive 32) packages/daemon/src/adapters/pi-readiness.ts:163 — pi-readiness.piCredentialEvidence has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4 (5 pts), error handling 3 (4 pts), boolean chains 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 · rigspec-schema.validateServicesBlock (cognitive 32) · ×1
  • rigspec-schema.validateServicesBlock (cognitive 32) packages/daemon/src/domain/rigspec-schema.ts:940 — rigspec-schema.validateServicesBlock has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QueueRepository.recordDelegatedDecision (cognitive 32) · ×1
  • QueueRepository.recordDelegatedDecision (cognitive 32) packages/daemon/src/domain/queue-repository.ts:4904 — QueueRepository.recordDelegatedDecision has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 4919). 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 · daemon-start-lock.archiveIfBeforeBoot (cognitive 32) · ×1
  • daemon-start-lock.archiveIfBeforeBoot (cognitive 32) packages/cli/src/daemon-start-lock.ts:109 — daemon-start-lock.archiveIfBeforeBoot has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, error handling 4 (5 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 · ps.runCrossHostPs (cognitive 32) · ×1
  • ps.runCrossHostPs (cognitive 32) packages/cli/src/commands/ps.ts:1692 — ps.runCrossHostPs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 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 · ps.runHttpPs (cognitive 32) · ×1
  • ps.runHttpPs (cognitive 32) packages/cli/src/commands/ps.ts:1767 — ps.runHttpPs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (21 pts), ternaries 6 (7 pts), boolean chains 3, error handling 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · bundle-configuration.stageConfiguration (cognitive 32) · ×1
  • bundle-configuration.stageConfiguration (cognitive 32) packages/cli/src/lib/bundle-configuration.ts:168 — bundle-configuration.stageConfiguration has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (5 pts), boolean chains 2, ternaries 1 (2 pts), error handling 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 · stream-consumer.toDisposition (cognitive 32) · ×1
  • stream-consumer.toDisposition (cognitive 32) packages/cli/src/decisions/stream-consumer.ts:67 — stream-consumer.toDisposition has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 8 (11 pts), boolean chains 4 (nesting depth added 12). 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 · ClaudeCodeAdapter.project (cognitive 32) · ×1
  • ClaudeCodeAdapter.project (cognitive 32) packages/daemon/src/adapters/claude-code-adapter.ts:198 — ClaudeCodeAdapter.project has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 3 (7 pts), boolean chains 4, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 14). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AskService.ask (cognitive 32) · ×1
  • AskService.ask (cognitive 32) packages/daemon/src/domain/ask-service.ts:76 — AskService.ask has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 3, ternaries 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, 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 · classification-sources.classificationSources (cognitive 32) · ×1
  • classification-sources.classificationSources (cognitive 32) packages/daemon/src/domain/classification-sources.ts:27 — classification-sources.classificationSources has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (7 pts), boolean chains 6, loops 3 (4 pts), error handling 2 (nesting depth added 6). Of this number, 19 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · current-work.frontmatterIntent (cognitive 32) · ×1
  • current-work.frontmatterIntent (cognitive 32) packages/daemon/src/domain/current-work.ts:760 — current-work.frontmatterIntent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 6, error handling 1 (4 pts), loops 2 (4 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 · workflow-deadline.evaluateStepDeadline (cognitive 32) · ×1
  • workflow-deadline.evaluateStepDeadline (cognitive 32) packages/daemon/src/domain/workflow-deadline.ts:127 — workflow-deadline.evaluateStepDeadline has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 4 (16 pts), if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CurrentModelReader.prepare (cognitive 32) · ×1
  • CurrentModelReader.prepare (cognitive 32) packages/daemon/src/domain/model-divergence/current-model-reader.ts:218 — CurrentModelReader.prepare has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 6, ternaries 2, error handling 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 16 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 · SeatLifecycleService.effortReport (cognitive 32) · ×1
  • SeatLifecycleService.effortReport (cognitive 32) packages/daemon/src/domain/seat-lifecycle-service.ts:760 — SeatLifecycleService.effortReport has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 6 (17 pts), if/else 10 (13 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 · TerminalService.resolveView (cognitive 32) · ×1
  • TerminalService.resolveView (cognitive 32) packages/daemon/src/domain/terminal/terminal-service.ts:533 — TerminalService.resolveView has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (25 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hosts.hostsRoutes · ×1
  • hosts.hostsRoutes::settlePairRequest (cognitive 32) packages/daemon/src/routes/hosts.ts:292 — hosts.hostsRoutes::settlePairRequest has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 5 (6 pts), error handling 3 (4 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tool-brand.normalizeToolBrandId (cognitive 32) · ×1
  • tool-brand.normalizeToolBrandId (cognitive 32) packages/ui/src/lib/tool-brand.ts:150 — tool-brand.normalizeToolBrandId has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 16, if/else 16. 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 · ImportFlow.ImportFlow (cognitive 32) · ×1
  • ImportFlow.ImportFlow (cognitive 32) packages/ui/src/components/ImportFlow.tsx:67 — ImportFlow.ImportFlow has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 12, ternaries 2 (4 pts), error handling 3 (nesting depth added 5). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 4 function items inside it that branch (handleInstantiate, handlePreflight, handleValidate, …). 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 · composer-prompts.composerContainsOwnedText (cognitive 31) · ×1
  • composer-prompts.composerContainsOwnedText (cognitive 31) REDACTED:160 — composer-prompts.composerContainsOwnedText has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (3 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 · seat-skill-storage.seatSkillReplay (cognitive 31) · ×1
  • seat-skill-storage.seatSkillReplay (cognitive 31) packages/daemon/src/domain/seat-skill-storage.ts:413 — seat-skill-storage.seatSkillReplay has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 2 (6 pts), boolean chains 4, loops 2 (nesting depth added 14). 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 · delivery-rules-engine.decideDelivery (cognitive 31) · ×1
  • delivery-rules-engine.decideDelivery (cognitive 31) packages/daemon/src/domain/gateway/delivery-rules-engine.ts:126 — delivery-rules-engine.decideDelivery has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 6 (9 pts), boolean chains 6, match/switch 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 · project-catalog.inferCatalogProject (cognitive 31) · ×1
  • project-catalog.inferCatalogProject (cognitive 31) packages/daemon/src/domain/workspace/project-catalog.ts:74 — project-catalog.inferCatalogProject has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 12). 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 · QueueRepository.create (cognitive 31) · ×1
  • QueueRepository.create (cognitive 31) packages/daemon/src/domain/queue-repository.ts:2417 — QueueRepository.create has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, ternaries 2 (4 pts), error handling 2 (3 pts) (nesting depth added 14). Of this number, 24 points are the body's own statements and 7 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 · EnvironmentLifecycle.checkpoint (cognitive 31) · ×1
  • EnvironmentLifecycle.checkpoint (cognitive 31) packages/daemon/src/domain/environment-lifecycle.ts:205 — EnvironmentLifecycle.checkpoint has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 5, loops 2 (3 pts), error handling 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 · PiRuntimeAdapter.deliverStartup (cognitive 31) · ×1
  • PiRuntimeAdapter.deliverStartup (cognitive 31) packages/daemon/src/adapters/pi-runtime-adapter.ts:234 — PiRuntimeAdapter.deliverStartup has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (23 pts), ternaries 2 (3 pts), error handling 1 (2 pts), match/switch 1 (2 pts), loops 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 · ClaudeCompactionEnforcer.reconcilePreparations (cognitive 31) · ×1
  • ClaudeCompactionEnforcer.reconcilePreparations (cognitive 31) packages/daemon/src/domain/claude-compaction-enforcer.ts:2016 — ClaudeCompactionEnforcer.reconcilePreparations has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (9 pts), boolean chains 7, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · work-install.resolveWorkContextHome (cognitive 31) · ×1
  • work-install.resolveWorkContextHome (cognitive 31) packages/cli/src/lib/work-install.ts:287 — work-install.resolveWorkContextHome has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), error handling 1 (5 pts), boolean chains 4 (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 · shrink.shrinkCommand (cognitive 31) · ×1
  • shrink.shrinkCommand (cognitive 31) packages/cli/src/commands/shrink.ts:29 — shrink.shrinkCommand has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 5 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). None of this is in the body itself: all 31 points belong to 2 function items inside it that branch (a function literal at line 44, getClient). 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 · codex-network-default.decideCodexNetworkDefault (cognitive 31) · ×1
  • codex-network-default.decideCodexNetworkDefault (cognitive 31) packages/daemon/src/domain/codex-network-default.ts:46 — codex-network-default.decideCodexNetworkDefault has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmux-transport.buildCommand (cognitive 31) · ×1
  • cmux-transport.buildCommand (cognitive 31) REDACTED:59 — cmux-transport.buildCommand has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 5 (10 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codex-filesystem-preflight.compareFilesystem · ×1
  • codex-filesystem-preflight.compareFilesystem::at (cognitive 31) packages/daemon/src/domain/codex-filesystem-preflight.ts:59 — codex-filesystem-preflight.compareFilesystem::at has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 13, if/else 10, ternaries 5 (8 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. This shape REPEATS in the file: one other method here (codex-filesystem-preflight.compareFilesystem) 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 · codex-filesystem-preflight.compareRequirements (cognitive 31) · ×1
  • codex-filesystem-preflight.compareRequirements (cognitive 31) packages/daemon/src/domain/codex-filesystem-preflight.ts:131 — codex-filesystem-preflight.compareRequirements has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 5, 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 · current-work.evaluateCreateScope (cognitive 31) · ×1
  • current-work.evaluateCreateScope (cognitive 31) packages/daemon/src/domain/current-work.ts:486 — current-work.evaluateCreateScope has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 2, error handling 2, ternaries 1 (nesting depth added 10). 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 · socket-inbound.startSocketInbound (cognitive 31) · ×1
  • socket-inbound.startSocketInbound (cognitive 31) packages/daemon/src/domain/gateway/slack/socket-inbound.ts:127 — socket-inbound.startSocketInbound has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 20, if/else 9 (11 pts) (nesting depth added 2). None of this is in the body itself: all 31 points belong to 8 function literals inside it that branch (lines 283, 313, 329, …). 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 · slack-subsystem.buildSlackGatewayWire.deliverDigestPost (cognitive 31) · ×1
  • slack-subsystem.buildSlackGatewayWire.deliverDigestPost (cognitive 31) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:970 — slack-subsystem.buildSlackGatewayWire.deliverDigestPost has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 4 (7 pts), boolean chains 5, loops 1 (3 pts), error handling 1 (nesting depth added 10). Of this number, 25 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 · usage-series.computeTopBurn (cognitive 31) · ×1
  • usage-series.computeTopBurn (cognitive 31) REDACTED:163 — usage-series.computeTopBurn has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 3 (6 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkInstallationStore.replace (cognitive 31) · ×1
  • NetworkInstallationStore.replace (cognitive 31) packages/daemon/src/domain/network/network-installations.ts:171 — NetworkInstallationStore.replace has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 5 (10 pts), error handling 5 (8 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 · parked-query.diagnoseSeatParked (cognitive 31) · ×1
  • parked-query.diagnoseSeatParked (cognitive 31) packages/daemon/src/domain/parked-query.ts:128 — parked-query.diagnoseSeatParked has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 11 (22 pts), boolean chains 8, if/else 1 (nesting depth added 11). Of this number, 26 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 · config-model.configValue (cognitive 31) · ×1
  • config-model.configValue (cognitive 31) packages/tui/src/config/config-model.ts:115 — config-model.configValue has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 4 (8 pts), boolean chains 7 (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 · TerminalPreviewPopover.TerminalPreviewPopover (cognitive 31) · ×1
  • TerminalPreviewPopover.TerminalPreviewPopover (cognitive 31) packages/ui/src/components/topology/TerminalPreviewPopover.tsx:102 — TerminalPreviewPopover.TerminalPreviewPopover has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (17 pts), ternaries 6 (9 pts), boolean chains 5 (nesting depth added 5). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 180, a function literal at line 162, a function literal at line 126, …). 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 · useMissionControlAction.postAction (cognitive 31) · ×1
  • useMissionControlAction.postAction (cognitive 31) packages/ui/src/components/mission-control/hooks/useMissionControlAction.ts:82 — useMissionControlAction.postAction has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 14). 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 · VerbActions.VerbActions (cognitive 31) · ×1
  • VerbActions.VerbActions (cognitive 31) packages/ui/src/components/mission-control/components/VerbActions.tsx:103 — VerbActions.VerbActions has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, ternaries 10 (11 pts), if/else 2 (nesting depth added 1). Of this number, 20 points are the body's own statements and 11 belong to 6 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 · SliceReviewTab.DeliveredSection (cognitive 31) · ×1
  • SliceReviewTab.DeliveredSection (cognitive 31) packages/ui/src/components/review/SliceReviewTab.tsx:139 — SliceReviewTab.DeliveredSection has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 13 (31 pts) (nesting depth added 18). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 152, 140, 160). 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 · waiter (cognitive 31) · ×1
  • waiter (cognitive 31) REDACTED:101 — waiter has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 4, loops 2 (4 pts), other 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 · pi-readiness.piCredentialSource (cognitive 30) · ×1
  • pi-readiness.piCredentialSource (cognitive 30) packages/daemon/src/adapters/pi-readiness.ts:68 — pi-readiness.piCredentialSource has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8, ternaries 3, error handling 2 (nesting depth added 5). Of this number, 23 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 · skill-catalog.resolveSkillLoadout (cognitive 30) · ×1
  • skill-catalog.resolveSkillLoadout (cognitive 30) packages/daemon/src/domain/skill-catalog.ts:369 — skill-catalog.resolveSkillLoadout has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, loops 4 (5 pts), ternaries 2 (3 pts), error handling 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 · slack-api.callWebApi (cognitive 30) · ×1
  • slack-api.callWebApi (cognitive 30) REDACTED:93 — slack-api.callWebApi has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 5 (9 pts), boolean chains 4, loops 2 (4 pts), error handling 2 (nesting depth added 11). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to one function literal inside it that branches (line 102). 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 · EnvironmentLifecycle.verifyCheckpoint (cognitive 30) · ×1
  • EnvironmentLifecycle.verifyCheckpoint (cognitive 30) packages/daemon/src/domain/environment-lifecycle.ts:183 — EnvironmentLifecycle.verifyCheckpoint has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 8, loops 3 (4 pts), error handling 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 · SessionTransport.readAtReadableSize (cognitive 30) · ×1
  • SessionTransport.readAtReadableSize (cognitive 30) packages/daemon/src/domain/session-transport.ts:4913 — SessionTransport.readAtReadableSize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 8, ternaries 3 (4 pts) (nesting depth added 2). Most of this is not in the body itself: 14 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 4925). 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 · session-transport.findClaudeComposer (cognitive 30) · ×1
  • session-transport.findClaudeComposer (cognitive 30) packages/daemon/src/domain/session-transport.ts:420 — session-transport.findClaudeComposer has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5, loops 3 (4 pts), ternaries 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · daemon-lifecycle.stopDaemon (cognitive 30) · ×1
  • daemon-lifecycle.stopDaemon (cognitive 30) REDACTED:1010 — daemon-lifecycle.stopDaemon has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 5 (7 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 6). 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, 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 · queue-receipt.buildWriteReceipt (cognitive 30) · ×1
  • queue-receipt.buildWriteReceipt (cognitive 30) packages/cli/src/queue-receipt.ts:234 — queue-receipt.buildWriteReceipt has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (21 pts), if/else 4 (5 pts), boolean chains 4 (nesting depth added 11). Of this number, 25 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scope.buildMissionCreateCommand (cognitive 30) · ×1
  • scope.buildMissionCreateCommand (cognitive 30) packages/cli/src/commands/scope.ts:1032 — scope.buildMissionCreateCommand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (18 pts), ternaries 5, boolean chains 4, loops 2, error handling 1 (nesting depth added 3). None of this is in the body itself: all 30 points belong to one function literal inside it that branches (line 1044). 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 · permission-stop-descriptor.buildPermissionRuleSuggestions (cognitive 30) · ×1
  • permission-stop-descriptor.buildPermissionRuleSuggestions (cognitive 30) packages/daemon/assets/plugins/openrig-core/hooks/scripts/permission-stop-descriptor.cjs:166 — permission-stop-descriptor.buildPermissionRuleSuggestions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (3 pts), 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 · claude-activity-hooks.deriveRelayEvents (cognitive 30) · ×1
  • claude-activity-hooks.deriveRelayEvents (cognitive 30) packages/daemon/src/domain/claude-activity-hooks.ts:62 — claude-activity-hooks.deriveRelayEvents has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 4 (9 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (nesting depth added 14). Of this number, 26 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 · ContextMonitor.normalizeStartupStatus (cognitive 30) · ×1
  • ContextMonitor.normalizeStartupStatus (cognitive 30) packages/daemon/src/domain/context-monitor.ts:320 — ContextMonitor.normalizeStartupStatus has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 8 (10 pts), boolean chains 5, error handling 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 12 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 · crash-cart-conductor.adoptLivePanesRig (cognitive 30) · ×1
  • crash-cart-conductor.adoptLivePanesRig (cognitive 30) packages/daemon/src/domain/crash-cart-conductor.ts:161 — crash-cart-conductor.adoptLivePanesRig has cognitive complexity 30 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 7 (12 pts), boolean chains 1, ternaries 1 (nesting depth added 15). 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, 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 · current-work.resolveWorkNodeDirs (cognitive 30) · ×1
  • current-work.resolveWorkNodeDirs (cognitive 30) packages/daemon/src/domain/current-work.ts:283 — current-work.resolveWorkNodeDirs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 4 (10 pts), boolean chains 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 · desired-claude-activity-hooks.agentResolvedAgainstRecordedRoots (cognitive 30) · ×1
  • desired-claude-activity-hooks.agentResolvedAgainstRecordedRoots (cognitive 30) packages/daemon/src/domain/desired-claude-activity-hooks.ts:26 — desired-claude-activity-hooks.agentResolvedAgainstRecordedRoots has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 6 (10 pts), boolean chains 7, loops 1 (nesting depth added 8). Of this number, 25 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SeatLifecycleService.stopManagedTmuxSeat (cognitive 30) · ×1
  • SeatLifecycleService.stopManagedTmuxSeat (cognitive 30) packages/daemon/src/domain/seat-lifecycle-service.ts:2099 — SeatLifecycleService.stopManagedTmuxSeat has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7, error handling 2, ternaries 2 (nesting depth added 6). Of this number, 24 points are the body's own statements and 6 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 · seat-lifecycle-service.effortSummary (cognitive 30) · ×1
  • seat-lifecycle-service.effortSummary (cognitive 30) packages/daemon/src/domain/seat-lifecycle-service.ts:2583 — seat-lifecycle-service.effortSummary has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 12 (26 pts), boolean chains 2, if/else 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 · rigs.rigsRoutes.delete("/ · ×1
  • rigs.rigsRoutes.delete("/:rigId/pods/:podRef") (cognitive 30) packages/daemon/src/routes/rigs.ts:858 — rigs.rigsRoutes.delete("/:rigId/pods/:podRef") has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (28 pts), if/else 2 (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 · startup.reviewSelectedHistory (cognitive 30) · ×1
  • startup.reviewSelectedHistory (cognitive 30) packages/daemon/src/routes/startup.ts:329 — startup.reviewSelectedHistory has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 9, boolean chains 7, error handling 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 · slices.resolveSliceProjectLookup.resolveProjectId (cognitive 30) · ×1
  • slices.resolveSliceProjectLookup.resolveProjectId (cognitive 30) packages/daemon/src/routes/slices.ts:333 — slices.resolveSliceProjectLookup.resolveProjectId has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 3 (6 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 11). Of this number, 23 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 · terminal-ws.registerTerminalWs (cognitive 30) · ×1
  • terminal-ws.registerTerminalWs (cognitive 30) packages/daemon/src/routes/terminal-ws.ts:42 — terminal-ws.registerTerminalWs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 5 (7 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 4). None of this is in the body itself: all 30 points belong to 5 function items inside it that branch (a function literal at line 66, a function literal at line 83, getRegistry, …). 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 · reading.fileLines (cognitive 30) · ×1
  • reading.fileLines (cognitive 30) packages/tui/src/reading.ts:53 — reading.fileLines has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, ternaries 3 (5 pts), loops 1 (nesting depth added 10). Of this number, 15 points are the body's own statements and 15 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 · trace-to-root.intent (cognitive 30) · ×1
  • trace-to-root.intent (cognitive 30) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:112 — trace-to-root.intent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, error handling 1 (4 pts), 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 · PermissionStopObservations.observe (cognitive 29) · ×1
  • PermissionStopObservations.observe (cognitive 29) packages/daemon/src/domain/permission-stop-observation.ts:93 — PermissionStopObservations.observe has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 7, loops 2 (3 pts), 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 · skill-discovery.scanSkillRoots (cognitive 29) · ×1
  • skill-discovery.scanSkillRoots (cognitive 29) packages/daemon/src/domain/skill-discovery.ts:166 — skill-discovery.scanSkillRoots has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 3 (8 pts), ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EnvironmentPlatform.project (cognitive 29) · ×1
  • EnvironmentPlatform.project (cognitive 29) packages/daemon/src/domain/environment-platform.ts:173 — EnvironmentPlatform.project has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, ternaries 3 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · compose.deriveWorkflowExceptions (cognitive 29) · ×1
  • compose.deriveWorkflowExceptions (cognitive 29) REDACTED:828 — compose.deriveWorkflowExceptions has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 4 (8 pts), boolean chains 3, 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 · judgments.policyOf (cognitive 29) · ×1
  • judgments.policyOf (cognitive 29) packages/daemon/src/domain/proof/judgments.ts:86 — judgments.policyOf has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (17 pts), boolean chains 5, ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SeatActivityService.reportEvidence (cognitive 29) · ×1
  • SeatActivityService.reportEvidence (cognitive 29) packages/daemon/src/domain/seat-activity-service.ts:546 — SeatActivityService.reportEvidence has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 15, if/else 10 (13 pts), ternaries 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 · node-inventory.buildInventoryItem (cognitive 29) · ×1
  • node-inventory.buildInventoryItem (cognitive 29) REDACTED:983 — node-inventory.buildInventoryItem has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 12, if/else 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 · hosted-wake.ringHostedWake (cognitive 29) · ×1
  • hosted-wake.ringHostedWake (cognitive 29) packages/daemon/src/domain/hosted-wake.ts:46 — hosted-wake.ringHostedWake has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, ternaries 7 (8 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · bundle-source.checkGitHubBundleRefs (cognitive 29) · ×1
  • bundle-source.checkGitHubBundleRefs (cognitive 29) packages/cli/src/lib/bundle-source.ts:129 — bundle-source.checkGitHubBundleRefs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (8 pts), ternaries 4 (7 pts), boolean chains 3, error handling 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context-git.addGitContext (cognitive 29) · ×1
  • context-git.addGitContext (cognitive 29) packages/cli/src/lib/context-git.ts:184 — context-git.addGitContext has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 3 (5 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tmux-attachment.readRecordedTmuxServerArgs (cognitive 29) · ×1
  • tmux-attachment.readRecordedTmuxServerArgs (cognitive 29) packages/cli/src/tmux-attachment.ts:26 — tmux-attachment.readRecordedTmuxServerArgs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (8 pts), boolean chains 7, error handling 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · file.fileCommand (cognitive 29) · ×1
  • file.fileCommand (cognitive 29) packages/cli/src/commands/file.ts:26 — file.fileCommand has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 3 (9 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 13). None of this is in the body itself: all 29 points belong to one function literal inside it that branches (line 38). 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 · slack.socketDeliveryLines (cognitive 29) · ×1
  • slack.socketDeliveryLines (cognitive 29) packages/cli/src/commands/slack.ts:50 — slack.socketDeliveryLines has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (24 pts), if/else 5 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · stream-outcome.work (cognitive 29) · ×1
  • stream-outcome.work (cognitive 29) packages/cli/src/commands/stream-outcome.ts:29 — stream-outcome.work has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 5 (10 pts), boolean chains 5, loops 1 (nesting depth added 13). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · refocus-state.acquire (cognitive 29) · ×1
  • refocus-state.acquire (cognitive 29) packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus-state.cjs:17 — refocus-state.acquire has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 4 (9 pts), loops 1 (nesting depth added 17). Of this number, 25 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 · gen-control-plane-json.extractSkillEdgeLayout (cognitive 29) · ×1
  • gen-control-plane-json.extractSkillEdgeLayout (cognitive 29) packages/daemon/scripts/gen-control-plane-json.mjs:66 — gen-control-plane-json.extractSkillEdgeLayout has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 3 (10 pts), loops 4 (7 pts), boolean chains 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 · ClaudeCodeAdapter.reconcileClaudeActivityHooks (cognitive 29) · ×1
  • ClaudeCodeAdapter.reconcileClaudeActivityHooks (cognitive 29) packages/daemon/src/adapters/claude-code-adapter.ts:1331 — ClaudeCodeAdapter.reconcileClaudeActivityHooks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 6, error handling 2 (4 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bundle-types.validatePodBundleManifest (cognitive 29) · ×1
  • bundle-types.validatePodBundleManifest (cognitive 29) packages/daemon/src/domain/bundle-types.ts:487 — bundle-types.validatePodBundleManifest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RigInstantiator.computeLaunchOrder (cognitive 29) · ×1
  • RigInstantiator.computeLaunchOrder (cognitive 29) packages/daemon/src/domain/rigspec-instantiator.ts:254 — RigInstantiator.computeLaunchOrder has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (9 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 · services-readiness.evaluateWaitTargets (cognitive 29) · ×1
  • services-readiness.evaluateWaitTargets (cognitive 29) packages/daemon/src/domain/services-readiness.ts:22 — services-readiness.evaluateWaitTargets has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 7 (10 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 · rehydrate-eligibility.assessSnapshotCurrentOccupants (cognitive 29) · ×1
  • rehydrate-eligibility.assessSnapshotCurrentOccupants (cognitive 29) packages/daemon/src/domain/rehydrate-eligibility.ts:20 — rehydrate-eligibility.assessSnapshotCurrentOccupants has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 9, ternaries 2 (5 pts), loops 1 (nesting depth added 10). Of this number, 25 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 · current-work.deriveCurrentWork (cognitive 29) · ×1
  • current-work.deriveCurrentWork (cognitive 29) packages/daemon/src/domain/current-work.ts:606 — current-work.deriveCurrentWork has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 2, 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 · RestoreOrchestrator.computeRestorePlan (cognitive 29) · ×1
  • RestoreOrchestrator.computeRestorePlan (cognitive 29) packages/daemon/src/domain/restore-orchestrator.ts:1189 — RestoreOrchestrator.computeRestorePlan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (9 pts), boolean chains 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 · PiCompactionService.request (cognitive 29) · ×1
  • PiCompactionService.request (cognitive 29) packages/daemon/src/domain/pi-compaction-service.ts:85 — PiCompactionService.request has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, ternaries 4 (7 pts), error handling 1 (nesting depth added 5). 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 · project-classifier.validateClassifyInput (cognitive 29) · ×1
  • project-classifier.validateClassifyInput (cognitive 29) packages/daemon/src/domain/project-classifier.ts:406 — project-classifier.validateClassifyInput has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 11, ternaries 1 (3 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · source-watch.shallowWatches (cognitive 29) · ×1
  • source-watch.shallowWatches (cognitive 29) packages/daemon/src/domain/proof/source-watch.ts:44 — source-watch.shallowWatches has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (8 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 10). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage-across-hosts.groupUsageAcrossHosts (cognitive 29) · ×1
  • usage-across-hosts.groupUsageAcrossHosts (cognitive 29) packages/daemon/src/domain/provider/usage-across-hosts.ts:160 — usage-across-hosts.groupUsageAcrossHosts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 3 (12 pts), loops 4 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage-across-hosts.remoteRefreshLeg (cognitive 29) · ×1
  • usage-across-hosts.remoteRefreshLeg (cognitive 29) packages/daemon/src/domain/provider/usage-across-hosts.ts:594 — usage-across-hosts.remoteRefreshLeg has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 4 (8 pts), boolean chains 5, match/switch 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 · RestoreCheckService.checkStartupContext (cognitive 29) · ×1
  • RestoreCheckService.checkStartupContext (cognitive 29) packages/daemon/src/domain/restore-check-service.ts:1036 — RestoreCheckService.checkStartupContext has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, ternaries 4 (6 pts), match/switch 1 (nesting depth added 7). Of this number, 24 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 · RestoreCheckService.checkSharedConversations (cognitive 29) · ×1
  • RestoreCheckService.checkSharedConversations (cognitive 29) packages/daemon/src/domain/restore-check-service.ts:1752 — RestoreCheckService.checkSharedConversations has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 7 (10 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 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 · WorkflowRuntime.reconcileStuckExceptions (cognitive 29) · ×1
  • WorkflowRuntime.reconcileStuckExceptions (cognitive 29) packages/daemon/src/domain/workflow-runtime.ts:935 — WorkflowRuntime.reconcileStuckExceptions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 3 (7 pts), boolean chains 5, loops 1 (nesting depth added 13). None of this is in the body itself: all 29 points belong to 3 function literals inside it that branch (lines 937, 948, 947). 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 · restore-check.getStartupContext (cognitive 29) · ×1
  • restore-check.getStartupContext (cognitive 29) packages/daemon/src/routes/restore-check.ts:52 — restore-check.getStartupContext has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12, ternaries 9 (10 pts), boolean chains 6, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 127, 115, 93). 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 · sessions.nodesRoutes.delete("/ · ×1
  • sessions.nodesRoutes.delete("/:logicalId") (cognitive 29) packages/daemon/src/routes/sessions.ts:566 — sessions.nodesRoutes.delete("/:logicalId") has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (27 pts), if/else 2 (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 · config.configRoutes (cognitive 29) · ×1
  • config.configRoutes (cognitive 29) packages/daemon/src/routes/config.ts:37 — config.configRoutes has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (17 pts), error handling 6 (8 pts), boolean chains 2, ternaries 2 (nesting depth added 3). None of this is in the body itself: all 29 points belong to 5 function literals inside it that branch (lines 40, 94, 116, …). 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 · open-window.openTerminalInWindow (cognitive 29) · ×1
  • open-window.openTerminalInWindow (cognitive 29) packages/tui/src/terminals/open-window.ts:127 — open-window.openTerminalInWindow has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (8 pts), boolean chains 7, error handling 2, loops 1 (2 pts) (nesting depth added 7). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · seat-effort.readNativeEffort (cognitive 28) · ×1
  • seat-effort.readNativeEffort (cognitive 28) packages/daemon/src/domain/seat-effort.ts:193 — seat-effort.readNativeEffort has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, error handling 2, ternaries 1 (2 pts), loops 1 (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 · conflict-detector.detectConflicts (cognitive 28) · ×1
  • conflict-detector.detectConflicts (cognitive 28) packages/daemon/src/domain/conflict-detector.ts:29 — conflict-detector.detectConflicts has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 5, error handling 1 (3 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 · skill-catalog.scanCatalog (cognitive 28) · ×1
  • skill-catalog.scanCatalog (cognitive 28) packages/daemon/src/domain/skill-catalog.ts:301 — skill-catalog.scanCatalog has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, loops 3, error handling 1, ternaries 1 (nesting depth added 8). Of this number, 21 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 · kernel-hook-review.makeKernelHookReviewReader.<returned closure> (cognitive 28) · ×1
  • kernel-hook-review.makeKernelHookReviewReader.<returned closure> (cognitive 28) packages/daemon/src/domain/kernel-hook-review.ts:22 — kernel-hook-review.makeKernelHookReviewReader.<returned closure> has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 6, ternaries 2 (6 pts), error handling 1 (2 pts), 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 · compose.composeSliceReview (cognitive 28) · ×1
  • compose.composeSliceReview (cognitive 28) REDACTED:1114 — compose.composeSliceReview has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 15 (18 pts), boolean chains 9, if/else 1 (nesting depth added 3). Of this number, 22 points are the body's own statements and 6 belong to 5 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 · SliceIndexer.missionIdAliases (cognitive 28) · ×1
  • SliceIndexer.missionIdAliases (cognitive 28) packages/daemon/src/domain/slices/slice-indexer.ts:971 — SliceIndexer.missionIdAliases has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (5 pts), boolean chains 3, error handling 1 (2 pts), 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 · SeatActivityService.pollAllRunningTmuxSeats (cognitive 28) · ×1
  • SeatActivityService.pollAllRunningTmuxSeats (cognitive 28) packages/daemon/src/domain/seat-activity-service.ts:400 — SeatActivityService.pollAllRunningTmuxSeats has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (6 pts), boolean chains 4, error handling 2 (3 pts), loops 3 (nesting depth added 9). 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 · QueueRepository.retryUnroutableWakesOnReachable (cognitive 28) · ×1
  • QueueRepository.retryUnroutableWakesOnReachable (cognitive 28) packages/daemon/src/domain/queue-repository.ts:2147 — QueueRepository.retryUnroutableWakesOnReachable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 2 (4 pts), ternaries 3 (4 pts) (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionTransport.doReconcileStartupReadiness (cognitive 28) · ×1
  • SessionTransport.doReconcileStartupReadiness (cognitive 28) packages/daemon/src/domain/session-transport.ts:5148 — SessionTransport.doReconcileStartupReadiness has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 6, ternaries 3, error handling 1 (nesting depth added 2). Of this number, 16 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 · check-runner.server (cognitive 28) · ×1
  • check-runner.server (cognitive 28) docs/reference/runner-conformance/check-runner.mjs:86 — check-runner.server has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8, ternaries 2 (3 pts), error handling 1 (nesting depth added 4). None of this is in the body itself: all 28 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 · auth.authCommand (cognitive 28) · ×1
  • auth.authCommand (cognitive 28) packages/cli/src/commands/auth.ts:49 — auth.authCommand has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, ternaries 6, boolean chains 2, loops 2. None of this is in the body itself: all 28 points belong to 11 function items inside it that branch (a function literal at line 113, a function literal at line 75, onHost, …). 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 · work-install.resolveExplicitSlice (cognitive 28) · ×1
  • work-install.resolveExplicitSlice (cognitive 28) packages/cli/src/lib/work-install.ts:174 — work-install.resolveExplicitSlice has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · work-install.resolveWorkProject (cognitive 28) · ×1
  • work-install.resolveWorkProject (cognitive 28) packages/cli/src/lib/work-install.ts:228 — work-install.resolveWorkProject has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, error handling 2 (3 pts), 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 · context-install.validateContextPackManifestForInstall (cognitive 28) · ×1
  • context-install.validateContextPackManifestForInstall (cognitive 28) packages/cli/src/lib/context-install.ts:77 — context-install.validateContextPackManifestForInstall has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 9, 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 · mcp-server.namedSeats (cognitive 28) · ×1
  • mcp-server.namedSeats (cognitive 28) packages/cli/src/mcp-server.ts:865 — mcp-server.namedSeats has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (7 pts), boolean chains 6, 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 · stream-consumer.applyEffect (cognitive 28) · ×1
  • stream-consumer.applyEffect (cognitive 28) packages/cli/src/decisions/stream-consumer.ts:114 — stream-consumer.applyEffect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 6, ternaries 1 (nesting depth added 6). Of this number, 20 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 · reconcile-session.reconcileSessionCommand (cognitive 28) · ×1
  • reconcile-session.reconcileSessionCommand (cognitive 28) packages/cli/src/commands/reconcile-session.ts:36 — reconcile-session.reconcileSessionCommand has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7, ternaries 3 (4 pts), loops 1 (2 pts) (nesting depth added 4). None of this is in the body itself: all 28 points belong to one function literal inside it that branches (line 68). 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 · restore-check.restoreCheckCommand (cognitive 28) · ×1
  • restore-check.restoreCheckCommand (cognitive 28) packages/cli/src/commands/restore-check.ts:204 — restore-check.restoreCheckCommand has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 6). None of this is in the body itself: all 28 points belong to one function literal inside it that branches (line 246). 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 · terminal-window-rex.openRexView (cognitive 28) · ×1
  • terminal-window-rex.openRexView (cognitive 28) packages/cli/src/terminal-window-rex.ts:79 — terminal-window-rex.openRexView has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 9, boolean chains 6, error handling 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 · bounded-probe-exec.boundedProbeExec.<returned closure> (cognitive 28) · ×1
  • bounded-probe-exec.boundedProbeExec.<returned closure> (cognitive 28) packages/daemon/src/adapters/bounded-probe-exec.ts:97 — bounded-probe-exec.boundedProbeExec.<returned closure> has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17, ternaries 3 (5 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 2). None of this is in the body itself: all 28 points belong to 16 function literals inside it that branch (lines 177, 97, 126, …). 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 · codex-runtime-adapter.tomlSections (cognitive 28) · ×1
  • codex-runtime-adapter.tomlSections (cognitive 28) packages/daemon/src/adapters/codex-runtime-adapter.ts:2460 — codex-runtime-adapter.tomlSections has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (9 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 10). 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 · topology-defaults-installer.installTopologyDefaults (cognitive 28) · ×1
  • topology-defaults-installer.installTopologyDefaults (cognitive 28) packages/daemon/src/domain/topology-defaults-installer.ts:52 — topology-defaults-installer.installTopologyDefaults has cognitive complexity 28 (threshold 15). Drivers by points: loops 7 (9 pts), ternaries 4 (8 pts), if/else 6 (7 pts), error handling 4 (nesting depth added 7). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to 8 function items inside it that branch (copyIfAbsent, ensureDir, section, …). 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 · bundle-context-packs-router.routeContextPacks (cognitive 28) · ×1
  • bundle-context-packs-router.routeContextPacks (cognitive 28) packages/daemon/src/domain/bundle-context-packs-router.ts:119 — bundle-context-packs-router.routeContextPacks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (6 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 13). 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 · ClaimService.repairMissingPane (cognitive 28) · ×1
  • ClaimService.repairMissingPane (cognitive 28) packages/daemon/src/domain/claim-service.ts:691 — ClaimService.repairMissingPane has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13, boolean chains 10, ternaries 2 (4 pts), error handling 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 13 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 · open-asks.deliveryFact (cognitive 28) · ×1
  • open-asks.deliveryFact (cognitive 28) packages/daemon/src/domain/gateway/slack/open-asks.ts:129 — open-asks.deliveryFact has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 3 (7 pts), boolean chains 5, 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 · fleet-scopes.remoteCounts (cognitive 28) · ×1
  • fleet-scopes.remoteCounts (cognitive 28) packages/daemon/src/domain/hosts/fleet-scopes.ts:157 — fleet-scopes.remoteCounts has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 5, loops 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 · SuccessorSessionLauncher.startAgent (cognitive 28) · ×1
  • SuccessorSessionLauncher.startAgent (cognitive 28) packages/daemon/src/domain/successor-session-launcher.ts:447 — SuccessorSessionLauncher.startAgent has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (18 pts), if/else 6, error handling 3 (4 pts) (nesting depth added 8). 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 · SeatLifecycleService.planFresh (cognitive 28) · ×1
  • SeatLifecycleService.planFresh (cognitive 28) packages/daemon/src/domain/seat-lifecycle-service.ts:1569 — SeatLifecycleService.planFresh has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 7 (9 pts), boolean chains 3 (nesting depth added 5). Of this number, 24 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 · RestoreCheckService.checkHooks (cognitive 28) · ×1
  • RestoreCheckService.checkHooks (cognitive 28) packages/daemon/src/domain/restore-check-service.ts:1214 — RestoreCheckService.checkHooks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (8 pts), boolean chains 4, 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 · fleet-compose.unionFleet (cognitive 28) · ×1
  • fleet-compose.unionFleet (cognitive 28) packages/daemon/src/domain/review/fleet-compose.ts:116 — fleet-compose.unionFleet has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 5 (8 pts), ternaries 4 (nesting depth added 14). 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 · RigSpecExporter.exportLegacy (cognitive 28) · ×1
  • RigSpecExporter.exportLegacy (cognitive 28) packages/daemon/src/domain/rigspec-exporter.ts:135 — RigSpecExporter.exportLegacy has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, boolean chains 5, ternaries 4. None of this is in the body itself: all 28 points belong to 3 function literals inside it that branch (lines 142, 188, 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 · watchdog-delivery.makeWatchdogDeliver · ×1
  • watchdog-delivery.makeWatchdogDeliver::deliver (cognitive 28) packages/daemon/src/domain/watchdog-delivery.ts:24 — watchdog-delivery.makeWatchdogDeliver::deliver has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (19 pts), boolean chains 6, if/else 2, error handling 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 · bootstrap-failure-response.bootstrapFailureResponse (cognitive 28) · ×1
  • bootstrap-failure-response.bootstrapFailureResponse (cognitive 28) packages/daemon/src/routes/bootstrap-failure-response.ts:7 — bootstrap-failure-response.bootstrapFailureResponse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10, ternaries 4 (6 pts) (nesting depth added 5). Of this number, 15 points are the body's own statements and 13 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 · env.envRoutes (cognitive 28) · ×1
  • env.envRoutes (cognitive 28) packages/daemon/src/routes/env.ts:14 — env.envRoutes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (16 pts), error handling 4 (6 pts), ternaries 5, boolean chains 1 (nesting depth added 3). None of this is in the body itself: all 28 points belong to 3 function literals inside it that branch (lines 18, 74, 111). 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 · scopes-model.proofEvidence (cognitive 28) · ×1
  • scopes-model.proofEvidence (cognitive 28) packages/tui/src/scopes/scopes-model.ts:207 — scopes-model.proofEvidence has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (10 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 9). 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 · input.resolveKeyAction (cognitive 28) · ×1
  • input.resolveKeyAction (cognitive 28) packages/tui/src/input.ts:173 — input.resolveKeyAction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 5 (9 pts), boolean chains 5 (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 · useActivityFeed.eventSummary (cognitive 28) · ×1
  • useActivityFeed.eventSummary (cognitive 28) packages/ui/src/hooks/useActivityFeed.ts:181 — useActivityFeed.eventSummary has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 13 (26 pts), boolean chains 1, 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 · HostConfigCard.HostConfigCard (cognitive 28) · ×1
  • HostConfigCard.HostConfigCard (cognitive 28) packages/ui/src/components/dashboard/HostConfigCard.tsx:36 — HostConfigCard.HostConfigCard has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (21 pts), boolean chains 3, if/else 2 (3 pts), error handling 1 (nesting depth added 11). Of this number, 18 points are the body's own statements and 10 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 · LaunchCmuxButton.LaunchCmuxButton (cognitive 28) · ×1
  • LaunchCmuxButton.LaunchCmuxButton (cognitive 28) packages/ui/src/components/topology/LaunchCmuxButton.tsx:23 — LaunchCmuxButton.LaunchCmuxButton has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (18 pts), ternaries 4 (8 pts), boolean chains 1, error handling 1 (nesting depth added 6). None of this is in the body itself: all 28 points belong to 10 function items inside it that branch (a function literal at line 85, a function literal at line 150, setPendingUi, …). 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 · useTopologyEdgeActivity.normalizeEvent (cognitive 28) · ×1
  • useTopologyEdgeActivity.normalizeEvent (cognitive 28) packages/ui/src/hooks/useTopologyEdgeActivity.ts:52 — useTopologyEdgeActivity.normalizeEvent has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 8 (11 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · effective-model-readers.newestCodexModel (cognitive 27) · ×1
  • effective-model-readers.newestCodexModel (cognitive 27) packages/daemon/src/domain/model-divergence/effective-model-readers.ts:89 — effective-model-readers.newestCodexModel has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (18 pts), error handling 2 (6 pts), boolean chains 2, 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 · native-process-lineage.selectNativeProcess (cognitive 27) · ×1
  • native-process-lineage.selectNativeProcess (cognitive 27) packages/daemon/src/domain/native-process-lineage.ts:714 — native-process-lineage.selectNativeProcess has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 11, 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 · claude-continuation-launch.continuationArguments (cognitive 27) · ×1
  • claude-continuation-launch.continuationArguments (cognitive 27) packages/daemon/src/domain/claude-continuation-launch.ts:13 — claude-continuation-launch.continuationArguments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (7 pts), boolean chains 4, ternaries 2 (4 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 · rigspec-schema.validatePod (cognitive 27) · ×1
  • rigspec-schema.validatePod (cognitive 27) packages/daemon/src/domain/rigspec-schema.ts:431 — rigspec-schema.validatePod has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 2 (6 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 · InboundRouter.retryOwnDeadLetters (cognitive 27) · ×1
  • InboundRouter.retryOwnDeadLetters (cognitive 27) packages/daemon/src/domain/gateway/slack/inbound.ts:1006 — InboundRouter.retryOwnDeadLetters has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (23 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 · SliceIndexer.matchQitems (cognitive 27) · ×1
  • SliceIndexer.matchQitems (cognitive 27) packages/daemon/src/domain/slices/slice-indexer.ts:1242 — SliceIndexer.matchQitems has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (9 pts), ternaries 3 (6 pts), boolean chains 1, error handling 1 (nesting depth added 11). Of this number, 20 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 · transcript-rotation.startTranscriptRotation · ×1
  • transcript-rotation.startTranscriptRotation::tick (cognitive 27) packages/daemon/src/domain/transcript-rotation.ts:275 — transcript-rotation.startTranscriptRotation::tick has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 8, error handling 2, 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 · SeatActivityService.rawCandidate (cognitive 27) · ×1
  • SeatActivityService.rawCandidate (cognitive 27) packages/daemon/src/domain/seat-activity-service.ts:794 — SeatActivityService.rawCandidate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 10, 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 · node-inventory.getNodeDetail (cognitive 27) · ×1
  • node-inventory.getNodeDetail (cognitive 27) REDACTED:1271 — node-inventory.getNodeDetail has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 5, boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · QueueRepository.fallbackLineStart (cognitive 27) · ×1
  • QueueRepository.fallbackLineStart (cognitive 27) packages/daemon/src/domain/queue-repository.ts:5977 — QueueRepository.fallbackLineStart has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (6 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 10). 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 into named stages: move each independent step or branch 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-compaction-enforcer.readCompactionRecord (cognitive 27) · ×1
  • claude-compaction-enforcer.readCompactionRecord (cognitive 27) packages/daemon/src/domain/claude-compaction-enforcer.ts:685 — claude-compaction-enforcer.readCompactionRecord has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 25, error handling 1, ternaries 1. 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, 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 · agent-server.serveAcpAgent · ×1
  • agent-server.serveAcpAgent::askPerson (cognitive 27) packages/cli/src/acp/agent-server.ts:276 — agent-server.serveAcpAgent::askPerson has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (10 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · daemon-lifecycle.liveStartReservation (cognitive 27) · ×1
  • daemon-lifecycle.liveStartReservation (cognitive 27) REDACTED:1143 — daemon-lifecycle.liveStartReservation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (9 pts), error handling 2 (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 · roster.readRosterInventory (cognitive 27) · ×1
  • roster.readRosterInventory (cognitive 27) packages/cli/src/commands/roster.ts:50 — roster.readRosterInventory has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 2 (4 pts), boolean chains 3, 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 · mcp-server.projectForExternal (cognitive 27) · ×1
  • mcp-server.projectForExternal (cognitive 27) packages/cli/src/mcp-server.ts:375 — mcp-server.projectForExternal has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 9, ternaries 1 (3 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 · queue.readBackQueueUpdate (cognitive 27) · ×1
  • queue.readBackQueueUpdate (cognitive 27) packages/cli/src/commands/queue.ts:827 — queue.readBackQueueUpdate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, error handling 2 (3 pts), ternaries 2 (nesting depth added 6). Of this number, 18 points are the body's own statements and 9 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 · ClaudeCodeAdapter.assessManagedProbe (cognitive 27) · ×1
  • ClaudeCodeAdapter.assessManagedProbe (cognitive 27) packages/daemon/src/adapters/claude-code-adapter.ts:626 — ClaudeCodeAdapter.assessManagedProbe has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). 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 · codex-filesystem-preflight.decideCodexFilesystemPolicy (cognitive 27) · ×1
  • codex-filesystem-preflight.decideCodexFilesystemPolicy (cognitive 27) packages/daemon/src/domain/codex-filesystem-preflight.ts:166 — codex-filesystem-preflight.decideCodexFilesystemPolicy has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 6 (nesting depth added 3). 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, 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 · codex-runtime-adapter.upsertManagedCodexConfigFragment (cognitive 27) · ×1
  • codex-runtime-adapter.upsertManagedCodexConfigFragment (cognitive 27) packages/daemon/src/adapters/codex-runtime-adapter.ts:2906 — codex-runtime-adapter.upsertManagedCodexConfigFragment has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, loops 3 (5 pts), ternaries 3 (5 pts) (nesting depth added 8). Of this number, 21 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 · OmpFrameDecoder.push (cognitive 27) · ×1
  • OmpFrameDecoder.push (cognitive 27) packages/daemon/src/adapters/omp-rpc-frame.ts:92 — OmpFrameDecoder.push has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 6, error handling 1, ternaries 1 (nesting depth added 2). 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 · StubRuntimeAdapter.deliverStartup (cognitive 27) · ×1
  • StubRuntimeAdapter.deliverStartup (cognitive 27) packages/daemon/src/adapters/stub-runtime-adapter.ts:121 — StubRuntimeAdapter.deliverStartup has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (19 pts), ternaries 2 (3 pts), error handling 1 (2 pts), match/switch 1 (2 pts), 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 · PeriodicSnapshotScheduler.tick (cognitive 27) · ×1
  • PeriodicSnapshotScheduler.tick (cognitive 27) packages/daemon/src/domain/periodic-snapshot-scheduler.ts:80 — PeriodicSnapshotScheduler.tick has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 3 (9 pts), ternaries 1 (3 pts), boolean chains 2, 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 · thread-routing.makeThreadRouteResolver.<returned closure> (cognitive 27) · ×1
  • thread-routing.makeThreadRouteResolver.<returned closure> (cognitive 27) packages/daemon/src/domain/gateway/slack/thread-routing.ts:43 — thread-routing.makeThreadRouteResolver.<returned closure> has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (9 pts), boolean chains 7 (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 · SeatLifecycleService.setEffort (cognitive 27) · ×1
  • SeatLifecycleService.setEffort (cognitive 27) packages/daemon/src/domain/seat-lifecycle-service.ts:696 — SeatLifecycleService.setEffort has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), ternaries 5 (6 pts), boolean chains 1 (nesting depth added 8). 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 · queue-erasure.eraseRigRecords (cognitive 27) · ×1
  • queue-erasure.eraseRigRecords (cognitive 27) REDACTED:1124 — queue-erasure.eraseRigRecords has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). 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 · SeatRuntimeSwitchService.commit (cognitive 27) · ×1
  • SeatRuntimeSwitchService.commit (cognitive 27) packages/daemon/src/domain/seat-runtime-switch-service.ts:590 — SeatRuntimeSwitchService.commit has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 8, if/else 6 (7 pts) (nesting depth added 3). None of this is in the body itself: all 27 points belong to one function literal inside it that branches (line 602). 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 · skill-audit.auditSkills.entries (cognitive 27) · ×1
  • skill-audit.auditSkills.entries (cognitive 27) packages/daemon/src/domain/skill-audit.ts:244 — skill-audit.auditSkills.entries has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (15 pts), if/else 6 (9 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 · scope-task-terminal-view.readScopeIndex · ×1
  • scope-task-terminal-view.readScopeIndex::add (cognitive 27) packages/daemon/src/domain/terminal/scope-task-terminal-view.ts:42 — scope-task-terminal-view.readScopeIndex::add has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, ternaries 4 (5 pts), 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. This shape REPEATS in the file: one other method here (scope-task-terminal-view.readScopeIndex) 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 · pi-usage-facts.extractPiUsageFacts (cognitive 26) · ×1
  • pi-usage-facts.extractPiUsageFacts (cognitive 26) packages/daemon/src/domain/pi-usage-facts.ts:119 — pi-usage-facts.extractPiUsageFacts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, ternaries 3 (6 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 · skill-discovery.discoverSkillsWithProvenance (cognitive 26) · ×1
  • skill-discovery.discoverSkillsWithProvenance (cognitive 26) packages/daemon/src/domain/skill-discovery.ts:295 — skill-discovery.discoverSkillsWithProvenance has cognitive complexity 26 (threshold 15). Drivers by points: error handling 4 (11 pts), if/else 2 (6 pts), ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · skill-catalog.resolvePluginSkills (cognitive 26) · ×1
  • skill-catalog.resolvePluginSkills (cognitive 26) packages/daemon/src/domain/skill-catalog.ts:483 — skill-catalog.resolvePluginSkills has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 3 (5 pts), ternaries 4, boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · seat-launch-additions.seatLaunchAdditionsAt (cognitive 26) · ×1
  • seat-launch-additions.seatLaunchAdditionsAt (cognitive 26) packages/daemon/src/domain/seat-launch-additions.ts:290 — seat-launch-additions.seatLaunchAdditionsAt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 3 (4 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 4). Of this number, 23 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 · ClaudeManagedLaunch.credentialPrecedence (cognitive 26) · ×1
  • ClaudeManagedLaunch.credentialPrecedence (cognitive 26) packages/daemon/src/domain/claude-managed-launch.ts:193 — ClaudeManagedLaunch.credentialPrecedence has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 8 (10 pts), boolean chains 3, loops 3 (nesting depth added 7). Of this number, 25 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 · message.richInline (cognitive 26) · ×1
  • message.richInline (cognitive 26) packages/daemon/src/domain/gateway/slack/message.ts:346 — message.richInline has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (8 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). Of this number, 23 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 · SeatActivityService.pollPermissionPrompt (cognitive 26) · ×1
  • SeatActivityService.pollPermissionPrompt (cognitive 26) packages/daemon/src/domain/seat-activity-service.ts:275 — SeatActivityService.pollPermissionPrompt has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (9 pts), ternaries 3, loops 1 (nesting depth added 2). 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, 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 · QueueRepository.performWakeSend (cognitive 26) · ×1
  • QueueRepository.performWakeSend (cognitive 26) packages/daemon/src/domain/queue-repository.ts:2207 — QueueRepository.performWakeSend has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 8 (9 pts), boolean chains 2, 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 · session-transport.readInputBox (cognitive 26) · ×1
  • session-transport.readInputBox (cognitive 26) packages/daemon/src/domain/session-transport.ts:1981 — session-transport.readInputBox has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 3 (8 pts), boolean chains 4 (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 · ClaudeCompactionEnforcer.getOwedRestore (cognitive 26) · ×1
  • ClaudeCompactionEnforcer.getOwedRestore (cognitive 26) packages/daemon/src/domain/claude-compaction-enforcer.ts:943 — ClaudeCompactionEnforcer.getOwedRestore has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (19 pts), boolean chains 4, if/else 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 · whoami.runFanOutWhoami (cognitive 26) · ×1
  • whoami.runFanOutWhoami (cognitive 26) packages/cli/src/commands/whoami.ts:586 — whoami.runFanOutWhoami has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 2 (5 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 7). Of this number, 19 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 · bundle-check.checkBundleFolder (cognitive 26) · ×1
  • bundle-check.checkBundleFolder (cognitive 26) packages/cli/src/lib/bundle-check.ts:32 — bundle-check.checkBundleFolder has cognitive complexity 26 (threshold 15). Drivers by points: if/else 32 (46 pts), loops 11 (16 pts), boolean chains 14, ternaries 8 (14 pts), error handling 6 (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. This shape REPEATS in the file: 2 other methods here (bundle-check.checkBundleFolder::startupFiles, bundle-check.checkBundleFolder::agent) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · send.runCrossHostSend (cognitive 26) · ×1
  • send.runCrossHostSend (cognitive 26) packages/cli/src/commands/send.ts:828 — send.runCrossHostSend has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (21 pts), ternaries 3 (4 pts), boolean chains 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 · scope-fs.resolveMissionsRoot (cognitive 26) · ×1
  • scope-fs.resolveMissionsRoot (cognitive 26) packages/cli/src/lib/scope/scope-fs.ts:313 — scope-fs.resolveMissionsRoot has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (8 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reconstruction-reader.parseReconstructionJson · ×1
  • reconstruction-reader.parseReconstructionJson::value (cognitive 26) packages/cli/src/lib/reconstruction-reader.ts:70 — reconstruction-reader.parseReconstructionJson::value has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (7 pts), boolean chains 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 · down.confirmOwnRig (cognitive 26) · ×1
  • down.confirmOwnRig (cognitive 26) packages/cli/src/commands/down.ts:30 — down.confirmOwnRig has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 8 (9 pts), 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, 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 · parked.renderSeat (cognitive 26) · ×1
  • parked.renderSeat (cognitive 26) packages/cli/src/commands/parked.ts:36 — parked.renderSeat has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 2 (3 pts), boolean chains 2, 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 · decisions.parseTemplate (cognitive 26) · ×1
  • decisions.parseTemplate (cognitive 26) packages/cli/src/decisions/decisions.ts:81 — decisions.parseTemplate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 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 · scope.buildApproveCommand (cognitive 26) · ×1
  • scope.buildApproveCommand (cognitive 26) packages/cli/src/commands/scope.ts:2190 — scope.buildApproveCommand has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 9, boolean chains 6, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 2206). 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 · usage.providerChargeText (cognitive 26) · ×1
  • usage.providerChargeText (cognitive 26) packages/cli/src/commands/usage.ts:75 — usage.providerChargeText has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (22 pts), boolean chains 2, if/else 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude-team-permissions.decide (cognitive 26) · ×1
  • claude-team-permissions.decide (cognitive 26) packages/daemon/assets/claude-team-permissions.cjs:209 — claude-team-permissions.decide has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (9 pts), boolean chains 4, 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 · ClaudeCodeAdapter.launchHarness · ×1
  • ClaudeCodeAdapter.launchHarness::sendClassic (cognitive 26) packages/daemon/src/adapters/claude-code-adapter.ts:391 — ClaudeCodeAdapter.launchHarness::sendClassic has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 7 (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. This shape REPEATS in the file: one other method here (ClaudeCodeAdapter.launchHarness) 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 · pi-runner.createRunnerInput · ×1
  • pi-runner.createRunnerInput::receive (cognitive 26) REDACTED:595 — pi-runner.createRunnerInput::receive has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (7 pts), loops 2 (4 pts), boolean chains 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 · evidence-guard.evaluateProtection (cognitive 26) · ×1
  • evidence-guard.evaluateProtection (cognitive 26) packages/daemon/src/domain/agent-images/evidence-guard.ts:53 — evidence-guard.evaluateProtection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 5 (9 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 · EnvironmentArtifacts.export (cognitive 26) · ×1
  • EnvironmentArtifacts.export (cognitive 26) packages/daemon/src/domain/environment-artifacts.ts:48 — EnvironmentArtifacts.export has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 8, error handling 1 (2 pts), loops 1 (nesting depth added 4). Of this number, 19 points are the body's own statements and 7 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 · restore-plan-preview.buildRestorePlanPreview.nodes (cognitive 26) · ×1
  • restore-plan-preview.buildRestorePlanPreview.nodes (cognitive 26) packages/daemon/src/domain/restore-plan-preview.ts:340 — restore-plan-preview.buildRestorePlanPreview.nodes has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 15 (21 pts), boolean chains 5 (nesting depth added 6). Of this number, 23 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 · SlackAskSettlement.desired (cognitive 26) · ×1
  • SlackAskSettlement.desired (cognitive 26) packages/daemon/src/domain/gateway/slack/settled-asks.ts:166 — SlackAskSettlement.desired has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, ternaries 3 (7 pts) (nesting depth added 6). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HealthDiagnosisService.notifyOccurrence (cognitive 26) · ×1
  • HealthDiagnosisService.notifyOccurrence (cognitive 26) packages/daemon/src/domain/health-diagnosis.ts:246 — HealthDiagnosisService.notifyOccurrence has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 11, ternaries 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 · seat-cwd-preparation.projectionCopyDirectory (cognitive 26) · ×1
  • seat-cwd-preparation.projectionCopyDirectory (cognitive 26) packages/daemon/src/domain/seat-cwd-preparation.ts:81 — seat-cwd-preparation.projectionCopyDirectory has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 5 (10 pts), boolean chains 4 (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 · SliceDetailProjector.buildStory (cognitive 26) · ×1
  • SliceDetailProjector.buildStory (cognitive 26) packages/daemon/src/domain/slices/slice-detail-projector.ts:343 — SliceDetailProjector.buildStory has cognitive complexity 26 (threshold 15). Drivers by points: error handling 4 (7 pts), loops 4 (7 pts), ternaries 3 (7 pts), if/else 3 (4 pts), boolean chains 1 (nesting depth added 11). Of this number, 25 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 · scope-task-terminal-view.selectMission (cognitive 26) · ×1
  • scope-task-terminal-view.selectMission (cognitive 26) packages/daemon/src/domain/terminal/scope-task-terminal-view.ts:123 — scope-task-terminal-view.selectMission has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (6 pts), boolean chains 2, 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 · bundles.consumeAuthorBundleYaml · ×1
  • bundles.consumeAuthorBundleYaml::assertNoSymlinkEscapeInTree (cognitive 26) packages/daemon/src/routes/bundles.ts:526 — bundles.consumeAuthorBundleYaml::assertNoSymlinkEscapeInTree has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 3 (10 pts), loops 2 (3 pts), boolean chains 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 (bundles.consumeAuthorBundleYaml) 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 · telemetry.telemetryRoutes (cognitive 26) · ×1
  • telemetry.telemetryRoutes (cognitive 26) packages/daemon/src/routes/telemetry.ts:19 — telemetry.telemetryRoutes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8, ternaries 2 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 6). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 37, 72, 24, …). 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 · cost-model.providerChargeText (cognitive 26) · ×1
  • cost-model.providerChargeText (cognitive 26) packages/tui/src/cost/cost-model.ts:29 — cost-model.providerChargeText has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (22 pts), boolean chains 2, if/else 1, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · navigator.navigatorLabelsInner (cognitive 26) · ×1
  • navigator.navigatorLabelsInner (cognitive 26) packages/tui/src/navigator.ts:150 — navigator.navigatorLabelsInner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 6 (10 pts), loops 1 (nesting depth added 8). None of this is in the body itself: all 26 points belong to 3 function literals inside it that branch (lines 169, 152, 177). 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 · useMissionDiscovery.useMissionDiscovery (cognitive 26) · ×1
  • useMissionDiscovery.useMissionDiscovery (cognitive 26) packages/ui/src/hooks/useMissionDiscovery.ts:64 — useMissionDiscovery.useMissionDiscovery has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8, ternaries 5 (6 pts) (nesting depth added 4). 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, 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 · PackageInstallFlow.PackageInstallFlow (cognitive 26) · ×1
  • PackageInstallFlow.PackageInstallFlow (cognitive 26) packages/ui/src/components/PackageInstallFlow.tsx:133 — PackageInstallFlow.PackageInstallFlow has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 19, if/else 4, error handling 3. Of this number, 17 points are the body's own statements and 9 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.
D2 · Cognitive Complexity · ProofTab.ProofSliceCard (cognitive 26) · ×1
  • ProofTab.ProofSliceCard (cognitive 26) packages/ui/src/components/project/ProofTab.tsx:73 — ProofTab.ProofSliceCard has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 14 (22 pts), boolean chains 2, if/else 2 (nesting depth added 8). 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 · MissionReviewTab.BoardRowExpansion (cognitive 26) · ×1
  • MissionReviewTab.BoardRowExpansion (cognitive 26) packages/ui/src/components/review/MissionReviewTab.tsx:49 — MissionReviewTab.BoardRowExpansion has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (21 pts), if/else 3, boolean chains 2 (nesting depth added 10). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 89, onApprove). 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 · trace-to-root.render_candidates (cognitive 26) · ×1
  • trace-to-root.render_candidates (cognitive 26) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:407 — trace-to-root.render_candidates has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, ternaries 2 (4 pts), loops 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 · native-process-lineage.tokens (cognitive 25) · ×1
  • native-process-lineage.tokens (cognitive 25) packages/daemon/src/domain/native-process-lineage.ts:25 — native-process-lineage.tokens has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 5). Of this number, 18 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 · native-process-lineage.findExactNativeResumeProcess (cognitive 25) · ×1
  • native-process-lineage.findExactNativeResumeProcess (cognitive 25) packages/daemon/src/domain/native-process-lineage.ts:515 — native-process-lineage.findExactNativeResumeProcess has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), ternaries 1 (4 pts), boolean chains 3 (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 · current-generation-record.resolveIdentityVerifiedPiRecord (cognitive 25) · ×1
  • current-generation-record.resolveIdentityVerifiedPiRecord (cognitive 25) packages/daemon/src/domain/model-divergence/current-generation-record.ts:294 — current-generation-record.resolveIdentityVerifiedPiRecord has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, boolean chains 5, ternaries 2. 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: 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 · pane-envelope.wrapPaneEnvelope (cognitive 25) · ×1
  • pane-envelope.wrapPaneEnvelope (cognitive 25) packages/daemon/src/lib/pane-envelope.ts:114 — pane-envelope.wrapPaneEnvelope has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 9 (21 pts), boolean chains 3, if/else 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · agent-resolver.resolveWithImports (cognitive 25) · ×1
  • agent-resolver.resolveWithImports (cognitive 25) packages/daemon/src/domain/agent-resolver.ts:200 — agent-resolver.resolveWithImports has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 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 · ClaudeResumeAdapter.resume · ×1
  • ClaudeResumeAdapter.resume::sendClassic (cognitive 25) packages/daemon/src/adapters/claude-resume.ts:159 — ClaudeResumeAdapter.resume::sendClassic has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 6 (7 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. This shape REPEATS in the file: one other method here (ClaudeResumeAdapter.resume) 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 · InboundRouter.summaryOf (cognitive 25) · ×1
  • InboundRouter.summaryOf (cognitive 25) packages/daemon/src/domain/gateway/slack/inbound.ts:264 — InboundRouter.summaryOf has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 4 (5 pts), loops 2 (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 · queue-pickup.deriveClaimPickup (cognitive 25) · ×1
  • queue-pickup.deriveClaimPickup (cognitive 25) packages/daemon/src/domain/queue-pickup.ts:99 — queue-pickup.deriveClaimPickup has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, ternaries 3 (5 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · host-usage-rollup.rollupClaude (cognitive 25) · ×1
  • host-usage-rollup.rollupClaude (cognitive 25) packages/daemon/src/domain/provider/host-usage-rollup.ts:105 — host-usage-rollup.rollupClaude has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (7 pts), boolean chains 2, loops 2 (nesting depth added 8). Of this number, 20 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · markdown-address.scanHeaders (cognitive 25) · ×1
  • markdown-address.scanHeaders (cognitive 25) packages/daemon/src/domain/markdown-address.ts:108 — markdown-address.scanHeaders has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 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 · slice-indexer.parseTypedQueueScope (cognitive 25) · ×1
  • slice-indexer.parseTypedQueueScope (cognitive 25) packages/daemon/src/domain/slices/slice-indexer.ts:65 — slice-indexer.parseTypedQueueScope has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (3 pts), 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 · judgments.readSliceReadiness (cognitive 25) · ×1
  • judgments.readSliceReadiness (cognitive 25) packages/daemon/src/domain/proof/judgments.ts:187 — judgments.readSliceReadiness has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (12 pts), boolean chains 10, if/else 2, 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 · restore-guidance.seatGuidance (cognitive 25) · ×1
  • restore-guidance.seatGuidance (cognitive 25) packages/daemon/src/domain/restore-guidance.ts:103 — restore-guidance.seatGuidance has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, error handling 1 (3 pts), loops 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 · node-inventory.attachAgentActivity (cognitive 25) · ×1
  • node-inventory.attachAgentActivity (cognitive 25) REDACTED:1824 — node-inventory.attachAgentActivity has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10, boolean chains 8, ternaries 6 (7 pts) (nesting depth added 1). None of this is in the body itself: all 25 points belong to 3 function literals inside it that branch (lines 1862, 1945, 1905). 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 · relay-outbound.findPendingRelayReplyRef (cognitive 25) · ×1
  • relay-outbound.findPendingRelayReplyRef (cognitive 25) packages/daemon/src/domain/gateway/relay-outbound.ts:535 — relay-outbound.findPendingRelayReplyRef has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, ternaries 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 · QueueRepository.drainPendingWakeIntents (cognitive 25) · ×1
  • QueueRepository.drainPendingWakeIntents (cognitive 25) packages/daemon/src/domain/queue-repository.ts:1941 — QueueRepository.drainPendingWakeIntents has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). Of this number, 16 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 · StartupOrchestrator.executeActions (cognitive 25) · ×1
  • StartupOrchestrator.executeActions (cognitive 25) packages/daemon/src/domain/startup-orchestrator.ts:1166 — StartupOrchestrator.executeActions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, error handling 1 (2 pts), ternaries 2, 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 · session-transport.writtenFact (cognitive 25) · ×1
  • session-transport.writtenFact (cognitive 25) packages/daemon/src/domain/session-transport.ts:186 — session-transport.writtenFact has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, 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 · native-resume-probe.buildCodexResumeDisplay (cognitive 25) · ×1
  • native-resume-probe.buildCodexResumeDisplay (cognitive 25) packages/daemon/src/domain/native-resume-probe.ts:118 — native-resume-probe.buildCodexResumeDisplay has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8, ternaries 4 (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 · native-resume-probe.currentCodexAuthRefusal (cognitive 25) · ×1
  • native-resume-probe.currentCodexAuthRefusal (cognitive 25) packages/daemon/src/domain/native-resume-probe.ts:1011 — native-resume-probe.currentCodexAuthRefusal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, loops 3, ternaries 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 · atomic-text-write.writeTextAtomically (cognitive 25) · ×1
  • atomic-text-write.writeTextAtomically (cognitive 25) packages/cli/src/atomic-text-write.ts:6 — atomic-text-write.writeTextAtomically has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (6 pts), boolean chains 5, loops 1, 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 · ps.parsePsControls (cognitive 25) · ×1
  • ps.parsePsControls (cognitive 25) packages/cli/src/commands/ps.ts:427 — ps.parsePsControls has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, ternaries 4 (6 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 · acp.acpCommand (cognitive 25) · ×1
  • acp.acpCommand (cognitive 25) packages/cli/src/commands/acp.ts:189 — acp.acpCommand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 4 (5 pts), boolean chains 4, error handling 1 (nesting depth added 2). None of this is in the body itself: all 25 points belong to 7 function items inside it that branch (a function literal at line 336, a function literal at line 295, a function literal at line 225, …). 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 · broadcast.renderBroadcastResults (cognitive 25) · ×1
  • broadcast.renderBroadcastResults (cognitive 25) packages/cli/src/commands/broadcast.ts:224 — broadcast.renderBroadcastResults has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 8 (10 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 · capture.runCrossHostCapture (cognitive 25) · ×1
  • capture.runCrossHostCapture (cognitive 25) packages/cli/src/commands/capture.ts:303 — capture.runCrossHostCapture has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 2 (4 pts), boolean chains 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.
D2 · Cognitive Complexity · reconstruction-reader.readReconstruction (cognitive 25) · ×1
  • reconstruction-reader.readReconstruction (cognitive 25) packages/cli/src/lib/reconstruction-reader.ts:232 — reconstruction-reader.readReconstruction has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4 (8 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 9). Of this number, 15 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · requirements.requirementsCommand (cognitive 25) · ×1
  • requirements.requirementsCommand (cognitive 25) packages/cli/src/commands/requirements.ts:8 — requirements.requirementsCommand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 7). None of this is in the body itself: all 25 points belong to 2 function items inside it that branch (a function literal at line 22, getTarget). 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 · seat.runSeatHandover (cognitive 25) · ×1
  • seat.runSeatHandover (cognitive 25) packages/cli/src/commands/seat.ts:1843 — seat.runSeatHandover has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 3, 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 · workflow-errors.describeDaemonRejection (cognitive 25) · ×1
  • workflow-errors.describeDaemonRejection (cognitive 25) packages/cli/src/commands/workflow-errors.ts:32 — workflow-errors.describeDaemonRejection has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (19 pts), boolean chains 3, if/else 2, match/switch 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 · InstallEngine.apply (cognitive 25) · ×1
  • InstallEngine.apply (cognitive 25) packages/daemon/src/domain/install-engine.ts:49 — InstallEngine.apply has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 3 (6 pts), ternaries 3 (6 pts), boolean chains 1, 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 · relay-inbound.createRelayInboundHandler.listOutbox (cognitive 25) · ×1
  • relay-inbound.createRelayInboundHandler.listOutbox (cognitive 25) packages/daemon/src/domain/gateway/relay-inbound.ts:950 — relay-inbound.createRelayInboundHandler.listOutbox has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, ternaries 2 (4 pts), error handling 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 · slack-recovery.threadOrder (cognitive 25) · ×1
  • slack-recovery.threadOrder (cognitive 25) packages/daemon/src/domain/gateway/slack/slack-recovery.ts:277 — slack-recovery.threadOrder has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 6 (9 pts), boolean chains 2 (nesting depth added 9). None of this is in the body itself: all 25 points belong to 3 function items inside it that branch (a function literal at line 282, stalledAt, scannedAt). 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 · fleet-scopes.readHostScopes (cognitive 25) · ×1
  • fleet-scopes.readHostScopes (cognitive 25) packages/daemon/src/domain/hosts/fleet-scopes.ts:177 — fleet-scopes.readHostScopes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 5 (10 pts), boolean chains 3, match/switch 1 (nesting depth added 8). 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 · artifact-pool-helpers.scanArtifactPools (cognitive 25) · ×1
  • artifact-pool-helpers.scanArtifactPools (cognitive 25) packages/daemon/src/domain/policies/artifact-pool-helpers.ts:182 — artifact-pool-helpers.scanArtifactPools has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 2 (6 pts), loops 2 (3 pts), boolean chains 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 · SeatHandoverService.deliverRebuildPrimingPacket (cognitive 25) · ×1
  • SeatHandoverService.deliverRebuildPrimingPacket (cognitive 25) packages/daemon/src/domain/seat-handover-service.ts:1607 — SeatHandoverService.deliverRebuildPrimingPacket has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 3 (6 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts) (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 · claude-seat-switch.checkClaudeSeat (cognitive 25) · ×1
  • claude-seat-switch.checkClaudeSeat (cognitive 25) packages/daemon/src/domain/provider/claude-seat-switch.ts:21 — claude-seat-switch.checkClaudeSeat has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 8 (10 pts), boolean chains 3 (nesting depth added 5). 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 · HerdrAppProvider.reconcileState (cognitive 25) · ×1
  • HerdrAppProvider.reconcileState (cognitive 25) packages/daemon/src/domain/terminal/herdr-app-provider.ts:290 — HerdrAppProvider.reconcileState has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · seat.seatRoutes.post("/set-runtime/ · ×1
  • seat.seatRoutes.post("/set-runtime/:seatRef") (cognitive 25) packages/daemon/src/routes/seat.ts:327 — seat.seatRoutes.post("/set-runtime/:seatRef") has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 6, if/else 6 (nesting depth added 2). 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 · workspace.workspaceRoutes (cognitive 25) · ×1
  • workspace.workspaceRoutes (cognitive 25) packages/daemon/src/routes/workspace.ts:34 — workspace.workspaceRoutes has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 5, if/else 4 (5 pts), error handling 2 (nesting depth added 3). None of this is in the body itself: all 25 points belong to 2 function literals inside it that branch (lines 85, 37). 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 · views.viewsRoutes (cognitive 25) · ×1
  • views.viewsRoutes (cognitive 25) packages/daemon/src/routes/views.ts:19 — views.viewsRoutes has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 9, boolean chains 3, error handling 3 (nesting depth added 6). None of this is in the body itself: all 25 points belong to 5 function items inside it that branch (errorResponse, a function literal at line 113, a function literal at line 42, …). 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 · scopes-model.proofProvenanceLines (cognitive 25) · ×1
  • scopes-model.proofProvenanceLines (cognitive 25) packages/tui/src/scopes/scopes-model.ts:167 — scopes-model.proofProvenanceLines has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (8 pts), ternaries 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 · registry.resourceNames (cognitive 25) · ×1
  • registry.resourceNames (cognitive 25) packages/tui/src/commands/registry.ts:24 — registry.resourceNames has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (11 pts), ternaries 1 (nesting depth added 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProjectMetaPrimitives.eventToken (cognitive 25) · ×1
  • ProjectMetaPrimitives.eventToken (cognitive 25) packages/ui/src/components/project/ProjectMetaPrimitives.tsx:50 — ProjectMetaPrimitives.eventToken has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, 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 · CompactStatusRow.CompactStatusRow (cognitive 25) · ×1
  • CompactStatusRow.CompactStatusRow (cognitive 25) packages/ui/src/components/mission-control/components/CompactStatusRow.tsx:36 — CompactStatusRow.CompactStatusRow has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 15 (20 pts), boolean chains 3, if/else 2 (nesting depth added 5). Of this number, 23 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 · graph-layout.applyTreeLayout (cognitive 25) · ×1
  • graph-layout.applyTreeLayout (cognitive 25) packages/ui/src/lib/graph-layout.ts:49 — graph-layout.applyTreeLayout has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 6 (9 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 · migrate-telemetry-state-0.5.9.scanLegacy (cognitive 25) · ×1
  • migrate-telemetry-state-0.5.9.scanLegacy (cognitive 25) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:355 — migrate-telemetry-state-0.5.9.scanLegacy has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, ternaries 2 (4 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 · claude-auto-mode.claudeAutoModeStatus (cognitive 24) · ×1
  • claude-auto-mode.claudeAutoModeStatus (cognitive 24) packages/daemon/src/domain/claude-auto-mode.ts:88 — claude-auto-mode.claudeAutoModeStatus has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 4, if/else 4, 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 · pi-runner-protocol.buildPiChildEnv (cognitive 24) · ×1
  • pi-runner-protocol.buildPiChildEnv (cognitive 24) packages/daemon/src/adapters/pi-runner-protocol.ts:232 — pi-runner-protocol.buildPiChildEnv has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · native-process-lineage.candidatesMatching (cognitive 24) · ×1
  • native-process-lineage.candidatesMatching (cognitive 24) packages/daemon/src/domain/native-process-lineage.ts:683 — native-process-lineage.candidatesMatching has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, ternaries 3 (4 pts), loops 2 (3 pts) (nesting depth added 8). 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 · remote-daemon-http.remoteJsonRequest (cognitive 24) · ×1
  • remote-daemon-http.remoteJsonRequest (cognitive 24) packages/daemon/src/domain/hosts/remote-daemon-http.ts:116 — remote-daemon-http.remoteJsonRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (nesting depth added 5). 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 · quiet-hold-custody.quietHoldCustody (cognitive 24) · ×1
  • quiet-hold-custody.quietHoldCustody (cognitive 24) packages/daemon/src/domain/quiet-hold-custody.ts:34 — quiet-hold-custody.quietHoldCustody has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, ternaries 3, error handling 1, loops 1 (nesting depth added 3). Of this number, 23 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 · relay-outbound.renderPlainTextBody (cognitive 24) · ×1
  • relay-outbound.renderPlainTextBody (cognitive 24) packages/daemon/src/domain/gateway/relay-outbound.ts:346 — relay-outbound.renderPlainTextBody has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (8 pts), loops 2 (5 pts), boolean chains 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 · harness-not-started-notice.noticeHarnessNotStarted (cognitive 24) · ×1
  • harness-not-started-notice.noticeHarnessNotStarted (cognitive 24) packages/daemon/src/domain/harness-not-started-notice.ts:37 — harness-not-started-notice.noticeHarnessNotStarted has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (7 pts), boolean chains 4, error handling 1 (2 pts), loops 2 (nesting depth added 9). 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 · ConfigStore.reset (cognitive 24) · ×1
  • ConfigStore.reset (cognitive 24) packages/cli/src/config-store.ts:1743 — ConfigStore.reset has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, error handling 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 · daemon-lifecycle.waitForKernelReady (cognitive 24) · ×1
  • daemon-lifecycle.waitForKernelReady (cognitive 24) REDACTED:1520 — daemon-lifecycle.waitForKernelReady has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3, 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 · reconstruction-reader.reconstructionOutput (cognitive 24) · ×1
  • reconstruction-reader.reconstructionOutput (cognitive 24) packages/cli/src/lib/reconstruction-reader.ts:353 — reconstruction-reader.reconstructionOutput has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 5 (8 pts), boolean chains 2, ternaries 1 (nesting depth added 11). 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, 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 · mcp-server.requestsAdvisoryFor (cognitive 24) · ×1
  • mcp-server.requestsAdvisoryFor (cognitive 24) packages/cli/src/mcp-server.ts:267 — mcp-server.requestsAdvisoryFor has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 7, boolean chains 5, error handling 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: 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 · setup.routerLineStep (cognitive 24) · ×1
  • setup.routerLineStep (cognitive 24) packages/cli/src/commands/setup.ts:100 — setup.routerLineStep has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 3 (4 pts), boolean chains 2, 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 · DecisionRun.decide (cognitive 24) · ×1
  • DecisionRun.decide (cognitive 24) packages/cli/src/decisions/decisions.ts:228 — DecisionRun.decide has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 4 (6 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 · progress-edit.addProgressRow (cognitive 24) · ×1
  • progress-edit.addProgressRow (cognitive 24) packages/cli/src/lib/scope/progress-edit.ts:104 — progress-edit.addProgressRow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (6 pts), boolean chains 3, ternaries 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 · capability-delta.capabilityDeltaExpiryFindings (cognitive 24) · ×1
  • capability-delta.capabilityDeltaExpiryFindings (cognitive 24) packages/cli/src/lib/scope/capability-delta.ts:26 — capability-delta.capabilityDeltaExpiryFindings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 4 (7 pts), ternaries 3 (6 pts), boolean chains 2, 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 · transcript.renderTranscript (cognitive 24) · ×1
  • transcript.renderTranscript (cognitive 24) packages/cli/src/commands/transcript.ts:173 — transcript.renderTranscript has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (6 pts), boolean chains 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 · activity-relay.buildOpenRigPayload (cognitive 24) · ×1
  • activity-relay.buildOpenRigPayload (cognitive 24) REDACTED:83 — activity-relay.buildOpenRigPayload has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 8, error handling 2 (4 pts), if/else 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 · activity-relay.wallClockReset (cognitive 24) · ×1
  • activity-relay.wallClockReset (cognitive 24) REDACTED:199 — activity-relay.wallClockReset has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 1 (2 pts), ternaries 2, error handling 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 · ClaudeCodeAdapter.provisionManagedBootstrap (cognitive 24) · ×1
  • ClaudeCodeAdapter.provisionManagedBootstrap (cognitive 24) packages/daemon/src/adapters/claude-code-adapter.ts:1144 — ClaudeCodeAdapter.provisionManagedBootstrap has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 5 (7 pts), error handling 2 (4 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 · stub-runner.executeStubScript (cognitive 24) · ×1
  • stub-runner.executeStubScript (cognitive 24) REDACTED:130 — stub-runner.executeStubScript has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · continuity-policy-materializer.armContinuityPolicy (cognitive 24) · ×1
  • continuity-policy-materializer.armContinuityPolicy (cognitive 24) packages/daemon/src/domain/continuity-policy-materializer.ts:254 — continuity-policy-materializer.armContinuityPolicy has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (8 pts), ternaries 2 (4 pts), loops 2 (nesting depth added 4). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 9 function items inside it that branch (retireUnexpected, isCurrentShapeCandidate, a function literal at line 319, …). 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 · PodRigInstantiator.instantiateOnce · ×1
  • PodRigInstantiator.instantiateOnce::cleanup (cognitive 24) packages/daemon/src/domain/rigspec-instantiator.ts:1859 — PodRigInstantiator.instantiateOnce::cleanup has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (PodRigInstantiator.instantiateOnce) 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 · profile-source-resolver.makeProfileReadFile.<returned closure> (cognitive 24) · ×1
  • profile-source-resolver.makeProfileReadFile.<returned closure> (cognitive 24) packages/daemon/src/domain/context-packs/profile-source-resolver.ts:130 — profile-source-resolver.makeProfileReadFile.<returned closure> has cognitive complexity 24 (threshold 15). Drivers by points: error handling 5 (9 pts), ternaries 3 (6 pts), if/else 4 (5 pts), boolean chains 4 (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 · current-work.parseCreateScopeTags (cognitive 24) · ×1
  • current-work.parseCreateScopeTags (cognitive 24) packages/daemon/src/domain/current-work.ts:378 — current-work.parseCreateScopeTags has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileWriteService.writeAtomic (cognitive 24) · ×1
  • FileWriteService.writeAtomic (cognitive 24) packages/daemon/src/domain/files/file-write-service.ts:114 — FileWriteService.writeAtomic has cognitive complexity 24 (threshold 15). Drivers by points: error handling 8 (11 pts), ternaries 4 (8 pts), if/else 3 (4 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 · guidance-projection.readGuidanceProjection (cognitive 24) · ×1
  • guidance-projection.readGuidanceProjection (cognitive 24) packages/daemon/src/domain/guidance-projection.ts:39 — guidance-projection.readGuidanceProjection has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 2, error handling 2, if/else 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 · usage-series.providerChargeView (cognitive 24) · ×1
  • usage-series.providerChargeView (cognitive 24) REDACTED:468 — usage-series.providerChargeView has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (18 pts), if/else 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 12). 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, 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 · SeatLifecycleService.setCodexProfile (cognitive 24) · ×1
  • SeatLifecycleService.setCodexProfile (cognitive 24) packages/daemon/src/domain/seat-lifecycle-service.ts:1079 — SeatLifecycleService.setCodexProfile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 6 (7 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1100, 1114). 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 · claude-token-usage.claudeTokenUsageReader.<returned closure> (cognitive 24) · ×1
  • claude-token-usage.claudeTokenUsageReader.<returned closure> (cognitive 24) packages/daemon/src/domain/provider/claude-token-usage.ts:53 — claude-token-usage.claudeTokenUsageReader.<returned closure> has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 3 (5 pts), boolean chains 4, 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 · codex-usage-windows.normalizeCodexUsage (cognitive 24) · ×1
  • codex-usage-windows.normalizeCodexUsage (cognitive 24) packages/daemon/src/domain/provider/codex-usage-windows.ts:55 — codex-usage-windows.normalizeCodexUsage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 8 (10 pts), loops 2 (3 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 · TerminalService.followView (cognitive 24) · ×1
  • TerminalService.followView (cognitive 24) packages/daemon/src/domain/terminal/terminal-service.ts:222 — TerminalService.followView has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, ternaries 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 · MultiRigLauncher.launch (cognitive 24) · ×1
  • MultiRigLauncher.launch (cognitive 24) packages/daemon/src/domain/topology/multi-rig-launcher.ts:74 — MultiRigLauncher.launch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 10). Of this number, 15 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 · transcripts.transcriptRoutes (cognitive 24) · ×1
  • transcripts.transcriptRoutes (cognitive 24) packages/daemon/src/routes/transcripts.ts:155 — transcripts.transcriptRoutes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, ternaries 4 (7 pts), boolean chains 3, error handling 1 (nesting depth added 3). None of this is in the body itself: all 24 points belong to 3 function literals inside it that branch (lines 158, 207, 274). 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 · proof.proofRoutes · ×1
  • proof.proofRoutes::target (cognitive 24) packages/daemon/src/routes/proof.ts:53 — proof.proofRoutes::target has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 7 (8 pts), boolean chains 6, 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 · index.startServer (cognitive 24) · ×1
  • index.startServer (cognitive 24) packages/daemon/src/index.ts:284 — index.startServer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, ternaries 3 (4 pts), loops 1 (nesting depth added 3). Of this number, 18 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · scopes-model.wrapText (cognitive 24) · ×1
  • scopes-model.wrapText (cognitive 24) packages/tui/src/scopes/scopes-model.ts:124 — scopes-model.wrapText has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (6 pts), boolean chains 1, 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 · pairing.decideOnce (cognitive 24) · ×1
  • pairing.decideOnce (cognitive 24) packages/tui/src/config/pairing.ts:82 — pairing.decideOnce has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 6, boolean chains 3, error handling 3 (nesting depth added 5). Of this number, 19 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 · usage-model.seatLines (cognitive 24) · ×1
  • usage-model.seatLines (cognitive 24) packages/tui/src/usage/usage-model.ts:129 — usage-model.seatLines has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 8 (9 pts), boolean chains 2, loops 1 (nesting depth added 7). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useGlobalEvents.useGlobalEvents (cognitive 24) · ×1
  • useGlobalEvents.useGlobalEvents (cognitive 24) packages/ui/src/hooks/useGlobalEvents.ts:10 — useGlobalEvents.useGlobalEvents has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 4). None of this is in the body itself: all 24 points belong to 4 function literals inside it that branch (lines 22, 18, 99, …). 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 · migrate-telemetry-state-0.5.9.managedSystemWorldState (cognitive 24) · ×1
  • migrate-telemetry-state-0.5.9.managedSystemWorldState (cognitive 24) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:645 — migrate-telemetry-state-0.5.9.managedSystemWorldState has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 9 (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 · effective-model-readers.piSeatPinReadings (cognitive 23) · ×1
  • effective-model-readers.piSeatPinReadings (cognitive 23) packages/daemon/src/domain/model-divergence/effective-model-readers.ts:225 — effective-model-readers.piSeatPinReadings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResumeMetadataRefresher.captureCodexThreadId · ×1
  • ResumeMetadataRefresher.captureCodexThreadId::discover (cognitive 23) packages/daemon/src/domain/resume-metadata-refresher.ts:360 — ResumeMetadataRefresher.captureCodexThreadId::discover has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (4 pts), boolean chains 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 · ActivityGrantStore.bindingMatch (cognitive 23) · ×1
  • ActivityGrantStore.bindingMatch (cognitive 23) packages/daemon/src/domain/activity-grants.ts:212 — ActivityGrantStore.bindingMatch has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (9 pts), error handling 1, ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SettingsStore.writeConfig (cognitive 23) · ×1
  • SettingsStore.writeConfig (cognitive 23) packages/daemon/src/domain/user-settings/settings-store.ts:1381 — SettingsStore.writeConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (6 pts), boolean chains 4, loops 1, 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 · SettingsStore.reset (cognitive 23) · ×1
  • SettingsStore.reset (cognitive 23) packages/daemon/src/domain/user-settings/settings-store.ts:1528 — SettingsStore.reset has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, error handling 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 · skill-catalog.gitState (cognitive 23) · ×1
  • skill-catalog.gitState (cognitive 23) packages/daemon/src/domain/skill-catalog.ts:251 — skill-catalog.gitState has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (8 pts), loops 2 (3 pts), boolean chains 2, error handling 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 · seat-skill-storage.writeSeatSkillCatalog (cognitive 23) · ×1
  • seat-skill-storage.writeSeatSkillCatalog (cognitive 23) packages/daemon/src/domain/seat-skill-storage.ts:1090 — seat-skill-storage.writeSeatSkillCatalog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, error handling 3 (5 pts), ternaries 2 (4 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 · human-registry.canonicalProjectionSnapshot (cognitive 23) · ×1
  • human-registry.canonicalProjectionSnapshot (cognitive 23) packages/daemon/src/domain/gateway/human-registry.ts:1017 — human-registry.canonicalProjectionSnapshot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 5). 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 · slack-api.fetchRecentMessageTexts (cognitive 23) · ×1
  • slack-api.fetchRecentMessageTexts (cognitive 23) REDACTED:433 — slack-api.fetchRecentMessageTexts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 5 (8 pts), boolean chains 2, loops 1 (nesting depth added 9). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · community-harness-presets.communityHarnessLabel (cognitive 23) · ×1
  • community-harness-presets.communityHarnessLabel (cognitive 23) packages/daemon/src/domain/community-harness-presets.ts:230 — community-harness-presets.communityHarnessLabel has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 8 (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 · relay-outbound.postRelayEnvelope (cognitive 23) · ×1
  • relay-outbound.postRelayEnvelope (cognitive 23) packages/daemon/src/domain/gateway/relay-outbound.ts:605 — relay-outbound.postRelayEnvelope has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 7 (8 pts), 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 · QueueRepository.recordWatchdogWakeAttempt (cognitive 23) · ×1
  • QueueRepository.recordWatchdogWakeAttempt (cognitive 23) packages/daemon/src/domain/queue-repository.ts:4363 — QueueRepository.recordWatchdogWakeAttempt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, ternaries 2 (3 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 4408, recordFired). 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 · session-transport.findCurrentPiDialog (cognitive 23) · ×1
  • session-transport.findCurrentPiDialog (cognitive 23) packages/daemon/src/domain/session-transport.ts:247 — session-transport.findCurrentPiDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (nesting depth added 7). Of this number, 22 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 · ClaudeCompactionEnforcer.deliverPreparation (cognitive 23) · ×1
  • ClaudeCompactionEnforcer.deliverPreparation (cognitive 23) packages/daemon/src/domain/claude-compaction-enforcer.ts:1706 — ClaudeCompactionEnforcer.deliverPreparation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 9, error handling 1, 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, 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 · whoami.runCrossHostWhoami (cognitive 23) · ×1
  • whoami.runCrossHostWhoami (cognitive 23) packages/cli/src/commands/whoami.ts:474 — whoami.runCrossHostWhoami has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (22 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 · broadcast.broadcastCommand (cognitive 23) · ×1
  • broadcast.broadcastCommand (cognitive 23) packages/cli/src/commands/broadcast.ts:27 — broadcast.broadcastCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 3). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 61). 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 · capture.captureCommand (cognitive 23) · ×1
  • capture.captureCommand (cognitive 23) packages/cli/src/commands/capture.ts:154 — capture.captureCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2, ternaries 2 (nesting depth added 4). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 222). 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 · config-init-workspace.initWorkspaceCommand.cmd (cognitive 23) · ×1
  • config-init-workspace.initWorkspaceCommand.cmd (cognitive 23) packages/cli/src/commands/config-init-workspace.ts:31 — config-init-workspace.initWorkspaceCommand.cmd has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (9 pts), loops 2 (4 pts), 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 · recap-seat.resolveRecapSeat (cognitive 23) · ×1
  • recap-seat.resolveRecapSeat (cognitive 23) packages/cli/src/recap-seat.ts:14 — recap-seat.resolveRecapSeat has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 7 (8 pts), boolean chains 4 (nesting depth added 4). 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: 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 · network.networkCommand (cognitive 23) · ×1
  • network.networkCommand (cognitive 23) packages/cli/src/commands/network.ts:67 — network.networkCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, ternaries 4 (6 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 4). None of this is in the body itself: all 23 points belong to 9 function items inside it that branch (a function literal at line 100, a function literal at line 122, finish, …). 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 · release.releaseCommand (cognitive 23) · ×1
  • release.releaseCommand (cognitive 23) packages/cli/src/commands/release.ts:8 — release.releaseCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 5 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). None of this is in the body itself: all 23 points belong to 2 function items inside it that branch (a function literal at line 26, getClient). 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 · scope.buildSliceCreateCommand (cognitive 23) · ×1
  • scope.buildSliceCreateCommand (cognitive 23) packages/cli/src/commands/scope.ts:323 — scope.buildSliceCreateCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (3 pts), error handling 2, boolean chains 1, ternaries 1 (nesting depth added 8). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 334). 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 · precompact-hook.readClaudeCompactionMessage (cognitive 23) · ×1
  • precompact-hook.readClaudeCompactionMessage (cognitive 23) packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs:167 — precompact-hook.readClaudeCompactionMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, error handling 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 · AgentImageLibraryService.install (cognitive 23) · ×1
  • AgentImageLibraryService.install (cognitive 23) packages/daemon/src/domain/agent-images/agent-image-library-service.ts:308 — AgentImageLibraryService.install has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 4 (5 pts), error handling 2 (3 pts), boolean chains 2, 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 · bundle-integrity.verifyIntegrity (cognitive 23) · ×1
  • bundle-integrity.verifyIntegrity (cognitive 23) packages/daemon/src/domain/bundle-integrity.ts:117 — bundle-integrity.verifyIntegrity has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3, ternaries 1 (3 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.
D2 · Cognitive Complexity · WorkflowInstanceStore.create (cognitive 23) · ×1
  • WorkflowInstanceStore.create (cognitive 23) packages/daemon/src/domain/workflow-instance-store.ts:137 — WorkflowInstanceStore.create has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 13 (16 pts), if/else 6, 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 · pi-usage-entries-store.validPiProviderCharge (cognitive 23) · ×1
  • pi-usage-entries-store.validPiProviderCharge (cognitive 23) packages/daemon/src/domain/pi-usage-entries-store.ts:29 — pi-usage-entries-store.validPiProviderCharge has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 8, ternaries 4. Of this number, 18 points are the body's own statements and 5 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 · ClaudeUsageWindows.project (cognitive 23) · ×1
  • ClaudeUsageWindows.project (cognitive 23) packages/daemon/src/domain/provider/claude-usage-windows.ts:255 — ClaudeUsageWindows.project has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (17 pts), if/else 3, boolean chains 1, error handling 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 · queue-erasure.walkEvents (cognitive 23) · ×1
  • queue-erasure.walkEvents (cognitive 23) REDACTED:309 — queue-erasure.walkEvents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queue-erasure.neverMemberGuard.<returned closure> (cognitive 23) · ×1
  • queue-erasure.neverMemberGuard.<returned closure> (cognitive 23) REDACTED:474 — queue-erasure.neverMemberGuard.<returned closure> has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 9). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RestoreCheckService.validateHostInfraDeclaration (cognitive 23) · ×1
  • RestoreCheckService.validateHostInfraDeclaration (cognitive 23) packages/daemon/src/domain/restore-check-service.ts:724 — RestoreCheckService.validateHostInfraDeclaration has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 7 (8 pts), boolean chains 7 (nesting depth added 2). Of this number, 16 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, 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 · HerdrAppProvider.remove (cognitive 23) · ×1
  • HerdrAppProvider.remove (cognitive 23) packages/daemon/src/domain/terminal/herdr-app-provider.ts:583 — HerdrAppProvider.remove has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 10). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · watchdog-delivery-receipts.withWatchdogReceipts · ×1
  • watchdog-delivery-receipts.withWatchdogReceipts::reconcile (cognitive 23) packages/daemon/src/domain/watchdog-delivery-receipts.ts:29 — watchdog-delivery-receipts.withWatchdogReceipts::reconcile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, 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 · packages.packagesRoutes.post("/install") (cognitive 23) · ×1
  • packages.packagesRoutes.post("/install") (cognitive 23) packages/daemon/src/routes/packages.ts:182 — packages.packagesRoutes.post("/install") has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 8 (9 pts), boolean chains 3, error handling 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 · scopes-model.scopeIdentityLines (cognitive 23) · ×1
  • scopes-model.scopeIdentityLines (cognitive 23) packages/tui/src/scopes/scopes-model.ts:324 — scopes-model.scopeIdentityLines has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 6, 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, 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 · render.wrapContentLines (cognitive 23) · ×1
  • render.wrapContentLines (cognitive 23) packages/tui/src/render.ts:1813 — render.wrapContentLines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 3 (9 pts), loops 2 (3 pts), boolean chains 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 · keys.resolveCrashCartKey (cognitive 23) · ×1
  • keys.resolveCrashCartKey (cognitive 23) packages/tui/src/crash-cart/keys.ts:16 — keys.resolveCrashCartKey has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (10 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 · MarkdownViewer.renderInline (cognitive 23) · ×1
  • MarkdownViewer.renderInline (cognitive 23) packages/ui/src/components/markdown/MarkdownViewer.tsx:363 — MarkdownViewer.renderInline has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 2, loops 1 (nesting depth added 11). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BundleInspector.BundleInspector (cognitive 23) · ×1
  • BundleInspector.BundleInspector (cognitive 23) packages/ui/src/components/BundleInspector.tsx:7 — BundleInspector.BundleInspector has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 21, if/else 1, ternaries 1. Of this number, 22 points are the body's own statements and 1 belongs 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 · AuditHistoryView.AuditHistoryView (cognitive 23) · ×1
  • AuditHistoryView.AuditHistoryView (cognitive 23) packages/ui/src/components/mission-control/views/AuditHistoryView.tsx:19 — AuditHistoryView.AuditHistoryView has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (14 pts), boolean chains 8, if/else 1 (nesting depth added 9). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 142, a function literal at line 20, a function literal at line 21, …). 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 · migrate-telemetry-state-0.5.9.validateLegacySources (cognitive 23) · ×1
  • migrate-telemetry-state-0.5.9.validateLegacySources (cognitive 23) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:873 — migrate-telemetry-state-0.5.9.validateLegacySources has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 4 (5 pts), ternaries 2 (3 pts) (nesting depth added 6). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventBus.discardOnThrow (cognitive 22) · ×1
  • EventBus.discardOnThrow (cognitive 22) packages/daemon/src/domain/event-bus.ts:120 — EventBus.discardOnThrow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (6 pts), boolean chains 2, ternaries 2, 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 · AgentActivityStore.recordRunnerObservation (cognitive 22) · ×1
  • AgentActivityStore.recordRunnerObservation (cognitive 22) packages/daemon/src/domain/agent-activity-store.ts:214 — AgentActivityStore.recordRunnerObservation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, ternaries 1 (3 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 224). 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 · pi-runner-protocol.buildPiRunnerCommand (cognitive 22) · ×1
  • pi-runner-protocol.buildPiRunnerCommand (cognitive 22) packages/daemon/src/adapters/pi-runner-protocol.ts:321 — pi-runner-protocol.buildPiRunnerCommand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 4 (6 pts), boolean chains 4, loops 1 (2 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.
D2 · Cognitive Complexity · seat-effort.emittedEffortFromArgv (cognitive 22) · ×1
  • seat-effort.emittedEffortFromArgv (cognitive 22) packages/daemon/src/domain/seat-effort.ts:148 — seat-effort.emittedEffortFromArgv has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, 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 · native-process-lineage.directClaudeChildren (cognitive 22) · ×1
  • native-process-lineage.directClaudeChildren (cognitive 22) packages/daemon/src/domain/native-process-lineage.ts:471 — native-process-lineage.directClaudeChildren has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, 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 · permission-drift.inspectClaude (cognitive 22) · ×1
  • permission-drift.inspectClaude (cognitive 22) packages/daemon/src/domain/permission-drift.ts:164 — permission-drift.inspectClaude has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 4 (5 pts), error handling 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 · skill-catalog.findDirectPluginCopies (cognitive 22) · ×1
  • skill-catalog.findDirectPluginCopies (cognitive 22) packages/daemon/src/domain/skill-catalog.ts:1314 — skill-catalog.findDirectPluginCopies has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bot-inbox.botInboxProblems (cognitive 22) · ×1
  • bot-inbox.botInboxProblems (cognitive 22) packages/daemon/src/domain/gateway/slack/bot-inbox.ts:35 — bot-inbox.botInboxProblems has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 10. Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 46). 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 · quiet-release.runQuietRelease (cognitive 22) · ×1
  • quiet-release.runQuietRelease (cognitive 22) packages/daemon/src/domain/policies/quiet-release.ts:247 — quiet-release.runQuietRelease has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 6). 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 · QueueRepository.propagateBlockerCompletion (cognitive 22) · ×1
  • QueueRepository.propagateBlockerCompletion (cognitive 22) packages/daemon/src/domain/queue-repository.ts:4209 — QueueRepository.propagateBlockerCompletion has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (8 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 · QueueRepository.currentDeliveryEpisode (cognitive 22) · ×1
  • QueueRepository.currentDeliveryEpisode (cognitive 22) packages/daemon/src/domain/queue-repository.ts:5710 — QueueRepository.currentDeliveryEpisode has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 5 (6 pts), boolean chains 2 (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 · EnvironmentStartup.retainedResume (cognitive 22) · ×1
  • EnvironmentStartup.retainedResume (cognitive 22) packages/daemon/src/domain/environment-startup.ts:55 — EnvironmentStartup.retainedResume has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check-runner.submitAsk (cognitive 22) · ×1
  • check-runner.submitAsk (cognitive 22) docs/reference/runner-conformance/check-runner.mjs:146 — check-runner.submitAsk has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 1). Of this number, 21 points are the body's own statements and 1 belongs 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 · queue-artifact.codeResultOf (cognitive 22) · ×1
  • queue-artifact.codeResultOf (cognitive 22) packages/cli/src/queue-artifact.ts:53 — queue-artifact.codeResultOf has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (8 pts), ternaries 2, error handling 1, loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · claude-transcript-parser.walkClaudeContent (cognitive 22) · ×1
  • claude-transcript-parser.walkClaudeContent (cognitive 22) packages/cli/src/restore-packet/claude-transcript-parser.ts:105 — claude-transcript-parser.walkClaudeContent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (5 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 · terminal-window.defaultWindowDeps.columns (cognitive 22) · ×1
  • terminal-window.defaultWindowDeps.columns (cognitive 22) packages/cli/src/terminal-window.ts:67 — terminal-window.defaultWindowDeps.columns has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), error handling 3 (4 pts), ternaries 1 (3 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 · terminal-window.openTerminalWindow · ×1
  • terminal-window.openTerminalWindow::measureWindow (cognitive 22) packages/cli/src/terminal-window.ts:272 — terminal-window.openTerminalWindow::measureWindow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, ternaries 2 (5 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. This shape REPEATS in the file: one other method here (terminal-window.openTerminalWindow) 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 · pi-runner.readPiSessionEntryIds (cognitive 22) · ×1
  • pi-runner.readPiSessionEntryIds (cognitive 22) REDACTED:878 — pi-runner.readPiSessionEntryIds has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 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 · DiscoveryCoordinator.scanOnce (cognitive 22) · ×1
  • DiscoveryCoordinator.scanOnce (cognitive 22) packages/daemon/src/domain/discovery-coordinator.ts:34 — DiscoveryCoordinator.scanOnce has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowInstanceStore.listFiltered (cognitive 22) · ×1
  • WorkflowInstanceStore.listFiltered (cognitive 22) packages/daemon/src/domain/workflow-instance-store.ts:360 — WorkflowInstanceStore.listFiltered has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 5 (8 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 · lifecycle-obligations.lifecycleObligations (cognitive 22) · ×1
  • lifecycle-obligations.lifecycleObligations (cognitive 22) packages/daemon/src/domain/lifecycle-obligations.ts:20 — lifecycle-obligations.lifecycleObligations has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (17 pts), boolean chains 3, error handling 1, if/else 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 35, 42). 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 · feed-perspective.feedPerspective (cognitive 22) · ×1
  • feed-perspective.feedPerspective (cognitive 22) packages/daemon/src/domain/feed-perspective.ts:14 — feed-perspective.feedPerspective has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 3, if/else 1 (nesting depth added 7). Of this number, 19 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 · FileWriteService.createAtomic (cognitive 22) · ×1
  • FileWriteService.createAtomic (cognitive 22) packages/daemon/src/domain/files/file-write-service.ts:228 — FileWriteService.createAtomic has cognitive complexity 22 (threshold 15). Drivers by points: error handling 7 (10 pts), ternaries 4 (8 pts), if/else 3 (4 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 · seat-restart-in-place.parseEffectiveSettings (cognitive 22) · ×1
  • seat-restart-in-place.parseEffectiveSettings (cognitive 22) packages/daemon/src/domain/seat-restart-in-place.ts:1068 — seat-restart-in-place.parseEffectiveSettings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 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 · claude-usage-reader.collectClaudeSignalsFromProviderUsageDirectory (cognitive 22) · ×1
  • claude-usage-reader.collectClaudeSignalsFromProviderUsageDirectory (cognitive 22) packages/daemon/src/domain/provider/claude-usage-reader.ts:109 — claude-usage-reader.collectClaudeSignalsFromProviderUsageDirectory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 3 (6 pts), loops 3 (4 pts), ternaries 2 (3 pts) (nesting depth added 10). Of this number, 17 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 · RestoreCheckService.checkSeatReadiness (cognitive 22) · ×1
  • RestoreCheckService.checkSeatReadiness (cognitive 22) packages/daemon/src/domain/restore-check-service.ts:929 — RestoreCheckService.checkSeatReadiness has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 3 (6 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 · RestoreCheckService.buildRecovery (cognitive 22) · ×1
  • RestoreCheckService.buildRecovery (cognitive 22) packages/daemon/src/domain/restore-check-service.ts:1587 — RestoreCheckService.buildRecovery has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (nesting depth added 8). 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 · RigLifecycleService.releaseRig · ×1
  • RigLifecycleService.releaseRig::release (cognitive 22) packages/daemon/src/domain/rig-lifecycle-service.ts:362 — RigLifecycleService.releaseRig::release has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RexAgentStatusRelay.reportNow (cognitive 22) · ×1
  • RexAgentStatusRelay.reportNow (cognitive 22) packages/daemon/src/domain/terminal/rex-agent-status.ts:141 — RexAgentStatusRelay.reportNow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 7 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 · TerminalService.openView (cognitive 22) · ×1
  • TerminalService.openView (cognitive 22) packages/daemon/src/domain/terminal/terminal-service.ts:333 — TerminalService.openView has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 7, boolean chains 4, loops 1 (2 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 · activity.submitPermission (cognitive 22) · ×1
  • activity.submitPermission (cognitive 22) packages/daemon/src/routes/activity.ts:989 — activity.submitPermission has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, error handling 2 (3 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 · startup.createDaemon · ×1
  • startup.createDaemon::topologyDestinationAdvisory (cognitive 22) packages/daemon/src/startup.ts:449 — startup.createDaemon::topologyDestinationAdvisory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, ternaries 1 (2 pts), 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. This shape REPEATS in the file: one other method here (startup.createDaemon) 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 · hatchet.drawEdge (cognitive 22) · ×1
  • hatchet.drawEdge (cognitive 22) packages/tui/src/topology/styles/hatchet.ts:63 — hatchet.drawEdge has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (8 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). Of this number, 11 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 · local-reading.localLines (cognitive 22) · ×1
  • local-reading.localLines (cognitive 22) packages/tui/src/local-reading.ts:74 — local-reading.localLines has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 7 (9 pts), loops 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 · AppShell.AppShellInner (cognitive 22) · ×1
  • AppShell.AppShellInner (cognitive 22) packages/ui/src/components/AppShell.tsx:373 — AppShell.AppShellInner has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (7 pts), if/else 4 (nesting depth added 1). Of this number, 17 points are the body's own statements and 5 belong to 4 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 · BootstrapWizard.BootstrapWizard (cognitive 22) · ×1
  • BootstrapWizard.BootstrapWizard (cognitive 22) packages/ui/src/components/BootstrapWizard.tsx:27 — BootstrapWizard.BootstrapWizard has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 18, error handling 2, if/else 1, ternaries 1. Of this number, 17 points are the body's own statements and 5 belong to 7 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 · SeatOverviewTable.SeatOverviewTable (cognitive 22) · ×1
  • SeatOverviewTable.SeatOverviewTable (cognitive 22) packages/ui/src/components/SeatOverviewTable.tsx:79 — SeatOverviewTable.SeatOverviewTable has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 16 (17 pts), boolean chains 5 (nesting depth added 1). Of this number, 19 points are the body's own statements and 3 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 · startup-submission-evidence.composerRegion (cognitive 21) · ×1
  • startup-submission-evidence.composerRegion (cognitive 21) packages/daemon/src/domain/startup-submission-evidence.ts:35 — startup-submission-evidence.composerRegion has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 5 (7 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 7). 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 · PermissionStopObservations.read (cognitive 21) · ×1
  • PermissionStopObservations.read (cognitive 21) packages/daemon/src/domain/permission-stop-observation.ts:131 — PermissionStopObservations.read has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 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 · process-table.startReader (cognitive 21) · ×1
  • process-table.startReader (cognitive 21) packages/daemon/src/domain/process-table.ts:173 — process-table.startReader has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). None of this is in the body itself: all 21 points belong to 2 function items inside it that branch (a function literal at line 176, lost). 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 · native-process-lineage.codexConversationToken (cognitive 21) · ×1
  • native-process-lineage.codexConversationToken (cognitive 21) packages/daemon/src/domain/native-process-lineage.ts:193 — native-process-lineage.codexConversationToken has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 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 · session-name.tmuxFormatChange (cognitive 21) · ×1
  • session-name.tmuxFormatChange (cognitive 21) packages/daemon/src/domain/session-name.ts:123 — session-name.tmuxFormatChange has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionRegistry.assertAddressAvailable (cognitive 21) · ×1
  • SessionRegistry.assertAddressAvailable (cognitive 21) packages/daemon/src/domain/session-registry.ts:249 — SessionRegistry.assertAddressAvailable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, loops 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 · skill-catalog.readOwnershipManifest (cognitive 21) · ×1
  • skill-catalog.readOwnershipManifest (cognitive 21) packages/daemon/src/domain/skill-catalog.ts:570 — skill-catalog.readOwnershipManifest has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, if/else 6, 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 · skill-catalog.retireDirectPluginCopies (cognitive 21) · ×1
  • skill-catalog.retireDirectPluginCopies (cognitive 21) packages/daemon/src/domain/skill-catalog.ts:1352 — skill-catalog.retireDirectPluginCopies has cognitive complexity 21 (threshold 15). Drivers by points: error handling 5 (8 pts), if/else 5 (8 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · relay-config.evaluateRelayCandidate (cognitive 21) · ×1
  • relay-config.evaluateRelayCandidate (cognitive 21) packages/daemon/src/domain/gateway/relay-config.ts:189 — relay-config.evaluateRelayCandidate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, error handling 1, loops 1, 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 · operator-delivery-engine.makeOperatorDeliveryEngine.resolvedFor (cognitive 21) · ×1
  • operator-delivery-engine.makeOperatorDeliveryEngine.resolvedFor (cognitive 21) packages/daemon/src/domain/gateway/operator-delivery-engine.ts:128 — operator-delivery-engine.makeOperatorDeliveryEngine.resolvedFor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SliceIndexer.missionAuthoredStatuses (cognitive 21) · ×1
  • SliceIndexer.missionAuthoredStatuses (cognitive 21) packages/daemon/src/domain/slices/slice-indexer.ts:472 — SliceIndexer.missionAuthoredStatuses has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts), boolean chains 2, 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 · fresh-occupant-relation.readReadyFreshLaunchFences (cognitive 21) · ×1
  • fresh-occupant-relation.readReadyFreshLaunchFences (cognitive 21) packages/daemon/src/domain/fresh-occupant-relation.ts:44 — fresh-occupant-relation.readReadyFreshLaunchFences has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 4 (6 pts), boolean chains 5, 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 · queue-wake-ladder.refusedWatchdogJobs (cognitive 21) · ×1
  • queue-wake-ladder.refusedWatchdogJobs (cognitive 21) packages/daemon/src/domain/queue-wake-ladder.ts:1156 — queue-wake-ladder.refusedWatchdogJobs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 6 (7 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1175, 1179). 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 · queue-repository.listablePullOutboxKeys (cognitive 21) · ×1
  • queue-repository.listablePullOutboxKeys (cognitive 21) packages/daemon/src/domain/queue-repository.ts:6456 — queue-repository.listablePullOutboxKeys has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 6, ternaries 2 (4 pts), loops 2 (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 · TmuxAdapter.proveSeatScope (cognitive 21) · ×1
  • TmuxAdapter.proveSeatScope (cognitive 21) packages/daemon/src/adapters/tmux.ts:897 — TmuxAdapter.proveSeatScope has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queue-receipt.rowReceipt (cognitive 21) · ×1
  • queue-receipt.rowReceipt (cognitive 21) packages/cli/src/queue-receipt.ts:118 — queue-receipt.rowReceipt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (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 · run-on-host.runOnSshHost (cognitive 21) · ×1
  • run-on-host.runOnSshHost (cognitive 21) packages/cli/src/lib/run-on-host.ts:44 — run-on-host.runOnSshHost has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, 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 · capture.renderCapture (cognitive 21) · ×1
  • capture.renderCapture (cognitive 21) packages/cli/src/commands/capture.ts:106 — capture.renderCapture has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (note). 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 · scope-fs.findSlice (cognitive 21) · ×1
  • scope-fs.findSlice (cognitive 21) packages/cli/src/lib/scope/scope-fs.ts:564 — scope-fs.findSlice has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 1 (4 pts), boolean chains 2, 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 · remove.removeCommand (cognitive 21) · ×1
  • remove.removeCommand (cognitive 21) packages/cli/src/commands/remove.ts:8 — remove.removeCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, ternaries 3 (nesting depth added 3). None of this is in the body itself: all 21 points belong to 2 function items inside it that branch (a function literal at line 23, getClient). 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 · stream-outcome.streamOutcome (cognitive 21) · ×1
  • stream-outcome.streamOutcome (cognitive 21) packages/cli/src/commands/stream-outcome.ts:102 — stream-outcome.streamOutcome has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 5, if/else 3, loops 1 (nesting depth added 2). 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: 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 · front-door.probeFrontDoor (cognitive 21) · ×1
  • front-door.probeFrontDoor (cognitive 21) packages/cli/src/front-door.ts:112 — front-door.probeFrontDoor has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (6 pts), boolean chains 3, 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 · local-reading.localRead (cognitive 21) · ×1
  • local-reading.localRead (cognitive 21) packages/cli/src/local-reading.ts:10 — local-reading.localRead has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 4, error handling 2 (3 pts), boolean chains 2 (nesting depth added 7). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 21, 38, 25). 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 · ClaudeCodeAdapter.mergeJsonFragment (cognitive 21) · ×1
  • ClaudeCodeAdapter.mergeJsonFragment (cognitive 21) packages/daemon/src/adapters/claude-code-adapter.ts:1085 — ClaudeCodeAdapter.mergeJsonFragment has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 2 (9 pts), if/else 3 (6 pts), error handling 2 (5 pts), boolean chains 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 · codex-filesystem-preflight.compareFilesystem (cognitive 21) · ×1
  • codex-filesystem-preflight.compareFilesystem (cognitive 21) packages/daemon/src/domain/codex-filesystem-preflight.ts:48 — codex-filesystem-preflight.compareFilesystem has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 19, ternaries 5 (8 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. This shape REPEATS in the file: one other method here (codex-filesystem-preflight.compareFilesystem::at) 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 · codex-runtime-adapter.withoutTomlPath (cognitive 21) · ×1
  • codex-runtime-adapter.withoutTomlPath (cognitive 21) packages/daemon/src/adapters/codex-runtime-adapter.ts:3016 — codex-runtime-adapter.withoutTomlPath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (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 · seat-runtime-home-record.recordRuntimeHome (cognitive 21) · ×1
  • seat-runtime-home-record.recordRuntimeHome (cognitive 21) packages/daemon/src/domain/seat-runtime-home-record.ts:194 — seat-runtime-home-record.recordRuntimeHome has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 8, ternaries 1. Of this number, 13 points are the body's own statements and 8 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 · running-name-guard.confirmStoppedGenerations (cognitive 21) · ×1
  • running-name-guard.confirmStoppedGenerations (cognitive 21) packages/daemon/src/domain/running-name-guard.ts:89 — running-name-guard.confirmStoppedGenerations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (7 pts), error handling 1 (3 pts), loops 2 (3 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 · BootstrapOrchestrator.buildServicePrelaunchHook (cognitive 21) · ×1
  • BootstrapOrchestrator.buildServicePrelaunchHook (cognitive 21) packages/daemon/src/domain/bootstrap-orchestrator.ts:911 — BootstrapOrchestrator.buildServicePrelaunchHook has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 3 (4 pts), error handling 2 (3 pts) (nesting depth added 4). 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 944, 950, 962). 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 · compaction-restore-notice.recoveryRecipient (cognitive 21) · ×1
  • compaction-restore-notice.recoveryRecipient (cognitive 21) packages/daemon/src/domain/compaction-restore-notice.ts:13 — compaction-restore-notice.recoveryRecipient has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 6). Of this number, 16 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 · ContextMonitor.runPoll (cognitive 21) · ×1
  • ContextMonitor.runPoll (cognitive 21) packages/daemon/src/domain/context-monitor.ts:105 — ContextMonitor.runPoll has cognitive complexity 21 (threshold 15). Drivers by points: error handling 3 (11 pts), if/else 3 (7 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 · current-restore-snapshot.currentRestoreSnapshot (cognitive 21) · ×1
  • current-restore-snapshot.currentRestoreSnapshot (cognitive 21) packages/daemon/src/domain/current-restore-snapshot.ts:9 — current-restore-snapshot.currentRestoreSnapshot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 6, ternaries 2 (nesting depth added 8). 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 · MissionControlWriteContract.resolveParked (cognitive 21) · ×1
  • MissionControlWriteContract.resolveParked (cognitive 21) packages/daemon/src/domain/mission-control/mission-control-write-contract.ts:473 — MissionControlWriteContract.resolveParked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 5 (7 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 4). 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, 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 · health-detectors.evaluatePassiveCeremony (cognitive 21) · ×1
  • health-detectors.evaluatePassiveCeremony (cognitive 21) packages/daemon/src/domain/health-detectors.ts:420 — health-detectors.evaluatePassiveCeremony has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 8 (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 · PassiveCeremonySource.context (cognitive 21) · ×1
  • PassiveCeremonySource.context (cognitive 21) packages/daemon/src/domain/health-passive-ceremony.ts:300 — PassiveCeremonySource.context has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 11). 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 · WatchdogPolicyEngine.deliverHeldGroup (cognitive 21) · ×1
  • WatchdogPolicyEngine.deliverHeldGroup (cognitive 21) packages/daemon/src/domain/watchdog-policy-engine.ts:733 — WatchdogPolicyEngine.deliverHeldGroup 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 · PluginVendorService.ensureVendored (cognitive 21) · ×1
  • PluginVendorService.ensureVendored (cognitive 21) packages/daemon/src/domain/plugin-vendor-service.ts:137 — PluginVendorService.ensureVendored has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (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 · seat-restart-in-place.shellWords (cognitive 21) · ×1
  • seat-restart-in-place.shellWords (cognitive 21) packages/daemon/src/domain/seat-restart-in-place.ts:1102 — seat-restart-in-place.shellWords has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 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 · SeatLifecycleService.cleanSeat (cognitive 21) · ×1
  • SeatLifecycleService.cleanSeat (cognitive 21) packages/daemon/src/domain/seat-lifecycle-service.ts:1289 — SeatLifecycleService.cleanSeat has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 pts), boolean chains 3, loops 3 (nesting depth added 5). 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 · RestoreCheckService.checkRestorePreconditions (cognitive 21) · ×1
  • RestoreCheckService.checkRestorePreconditions (cognitive 21) packages/daemon/src/domain/restore-check-service.ts:474 — RestoreCheckService.checkRestorePreconditions has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 4, if/else 2, error handling 1 (nesting depth added 6). Of this number, 17 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 · RestoreCheckService.hasActivityRelayHook (cognitive 21) · ×1
  • RestoreCheckService.hasActivityRelayHook (cognitive 21) packages/daemon/src/domain/restore-check-service.ts:1379 — RestoreCheckService.hasActivityRelayHook has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 3 (5 pts), error handling 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1385, 1398). 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 · rig-edge-ops.addRigEdge (cognitive 21) · ×1
  • rig-edge-ops.addRigEdge (cognitive 21) packages/daemon/src/domain/rig-edge-ops.ts:110 — rig-edge-ops.addRigEdge has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 6, if/else 6 (nesting depth added 2). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 114, 128). 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 · RigLifecycleService.unclaimSession (cognitive 21) · ×1
  • RigLifecycleService.unclaimSession (cognitive 21) packages/daemon/src/domain/rig-lifecycle-service.ts:188 — RigLifecycleService.unclaimSession has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8, boolean chains 7, error handling 1 (3 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 3). Of this number, 16 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 · RigTeardownOrchestrator.cleanupSeatSkills (cognitive 21) · ×1
  • RigTeardownOrchestrator.cleanupSeatSkills (cognitive 21) packages/daemon/src/domain/rig-teardown.ts:349 — RigTeardownOrchestrator.cleanupSeatSkills has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), error handling 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 · StreamIntakeCoordinator.drain (cognitive 21) · ×1
  • StreamIntakeCoordinator.drain (cognitive 21) packages/daemon/src/domain/stream-intake.ts:254 — StreamIntakeCoordinator.drain has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (5 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 · StreamIntakeCoordinator.handleStreamItem (cognitive 21) · ×1
  • StreamIntakeCoordinator.handleStreamItem (cognitive 21) packages/daemon/src/domain/stream-intake.ts:308 — StreamIntakeCoordinator.handleStreamItem has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (6 pts), boolean chains 5 (nesting depth added 6). 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 · herdr-adapter.reportResumeCommands (cognitive 21) · ×1
  • herdr-adapter.reportResumeCommands (cognitive 21) packages/daemon/src/domain/terminal/herdr-adapter.ts:373 — herdr-adapter.reportResumeCommands has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 1 (4 pts), error handling 1 (3 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 · WorkflowRuntime.resumeFailureOccurrence (cognitive 21) · ×1
  • WorkflowRuntime.resumeFailureOccurrence (cognitive 21) packages/daemon/src/domain/workflow-runtime.ts:1395 — WorkflowRuntime.resumeFailureOccurrence has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, ternaries 4 (nesting depth added 2). Of this number, 13 points are the body's own statements and 8 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 · seat.setPermissionsHandler (cognitive 21) · ×1
  • seat.setPermissionsHandler (cognitive 21) packages/daemon/src/routes/seat.ts:506 — seat.setPermissionsHandler has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 7, boolean chains 3 (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 · state.agentMatches (cognitive 21) · ×1
  • state.agentMatches (cognitive 21) packages/tui/src/state.ts:464 — state.agentMatches has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (10 pts), boolean chains 6, if/else 1 (5 pts) (nesting depth added 10). 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 · MarkdownViewer.BlockRenderer (cognitive 21) · ×1
  • MarkdownViewer.BlockRenderer (cognitive 21) packages/ui/src/components/markdown/MarkdownViewer.tsx:285 — MarkdownViewer.BlockRenderer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (10 pts), boolean chains 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForkNowAction.ForkNowAction (cognitive 21) · ×1
  • ForkNowAction.ForkNowAction (cognitive 21) packages/ui/src/components/agent-images/ForkNowAction.tsx:31 — ForkNowAction.ForkNowAction has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, if/else 5, ternaries 1. Of this number, 12 points are the body's own statements and 9 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.
D2 · Cognitive Complexity · migrate-telemetry-state-0.5.9.readLibraryConfig (cognitive 21) · ×1
  • migrate-telemetry-state-0.5.9.readLibraryConfig (cognitive 21) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:227 — migrate-telemetry-state-0.5.9.readLibraryConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 6 (7 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 · (anonymous) (cognitive 21) · ×1
  • (anonymous) (cognitive 21) packages/daemon/assets/claude-statusline-context.cjs:26 — (anonymous) has cognitive complexity 21 (threshold 15). Drivers by points: other 9, if/else 4 (5 pts), boolean chains 3, ternaries 2 (3 pts), error handling 1 (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 · claude-credential-precedence.settingsFileConflicts (cognitive 20) · ×1
  • claude-credential-precedence.settingsFileConflicts (cognitive 20) packages/daemon/src/domain/claude-credential-precedence.ts:52 — claude-credential-precedence.settingsFileConflicts has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 3, if/else 2 (3 pts), error handling 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 · native-process-arguments.readNativeProcessArguments (cognitive 20) · ×1
  • native-process-arguments.readNativeProcessArguments (cognitive 20) packages/daemon/src/domain/native-process-arguments.ts:139 — native-process-arguments.readNativeProcessArguments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnapshotRepository.selectRestoreUsable (cognitive 20) · ×1
  • SnapshotRepository.selectRestoreUsable (cognitive 20) packages/daemon/src/domain/snapshot-repository.ts:99 — SnapshotRepository.selectRestoreUsable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 5 (6 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 · startup-validation.validateStartupFile (cognitive 20) · ×1
  • startup-validation.validateStartupFile (cognitive 20) packages/daemon/src/domain/startup-validation.ts:20 — startup-validation.validateStartupFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 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 · agent-manifest.validatePluginResources (cognitive 20) · ×1
  • agent-manifest.validatePluginResources (cognitive 20) packages/daemon/src/domain/agent-manifest.ts:513 — agent-manifest.validatePluginResources has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, 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 · native-permission-store.resolveLaunchOverrideFromFacts (cognitive 20) · ×1
  • native-permission-store.resolveLaunchOverrideFromFacts (cognitive 20) packages/daemon/src/domain/native-permission-store.ts:80 — native-permission-store.resolveLaunchOverrideFromFacts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 4 (5 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, 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 · EnvironmentPlatform.config (cognitive 20) · ×1
  • EnvironmentPlatform.config (cognitive 20) packages/daemon/src/domain/environment-platform.ts:74 — EnvironmentPlatform.config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 3, error handling 1, 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 · message.buildBodyBlocks (cognitive 20) · ×1
  • message.buildBodyBlocks (cognitive 20) packages/daemon/src/domain/gateway/slack/message.ts:385 — message.buildBodyBlocks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · default-receiver.describeDefaultReceiver (cognitive 20) · ×1
  • default-receiver.describeDefaultReceiver (cognitive 20) packages/daemon/src/domain/default-receiver.ts:58 — default-receiver.describeDefaultReceiver has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 1 (nesting depth added 11). 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 · relay-config.loadRelayProfiles (cognitive 20) · ×1
  • relay-config.loadRelayProfiles (cognitive 20) packages/daemon/src/domain/gateway/relay-config.ts:379 — relay-config.loadRelayProfiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). Of this number, 18 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 · lifecycle-manifest.validateMissionComposition (cognitive 20) · ×1
  • lifecycle-manifest.validateMissionComposition (cognitive 20) packages/daemon/src/domain/lifecycle-manifest.ts:30 — lifecycle-manifest.validateMissionComposition has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 7, ternaries 1 (2 pts) (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 45). 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 · judgments.ledger (cognitive 20) · ×1
  • judgments.ledger (cognitive 20) packages/daemon/src/domain/proof/judgments.ts:137 — judgments.ledger has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TranscriptStore.grepSync (cognitive 20) · ×1
  • TranscriptStore.grepSync (cognitive 20) REDACTED:405 — TranscriptStore.grepSync has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (8 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 · SessionTransport.claudeDeliveryObservation (cognitive 20) · ×1
  • SessionTransport.claudeDeliveryObservation (cognitive 20) packages/daemon/src/domain/session-transport.ts:4405 — SessionTransport.claudeDeliveryObservation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, error handling 1, 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 · local-daemon-owner.assessLocalDaemonOwner (cognitive 20) · ×1
  • local-daemon-owner.assessLocalDaemonOwner (cognitive 20) packages/cli/src/local-daemon-owner.ts:40 — local-daemon-owner.assessLocalDaemonOwner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 8, error handling 1, ternaries 1. Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 58, a function literal at line 59, observe). 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 · send.wrapSendBody (cognitive 20) · ×1
  • send.wrapSendBody (cognitive 20) packages/cli/src/commands/send.ts:85 — send.wrapSendBody has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 3, 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 · doctor.doctorCommand (cognitive 20) · ×1
  • doctor.doctorCommand (cognitive 20) REDACTED:618 — doctor.doctorCommand has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (8 pts), boolean chains 1, loops 1 (nesting depth added 9). None of this is in the body itself: all 20 points belong to 3 function literals inside it that branch (lines 626, 630, 639). 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 · mcp-server.mapResult (cognitive 20) · ×1
  • mcp-server.mapResult (cognitive 20) packages/cli/src/mcp-server.ts:903 — mcp-server.mapResult has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 5, if/else 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 · stream-consumer.applyPending (cognitive 20) · ×1
  • stream-consumer.applyPending (cognitive 20) packages/cli/src/decisions/stream-consumer.ts:170 — stream-consumer.applyPending has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (5 pts), error handling 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 · runtime-detect.detectRuntime (cognitive 20) · ×1
  • runtime-detect.detectRuntime (cognitive 20) packages/cli/src/restore-packet/runtime-detect.ts:42 — runtime-detect.detectRuntime has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, error handling 1 (2 pts), ternaries 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 · telemetry.telemetryCommand · ×1
  • telemetry.telemetryCommand::read (cognitive 20) packages/cli/src/commands/telemetry.ts:37 — telemetry.telemetryCommand::read has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (5 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 · claude-team-permissions.substitutions (cognitive 20) · ×1
  • claude-team-permissions.substitutions (cognitive 20) packages/daemon/assets/claude-team-permissions.cjs:81 — claude-team-permissions.substitutions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), ternaries 1 (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 · refocus.process.stdout.write() (cognitive 20) · ×1
  • refocus.process.stdout.write() (cognitive 20) packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs:664 — refocus.process.stdout.write() 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 · claude-owned-settings.stripOwnedRelayHooks (cognitive 20) · ×1
  • claude-owned-settings.stripOwnedRelayHooks (cognitive 20) packages/daemon/src/domain/claude-owned-settings.ts:53 — claude-owned-settings.stripOwnedRelayHooks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), ternaries 1 (2 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 · cmux.normalizeCapabilities (cognitive 20) · ×1
  • cmux.normalizeCapabilities (cognitive 20) REDACTED:322 — cmux.normalizeCapabilities has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 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 · cmux-transport.normalizePayload (cognitive 20) · ×1
  • cmux-transport.normalizePayload (cognitive 20) REDACTED:178 — cmux-transport.normalizePayload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (6 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 · cmux-transport.normalizeSurfaceRow (cognitive 20) · ×1
  • cmux-transport.normalizeSurfaceRow (cognitive 20) REDACTED:224 — cmux-transport.normalizeSurfaceRow has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 6, if/else 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 · codex-auth.copyOntoFresh (cognitive 20) · ×1
  • codex-auth.copyOntoFresh (cognitive 20) packages/daemon/src/domain/codex-auth.ts:139 — codex-auth.copyOntoFresh has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 5 (7 pts), boolean chains 3, 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 · RuntimeVerifier.verifyVersionOrHelp (cognitive 20) · ×1
  • RuntimeVerifier.verifyVersionOrHelp (cognitive 20) packages/daemon/src/domain/runtime-verifier.ts:166 — RuntimeVerifier.verifyVersionOrHelp has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), 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 · ServiceOrchestrator.boot (cognitive 20) · ×1
  • ServiceOrchestrator.boot (cognitive 20) packages/daemon/src/domain/service-orchestrator.ts:44 — ServiceOrchestrator.boot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 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 · current-work.inspectWorkNodeDirs (cognitive 20) · ×1
  • current-work.inspectWorkNodeDirs (cognitive 20) packages/daemon/src/domain/current-work.ts:217 — current-work.inspectWorkNodeDirs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 3 (5 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 · destination-successor.recordedSuccessorNotice (cognitive 20) · ×1
  • destination-successor.recordedSuccessorNotice (cognitive 20) packages/daemon/src/domain/destination-successor.ts:5 — destination-successor.recordedSuccessorNotice has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1, loops 1 (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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · existing-rig-restore.automaticRestoreOverrides (cognitive 20) · ×1
  • existing-rig-restore.automaticRestoreOverrides (cognitive 20) packages/daemon/src/domain/existing-rig-restore.ts:147 — existing-rig-restore.automaticRestoreOverrides has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 3). Of this number, 13 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 · relay-inbound.resolveOfferedReplyRefContext (cognitive 20) · ×1
  • relay-inbound.resolveOfferedReplyRefContext (cognitive 20) packages/daemon/src/domain/gateway/relay-inbound.ts:328 — relay-inbound.resolveOfferedReplyRefContext has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 2 (3 pts), ternaries 1 (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 · instance-initialization.ensureOpenRigInstance (cognitive 20) · ×1
  • instance-initialization.ensureOpenRigInstance (cognitive 20) packages/daemon/src/domain/instance-initialization.ts:41 — instance-initialization.ensureOpenRigInstance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4, boolean chains 3, loops 2 (3 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.
D2 · Cognitive Complexity · ProjectClassifier.classify (cognitive 20) · ×1
  • ProjectClassifier.classify (cognitive 20) packages/daemon/src/domain/project-classifier.ts:155 — ProjectClassifier.classify has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 7). 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 170). 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 · Reconciler.reconcile (cognitive 20) · ×1
  • Reconciler.reconcile (cognitive 20) packages/daemon/src/domain/reconciler.ts:58 — Reconciler.reconcile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (7 pts), error handling 2 (5 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 · claude-seat-switch.effortNote (cognitive 20) · ×1
  • claude-seat-switch.effortNote (cognitive 20) packages/daemon/src/domain/provider/claude-seat-switch.ts:194 — claude-seat-switch.effortNote has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (6 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 · queue-retention.pruneEvents (cognitive 20) · ×1
  • queue-retention.pruneEvents (cognitive 20) packages/daemon/src/domain/queue-retention.ts:458 — queue-retention.pruneEvents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 7 (8 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queue-retention.runQueueRetentionSweep (cognitive 20) · ×1
  • queue-retention.runQueueRetentionSweep (cognitive 20) packages/daemon/src/domain/queue-retention.ts:559 — queue-retention.runQueueRetentionSweep has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4, error handling 1 (2 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 · RestoreCheckService.checkOtherHookChannels (cognitive 20) · ×1
  • RestoreCheckService.checkOtherHookChannels (cognitive 20) packages/daemon/src/domain/restore-check-service.ts:1346 — RestoreCheckService.checkOtherHookChannels has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (4 pts), error handling 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 · ReviewGatherer.attentionForTag (cognitive 20) · ×1
  • ReviewGatherer.attentionForTag (cognitive 20) packages/daemon/src/domain/review/gather.ts:517 — ReviewGatherer.attentionForTag has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 6, boolean chains 2, error handling 1 (2 pts) (nesting depth added 2). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 548, 568). 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 · SeatSwitchClientService.switchClient (cognitive 20) · ×1
  • SeatSwitchClientService.switchClient (cognitive 20) packages/daemon/src/domain/seat-switch-client-service.ts:97 — SeatSwitchClientService.switchClient has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 3 (4 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · frontmatter-validator.validateFile (cognitive 20) · ×1
  • frontmatter-validator.validateFile (cognitive 20) packages/daemon/src/domain/workspace/frontmatter-validator.ts:143 — frontmatter-validator.validateFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 2, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessions.nodesRoutes.post("/launch-subset") (cognitive 20) · ×1
  • sessions.nodesRoutes.post("/launch-subset") (cognitive 20) packages/daemon/src/routes/sessions.ts:409 — sessions.nodesRoutes.post("/launch-subset") has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 5 (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 · snapshots.snapshotsRoutes.post("/") (cognitive 20) · ×1
  • snapshots.snapshotsRoutes.post("/") (cognitive 20) packages/daemon/src/routes/snapshots.ts:27 — snapshots.snapshotsRoutes.post("/") has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, error handling 2 (3 pts), 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 · scope-audit.buildAuditDependencyGraph (cognitive 20) · ×1
  • scope-audit.buildAuditDependencyGraph (cognitive 20) packages/daemon/src/routes/scope-audit.ts:55 — scope-audit.buildAuditDependencyGraph has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). 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 · execution-model.laneDetail (cognitive 20) · ×1
  • execution-model.laneDetail (cognitive 20) packages/tui/src/execution/execution-model.ts:743 — execution-model.laneDetail has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 3, boolean chains 2 (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 · usage-hosts-model.usageHostsLines (cognitive 20) · ×1
  • usage-hosts-model.usageHostsLines (cognitive 20) packages/tui/src/usage/usage-hosts-model.ts:50 — usage-hosts-model.usageHostsLines has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 5 (6 pts), loops 5 (6 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 · DaemonClient.configBrowser (cognitive 20) · ×1
  • DaemonClient.configBrowser (cognitive 20) packages/tui/src/daemon-client.ts:164 — DaemonClient.configBrowser has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (14 pts), boolean chains 3, if/else 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal-model.terminalExplorerRows (cognitive 20) · ×1
  • terminal-model.terminalExplorerRows (cognitive 20) packages/tui/src/terminals/terminal-model.ts:69 — terminal-model.terminalExplorerRows has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 4, if/else 2 (3 pts), loops 2 (3 pts) (nesting depth added 8). 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 · LocalReadingController.key (cognitive 20) · ×1
  • LocalReadingController.key (cognitive 20) packages/tui/src/local-reading.ts:45 — LocalReadingController.key has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 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 · useActivityFeed.useActivityFeed (cognitive 20) · ×1
  • useActivityFeed.useActivityFeed (cognitive 20) packages/ui/src/hooks/useActivityFeed.ts:26 — useActivityFeed.useActivityFeed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, ternaries 1 (nesting depth added 4). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 32). 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 · FocusedTerminal.mapXtermInput (cognitive 20) · ×1
  • FocusedTerminal.mapXtermInput (cognitive 20) packages/ui/src/components/terminal/FocusedTerminal.tsx:67 — FocusedTerminal.mapXtermInput has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 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 · useTopologyActivity.useTopologyActivity (cognitive 20) · ×1
  • useTopologyActivity.useTopologyActivity (cognitive 20) packages/ui/src/hooks/useTopologyActivity.ts:101 — useTopologyActivity.useTopologyActivity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). None of this is in the body itself: all 20 points belong to 3 function literals inside it that branch (lines 112, 164, 174). 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 · LiveNodeDetails.AgentSpecSection (cognitive 20) · ×1
  • LiveNodeDetails.AgentSpecSection (cognitive 20) packages/ui/src/components/LiveNodeDetails.tsx:97 — LiveNodeDetails.AgentSpecSection has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (17 pts), boolean chains 3 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AgentsBandView.AgentsBandView (cognitive 20) · ×1
  • AgentsBandView.AgentsBandView (cognitive 20) packages/ui/src/components/review/AgentsBandView.tsx:105 — AgentsBandView.AgentsBandView has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 14 (19 pts), boolean chains 1 (nesting depth added 5). Of this number, 14 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 · SliceReviewTab.SliceReviewTab (cognitive 20) · ×1
  • SliceReviewTab.SliceReviewTab (cognitive 20) packages/ui/src/components/review/SliceReviewTab.tsx:227 — SliceReviewTab.SliceReviewTab has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 2, if/else 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 · MissionReviewTab.Board (cognitive 20) · ×1
  • MissionReviewTab.Board (cognitive 20) packages/ui/src/components/review/MissionReviewTab.tsx:156 — MissionReviewTab.Board has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (18 pts), boolean chains 2 (nesting depth added 8). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 177, 190, 196). 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 · MissionReviewTab.MissionReviewTab (cognitive 20) · ×1
  • MissionReviewTab.MissionReviewTab (cognitive 20) packages/ui/src/components/review/MissionReviewTab.tsx:293 — MissionReviewTab.MissionReviewTab has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (16 pts), boolean chains 2, if/else 2 (nesting depth added 7). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 331). 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 · priority-rail-rule.computeLintWarnings (cognitive 20) · ×1
  • priority-rail-rule.computeLintWarnings (cognitive 20) packages/ui/src/components/progress/priority-rail-rule.ts:94 — priority-rail-rule.computeLintWarnings has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 3 (nesting depth added 6). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · graph-layout.layoutSingleColumn (cognitive 20) · ×1
  • graph-layout.layoutSingleColumn (cognitive 20) packages/ui/src/lib/graph-layout.ts:231 — graph-layout.layoutSingleColumn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 6 (8 pts), boolean chains 4 (nesting depth added 6). Of this number, 10 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 · trace-to-root.render_held_and_next (cognitive 20) · ×1
  • trace-to-root.render_held_and_next (cognitive 20) packages/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py:378 — trace-to-root.render_held_and_next has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 4, loops 2 (4 pts), ternaries 1 (3 pts) (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 · community-harness-launch-result.readLaunchResult (cognitive 19) · ×1
  • community-harness-launch-result.readLaunchResult (cognitive 19) packages/daemon/src/domain/community-harness-launch-result.ts:42 — community-harness-launch-result.readLaunchResult has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, error handling 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 · seat-effort.codexTurnOutcome (cognitive 19) · ×1
  • seat-effort.codexTurnOutcome (cognitive 19) packages/daemon/src/domain/seat-effort.ts:238 — seat-effort.codexTurnOutcome has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, 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 · native-process-lineage.observeClaudeDelivery · ×1
  • native-process-lineage.observeClaudeDelivery::sample (cognitive 19) packages/daemon/src/domain/native-process-lineage.ts:1043 — native-process-lineage.observeClaudeDelivery::sample has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (3 pts), boolean chains 1, 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 · OutboxHandler.replaceRunnerRun (cognitive 19) · ×1
  • OutboxHandler.replaceRunnerRun (cognitive 19) packages/daemon/src/domain/outbox-handler.ts:331 — OutboxHandler.replaceRunnerRun has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 2 (7 pts), loops 3 (6 pts), if/else 2 (4 pts), boolean chains 2 (nesting depth added 10). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 333). 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 · settings-store.acceptedIntegerRange (cognitive 19) · ×1
  • settings-store.acceptedIntegerRange (cognitive 19) packages/daemon/src/domain/user-settings/settings-store.ts:1148 — settings-store.acceptedIntegerRange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 6). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SeatDeliveryGuard.custody (cognitive 19) · ×1
  • SeatDeliveryGuard.custody (cognitive 19) packages/daemon/src/domain/seat-delivery-guard.ts:335 — SeatDeliveryGuard.custody has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 4). None of this is in the body itself: all 19 points belong to 4 function items inside it that branch (acquire, validate, acquire::run, …). 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 · package-manifest.serializeManifest (cognitive 19) · ×1
  • package-manifest.serializeManifest (cognitive 19) packages/daemon/src/domain/package-manifest.ts:429 — package-manifest.serializeManifest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (19 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 · profile-resolver.buildResourcePool (cognitive 19) · ×1
  • profile-resolver.buildResourcePool (cognitive 19) packages/daemon/src/domain/profile-resolver.ts:479 — profile-resolver.buildResourcePool has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 5 (9 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 · HumanQuietStore.quietStateFor (cognitive 19) · ×1
  • HumanQuietStore.quietStateFor (cognitive 19) packages/daemon/src/domain/gateway/human-quiet-windows.ts:122 — HumanQuietStore.quietStateFor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 2 (3 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 · SliceIndexer.scanProofPacket · ×1
  • SliceIndexer.scanProofPacket::walk (cognitive 19) packages/daemon/src/domain/slices/slice-indexer.ts:1590 — SliceIndexer.scanProofPacket::walk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (4 pts), boolean chains 3, ternaries 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 · queue-wait-backoff.refreshQueueWaits (cognitive 19) · ×1
  • queue-wait-backoff.refreshQueueWaits (cognitive 19) packages/daemon/src/domain/queue-wait-backoff.ts:98 — queue-wait-backoff.refreshQueueWaits has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, 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 · SeatStructuralActivityService.pollAllRunningTmuxSeats (cognitive 19) · ×1
  • SeatStructuralActivityService.pollAllRunningTmuxSeats (cognitive 19) packages/daemon/src/domain/seat-structural-activity-service.ts:183 — SeatStructuralActivityService.pollAllRunningTmuxSeats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 2, ternaries 2, error handling 1 (nesting depth added 2). 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: 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 · workspace-resolver.resolveNodeWorkspace (cognitive 19) · ×1
  • workspace-resolver.resolveNodeWorkspace (cognitive 19) packages/daemon/src/domain/workspace/workspace-resolver.ts:57 — workspace-resolver.resolveNodeWorkspace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · queue-wake-ladder.ensureEscalationRow (cognitive 19) · ×1
  • queue-wake-ladder.ensureEscalationRow (cognitive 19) packages/daemon/src/domain/queue-wake-ladder.ts:1863 — queue-wake-ladder.ensureEscalationRow has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 4, if/else 3 (4 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 · QueueRepository.closeCrossHostHandoffSource (cognitive 19) · ×1
  • QueueRepository.closeCrossHostHandoffSource (cognitive 19) packages/daemon/src/domain/queue-repository.ts:3174 — QueueRepository.closeCrossHostHandoffSource has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (4 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 5). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 3220). 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 · QueueRepository.passRunnerAnswerToDecider (cognitive 19) · ×1
  • QueueRepository.passRunnerAnswerToDecider (cognitive 19) packages/daemon/src/domain/queue-repository.ts:4488 — QueueRepository.passRunnerAnswerToDecider has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, ternaries 5 (6 pts), if/else 3 (4 pts), error handling 2, loops 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: 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 · QueueRepository.findUndelivered (cognitive 19) · ×1
  • QueueRepository.findUndelivered (cognitive 19) packages/daemon/src/domain/queue-repository.ts:5503 — QueueRepository.findUndelivered has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, ternaries 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 · PiRuntimeAdapter.projectEntry (cognitive 19) · ×1
  • PiRuntimeAdapter.projectEntry (cognitive 19) packages/daemon/src/adapters/pi-runtime-adapter.ts:587 — PiRuntimeAdapter.projectEntry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 1 (3 pts), loops 1 (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 · StartupOrchestrator.owedStartup (cognitive 19) · ×1
  • StartupOrchestrator.owedStartup (cognitive 19) packages/daemon/src/domain/startup-orchestrator.ts:1353 — StartupOrchestrator.owedStartup has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (19 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 · SessionTransport.preWaitForIdle (cognitive 19) · ×1
  • SessionTransport.preWaitForIdle (cognitive 19) packages/daemon/src/domain/session-transport.ts:3309 — SessionTransport.preWaitForIdle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, error handling 2, ternaries 1 (2 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 · SessionTransport.broadcast (cognitive 19) · ×1
  • SessionTransport.broadcast (cognitive 19) packages/daemon/src/domain/session-transport.ts:5047 — SessionTransport.broadcast has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 4, if/else 1, loops 1 (nesting depth added 5). Of this number, 15 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 · TmuxAdapter.startServerInUserScope (cognitive 19) · ×1
  • TmuxAdapter.startServerInUserScope (cognitive 19) packages/daemon/src/adapters/tmux.ts:1497 — TmuxAdapter.startServerInUserScope has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, error handling 1 (2 pts), ternaries 2, loops 1 (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 · TmuxAdapter.readAllPaneProcesses (cognitive 19) · ×1
  • TmuxAdapter.readAllPaneProcesses (cognitive 19) packages/daemon/src/adapters/tmux.ts:2986 — TmuxAdapter.readAllPaneProcesses has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (9 pts), boolean chains 4, if/else 2 (4 pts), error handling 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 · ClaudeCompactionEnforcer.endedAttemptGate (cognitive 19) · ×1
  • ClaudeCompactionEnforcer.endedAttemptGate (cognitive 19) packages/daemon/src/domain/claude-compaction-enforcer.ts:853 — ClaudeCompactionEnforcer.endedAttemptGate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 8, error handling 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 · ClaudeCompactionEnforcer.drainPendingPreparedCompact (cognitive 19) · ×1
  • ClaudeCompactionEnforcer.drainPendingPreparedCompact (cognitive 19) packages/daemon/src/domain/claude-compaction-enforcer.ts:1010 — ClaudeCompactionEnforcer.drainPendingPreparedCompact has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 2). Of this number, 15 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.
D2 · Cognitive Complexity · ClaudeCompactionEnforcer.noteEndedPreparation (cognitive 19) · ×1
  • ClaudeCompactionEnforcer.noteEndedPreparation (cognitive 19) packages/daemon/src/domain/claude-compaction-enforcer.ts:2235 — ClaudeCompactionEnforcer.noteEndedPreparation has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 2, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · native-resume-probe.looksLikeCodexLoginPrompt (cognitive 19) · ×1
  • native-resume-probe.looksLikeCodexLoginPrompt (cognitive 19) packages/daemon/src/domain/native-resume-probe.ts:1042 — native-resume-probe.looksLikeCodexLoginPrompt has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check-runner.parseArgs (cognitive 19) · ×1
  • check-runner.parseArgs (cognitive 19) docs/reference/runner-conformance/check-runner.mjs:32 — check-runner.parseArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (18 pts), loops 1 (nesting depth added 2). 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: 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 · host-registry.updateHostEntry (cognitive 19) · ×1
  • host-registry.updateHostEntry (cognitive 19) packages/cli/src/host-registry.ts:445 — host-registry.updateHostEntry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, loops 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, 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 · ps.parseFilter (cognitive 19) · ×1
  • ps.parseFilter (cognitive 19) packages/cli/src/commands/ps.ts:310 — ps.parseFilter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 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 · queue-receipt.wakeEvidence (cognitive 19) · ×1
  • queue-receipt.wakeEvidence (cognitive 19) packages/cli/src/queue-receipt.ts:89 — queue-receipt.wakeEvidence has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 4, 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 · whoami.resolveIdentitySource (cognitive 19) · ×1
  • whoami.resolveIdentitySource (cognitive 19) packages/cli/src/commands/whoami.ts:217 — whoami.resolveIdentitySource has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 3 (6 pts), 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 · bundle-source.importGitHubBundle (cognitive 19) · ×1
  • bundle-source.importGitHubBundle (cognitive 19) packages/cli/src/lib/bundle-source.ts:272 — bundle-source.importGitHubBundle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 2 (3 pts), error handling 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 · bundle-check.schemaNameProblem (cognitive 19) · ×1
  • bundle-check.schemaNameProblem (cognitive 19) packages/cli/src/lib/bundle-check.ts:14 — bundle-check.schemaNameProblem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (6 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 · usage.piCostLine (cognitive 19) · ×1
  • usage.piCostLine (cognitive 19) packages/cli/src/commands/usage.ts:56 — usage.piCostLine has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (19 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 · claude-owned-settings.cleanupOwnedClaudeCwd (cognitive 19) · ×1
  • claude-owned-settings.cleanupOwnedClaudeCwd (cognitive 19) packages/daemon/src/domain/claude-owned-settings.ts:112 — claude-owned-settings.cleanupOwnedClaudeCwd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ClaudeCodeAdapter.paneOccupant (cognitive 19) · ×1
  • ClaudeCodeAdapter.paneOccupant (cognitive 19) packages/daemon/src/adapters/claude-code-adapter.ts:724 — ClaudeCodeAdapter.paneOccupant has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (7 pts), boolean chains 3, 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 · CodexRuntimeAdapter.project (cognitive 19) · ×1
  • CodexRuntimeAdapter.project (cognitive 19) packages/daemon/src/adapters/codex-runtime-adapter.ts:823 — CodexRuntimeAdapter.project has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (5 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codex-runtime-adapter.rekeyCodexHookStateText (cognitive 19) · ×1
  • codex-runtime-adapter.rekeyCodexHookStateText (cognitive 19) packages/daemon/src/adapters/codex-runtime-adapter.ts:2638 — codex-runtime-adapter.rekeyCodexHookStateText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (6 pts), boolean chains 1, 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 · StubRuntimeAdapter.launchHarness (cognitive 19) · ×1
  • StubRuntimeAdapter.launchHarness (cognitive 19) packages/daemon/src/adapters/stub-runtime-adapter.ts:164 — StubRuntimeAdapter.launchHarness has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 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 · bundle-types.serializePodBundleManifest (cognitive 19) · ×1
  • bundle-types.serializePodBundleManifest (cognitive 19) packages/daemon/src/domain/bundle-types.ts:524 — bundle-types.serializePodBundleManifest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · daemon-shutdown.createDaemonShutdown.<returned closure> (cognitive 19) · ×1
  • daemon-shutdown.createDaemonShutdown.<returned closure> (cognitive 19) packages/daemon/src/daemon-shutdown.ts:121 — daemon-shutdown.createDaemonShutdown.<returned closure> has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (5 pts), ternaries 3, loops 1 (nesting depth added 5). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 164, finish). 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 · evidence-guard.walkYaml (cognitive 19) · ×1
  • evidence-guard.walkYaml (cognitive 19) packages/daemon/src/domain/agent-images/evidence-guard.ts:144 — evidence-guard.walkYaml has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (6 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 · evidence-guard.collectImageRefs (cognitive 19) · ×1
  • evidence-guard.collectImageRefs (cognitive 19) packages/daemon/src/domain/agent-images/evidence-guard.ts:172 — evidence-guard.collectImageRefs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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 · rigspec-preflight.verifyCodexProfiles (cognitive 19) · ×1
  • rigspec-preflight.verifyCodexProfiles (cognitive 19) packages/daemon/src/domain/rigspec-preflight.ts:602 — rigspec-preflight.verifyCodexProfiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 1 (4 pts), loops 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 · LegacyBundleAssembler.assemble (cognitive 19) · ×1
  • LegacyBundleAssembler.assemble (cognitive 19) packages/daemon/src/domain/bundle-assembler.ts:60 — LegacyBundleAssembler.assemble has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3, 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 · ContextPackLibraryService.scan (cognitive 19) · ×1
  • ContextPackLibraryService.scan (cognitive 19) packages/daemon/src/domain/context-packs/context-pack-library-service.ts:122 — ContextPackLibraryService.scan has cognitive complexity 19 (threshold 15). Drivers by points: error handling 3 (9 pts), ternaries 1 (4 pts), if/else 1 (3 pts), loops 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 · workflow-role-resolver.selectRoleSeat (cognitive 19) · ×1
  • workflow-role-resolver.selectRoleSeat (cognitive 19) packages/daemon/src/domain/workflow-role-resolver.ts:105 — workflow-role-resolver.selectRoleSeat has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). Of this number, 15 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 · RestoreOrchestrator.classifyRunningSessions (cognitive 19) · ×1
  • RestoreOrchestrator.classifyRunningSessions (cognitive 19) packages/daemon/src/domain/restore-orchestrator.ts:1004 — RestoreOrchestrator.classifyRunningSessions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, 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 · restore-orchestrator.snapshotLaunchOutcome (cognitive 19) · ×1
  • restore-orchestrator.snapshotLaunchOutcome (cognitive 19) packages/daemon/src/domain/restore-orchestrator.ts:194 — restore-orchestrator.snapshotLaunchOutcome has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, ternaries 4 (7 pts), boolean chains 4 (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 · OperatingPostureService.target (cognitive 19) · ×1
  • OperatingPostureService.target (cognitive 19) packages/daemon/src/domain/rig-mode/operating-posture.ts:223 — OperatingPostureService.target has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 6, boolean chains 3 (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 · health-policy.validateHealthPolicy (cognitive 19) · ×1
  • health-policy.validateHealthPolicy (cognitive 19) packages/daemon/src/domain/health-policy.ts:41 — health-policy.validateHealthPolicy has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (8 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · health-detectors.evaluateCoordination (cognitive 19) · ×1
  • health-detectors.evaluateCoordination (cognitive 19) packages/daemon/src/domain/health-detectors.ts:378 — health-detectors.evaluateCoordination has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 4, if/else 3 (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 · HealthDiagnosisService.validateProgress (cognitive 19) · ×1
  • HealthDiagnosisService.validateProgress (cognitive 19) packages/daemon/src/domain/health-diagnosis.ts:219 — HealthDiagnosisService.validateProgress has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (8 pts), loops 1 (nesting depth added 1). 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, 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 · health-context.healthAuthority (cognitive 19) · ×1
  • health-context.healthAuthority (cognitive 19) packages/daemon/src/domain/health-context.ts:90 — health-context.healthAuthority has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 6, ternaries 5, error handling 1. Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (belongs, 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 · hosts-registry-writer.updateHostEntry (cognitive 19) · ×1
  • hosts-registry-writer.updateHostEntry (cognitive 19) packages/daemon/src/domain/hosts/hosts-registry-writer.ts:132 — hosts-registry-writer.updateHostEntry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, loops 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, 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 · PluginDiscoveryService.scanCwdBundledPlugins (cognitive 19) · ×1
  • PluginDiscoveryService.scanCwdBundledPlugins (cognitive 19) packages/daemon/src/domain/plugin-discovery-service.ts:286 — PluginDiscoveryService.scanCwdBundledPlugins has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SeatLifecycleService.stopSeatChecked (cognitive 19) · ×1
  • SeatLifecycleService.stopSeatChecked (cognitive 19) packages/daemon/src/domain/seat-lifecycle-service.ts:1248 — SeatLifecycleService.stopSeatChecked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, ternaries 2 (5 pts), boolean chains 3, error handling 1 (nesting depth added 3). Of this number, 11 points are the body's own statements and 8 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 · SeatLifecycleService.inPlaceTarget (cognitive 19) · ×1
  • SeatLifecycleService.inPlaceTarget (cognitive 19) packages/daemon/src/domain/seat-lifecycle-service.ts:2035 — SeatLifecycleService.inPlaceTarget has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, ternaries 6 (7 pts), boolean chains 3, 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 · subscription-move-report.findCredential (cognitive 19) · ×1
  • subscription-move-report.findCredential (cognitive 19) packages/daemon/src/domain/provider/subscription-move-report.ts:70 — subscription-move-report.findCredential has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), ternaries 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 · queue-erasure.addressesAtRig (cognitive 19) · ×1
  • queue-erasure.addressesAtRig (cognitive 19) REDACTED:442 — queue-erasure.addressesAtRig has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (7 pts), boolean chains 2 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · RestoreCheckService.buildRigRollup (cognitive 19) · ×1
  • RestoreCheckService.buildRigRollup (cognitive 19) packages/daemon/src/domain/restore-check-service.ts:1798 — RestoreCheckService.buildRigRollup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2, loops 1 (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, 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 · UpCommandRouter.autoDetect (cognitive 19) · ×1
  • UpCommandRouter.autoDetect (cognitive 19) packages/daemon/src/domain/up-command-router.ts:134 — UpCommandRouter.autoDetect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, error handling 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 · frontmatter-validator.validateWorkspaceFrontmatter · ×1
  • frontmatter-validator.validateWorkspaceFrontmatter::walk (cognitive 19) packages/daemon/src/domain/workspace/frontmatter-validator.ts:90 — frontmatter-validator.validateWorkspaceFrontmatter::walk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, 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 · packages.packagesRoutes.post("/plan") (cognitive 19) · ×1
  • packages.packagesRoutes.post("/plan") (cognitive 19) packages/daemon/src/routes/packages.ts:106 — packages.packagesRoutes.post("/plan") has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 5, boolean chains 2, error handling 1 (nesting depth added 1). Of this number, 13 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 · bootstrap.bootstrapRoutes.post("/apply") (cognitive 19) · ×1
  • bootstrap.bootstrapRoutes.post("/apply") (cognitive 19) packages/daemon/src/routes/bootstrap.ts:77 — bootstrap.bootstrapRoutes.post("/apply") has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 6 (7 pts), boolean chains 2, error handling 1 (nesting depth added 4). Of this number, 15 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 · TerminalBrokerRegistry.attach (cognitive 19) · ×1
  • TerminalBrokerRegistry.attach (cognitive 19) packages/daemon/src/terminal/TerminalSessionBroker.ts:683 — TerminalBrokerRegistry.attach has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 10). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 701, 705, 689). 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 · browser-boundary.browserBoundary.<returned closure> (cognitive 19) · ×1
  • browser-boundary.browserBoundary.<returned closure> (cognitive 19) packages/daemon/src/middleware/browser-boundary.ts:285 — browser-boundary.browserBoundary.<returned closure> has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (6 pts), boolean chains 3 (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 · execution-model.stateWord (cognitive 19) · ×1
  • execution-model.stateWord (cognitive 19) packages/tui/src/execution/execution-model.ts:276 — execution-model.stateWord has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, ternaries 4 (8 pts), 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 · usage-model.usageLines (cognitive 19) · ×1
  • usage-model.usageLines (cognitive 19) packages/tui/src/usage/usage-model.ts:164 — usage-model.usageLines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · layout.rankNodes (cognitive 19) · ×1
  • layout.rankNodes (cognitive 19) packages/tui/src/topology/layout.ts:69 — layout.rankNodes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (6 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 · braille.renderBraille (cognitive 19) · ×1
  • braille.renderBraille (cognitive 19) packages/tui/src/topology/styles/braille.ts:47 — braille.renderBraille has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (7 pts), loops 3, 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 · help.helpScreen (cognitive 19) · ×1
  • help.helpScreen (cognitive 19) packages/tui/src/commands/help.ts:7 — help.helpScreen has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (16 pts), loops 2, if/else 1 (nesting depth added 7). 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 · cost-model.piHeadLine (cognitive 19) · ×1
  • cost-model.piHeadLine (cognitive 19) packages/tui/src/cost/cost-model.ts:52 — cost-model.piHeadLine has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (19 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 · health-model.healthDetailLines (cognitive 19) · ×1
  • health-model.healthDetailLines (cognitive 19) packages/tui/src/health/health-model.ts:287 — health-model.healthDetailLines has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 3, 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 · restore-input.restoreKeyAction (cognitive 19) · ×1
  • restore-input.restoreKeyAction (cognitive 19) packages/tui/src/crash-cart/restore-input.ts:33 — restore-input.restoreKeyAction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 pts), boolean chains 4 (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 · SyntaxHighlight.tokenizeJson (cognitive 19) · ×1
  • SyntaxHighlight.tokenizeJson (cognitive 19) packages/ui/src/components/markdown/SyntaxHighlight.tsx:216 — SyntaxHighlight.tokenizeJson has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (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 · SettingsSystemStatusPanel.SettingsSystemStatusPanel (cognitive 19) · ×1
  • SettingsSystemStatusPanel.SettingsSystemStatusPanel (cognitive 19) packages/ui/src/components/system/SettingsSystemStatusPanel.tsx:26 — SettingsSystemStatusPanel.SettingsSystemStatusPanel has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (19 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 · StoryGraph.StoryGraph (cognitive 19) · ×1
  • StoryGraph.StoryGraph (cognitive 19) packages/ui/src/components/project/StoryGraph.tsx:119 — StoryGraph.StoryGraph has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 5, loops 2, boolean chains 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 205, 225, 133, …). 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 · managed-blocks.mergeManagedBlockText (cognitive 18) · ×1
  • managed-blocks.mergeManagedBlockText (cognitive 18) REDACTED:88 — managed-blocks.mergeManagedBlockText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, 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 · agent-activity-store.hookEventState (cognitive 18) · ×1
  • agent-activity-store.hookEventState (cognitive 18) packages/daemon/src/domain/agent-activity-store.ts:591 — agent-activity-store.hookEventState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 2 (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 · codex-thread-id.resolveCodexDbPaths (cognitive 18) · ×1
  • codex-thread-id.resolveCodexDbPaths (cognitive 18) REDACTED:508 — codex-thread-id.resolveCodexDbPaths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2, loops 1 (nesting depth added 5). 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 · pi-readiness.judgeChargeProvenance (cognitive 18) · ×1
  • pi-readiness.judgeChargeProvenance (cognitive 18) packages/daemon/src/adapters/pi-readiness.ts:252 — pi-readiness.judgeChargeProvenance has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (7 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 · OutboxHandler.retain (cognitive 18) · ×1
  • OutboxHandler.retain (cognitive 18) packages/daemon/src/domain/outbox-handler.ts:460 — OutboxHandler.retain has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6 (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 462). 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 · ActivityGrantStore.reconcileBinding (cognitive 18) · ×1
  • ActivityGrantStore.reconcileBinding (cognitive 18) packages/daemon/src/domain/activity-grants.ts:136 — ActivityGrantStore.reconcileBinding has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 138, 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 · codex-rebuild-permissions.parseCodexPermissionEnvelope (cognitive 18) · ×1
  • codex-rebuild-permissions.parseCodexPermissionEnvelope (cognitive 18) packages/daemon/src/domain/codex-rebuild-permissions.ts:24 — codex-rebuild-permissions.parseCodexPermissionEnvelope has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, 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 · rig-repository.isStoredServices (cognitive 18) · ×1
  • rig-repository.isStoredServices (cognitive 18) packages/daemon/src/domain/rig-repository.ts:135 — rig-repository.isStoredServices has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, 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 · claude-continuation-launch.resumedClaudeArguments (cognitive 18) · ×1
  • claude-continuation-launch.resumedClaudeArguments (cognitive 18) packages/daemon/src/domain/claude-continuation-launch.ts:94 — claude-continuation-launch.resumedClaudeArguments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). 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 · seat-skill-storage.writeSeatSkillRouter (cognitive 18) · ×1
  • seat-skill-storage.writeSeatSkillRouter (cognitive 18) packages/daemon/src/domain/seat-skill-storage.ts:1223 — seat-skill-storage.writeSeatSkillRouter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 3 (5 pts), boolean chains 4, 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 · rigspec-schema.normalizePod.members (cognitive 18) · ×1
  • rigspec-schema.normalizePod.members (cognitive 18) packages/daemon/src/domain/rigspec-schema.ts:1320 — rigspec-schema.normalizePod.members has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 16, boolean chains 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 · ClaudeManagedLaunch.seatTokenLaunch (cognitive 18) · ×1
  • ClaudeManagedLaunch.seatTokenLaunch (cognitive 18) packages/daemon/src/domain/claude-managed-launch.ts:139 — ClaudeManagedLaunch.seatTokenLaunch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (4 pts), boolean chains 3, 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 · OpenShellPodmanObserver.capture (cognitive 18) · ×1
  • OpenShellPodmanObserver.capture (cognitive 18) packages/daemon/src/adapters/openshell-podman-observer.ts:38 — OpenShellPodmanObserver.capture has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, loops 2 (3 pts) (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 · ChannelCoverageStore.read (cognitive 18) · ×1
  • ChannelCoverageStore.read (cognitive 18) packages/daemon/src/domain/gateway/slack/state-store.ts:318 — ChannelCoverageStore.read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, 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 · ThreadCoverageStore.read (cognitive 18) · ×1
  • ThreadCoverageStore.read (cognitive 18) packages/daemon/src/domain/gateway/slack/state-store.ts:416 — ThreadCoverageStore.read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, 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 · inbound.ingestDecision (cognitive 18) · ×1
  • inbound.ingestDecision (cognitive 18) packages/daemon/src/domain/gateway/slack/inbound.ts:134 — inbound.ingestDecision has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8 (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 · slack-api.postChatMessage (cognitive 18) · ×1
  • slack-api.postChatMessage (cognitive 18) REDACTED:505 — slack-api.postChatMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 3 (4 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 · return-route.resolveEscalationReturnRoute (cognitive 18) · ×1
  • return-route.resolveEscalationReturnRoute (cognitive 18) packages/daemon/src/domain/return-route.ts:107 — return-route.resolveEscalationReturnRoute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (4 pts), error handling 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · markdown-address.parseMarkdownSections (cognitive 18) · ×1
  • markdown-address.parseMarkdownSections (cognitive 18) packages/daemon/src/domain/markdown-address.ts:170 — markdown-address.parseMarkdownSections has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (5 pts), loops 3 (4 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 · compose.composeMissionReview (cognitive 18) · ×1
  • compose.composeMissionReview (cognitive 18) REDACTED:1297 — compose.composeMissionReview has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, loops 3 (4 pts), ternaries 3, match/switch 1 (nesting depth added 4). 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 · SliceIndexer.findProofPacket (cognitive 18) · ×1
  • SliceIndexer.findProofPacket (cognitive 18) packages/daemon/src/domain/slices/slice-indexer.ts:1539 — SliceIndexer.findProofPacket has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 5). 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 · codex-limit-banner.detectCodexLimitBanner (cognitive 18) · ×1
  • codex-limit-banner.detectCodexLimitBanner (cognitive 18) packages/daemon/src/domain/provider/codex-limit-banner.ts:43 — codex-limit-banner.detectCodexLimitBanner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), 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 · HookBridge.poll (cognitive 18) · ×1
  • HookBridge.poll (cognitive 18) packages/daemon/src/domain/hook-bridge.ts:420 — HookBridge.poll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 4). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EnvironmentLifecycle.checkCompletions (cognitive 18) · ×1
  • EnvironmentLifecycle.checkCompletions (cognitive 18) packages/daemon/src/domain/environment-lifecycle.ts:341 — EnvironmentLifecycle.checkCompletions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (5 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TmuxAdapter.killSession (cognitive 18) · ×1
  • TmuxAdapter.killSession (cognitive 18) packages/daemon/src/adapters/tmux.ts:2169 — TmuxAdapter.killSession has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2172, 2184). 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 · terminal-policy.parseTerminalPolicy (cognitive 18) · ×1
  • terminal-policy.parseTerminalPolicy (cognitive 18) packages/daemon/src/domain/terminal-policy.ts:20 — terminal-policy.parseTerminalPolicy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · native-resume-probe.insideClaudeTrustDialog (cognitive 18) · ×1
  • native-resume-probe.insideClaudeTrustDialog (cognitive 18) packages/daemon/src/domain/native-resume-probe.ts:831 — native-resume-probe.insideClaudeTrustDialog has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, loops 2 (nesting depth added 4). 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 · fetch-with-timeout.fetchWithTimeout (cognitive 18) · ×1
  • fetch-with-timeout.fetchWithTimeout (cognitive 18) packages/cli/src/fetch-with-timeout.ts:21 — fetch-with-timeout.fetchWithTimeout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, error handling 1, 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 · daemon-lifecycle.findSiblingHome (cognitive 18) · ×1
  • daemon-lifecycle.findSiblingHome (cognitive 18) REDACTED:1108 — daemon-lifecycle.findSiblingHome has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (3 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 · archive.archiveCommand (cognitive 18) · ×1
  • archive.archiveCommand (cognitive 18) packages/cli/src/commands/archive.ts:26 — archive.archiveCommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, ternaries 1 (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 36). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · bundle-source.selectGitHubBundleSource (cognitive 18) · ×1
  • bundle-source.selectGitHubBundleSource (cognitive 18) packages/cli/src/lib/bundle-source.ts:47 — bundle-source.selectGitHubBundleSource has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), boolean chains 2, 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 · bundle.bundleInstallError (cognitive 18) · ×1
  • bundle.bundleInstallError (cognitive 18) packages/cli/src/commands/bundle.ts:32 — bundle.bundleInstallError has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 4 (7 pts), loops 3, 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 · doctor.listenerOwnerCheck (cognitive 18) · ×1
  • doctor.listenerOwnerCheck (cognitive 18) REDACTED:72 — doctor.listenerOwnerCheck has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 4, if/else 4, 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 · edge.report (cognitive 18) · ×1
  • edge.report (cognitive 18) packages/cli/src/commands/edge.ts:32 — edge.report has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · edge.edgeCommand (cognitive 18) · ×1
  • edge.edgeCommand (cognitive 18) packages/cli/src/commands/edge.ts:75 — edge.edgeCommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, ternaries 2, error handling 1 (nesting depth added 1). None of this is in the body itself: all 18 points belong to 3 function items inside it that branch (run, a function literal at line 147, a function literal at line 164). 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 · preflight.preflightCommand (cognitive 18) · ×1
  • preflight.preflightCommand (cognitive 18) packages/cli/src/commands/preflight.ts:14 — preflight.preflightCommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (nesting depth added 8). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 19). 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 · queue.withClient (cognitive 18) · ×1
  • queue.withClient (cognitive 18) packages/cli/src/commands/queue.ts:306 — queue.withClient has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 4 (6 pts), boolean chains 4, 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 · queue.emitHandoffScopeAdvisories (cognitive 18) · ×1
  • queue.emitHandoffScopeAdvisories (cognitive 18) packages/cli/src/commands/queue.ts:922 — queue.emitHandoffScopeAdvisories has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, 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 · restore-check.printCompact (cognitive 18) · ×1
  • restore-check.printCompact (cognitive 18) packages/cli/src/commands/restore-check.ts:445 — restore-check.printCompact has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (8 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 · workspace.renderHumanDoctorReport (cognitive 18) · ×1
  • workspace.renderHumanDoctorReport (cognitive 18) packages/cli/src/commands/workspace.ts:264 — workspace.renderHumanDoctorReport has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · restore-from-jsonl.findLatestJsonl (cognitive 18) · ×1
  • restore-from-jsonl.findLatestJsonl (cognitive 18) packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs:62 — restore-from-jsonl.findLatestJsonl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 1 (3 pts), loops 2 (3 pts), ternaries 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 · codex-network-default.converse (cognitive 18) · ×1
  • codex-network-default.converse (cognitive 18) packages/daemon/src/domain/codex-network-default.ts:163 — codex-network-default.converse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 6). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 183, 169, 176). 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 · ClaudeCodeAdapter.provisionContextCollector (cognitive 18) · ×1
  • ClaudeCodeAdapter.provisionContextCollector (cognitive 18) packages/daemon/src/adapters/claude-code-adapter.ts:1268 — ClaudeCodeAdapter.provisionContextCollector has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, error handling 1 (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 · cmux-transport.normalizeWorkspaceRow (cognitive 18) · ×1
  • cmux-transport.normalizeWorkspaceRow (cognitive 18) REDACTED:249 — cmux-transport.normalizeWorkspaceRow has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 3, 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 · codex-owned-plugin-trust.codexPluginContentHash · ×1
  • codex-owned-plugin-trust.codexPluginContentHash::visit (cognitive 18) packages/daemon/src/domain/codex-owned-plugin-trust.ts:31 — codex-owned-plugin-trust.codexPluginContentHash::visit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), boolean chains 3 (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 · pi-openrouter-charge.openRouterGenerationFetcher.<returned closure> (cognitive 18) · ×1
  • pi-openrouter-charge.openRouterGenerationFetcher.<returned closure> (cognitive 18) packages/daemon/src/adapters/pi-openrouter-charge.ts:62 — pi-openrouter-charge.openRouterGenerationFetcher.<returned closure> has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 2, error handling 2, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RunnerCore.handlePiLine (cognitive 18) · ×1
  • RunnerCore.handlePiLine (cognitive 18) REDACTED:1061 — RunnerCore.handlePiLine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (5 pts), boolean chains 1, 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 · pi-runner.resolveActivityEndpoint (cognitive 18) · ×1
  • pi-runner.resolveActivityEndpoint (cognitive 18) REDACTED:2004 — pi-runner.resolveActivityEndpoint has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), error handling 1 (2 pts), ternaries 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 · stub-runner.resolveStubActivityEndpoint (cognitive 18) · ×1
  • stub-runner.resolveStubActivityEndpoint (cognitive 18) REDACTED:273 — stub-runner.resolveStubActivityEndpoint has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), error handling 1 (2 pts), ternaries 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 · bundle-types.validatePluginsBlock (cognitive 18) · ×1
  • bundle-types.validatePluginsBlock (cognitive 18) packages/daemon/src/domain/bundle-types.ts:147 — bundle-types.validatePluginsBlock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 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 · bundle-types.serializeLegacyBundleManifest (cognitive 18) · ×1
  • bundle-types.serializeLegacyBundleManifest (cognitive 18) packages/daemon/src/domain/bundle-types.ts:788 — bundle-types.serializeLegacyBundleManifest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 6, ternaries 1. 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: 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 · AgentImageLibraryService.scan (cognitive 18) · ×1
  • AgentImageLibraryService.scan (cognitive 18) packages/daemon/src/domain/agent-images/agent-image-library-service.ts:77 — AgentImageLibraryService.scan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (6 pts), error handling 2 (5 pts), ternaries 1 (4 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 · agent-starter-resolver.scanForCredentials (cognitive 18) · ×1
  • agent-starter-resolver.scanForCredentials (cognitive 18) REDACTED:215 — agent-starter-resolver.scanForCredentials has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, 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 · PodRigInstantiator.launchValidatedSpec (cognitive 18) · ×1
  • PodRigInstantiator.launchValidatedSpec (cognitive 18) packages/daemon/src/domain/rigspec-instantiator.ts:1042 — PodRigInstantiator.launchValidatedSpec has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 3 (6 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 · PodRigInstantiator.persistedMember (cognitive 18) · ×1
  • PodRigInstantiator.persistedMember (cognitive 18) packages/daemon/src/domain/rigspec-instantiator.ts:2283 — PodRigInstantiator.persistedMember has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 5 (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 · PodRigInstantiator.launchExistingTerminalMember (cognitive 18) · ×1
  • PodRigInstantiator.launchExistingTerminalMember (cognitive 18) packages/daemon/src/domain/rigspec-instantiator.ts:2975 — PodRigInstantiator.launchExistingTerminalMember has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 6, error handling 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · LegacyBundleSourceResolver.resolve (cognitive 18) · ×1
  • LegacyBundleSourceResolver.resolve (cognitive 18) packages/daemon/src/domain/bundle-source-resolver.ts:39 — LegacyBundleSourceResolver.resolve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (4 pts), ternaries 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 · profile-composer.composeProfile (cognitive 18) · ×1
  • profile-composer.composeProfile (cognitive 18) packages/daemon/src/domain/context-packs/profile-composer.ts:170 — profile-composer.composeProfile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (4 pts), ternaries 2, 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 · ClaimService.bind (cognitive 18) · ×1
  • ClaimService.bind (cognitive 18) packages/daemon/src/domain/claim-service.ts:353 — ClaimService.bind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 4, boolean chains 3, 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 · ClaimService.createAndBindToPod (cognitive 18) · ×1
  • ClaimService.createAndBindToPod (cognitive 18) packages/daemon/src/domain/claim-service.ts:790 — ClaimService.createAndBindToPod has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 4, boolean chains 2, 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 · current-work.deriveRole (cognitive 18) · ×1
  • current-work.deriveRole (cognitive 18) packages/daemon/src/domain/current-work.ts:64 — current-work.deriveRole has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, ternaries 3 (6 pts), if/else 4, error handling 2 (nesting depth added 3). Of this number, 17 points are the body's own statements and 1 belongs 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 · workflow-projector.compileGate (cognitive 18) · ×1
  • workflow-projector.compileGate (cognitive 18) packages/daemon/src/domain/workflow-projector.ts:1896 — workflow-projector.compileGate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 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 · execution-view.readReviewRegistry (cognitive 18) · ×1
  • execution-view.readReviewRegistry (cognitive 18) packages/daemon/src/domain/execution-view.ts:687 — execution-view.readReviewRegistry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 3 (6 pts), error handling 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 · relay-inbound.parseInboundEnvelope (cognitive 18) · ×1
  • relay-inbound.parseInboundEnvelope (cognitive 18) packages/daemon/src/domain/gateway/relay-inbound.ts:179 — relay-inbound.parseInboundEnvelope has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, 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 · UsageWindows.runRead (cognitive 18) · ×1
  • UsageWindows.runRead (cognitive 18) packages/daemon/src/domain/provider/usage-windows.ts:171 — UsageWindows.runRead has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (5 pts), 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 · fleet-scopes.aggregateFleetScopes (cognitive 18) · ×1
  • fleet-scopes.aggregateFleetScopes (cognitive 18) packages/daemon/src/domain/hosts/fleet-scopes.ts:258 — fleet-scopes.aggregateFleetScopes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (5 pts), boolean chains 3, loops 2 (nesting depth added 5). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (worker, a function literal at line 279). 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 · NetworkInstallationStore.setParticipants (cognitive 18) · ×1
  • NetworkInstallationStore.setParticipants (cognitive 18) packages/daemon/src/domain/network/network-installations.ts:323 — NetworkInstallationStore.setParticipants has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 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 · watchdog-policy-engine.parseWatchdogSpec (cognitive 18) · ×1
  • watchdog-policy-engine.parseWatchdogSpec (cognitive 18) packages/daemon/src/domain/watchdog-policy-engine.ts:939 — watchdog-policy-engine.parseWatchdogSpec has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 3 (4 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PluginDiscoveryService.assertNoDuplicateVendoredHooks (cognitive 18) · ×1
  • PluginDiscoveryService.assertNoDuplicateVendoredHooks (cognitive 18) packages/daemon/src/domain/plugin-discovery-service.ts:437 — PluginDiscoveryService.assertNoDuplicateVendoredHooks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 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 · PluginVendorService.ensureSkillDirGlobally (cognitive 18) · ×1
  • PluginVendorService.ensureSkillDirGlobally (cognitive 18) packages/daemon/src/domain/plugin-vendor-service.ts:269 — PluginVendorService.ensureSkillDirGlobally has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mode-scheduled-end.recipientFor (cognitive 18) · ×1
  • mode-scheduled-end.recipientFor (cognitive 18) packages/daemon/src/domain/policies/mode-scheduled-end.ts:107 — mode-scheduled-end.recipientFor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (4 pts), boolean chains 1, error handling 1 (nesting depth added 3). 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: 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 · seat-cwd-preparation.planCwdPreparation (cognitive 18) · ×1
  • seat-cwd-preparation.planCwdPreparation (cognitive 18) packages/daemon/src/domain/seat-cwd-preparation.ts:26 — seat-cwd-preparation.planCwdPreparation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3, boolean chains 2, 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 · CodexInPlaceRestart.readToolTurn (cognitive 18) · ×1
  • CodexInPlaceRestart.readToolTurn (cognitive 18) packages/daemon/src/domain/seat-restart-in-place.ts:845 — CodexInPlaceRestart.readToolTurn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 1 (2 pts), ternaries 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 · usage-across-hosts.selectUsageHosts (cognitive 18) · ×1
  • usage-across-hosts.selectUsageHosts (cognitive 18) packages/daemon/src/domain/provider/usage-across-hosts.ts:230 — usage-across-hosts.selectUsageHosts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 2 (3 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 · queue-retention.pruneStreamItems (cognitive 18) · ×1
  • queue-retention.pruneStreamItems (cognitive 18) packages/daemon/src/domain/queue-retention.ts:360 — queue-retention.pruneStreamItems has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 6, boolean chains 3, loops 1 (nesting depth added 1). 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: 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 · fleet-compose.readHostComposedRig (cognitive 18) · ×1
  • fleet-compose.readHostComposedRig (cognitive 18) packages/daemon/src/domain/review/fleet-compose.ts:255 — fleet-compose.readHostComposedRig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (7 pts), boolean chains 1, 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 · runtime-switch-materials.planRuntimeSwitchMaterials.prepare (cognitive 18) · ×1
  • runtime-switch-materials.planRuntimeSwitchMaterials.prepare (cognitive 18) packages/daemon/src/domain/runtime-switch-materials.ts:187 — runtime-switch-materials.planRuntimeSwitchMaterials.prepare has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 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 · herdr-viewer.findAttributedViewerPanes (cognitive 18) · ×1
  • herdr-viewer.findAttributedViewerPanes (cognitive 18) packages/daemon/src/domain/terminal/herdr-viewer.ts:71 — herdr-viewer.findAttributedViewerPanes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, 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 · scope-task-terminal-view.readScopeIndex (cognitive 18) · ×1
  • scope-task-terminal-view.readScopeIndex (cognitive 18) packages/daemon/src/domain/terminal/scope-task-terminal-view.ts:23 — scope-task-terminal-view.readScopeIndex has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17 (39 pts), error handling 5 (10 pts), boolean chains 8, ternaries 6 (8 pts), loops 5 (6 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. This shape REPEATS in the file: one other method here (scope-task-terminal-view.readScopeIndex::add) 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 · activity.evidenceFromHookActivity (cognitive 18) · ×1
  • activity.evidenceFromHookActivity (cognitive 18) packages/daemon/src/routes/activity.ts:40 — activity.evidenceFromHookActivity has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 4, if/else 3, match/switch 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 · startup.observeSeat (cognitive 18) · ×1
  • startup.observeSeat (cognitive 18) packages/daemon/src/routes/startup.ts:196 — startup.observeSeat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (5 pts), boolean chains 4, 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 · workflow-model.actionLines (cognitive 18) · ×1
  • workflow-model.actionLines (cognitive 18) packages/tui/src/execution/workflow-model.ts:174 — workflow-model.actionLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (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 · execution-model.executionSliceStripLines (cognitive 18) · ×1
  • execution-model.executionSliceStripLines (cognitive 18) packages/tui/src/execution/execution-model.ts:853 — execution-model.executionSliceStripLines has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 5, if/else 2 (nesting depth added 2). 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: 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-marks.clawdFaithfulRows (cognitive 18) · ×1
  • runtime-marks.clawdFaithfulRows (cognitive 18) packages/tui/src/topology/runtime-marks.ts:50 — runtime-marks.clawdFaithfulRows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). 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 into named stages: move each independent step or branch 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.findAgentBySession (cognitive 18) · ×1
  • state.findAgentBySession (cognitive 18) packages/tui/src/state.ts:487 — state.findAgentBySession has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 10). 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 · cost-model.detailLines (cognitive 18) · ×1
  • cost-model.detailLines (cognitive 18) packages/tui/src/cost/cost-model.ts:111 — cost-model.detailLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (7 pts), boolean chains 3 (nesting depth added 6). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render.effortSavedText (cognitive 18) · ×1
  • render.effortSavedText (cognitive 18) packages/tui/src/render.ts:184 — render.effortSavedText has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 6 (8 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 · live.createLiveRefresh.readPage (cognitive 18) · ×1
  • live.createLiveRefresh.readPage (cognitive 18) packages/tui/src/live.ts:138 — live.createLiveRefresh.readPage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, 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 · main.run (cognitive 18) · ×1
  • main.run (cognitive 18) packages/tui/src/main.ts:55 — main.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 132 (253 pts), boolean chains 69, ternaries 24 (46 pts), error handling 5 (8 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 148). To reduce it, split the body into named stages: move each independent 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: 3 other methods here (main.run::draw, main.run::executeAct, main.run::handleInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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 · hybrid-layout.layoutHybridRig (cognitive 18) · ×1
  • hybrid-layout.layoutHybridRig (cognitive 18) packages/ui/src/lib/hybrid-layout.ts:122 — hybrid-layout.layoutHybridRig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 6 (7 pts), boolean chains 2 (nesting depth added 5). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostMultiRigGraph.HostMultiRigGraph (cognitive 18) · ×1
  • HostMultiRigGraph.HostMultiRigGraph (cognitive 18) packages/ui/src/components/topology/HostMultiRigGraph.tsx:87 — HostMultiRigGraph.HostMultiRigGraph has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 4, boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function items inside it that branch (onNodeClick, a function literal at line 134, a function literal at line 272, …). 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 · ScopePages.HostScopePage (cognitive 18) · ×1
  • ScopePages.HostScopePage (cognitive 18) packages/ui/src/components/topology/ScopePages.tsx:129 — ScopePages.HostScopePage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (10 pts), boolean chains 8 (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 · ScopePages.RigOverviewTab (cognitive 18) · ×1
  • ScopePages.RigOverviewTab (cognitive 18) packages/ui/src/components/topology/ScopePages.tsx:351 — ScopePages.RigOverviewTab has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 3, 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 · useScopeMarkdown.useScopeMarkdown (cognitive 18) · ×1
  • useScopeMarkdown.useScopeMarkdown (cognitive 18) packages/ui/src/hooks/useScopeMarkdown.ts:115 — useScopeMarkdown.useScopeMarkdown has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, ternaries 5 (6 pts), boolean chains 4 (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 · ScopePages.WorkspaceScopePage (cognitive 18) · ×1
  • ScopePages.WorkspaceScopePage (cognitive 18) packages/ui/src/components/project/ScopePages.tsx:697 — ScopePages.WorkspaceScopePage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 5, if/else 1 (nesting depth added 1). 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: 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 · FleetPage.FleetPage (cognitive 18) · ×1
  • FleetPage.FleetPage (cognitive 18) packages/ui/src/components/review/FleetPage.tsx:150 — FleetPage.FleetPage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11 (15 pts), if/else 2, boolean chains 1 (nesting depth added 4). Of this number, 10 points are the body's own statements and 8 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 · follow (cognitive 18) · ×1
  • follow (cognitive 18) packages/daemon/assets/herdr-app/mods/rig-strip/main.js:105 — follow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, other 2, loops 1, 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 · AgentActivityStore.getRunnerObservation (cognitive 17) · ×1
  • AgentActivityStore.getRunnerObservation (cognitive 17) packages/daemon/src/domain/agent-activity-store.ts:269 — AgentActivityStore.getRunnerObservation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 2, error handling 1. 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: 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 · AgentActivityStore.findCompactSessionStart (cognitive 17) · ×1
  • AgentActivityStore.findCompactSessionStart (cognitive 17) packages/daemon/src/domain/agent-activity-store.ts:317 — AgentActivityStore.findCompactSessionStart has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 4). Of this number, 12 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 · SettingsStore.resolveOneUnpaired (cognitive 17) · ×1
  • SettingsStore.resolveOneUnpaired (cognitive 17) packages/daemon/src/domain/user-settings/settings-store.ts:1269 — SettingsStore.resolveOneUnpaired has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 2 (6 pts), error handling 2 (4 pts), if/else 3 (4 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 · startup-validation.validateStartupBlock (cognitive 17) · ×1
  • startup-validation.validateStartupBlock (cognitive 17) packages/daemon/src/domain/startup-validation.ts:120 — startup-validation.validateStartupBlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · seat-skill-storage.rehydrateSeatSkills (cognitive 17) · ×1
  • seat-skill-storage.rehydrateSeatSkills (cognitive 17) packages/daemon/src/domain/seat-skill-storage.ts:274 — seat-skill-storage.rehydrateSeatSkills has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 3 (7 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 · seat-skill-storage.recordedSeatSkillFiles (cognitive 17) · ×1
  • seat-skill-storage.recordedSeatSkillFiles (cognitive 17) packages/daemon/src/domain/seat-skill-storage.ts:920 — seat-skill-storage.recordedSeatSkillFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (4 pts), boolean chains 3, 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 · rigspec-schema.validateCrossPodEdge (cognitive 17) · ×1
  • rigspec-schema.validateCrossPodEdge (cognitive 17) packages/daemon/src/domain/rigspec-schema.ts:899 — rigspec-schema.validateCrossPodEdge has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5 (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 · human-registry.projectHumans (cognitive 17) · ×1
  • human-registry.projectHumans (cognitive 17) packages/daemon/src/domain/gateway/human-registry.ts:362 — human-registry.projectHumans has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 1 (3 pts), ternaries 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). 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 · parked-owner-consumer.changedSince (cognitive 17) · ×1
  • parked-owner-consumer.changedSince (cognitive 17) packages/daemon/src/domain/policies/parked-owner-consumer.ts:158 — parked-owner-consumer.changedSince has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · markdown-address.validateMarkdownAddressability (cognitive 17) · ×1
  • markdown-address.validateMarkdownAddressability (cognitive 17) packages/daemon/src/domain/markdown-address.ts:254 — markdown-address.validateMarkdownAddressability has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), boolean chains 3 (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 · QueueWakeRepository.getStatus (cognitive 17) · ×1
  • QueueWakeRepository.getStatus (cognitive 17) packages/daemon/src/domain/queue-wake-repository.ts:100 — QueueWakeRepository.getStatus has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), ternaries 4 (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 · QueueRepository.classifyOwnerNotification (cognitive 17) · ×1
  • QueueRepository.classifyOwnerNotification (cognitive 17) packages/daemon/src/domain/queue-repository.ts:1435 — QueueRepository.classifyOwnerNotification has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 2 (5 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 · QueueRepository.deliverWakeIntent · ×1
  • QueueRepository.deliverWakeIntent::claim (cognitive 17) packages/daemon/src/domain/queue-repository.ts:1709 — QueueRepository.deliverWakeIntent::claim has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, ternaries 1 (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. This shape REPEATS in the file: one other method here (QueueRepository.deliverWakeIntent) 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 · QueueRepository.listRows (cognitive 17) · ×1
  • QueueRepository.listRows (cognitive 17) packages/daemon/src/domain/queue-repository.ts:5110 — QueueRepository.listRows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, ternaries 6 (7 pts), boolean chains 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 · StartupOrchestrator.fail (cognitive 17) · ×1
  • StartupOrchestrator.fail (cognitive 17) packages/daemon/src/domain/startup-orchestrator.ts:1121 — StartupOrchestrator.fail has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 3, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · session-transport.styledLines (cognitive 17) · ×1
  • session-transport.styledLines (cognitive 17) packages/daemon/src/domain/session-transport.ts:704 — session-transport.styledLines has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 7). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 706). 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 · ClaudeCompactionEnforcer.observedCompaction (cognitive 17) · ×1
  • ClaudeCompactionEnforcer.observedCompaction (cognitive 17) packages/daemon/src/domain/claude-compaction-enforcer.ts:895 — ClaudeCompactionEnforcer.observedCompaction has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 7, 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 · ClaudeCompactionEnforcer.recordRestoreFailure (cognitive 17) · ×1
  • ClaudeCompactionEnforcer.recordRestoreFailure (cognitive 17) packages/daemon/src/domain/claude-compaction-enforcer.ts:1117 — ClaudeCompactionEnforcer.recordRestoreFailure has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11, boolean chains 5, if/else 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 · check-runner.launch (cognitive 17) · ×1
  • check-runner.launch (cognitive 17) docs/reference/runner-conformance/check-runner.mjs:182 — check-runner.launch has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 11, if/else 4, error handling 1, ternaries 1. Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 225, 229, 232, …). 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 · fake-acp-agent.prompt (cognitive 17) · ×1
  • fake-acp-agent.prompt (cognitive 17) docs/reference/runner-conformance/fake-acp-agent.mjs:65 — fake-acp-agent.prompt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (4 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 · fake-acp-agent.handle (cognitive 17) · ×1
  • fake-acp-agent.handle (cognitive 17) docs/reference/runner-conformance/fake-acp-agent.mjs:112 — fake-acp-agent.handle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigStore.resolveOneUnpaired (cognitive 17) · ×1
  • ConfigStore.resolveOneUnpaired (cognitive 17) packages/cli/src/config-store.ts:1655 — ConfigStore.resolveOneUnpaired has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 2 (6 pts), error handling 2 (4 pts), if/else 3 (4 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 · DaemonClient.fetch (cognitive 17) · ×1
  • DaemonClient.fetch (cognitive 17) REDACTED:393 — DaemonClient.fetch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (6 pts), boolean chains 2, 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 · ps.modelLines (cognitive 17) · ×1
  • ps.modelLines (cognitive 17) packages/cli/src/commands/ps.ts:689 — ps.modelLines has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 8). Of this number, 14 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 · agent.agentCommand (cognitive 17) · ×1
  • agent.agentCommand (cognitive 17) REDACTED:19 — agent.agentCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 3). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 31). 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 · host-bindings.loadHostBindings (cognitive 17) · ×1
  • host-bindings.loadHostBindings (cognitive 17) packages/cli/src/host-bindings.ts:46 — host-bindings.loadHostBindings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, error handling 1, loops 1 (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 · cross-host-target.resolveCrossHostTarget (cognitive 17) · ×1
  • cross-host-target.resolveCrossHostTarget (cognitive 17) packages/cli/src/cross-host-target.ts:60 — cross-host-target.resolveCrossHostTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 4 (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 · compact-plan.printHuman (cognitive 17) · ×1
  • compact-plan.printHuman (cognitive 17) packages/cli/src/commands/compact-plan.ts:391 — compact-plan.printHuman has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (6 pts), if/else 5, ternaries 2 (5 pts), boolean chains 1 (nesting depth added 6). Of this number, 15 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 · heartbeat.printHumanHeartbeat (cognitive 17) · ×1
  • heartbeat.printHumanHeartbeat (cognitive 17) packages/cli/src/commands/heartbeat.ts:480 — heartbeat.printHumanHeartbeat has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (10 pts), loops 2 (4 pts), if/else 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 · queue.queueReadTarget (cognitive 17) · ×1
  • queue.queueReadTarget (cognitive 17) packages/cli/src/commands/queue.ts:592 — queue.queueReadTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (6 pts), boolean chains 3 (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 · restore-check.printHuman (cognitive 17) · ×1
  • restore-check.printHuman (cognitive 17) packages/cli/src/commands/restore-check.ts:386 — restore-check.printHuman has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 5 (6 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 · scope.buildSliceMoveCommand (cognitive 17) · ×1
  • scope.buildSliceMoveCommand (cognitive 17) packages/cli/src/commands/scope.ts:827 — scope.buildSliceMoveCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4, boolean chains 3, error handling 2 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 834, 852). 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 · start.lastStopState (cognitive 17) · ×1
  • start.lastStopState (cognitive 17) packages/cli/src/commands/start.ts:76 — start.lastStopState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workspace.workspaceCommand (cognitive 17) · ×1
  • workspace.workspaceCommand (cognitive 17) packages/cli/src/commands/workspace.ts:74 — workspace.workspaceCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, error handling 1 (nesting depth added 1). None of this is in the body itself: all 17 points belong to 3 function literals inside it that branch (lines 170, 122, 99). 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 · restore-from-jsonl.discoverDocs (cognitive 17) · ×1
  • restore-from-jsonl.discoverDocs (cognitive 17) packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs:225 — restore-from-jsonl.discoverDocs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), 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 · CodexRuntimeAdapter.captureFreshThreadId (cognitive 17) · ×1
  • CodexRuntimeAdapter.captureFreshThreadId (cognitive 17) packages/daemon/src/adapters/codex-runtime-adapter.ts:1786 — CodexRuntimeAdapter.captureFreshThreadId has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PiResumeAdapter.verifyResume (cognitive 17) · ×1
  • PiResumeAdapter.verifyResume (cognitive 17) packages/daemon/src/adapters/pi-resume.ts:204 — PiResumeAdapter.verifyResume has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LegacyRigSpecCodec.serialize (cognitive 17) · ×1
  • LegacyRigSpecCodec.serialize (cognitive 17) packages/daemon/src/domain/rigspec-codec.ts:245 — LegacyRigSpecCodec.serialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1. None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 250). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · bundle-agent-images-router.routeAgentImages (cognitive 17) · ×1
  • bundle-agent-images-router.routeAgentImages (cognitive 17) packages/daemon/src/domain/bundle-agent-images-router.ts:101 — bundle-agent-images-router.routeAgentImages 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 · project-read.workSource (cognitive 17) · ×1
  • project-read.workSource (cognitive 17) packages/daemon/src/domain/workspace/project-read.ts:23 — project-read.workSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 1 (3 pts), boolean chains 2, 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 · WorkflowInstanceStore.updateFrontier (cognitive 17) · ×1
  • WorkflowInstanceStore.updateFrontier (cognitive 17) packages/daemon/src/domain/workflow-instance-store.ts:387 — WorkflowInstanceStore.updateFrontier has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (7 pts), if/else 6, boolean chains 4 (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 · restore-plan-preview.tokenStateFor (cognitive 17) · ×1
  • restore-plan-preview.tokenStateFor (cognitive 17) packages/daemon/src/domain/restore-plan-preview.ts:107 — restore-plan-preview.tokenStateFor has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), 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 · shared-conversation.compareConversations (cognitive 17) · ×1
  • shared-conversation.compareConversations (cognitive 17) packages/daemon/src/domain/shared-conversation.ts:54 — shared-conversation.compareConversations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 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 · RestoreOrchestrator.postLaunchRestore · ×1
  • RestoreOrchestrator.postLaunchRestore::effortForRestore (cognitive 17) packages/daemon/src/domain/restore-orchestrator.ts:1967 — RestoreOrchestrator.postLaunchRestore::effortForRestore has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 2 (3 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. This shape REPEATS in the file: one other method here (RestoreOrchestrator.postLaunchRestore) 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 · attention-aggregator.readHostAttention (cognitive 17) · ×1
  • attention-aggregator.readHostAttention (cognitive 17) packages/daemon/src/domain/feed/attention-aggregator.ts:57 — attention-aggregator.readHostAttention has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 5 (6 pts), boolean chains 1, 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 · transport.connectGateway (cognitive 17) · ×1
  • transport.connectGateway (cognitive 17) packages/daemon/src/domain/gateway/transport.ts:49 — transport.connectGateway has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 8). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 62). 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 · HumanModeService.endAvailability (cognitive 17) · ×1
  • HumanModeService.endAvailability (cognitive 17) packages/daemon/src/domain/gateway/human-operating-modes.ts:351 — HumanModeService.endAvailability has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 2 (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 · slack-subsystem.buildSlackGatewayWire.personRootChannel (cognitive 17) · ×1
  • slack-subsystem.buildSlackGatewayWire.personRootChannel (cognitive 17) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:573 — slack-subsystem.buildSlackGatewayWire.personRootChannel has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · health-detectors.selectContextEpisodeEvidence (cognitive 17) · ×1
  • health-detectors.selectContextEpisodeEvidence (cognitive 17) packages/daemon/src/domain/health-detectors.ts:324 — health-detectors.selectContextEpisodeEvidence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 4, loops 4, ternaries 2 (3 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 · kernel-boot.bootKernelIfNeeded (cognitive 17) · ×1
  • kernel-boot.bootKernelIfNeeded (cognitive 17) packages/daemon/src/domain/kernel-boot.ts:79 — kernel-boot.bootKernelIfNeeded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (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 · session-jsonl.readLinesBackwards (cognitive 17) · ×1
  • session-jsonl.readLinesBackwards (cognitive 17) packages/daemon/src/domain/session-jsonl.ts:59 — session-jsonl.readLinesBackwards has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 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 · CodexInPlaceRestart.stopUnderShell (cognitive 17) · ×1
  • CodexInPlaceRestart.stopUnderShell (cognitive 17) packages/daemon/src/domain/seat-restart-in-place.ts:651 — CodexInPlaceRestart.stopUnderShell has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (gone, wait, a function literal at line 674). 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 · SeatLifecycleService.continueStartupUnchecked (cognitive 17) · ×1
  • SeatLifecycleService.continueStartupUnchecked (cognitive 17) packages/daemon/src/domain/seat-lifecycle-service.ts:1389 — SeatLifecycleService.continueStartupUnchecked has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 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 · ProviderAccountReadingsStore.prune (cognitive 17) · ×1
  • ProviderAccountReadingsStore.prune (cognitive 17) packages/daemon/src/domain/provider/provider-account-readings.ts:114 — ProviderAccountReadingsStore.prune has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 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 · freeze.mediaBlock (cognitive 17) · ×1
  • freeze.mediaBlock (cognitive 17) packages/daemon/src/domain/review/freeze.ts:87 — freeze.mediaBlock has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 7). 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 · RigSpecExporter.memberStartupSource (cognitive 17) · ×1
  • RigSpecExporter.memberStartupSource (cognitive 17) packages/daemon/src/domain/rigspec-exporter.ts:63 — RigSpecExporter.memberStartupSource has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 2. Of this number, 15 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.
D2 · Cognitive Complexity · skill-audit.isSelfReferential (cognitive 17) · ×1
  • skill-audit.isSelfReferential (cognitive 17) packages/daemon/src/domain/skill-audit.ts:53 — skill-audit.isSelfReferential has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 7, error handling 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 · HerdrAppProvider.openPending (cognitive 17) · ×1
  • HerdrAppProvider.openPending (cognitive 17) packages/daemon/src/domain/terminal/herdr-app-provider.ts:544 — HerdrAppProvider.openPending has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, 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 · TerminalService.resolveComposed (cognitive 17) · ×1
  • TerminalService.resolveComposed (cognitive 17) packages/daemon/src/domain/terminal/terminal-service.ts:369 — TerminalService.resolveComposed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · activity.bindToGrant (cognitive 17) · ×1
  • activity.bindToGrant (cognitive 17) packages/daemon/src/routes/activity.ts:219 — activity.bindToGrant has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 6, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · activity.piUsageRequest (cognitive 17) · ×1
  • activity.piUsageRequest (cognitive 17) packages/daemon/src/routes/activity.ts:288 — activity.piUsageRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 1, 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 · bundles.extractInstallTimeMetadata (cognitive 17) · ×1
  • bundles.extractInstallTimeMetadata (cognitive 17) packages/daemon/src/routes/bundles.ts:122 — bundles.extractInstallTimeMetadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, error handling 1 (2 pts), ternaries 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, 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 · down.downRoutes.post("/") (cognitive 17) · ×1
  • down.downRoutes.post("/") (cognitive 17) packages/daemon/src/routes/down.ts:23 — down.downRoutes.post("/") has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, ternaries 2, 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 · seat.seatRoutes.post("/handover/ · ×1
  • seat.seatRoutes.post("/handover/:seatRef") (cognitive 17) packages/daemon/src/routes/seat.ts:385 — seat.seatRoutes.post("/handover/:seatRef") has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 4 (5 pts), boolean chains 4 (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 · config-model.configContentLines (cognitive 17) · ×1
  • config-model.configContentLines (cognitive 17) packages/tui/src/config/config-model.ts:191 — config-model.configContentLines has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 8 (nesting depth added 4). Of this number, 15 points are the body's own statements and 2 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 · detail.wrapDetailLines (cognitive 17) · ×1
  • detail.wrapDetailLines (cognitive 17) packages/tui/src/detail.ts:35 — detail.wrapDetailLines has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (5 pts), ternaries 3 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 43, 39). 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 · project-mission-state.reconcileMissionStatus (cognitive 17) · ×1
  • project-mission-state.reconcileMissionStatus (cognitive 17) packages/ui/src/lib/project-mission-state.ts:123 — project-mission-state.reconcileMissionStatus has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 4 (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 · SubscriptionToggleList.SubscriptionToggleList (cognitive 17) · ×1
  • SubscriptionToggleList.SubscriptionToggleList (cognitive 17) packages/ui/src/components/for-you/SubscriptionToggleList.tsx:65 — SubscriptionToggleList.SubscriptionToggleList has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 4 (nesting depth added 4). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 83, 153, 114). 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 · LaunchRecoveryModal.LaunchRecoveryModal (cognitive 17) · ×1
  • LaunchRecoveryModal.LaunchRecoveryModal (cognitive 17) packages/ui/src/components/LaunchRecoveryModal.tsx:105 — LaunchRecoveryModal.LaunchRecoveryModal has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 2, if/else 2 (nesting depth added 4). Of this number, 13 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 · migrate-telemetry-state-0.5.9.treeSnapshot (cognitive 17) · ×1
  • migrate-telemetry-state-0.5.9.treeSnapshot (cognitive 17) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:95 — migrate-telemetry-state-0.5.9.treeSnapshot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 3 of the 17 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 · migrate-telemetry-state-0.5.9.verify (cognitive 17) · ×1
  • migrate-telemetry-state-0.5.9.verify (cognitive 17) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:783 — migrate-telemetry-state-0.5.9.verify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2, ternaries 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 · refresh-managed-plugin.classify (cognitive 17) · ×1
  • refresh-managed-plugin.classify (cognitive 17) skills/_canonical/core/openrig-upgrade/scripts/refresh-managed-plugin.mjs:62 — refresh-managed-plugin.classify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. 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 · connection-contract.readWakeOutcome (cognitive 16) · ×1
  • connection-contract.readWakeOutcome (cognitive 16) packages/daemon/src/domain/connection-contract.ts:160 — connection-contract.readWakeOutcome has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 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 · claude-credential-precedence.projectRootForLocalSettings (cognitive 16) · ×1
  • claude-credential-precedence.projectRootForLocalSettings (cognitive 16) packages/daemon/src/domain/claude-credential-precedence.ts:78 — claude-credential-precedence.projectRootForLocalSettings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 2 (6 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexThreadIdResolver.resolveInternal (cognitive 16) · ×1
  • CodexThreadIdResolver.resolveInternal (cognitive 16) REDACTED:203 — CodexThreadIdResolver.resolveInternal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 4). Of this number, 15 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 · native-process-arguments.readNativeProcessLaunch (cognitive 16) · ×1
  • native-process-arguments.readNativeProcessLaunch (cognitive 16) packages/daemon/src/domain/native-process-arguments.ts:187 — native-process-arguments.readNativeProcessLaunch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 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 · native-process-lineage.claudeHookFromLaunchedProcess (cognitive 16) · ×1
  • native-process-lineage.claudeHookFromLaunchedProcess (cognitive 16) packages/daemon/src/domain/native-process-lineage.ts:885 — native-process-lineage.claudeHookFromLaunchedProcess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 1 (3 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 · OutboxHandler.record (cognitive 16) · ×1
  • OutboxHandler.record (cognitive 16) packages/daemon/src/domain/outbox-handler.ts:405 — OutboxHandler.record 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 · session-name.validateSessionComponents (cognitive 16) · ×1
  • session-name.validateSessionComponents (cognitive 16) packages/daemon/src/domain/session-name.ts:70 — session-name.validateSessionComponents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SeatDeliveryGuard.operation (cognitive 16) · ×1
  • SeatDeliveryGuard.operation (cognitive 16) packages/daemon/src/domain/seat-delivery-guard.ts:290 — SeatDeliveryGuard.operation has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 5, if/else 4 (5 pts) (nesting depth added 4). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 297). 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 · rig-repository.isStoredContinuityPolicy (cognitive 16) · ×1
  • rig-repository.isStoredContinuityPolicy (cognitive 16) packages/daemon/src/domain/rig-repository.ts:106 — rig-repository.isStoredContinuityPolicy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 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 · agent-manifest.validateLifecycle (cognitive 16) · ×1
  • agent-manifest.validateLifecycle (cognitive 16) packages/daemon/src/domain/agent-manifest.ts:75 — agent-manifest.validateLifecycle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 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.
D2 · Cognitive Complexity · skill-discovery.findNamedSkillsForRuntime (cognitive 16) · ×1
  • skill-discovery.findNamedSkillsForRuntime (cognitive 16) packages/daemon/src/domain/skill-discovery.ts:228 — skill-discovery.findNamedSkillsForRuntime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 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 · profile-resolver.resolveProfileUses (cognitive 16) · ×1
  • profile-resolver.resolveProfileUses (cognitive 16) packages/daemon/src/domain/profile-resolver.ts:533 — profile-resolver.resolveProfileUses has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (3 pts), boolean chains 2, 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 · ClaudeManagedLaunch.seatEnvKeys (cognitive 16) · ×1
  • ClaudeManagedLaunch.seatEnvKeys (cognitive 16) packages/daemon/src/domain/claude-managed-launch.ts:100 — ClaudeManagedLaunch.seatEnvKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (5 pts), loops 3 (5 pts), boolean chains 3, error handling 2 (3 pts) (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 · startup-proof.orientedFromRows (cognitive 16) · ×1
  • startup-proof.orientedFromRows (cognitive 16) packages/daemon/src/domain/startup-proof.ts:239 — startup-proof.orientedFromRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (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 · scope-view-projection.fmList (cognitive 16) · ×1
  • scope-view-projection.fmList (cognitive 16) REDACTED:87 — scope-view-projection.fmList has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (2 pts), boolean chains 1, error handling 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 · scope-view-projection.projectSliceScope (cognitive 16) · ×1
  • scope-view-projection.projectSliceScope (cognitive 16) REDACTED:230 — scope-view-projection.projectSliceScope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, loops 1 (2 pts), 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 · codex-limit-banner.recordCodexLimitBanner (cognitive 16) · ×1
  • codex-limit-banner.recordCodexLimitBanner (cognitive 16) packages/daemon/src/domain/provider/codex-limit-banner.ts:143 — codex-limit-banner.recordCodexLimitBanner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, ternaries 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 · execution-candidate-reader.readRowsCooperatively (cognitive 16) · ×1
  • execution-candidate-reader.readRowsCooperatively (cognitive 16) packages/daemon/src/domain/execution-candidate-reader.ts:37 — execution-candidate-reader.readRowsCooperatively has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (5 pts), error handling 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 · RunnerPermissions.submit (cognitive 16) · ×1
  • RunnerPermissions.submit (cognitive 16) packages/daemon/src/domain/runner-permissions.ts:174 — RunnerPermissions.submit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 6 (7 pts), boolean chains 2 (nesting depth added 2). Of this number, 14 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 · QueueRepository.decisionRevision (cognitive 16) · ×1
  • QueueRepository.decisionRevision (cognitive 16) packages/daemon/src/domain/queue-repository.ts:4759 — QueueRepository.decisionRevision has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 4, if/else 1 (2 pts), loops 1 (nesting depth added 3). Of this number, 14 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 · session-transport.boxHoldsText (cognitive 16) · ×1
  • session-transport.boxHoldsText (cognitive 16) packages/daemon/src/domain/session-transport.ts:1613 — session-transport.boxHoldsText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TmuxAdapter.scopeStartOutcome (cognitive 16) · ×1
  • TmuxAdapter.scopeStartOutcome (cognitive 16) packages/daemon/src/adapters/tmux.ts:1204 — TmuxAdapter.scopeStartOutcome has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (5 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 · native-resume-probe.claudeCurrentRows (cognitive 16) · ×1
  • native-resume-probe.claudeCurrentRows (cognitive 16) packages/daemon/src/domain/native-resume-probe.ts:652 — native-resume-probe.claudeCurrentRows has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 2 (4 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 3). Of this number, 12 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 · JsonRpcPeer.receive (cognitive 16) · ×1
  • JsonRpcPeer.receive (cognitive 16) packages/cli/src/acp/json-rpc-stdio.ts:86 — JsonRpcPeer.receive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · ps.compactNodeProjection (cognitive 16) · ×1
  • ps.compactNodeProjection (cognitive 16) packages/cli/src/commands/ps.ts:749 — ps.compactNodeProjection has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 6, boolean chains 2 (nesting depth added 1). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 750). 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 · send.classifyDeliveryEffect (cognitive 16) · ×1
  • send.classifyDeliveryEffect (cognitive 16) packages/cli/src/commands/send.ts:691 — send.classifyDeliveryEffect has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 5, ternaries 3 (5 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · capture.runHttpHostCapture (cognitive 16) · ×1
  • capture.runHttpHostCapture (cognitive 16) packages/cli/src/commands/capture.ts:378 — capture.runHttpHostCapture has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (4 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.
D2 · Cognitive Complexity · provider-auth.checkCodexAuth (cognitive 16) · ×1
  • provider-auth.checkCodexAuth (cognitive 16) packages/cli/src/provider-auth.ts:78 — provider-auth.checkCodexAuth has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 1 (4 pts), error handling 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 · policy.applyToSeat (cognitive 16) · ×1
  • policy.applyToSeat (cognitive 16) packages/cli/src/commands/policy.ts:147 — policy.applyToSeat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3 (5 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 · DecisionRun.questions (cognitive 16) · ×1
  • DecisionRun.questions (cognitive 16) packages/cli/src/decisions/decisions.ts:287 — DecisionRun.questions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 1 (3 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 · seat.printClaudeAutoMode (cognitive 16) · ×1
  • seat.printClaudeAutoMode (cognitive 16) packages/cli/src/commands/seat.ts:252 — seat.printClaudeAutoMode has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (12 pts), loops 2, boolean chains 1, if/else 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 · seat.printRestartReport (cognitive 16) · ×1
  • seat.printRestartReport (cognitive 16) packages/cli/src/commands/seat.ts:2063 — seat.printRestartReport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, ternaries 2 (3 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 · start.multiSelectPicker (cognitive 16) · ×1
  • start.multiSelectPicker (cognitive 16) packages/cli/src/commands/start.ts:105 — start.multiSelectPicker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 2). None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 144, 115, 111). 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 · affected-skills.expandChangedSurface (cognitive 16) · ×1
  • affected-skills.expandChangedSurface (cognitive 16) packages/cli/src/release-surface/affected-skills.ts:46 — affected-skills.expandChangedSurface has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 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 · activity-relay.claudeLimitResetAt (cognitive 16) · ×1
  • activity-relay.claudeLimitResetAt (cognitive 16) REDACTED:177 — activity-relay.claudeLimitResetAt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7 (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 · refocus.readConfiguredContent (cognitive 16) · ×1
  • refocus.readConfiguredContent (cognitive 16) packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs:85 — refocus.readConfiguredContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (4 pts), boolean chains 3 (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 · ClaudeCodeAdapter.provisionClaudeState (cognitive 16) · ×1
  • ClaudeCodeAdapter.provisionClaudeState (cognitive 16) packages/daemon/src/adapters/claude-code-adapter.ts:1187 — ClaudeCodeAdapter.provisionClaudeState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, loops 1 (2 pts), 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 · claude-code-adapter.readClaudeSelfReportEvidence (cognitive 16) · ×1
  • claude-code-adapter.readClaudeSelfReportEvidence (cognitive 16) packages/daemon/src/adapters/claude-code-adapter.ts:1504 — claude-code-adapter.readClaudeSelfReportEvidence has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (3 pts), boolean chains 2, loops 1, 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 · codex-profile-preflight.verifyCodexProfileLoads (cognitive 16) · ×1
  • codex-profile-preflight.verifyCodexProfileLoads (cognitive 16) packages/daemon/src/domain/codex-profile-preflight.ts:16 — codex-profile-preflight.verifyCodexProfileLoads has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (13 pts), boolean chains 2, error handling 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 · StubRuntimeAdapter.checkReady (cognitive 16) · ×1
  • StubRuntimeAdapter.checkReady (cognitive 16) packages/daemon/src/adapters/stub-runtime-adapter.ts:216 — StubRuntimeAdapter.checkReady has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), 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 · StubRuntimeAdapter.projectEntry (cognitive 16) · ×1
  • StubRuntimeAdapter.projectEntry (cognitive 16) packages/daemon/src/adapters/stub-runtime-adapter.ts:295 — StubRuntimeAdapter.projectEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 1 (3 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentImageLibraryService.readImageEntry (cognitive 16) · ×1
  • AgentImageLibraryService.readImageEntry (cognitive 16) packages/daemon/src/domain/agent-images/agent-image-library-service.ts:215 — AgentImageLibraryService.readImageEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), error handling 3 (4 pts), boolean chains 3, ternaries 3 (nesting depth added 2). 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, 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 · rigspec-preflight.permissionPolicyDiscoveryWarnings (cognitive 16) · ×1
  • rigspec-preflight.permissionPolicyDiscoveryWarnings (cognitive 16) packages/daemon/src/domain/rigspec-preflight.ts:233 — rigspec-preflight.permissionPolicyDiscoveryWarnings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (3 pts), 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 · bundle-behaviour-inspect.inspectBundleBehaviour · ×1
  • bundle-behaviour-inspect.inspectBundleBehaviour::walk (cognitive 16) packages/daemon/src/domain/bundle-behaviour-inspect.ts:14 — bundle-behaviour-inspect.inspectBundleBehaviour::walk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 1 (2 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 · workflow-reconciliation.reviseGraph (cognitive 16) · ×1
  • workflow-reconciliation.reviseGraph (cognitive 16) packages/daemon/src/domain/workflow-reconciliation.ts:210 — workflow-reconciliation.reviseGraph has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 226). 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 · MissionControlWriteContract.act (cognitive 16) · ×1
  • MissionControlWriteContract.act (cognitive 16) packages/daemon/src/domain/mission-control/mission-control-write-contract.ts:163 — MissionControlWriteContract.act has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 5 (6 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 · KernelBootTracker.getStatus (cognitive 16) · ×1
  • KernelBootTracker.getStatus (cognitive 16) packages/daemon/src/domain/kernel-boot-tracker.ts:168 — KernelBootTracker.getStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 4 (5 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 · MissionControlAuditBrowse.query (cognitive 16) · ×1
  • MissionControlAuditBrowse.query (cognitive 16) packages/daemon/src/domain/mission-control/audit-browse.ts:78 — MissionControlAuditBrowse.query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, ternaries 3, boolean chains 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 · MissionControlFleetCliCapability.rollupFleet (cognitive 16) · ×1
  • MissionControlFleetCliCapability.rollupFleet (cognitive 16) packages/daemon/src/domain/mission-control/mission-control-fleet-cli-capability.ts:109 — MissionControlFleetCliCapability.rollupFleet has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (5 pts), if/else 2 (4 pts), loops 2 (3 pts), boolean chains 2, 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 · plugin-discovery-service.readProfilesUsingPlugin (cognitive 16) · ×1
  • plugin-discovery-service.readProfilesUsingPlugin (cognitive 16) packages/daemon/src/domain/plugin-discovery-service.ts:802 — plugin-discovery-service.readProfilesUsingPlugin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, 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 · require-sender-identity.parseIdentityPrincipal (cognitive 16) · ×1
  • require-sender-identity.parseIdentityPrincipal (cognitive 16) packages/daemon/src/routes/require-sender-identity.ts:229 — require-sender-identity.parseIdentityPrincipal has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 2, error handling 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, 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 · ReviewGatherer.gatherWorkflowExceptions (cognitive 16) · ×1
  • ReviewGatherer.gatherWorkflowExceptions (cognitive 16) packages/daemon/src/domain/review/gather.ts:415 — ReviewGatherer.gatherWorkflowExceptions has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 4, error handling 2 (3 pts), if/else 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 14 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 · ReviewGatherer.agentsForSlices (cognitive 16) · ×1
  • ReviewGatherer.agentsForSlices (cognitive 16) packages/daemon/src/domain/review/gather.ts:593 — ReviewGatherer.agentsForSlices has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 3 (5 pts), loops 2 (3 pts), ternaries 3 (nesting depth added 3). Of this number, 12 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 · ReviewGatherer.rigRoster (cognitive 16) · ×1
  • ReviewGatherer.rigRoster (cognitive 16) packages/daemon/src/domain/review/gather.ts:660 — ReviewGatherer.rigRoster has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 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 · RigExpansionService.expand (cognitive 16) · ×1
  • RigExpansionService.expand (cognitive 16) packages/daemon/src/domain/rig-expansion-service.ts:30 — RigExpansionService.expand has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 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 · CmuxProviderAdapter.openView (cognitive 16) · ×1
  • CmuxProviderAdapter.openView (cognitive 16) packages/daemon/src/domain/terminal/cmux-provider-adapter.ts:73 — CmuxProviderAdapter.openView has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 4 (5 pts), boolean chains 2, 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 · herdr-live-workspace.findLiveHerdrWorkspace (cognitive 16) · ×1
  • herdr-live-workspace.findLiveHerdrWorkspace (cognitive 16) packages/daemon/src/domain/terminal/herdr-live-workspace.ts:113 — herdr-live-workspace.findLiveHerdrWorkspace has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, ternaries 5 (6 pts), if/else 1 (2 pts), loops 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 5 function items inside it that branch (a function literal at line 120, a function literal at line 125, a function literal at line 123, …). 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 · HerdrAppProvider.endVerified (cognitive 16) · ×1
  • HerdrAppProvider.endVerified (cognitive 16) packages/daemon/src/domain/terminal/herdr-app-provider.ts:665 — HerdrAppProvider.endVerified has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, 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 · rex-adapter.exitedTiles (cognitive 16) · ×1
  • rex-adapter.exitedTiles (cognitive 16) packages/daemon/src/domain/terminal/rex-adapter.ts:37 — rex-adapter.exitedTiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, error handling 2, loops 1, ternaries 1 (nesting depth added 1). 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 (check, a function literal at line 50, unconfirmed). 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 · TerminalService.listViews (cognitive 16) · ×1
  • TerminalService.listViews (cognitive 16) packages/daemon/src/domain/terminal/terminal-service.ts:470 — TerminalService.listViews has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (6 pts), loops 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 · UpCommandRouter.validateYamlAsRigSpec (cognitive 16) · ×1
  • UpCommandRouter.validateYamlAsRigSpec (cognitive 16) packages/daemon/src/domain/up-command-router.ts:90 — UpCommandRouter.validateYamlAsRigSpec has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, 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 · workspace-doctor.checkSdlcConventionSections (cognitive 16) · ×1
  • workspace-doctor.checkSdlcConventionSections (cognitive 16) packages/daemon/src/domain/workspace/workspace-doctor.ts:476 — workspace-doctor.checkSdlcConventionSections has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (6 pts), if/else 2 (4 pts), loops 2 (3 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 · activity.activityRoutes.get("/parked") (cognitive 16) · ×1
  • activity.activityRoutes.get("/parked") (cognitive 16) packages/daemon/src/routes/activity.ts:1118 — activity.activityRoutes.get("/parked") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 1 (nesting depth added 1). 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: 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 · restore-check.createRestoreCheckService (cognitive 16) · ×1
  • restore-check.createRestoreCheckService (cognitive 16) packages/daemon/src/routes/restore-check.ts:155 — restore-check.createRestoreCheckService has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), error handling 3 (4 pts), if/else 3 (4 pts), boolean chains 1 (nesting depth added 5). None of this is in the body itself: all 16 points belong to 4 function literals inside it that branch (lines 206, 162, 202, …). 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 · sessions.sessionAdminRoutes.post("/ · ×1
  • sessions.sessionAdminRoutes.post("/:sessionName/repair-missing-pane") (cognitive 16) packages/daemon/src/routes/sessions.ts:684 — sessions.sessionAdminRoutes.post("/:sessionName/repair-missing-pane") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 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 · snapshots.restoreRoutes.post("/ · ×1
  • snapshots.restoreRoutes.post("/:snapshotId") (cognitive 16) packages/daemon/src/routes/snapshots.ts:126 — snapshots.restoreRoutes.post("/:snapshotId") has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (6 pts), boolean chains 3 (nesting depth added 4). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 156, 188, 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 · browser-boundary.browserBoundary (cognitive 16) · ×1
  • browser-boundary.browserBoundary (cognitive 16) packages/daemon/src/middleware/browser-boundary.ts:205 — browser-boundary.browserBoundary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 7 function items inside it that branch (acceptedTarget, logRefusal, explicitlyAllowedOrigin, …). 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 · workflow-model.shellWords (cognitive 16) · ×1
  • workflow-model.shellWords (cognitive 16) packages/tui/src/execution/workflow-model.ts:123 — workflow-model.shellWords has cognitive complexity 16 (threshold 15). Drivers by points: if/else 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 · PageRead.fetch (cognitive 16) · ×1
  • PageRead.fetch (cognitive 16) packages/tui/src/page-read.ts:15 — PageRead.fetch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, ternaries 2 (3 pts), error handling 1 (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 16). 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 · usage-model.identityLabel (cognitive 16) · ×1
  • usage-model.identityLabel (cognitive 16) packages/tui/src/usage/usage-model.ts:40 — usage-model.identityLabel has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · state.locationKey (cognitive 16) · ×1
  • state.locationKey (cognitive 16) packages/tui/src/state.ts:417 — state.locationKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, match/switch 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 · state.agentsRunningSpecTargets (cognitive 16) · ×1
  • state.agentsRunningSpecTargets (cognitive 16) packages/tui/src/state.ts:512 — state.agentsRunningSpecTargets has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (5 pts), boolean chains 1 (nesting depth added 10). 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 · restore-lifecycle.driveRestoreLifecycle (cognitive 16) · ×1
  • restore-lifecycle.driveRestoreLifecycle (cognitive 16) packages/tui/src/crash-cart/restore-lifecycle.ts:105 — restore-lifecycle.driveRestoreLifecycle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 2 (5 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StartupController.refresh (cognitive 16) · ×1
  • StartupController.refresh (cognitive 16) packages/tui/src/startup.ts:67 — StartupController.refresh has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 1 (2 pts), error handling 1 (nesting depth added 2). None of this is in the body itself: all 16 points belong to 2 function literals inside it that branch (lines 68, 77). 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 · navigator.contentOf (cognitive 16) · ×1
  • navigator.contentOf (cognitive 16) packages/tui/src/navigator.ts:65 — navigator.contentOf has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5, boolean chains 1 (nesting depth added 5). 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 · render.effortObservedText (cognitive 16) · ×1
  • render.effortObservedText (cognitive 16) packages/tui/src/render.ts:219 — render.effortObservedText has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 3, if/else 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 · render.queueFacts (cognitive 16) · ×1
  • render.queueFacts (cognitive 16) packages/tui/src/render.ts:273 — render.queueFacts has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (6 pts), if/else 3 (5 pts), loops 2 (3 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 · RuntimeMark.ToolMark (cognitive 16) · ×1
  • RuntimeMark.ToolMark (cognitive 16) packages/ui/src/components/graphics/RuntimeMark.tsx:406 — RuntimeMark.ToolMark has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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 · ProjectMetaPrimitives.queueStateToken (cognitive 16) · ×1
  • ProjectMetaPrimitives.queueStateToken (cognitive 16) packages/ui/src/components/project/ProjectMetaPrimitives.tsx:109 — ProjectMetaPrimitives.queueStateToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, 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 · feed-classifier.classifyEvent (cognitive 16) · ×1
  • feed-classifier.classifyEvent (cognitive 16) packages/ui/src/lib/feed-classifier.ts:168 — feed-classifier.classifyEvent has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 5, 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 · TerminalLauncher.buildLauncherViews (cognitive 16) · ×1
  • TerminalLauncher.buildLauncherViews (cognitive 16) packages/ui/src/components/topology/TerminalLauncher.tsx:170 — TerminalLauncher.buildLauncherViews has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (5 pts), loops 5, ternaries 2 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowInstancePage.ExceptionBanner (cognitive 16) · ×1
  • WorkflowInstancePage.ExceptionBanner (cognitive 16) packages/ui/src/components/workflow/WorkflowInstancePage.tsx:69 — WorkflowInstancePage.ExceptionBanner has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 5, if/else 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 · guest.launch (cognitive 16) · ×1
  • guest.launch (cognitive 16) packages/daemon/assets/openshell/guest.py:150 — guest.launch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4, boolean chains 1, 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 · splitHeredocs (cognitive 16) · ×1
  • splitHeredocs (cognitive 16) packages/daemon/assets/claude-team-permissions.cjs:49 — splitHeredocs 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, 11 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.
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: registry.ts → daemon-client.ts, hydrate.ts, sections.ts packages/tui/src/commands/registry.ts — `packages/tui/src/commands/registry.ts` changes together with 3 other files — `packages/tui/src/daemon-client.ts`, `packages/tui/src/hydrate.ts`, `packages/tui/src/sections.ts` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×1
  • Duplicated block (5 lines × 2) packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:463 — packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:463-467 | packages/daemon/assets/plugins/openrig-core/skills/openrig-operating-model/scripts/compose.py:497-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
IC1 · Incompleteness & stubs · Hollow method · ×1
  • Hollow method — returns a constant without doing the work packages/ui/twin/eventsource-stub.ts:50 — `dispatchEvent` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
R10 · Code Duplication · Forked directory tree (54 identical files, ~9686 lines × 2 trees) · ×1
  • Forked directory tree (54 identical files, ~9686 lines × 2 trees) skills/_canonical/core/openrig-upgrade/scripts/migrate-telemetry-state-0.5.9.mjs:1 — packages/daemon/specs/agents/shared/skills/ and skills/_canonical/ are near-verbatim copies of each other: 54 files are byte-identical under the same relative paths (~9686 lines; the trees hold 54 and 54 files). That is one structural fact, not 54 local ones: every edit made to one tree and not the other drifts silently, which is the failure whole-tree forks guarantee. Pick one tree as the single source and produce the other from it (generated, copied at build or release time, or re-exported) — or, if the copy is a stale snapshot nothing produces any more, delete it. Check first whether the copy is a deliberately published deliverable (a template consumers copy verbatim, a released sample frozen at a version); where it is, keep it produced from the source tree rather than edited in place.
R10 · Code Duplication · Duplication concentrated across 4 sibling directories (153 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (153 clone groups) REDACTED:1 — 153 duplicated blocks under packages/ have copies in at least two of the sibling directories cli, daemon, tui, ui — 96 of them are reported below, and 57 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 153 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 153 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 153 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 · Duplication concentrated across 4 sibling directories (34 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (34 clone groups) packages/daemon/src/domain/hosts/read-through.ts:125 — 34 duplicated blocks under packages/daemon/src/ have copies in at least two of the sibling directories adapters, domain, routes, terminal — 26 of them are reported below, and 8 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 34 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 34 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 34 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 · Duplication concentrated across 13 sibling directories (14 clone groups) · ×1
  • Duplication concentrated across 13 sibling directories (14 clone groups) packages/ui/src/components/for-you/FeedCard.tsx:613 — 14 duplicated blocks under packages/ui/src/components/ have copies in at least two of the sibling directories agent-images, dashboard, drawer-viewers, files, for-you, lab (+7 more sibling(s) not listed) — 6 of them are reported below, and 8 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 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 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 14 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 · Duplication concentrated across 3 sibling directories (13 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (13 clone groups) packages/ui/src/components/project/ScopePages.tsx:457 — 13 duplicated blocks under packages/ui/src/ have copies in at least two of the sibling directories components, hooks, lib — 7 of them are reported below, and 6 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 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 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 13 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 · Duplication concentrated across 14 sibling directories (11 clone groups) · ×1
  • Duplication concentrated across 14 sibling directories (11 clone groups) packages/daemon/src/domain/agent-images/manifest-parser.ts:17 — 11 duplicated blocks under packages/daemon/src/domain/ have copies in at least two of the sibling directories agent-images, context-packs, feed, files, gateway, hosts (+8 more sibling(s) not listed) — 6 of them are reported below, and 5 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 11 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 11 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 11 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 · Duplication concentrated across 3 sibling directories (9 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (9 clone groups) packages/daemon/scripts/gen-control-plane-json.mjs:249 — 9 of the duplicated blocks reported below have copies in at least two of the sibling directories packages, scripts, skills under the repository root. That concentration is one structural fact, not 9 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 9 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 · Duplication concentrated across 9 sibling directories (6 clone groups) · ×1
  • Duplication concentrated across 9 sibling directories (6 clone groups) packages/tui/src/cost/cost-model.ts:139 — 6 duplicated blocks under packages/tui/src/ have copies in at least two of the sibling directories attention, cost, crash-cart, execution, health, pulse (+3 more sibling(s) not listed) — 5 of them are reported below, and 1 is 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 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 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 6 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 · Duplication concentrated across 3 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (5 clone groups) packages/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs:34 — 5 duplicated blocks under packages/daemon/ have copies in at least two of the sibling directories assets, scripts, src — 3 of them are reported below, and 2 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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 (365 identical lines × 2 files) · ×1
  • Wholesale file copy (365 identical lines × 2 files) REDACTED:1 — REDACTED:1 · REDACTED:1 — these 2 files are line-for-line copies of one another — 365 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 (187 lines × 2 locations) · ×1
  • Duplicated block (187 lines × 2 locations) packages/cli/src/host-registry.ts:66 — packages/cli/src/host-registry.ts:66 · packages/daemon/src/domain/hosts/hosts-registry-reader.ts:21 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (142 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (142 matched lines × 2 locations) packages/daemon/src/domain/review/types.ts:62 — packages/daemon/src/domain/review/types.ts:62 · packages/ui/src/hooks/useReview.ts:18 — the two spans are one implementation copied and then locally edited — 649 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 (115 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (115 matched lines × 2 locations) packages/daemon/src/domain/agent-images/manifest-parser.ts:17 — packages/daemon/src/domain/agent-images/manifest-parser.ts:17 · REDACTED:33 — the two spans are one implementation copied and then locally edited — 620 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 (113 lines × 2 locations) · ×1
  • Duplicated block (113 lines × 2 locations) packages/cli/src/host-registry.ts:335 — packages/cli/src/host-registry.ts:335 · packages/daemon/src/domain/hosts/hosts-registry-writer.ts:34 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (102 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (102 matched lines × 2 locations) packages/cli/src/commands/ps.ts:1764 — packages/cli/src/commands/ps.ts:1764 · packages/cli/src/commands/whoami.ts:527 — the two spans are one implementation copied and then locally edited — 902 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 · Wholesale file copy (96 identical lines × 2 files) · ×1
  • Wholesale file copy (96 identical lines × 2 files) packages/cli/src/lib/permission-policy/policy-ref.ts:17 — packages/cli/src/lib/permission-policy/policy-ref.ts:17 · packages/daemon/src/domain/permission-policy/policy-ref.ts:17 — these 2 files are line-for-line copies of one another — 96 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 with local edits (95 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (95 matched lines × 2 locations) packages/daemon/src/routes/plugins.ts:71 — packages/daemon/src/routes/plugins.ts:71 · packages/daemon/src/routes/skills.ts:44 — the two spans are one implementation copied and then locally edited — 873 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 (92 lines × 2 locations) · ×1
  • Duplicated block (92 lines × 2 locations) packages/cli/src/commands/queue.ts:1919 — packages/cli/src/commands/queue.ts:1919 · packages/cli/src/commands/queue.ts:2026 — 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 (88 lines × 2 locations) · ×1
  • Duplicated block (88 lines × 2 locations) packages/cli/src/lib/scope/types.ts:9 — packages/cli/src/lib/scope/types.ts:9 · packages/daemon/src/domain/scope/types.ts:9 — the 2 copies are spread across 2 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited.
R10 · Code Duplication · Wholesale file copy (81 identical lines × 2 files) · ×1
  • Wholesale file copy (81 identical lines × 2 files) REDACTED:18 — REDACTED:18 · REDACTED:18 — these 2 files are line-for-line copies of one another — 81 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 with local edits (80 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (80 matched lines × 2 locations) packages/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs:34 — packages/daemon/assets/plugins/openrig-core/skills/loading-addressable-markdown/scripts/resolve-markdown.mjs:34 · packages/daemon/src/domain/markdown-address.ts:64 — the two spans are one implementation copied and then locally edited — 662 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 (73 lines × 2 locations) · ×1
  • Duplicated block (73 lines × 2 locations) packages/daemon/src/domain/queue-repository.ts:2853 — packages/daemon/src/domain/queue-repository.ts:2853 · packages/daemon/src/domain/queue-repository.ts:3039 — 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 (72 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (72 matched lines × 2 locations) packages/daemon/src/routes/chat.ts:13 — packages/daemon/src/routes/chat.ts:13 · packages/daemon/src/routes/stream.ts:38 — the two spans are one implementation copied and then locally edited — 578 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 (70 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (70 matched lines × 2 locations) packages/daemon/src/domain/feed/attention-aggregator.ts:43 — packages/daemon/src/domain/feed/attention-aggregator.ts:43 · packages/daemon/src/domain/review/fleet-compose.ts:227 — the two spans are one implementation copied and then locally edited — 615 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 (69 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (69 matched lines × 2 locations) packages/daemon/src/routes/bundles.ts:1136 — packages/daemon/src/routes/bundles.ts:1136 · packages/daemon/src/routes/up.ts:199 — the two spans are one implementation copied and then locally edited — 677 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 (68 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (68 matched lines × 2 locations) packages/daemon/src/domain/mission-control/audit-browse.ts:42 — packages/daemon/src/domain/mission-control/audit-browse.ts:42 · packages/daemon/src/domain/mission-control/mission-control-action-log.ts:63 — the two spans are one implementation copied and then locally edited — 407 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 (64 lines × 2 locations) · ×1
  • Duplicated block (64 lines × 2 locations) packages/cli/src/commands/scope.ts:1367 — packages/cli/src/commands/scope.ts:1367 · packages/daemon/src/routes/scope-audit.ts:267 — 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 (63 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (63 matched lines × 2 locations) packages/ui/src/hooks/useDismissedCardIds.ts:17 — packages/ui/src/hooks/useDismissedCardIds.ts:17 · packages/ui/src/hooks/useDismissedSeqs.ts:11 — the two spans are one implementation copied and then locally edited — 447 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 · Wholesale file copy (62 identical lines × 2 files) · ×1
  • Wholesale file copy (62 identical lines × 2 files) packages/cli/src/lib/permission-policy/policy-spec.ts:9 — packages/cli/src/lib/permission-policy/policy-spec.ts:9 · packages/daemon/src/domain/permission-policy/policy-spec.ts:9 — these 2 files are line-for-line copies of one another — 62 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 with local edits (57 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (57 matched lines × 2 locations) packages/cli/src/openrig-compat.ts:40 — packages/cli/src/openrig-compat.ts:40 · packages/daemon/src/openrig-compat.ts:8 — the two spans are one implementation copied and then locally edited — 357 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 (53 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (53 matched lines × 2 locations) packages/daemon/src/domain/claim-service.ts:396 — packages/daemon/src/domain/claim-service.ts:396 · packages/daemon/src/domain/claim-service.ts:844 — the two spans are one implementation copied and then locally edited — 420 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 (52 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (52 matched lines × 2 locations) packages/daemon/src/domain/spec-review-service.ts:12 — packages/daemon/src/domain/spec-review-service.ts:12 · packages/ui/src/hooks/useSpecReview.ts:20 — the two spans are one implementation copied and then locally edited — 287 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 (51 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (51 matched lines × 2 locations) packages/daemon/src/domain/files/file-write-service.ts:143 — packages/daemon/src/domain/files/file-write-service.ts:143 · packages/daemon/src/domain/files/file-write-service.ts:234 — the two spans are one implementation copied and then locally edited — 391 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 (51 lines × 2 locations) · ×1
  • Duplicated block (51 lines × 2 locations) packages/ui/src/components/DiscoveryOverlay.tsx:32 — packages/ui/src/components/DiscoveryOverlay.tsx:32 · packages/ui/src/components/DiscoveryPanel.tsx:78 — 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 (50 lines × 2 locations) · ×1
  • Duplicated block (50 lines × 2 locations) packages/cli/src/lib/scope/logical-checkbox.ts:45 — packages/cli/src/lib/scope/logical-checkbox.ts:45 · packages/daemon/src/domain/scope/logical-checkbox.ts:45 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (50 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (50 matched lines × 2 locations) packages/daemon/src/adapters/pi-resume.ts:120 — packages/daemon/src/adapters/pi-resume.ts:120 · packages/daemon/src/adapters/pi-runtime-adapter.ts:358 — the two spans are one implementation copied and then locally edited — 442 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 (48 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (48 matched lines × 2 locations) packages/ui/src/components/AgentSpecReview.tsx:17 — packages/ui/src/components/AgentSpecReview.tsx:17 · packages/ui/src/components/RigSpecReview.tsx:20 — the two spans are one implementation copied and then locally edited — 270 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 (47 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (47 matched lines × 2 locations) packages/daemon/src/domain/mission-control/notification-adapter-ntfy.ts:36 — packages/daemon/src/domain/mission-control/notification-adapter-ntfy.ts:36 · packages/daemon/src/domain/mission-control/notification-adapter-webhook.ts:44 — the two spans are one implementation copied and then locally edited — 319 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.
R2 · Cyclomatic Complexity · Complex function startNodeWithWarnings (cyclomatic 280, cognitive 455) · ×1
  • Complex function startNodeWithWarnings (cyclomatic 280, cognitive 455) packages/daemon/src/domain/startup-orchestrator.ts:347 — startNodeWithWarnings has cyclomatic complexity 280 and cognitive complexity 455; 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 255, cognitive 441) · ×1
  • Complex function (anonymous) (cyclomatic 255, cognitive 441) packages/cli/src/commands/up.ts:154 — (anonymous) has cyclomatic complexity 255 and cognitive complexity 441; 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 hydrateSnapshot (cyclomatic 238, cognitive 262) · ×1
  • Complex function hydrateSnapshot (cyclomatic 238, cognitive 262) packages/tui/src/hydrate.ts:392 — hydrateSnapshot has cyclomatic complexity 238 and cognitive complexity 262; 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 contentLines (cyclomatic 237, cognitive 520) · ×1
  • Complex function contentLines (cyclomatic 237, cognitive 520) packages/tui/src/render.ts:962 — contentLines has cyclomatic complexity 237 and cognitive complexity 520; 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 postLaunchRestore (cyclomatic 216, cognitive 416) · ×1
  • Complex function postLaunchRestore (cyclomatic 216, cognitive 416) packages/daemon/src/domain/restore-orchestrator.ts:1947 — postLaunchRestore has cyclomatic complexity 216 and cognitive complexity 416; 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 advancePromptRefusals (cyclomatic 203, cognitive 375) · ×1
  • Complex function advancePromptRefusals (cyclomatic 203, cognitive 375) packages/daemon/src/domain/queue-wake-ladder.ts:1256 — advancePromptRefusals has cyclomatic complexity 203 and cognitive complexity 375; 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 runStuckSweep (cyclomatic 195, cognitive 337) · ×1
  • Complex function runStuckSweep (cyclomatic 195, cognitive 337) packages/daemon/src/domain/queue-stuck-sweep.ts:804 — runStuckSweep has cyclomatic complexity 195 and cognitive complexity 337; 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 sendUnguarded (cyclomatic 191, cognitive 287) · ×1
  • Complex function sendUnguarded (cyclomatic 191, cognitive 287) packages/daemon/src/domain/session-transport.ts:3444 — sendUnguarded has cyclomatic complexity 191 and cognitive complexity 287; 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 describeBundleBehaviour (cyclomatic 176, cognitive 430) · ×1
  • Complex function describeBundleBehaviour (cyclomatic 176, cognitive 430) packages/daemon/src/domain/bundle-behaviour.ts:110 — describeBundleBehaviour has cyclomatic complexity 176 and cognitive complexity 430; 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 updateInTransactionalContext (cyclomatic 170, cognitive 186) · ×1
  • Complex function updateInTransactionalContext (cyclomatic 170, cognitive 186) packages/daemon/src/domain/queue-repository.ts:3628 — updateInTransactionalContext has cyclomatic complexity 170 and cognitive complexity 186; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function postHook (cyclomatic 160, cognitive 229) · ×1
  • Complex function postHook (cyclomatic 160, cognitive 229) packages/daemon/src/routes/activity.ts:396 — postHook has cyclomatic complexity 160 and cognitive complexity 229; 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 handover (cyclomatic 146, cognitive 216) · ×1
  • Complex function handover (cyclomatic 146, cognitive 216) packages/daemon/src/domain/seat-handover-service.ts:400 — handover has cyclomatic complexity 146 and cognitive complexity 216; 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 restoreNodeWithCompensation (cyclomatic 146, cognitive 194) · ×1
  • Complex function restoreNodeWithCompensation (cyclomatic 146, cognitive 194) packages/daemon/src/domain/restore-orchestrator.ts:1274 — restoreNodeWithCompensation has cyclomatic complexity 146 and cognitive complexity 194; 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 reduce (cyclomatic 143, cognitive 123) · ×1
  • Complex function reduce (cyclomatic 143, cognitive 123) packages/tui/src/state.ts:124 — reduce has cyclomatic complexity 143 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 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 (anonymous) (cyclomatic 140, cognitive 288) · ×1
  • Complex function (anonymous) (cyclomatic 140, cognitive 288) packages/cli/src/commands/start.ts:210 — (anonymous) has cyclomatic complexity 140 and cognitive complexity 288; 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 openTerminalWindow (cyclomatic 140, cognitive 202) · ×1
  • Complex function openTerminalWindow (cyclomatic 140, cognitive 202) packages/cli/src/terminal-window.ts:221 — openTerminalWindow has cyclomatic complexity 140 and cognitive complexity 202; 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 137, cognitive 193) · ×1
  • Complex function (anonymous) (cyclomatic 137, cognitive 193) packages/cli/src/commands/launch.ts:93 — (anonymous) has cyclomatic complexity 137 and cognitive complexity 193; 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 createDaemon (cyclomatic 136, cognitive 175) · ×1
  • Complex function createDaemon (cyclomatic 136, cognitive 175) packages/daemon/src/startup.ts:344 — createDaemon has cyclomatic complexity 136 and cognitive complexity 175; 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 handleEvent (cyclomatic 132, cognitive 183) · ×1
  • Complex function handleEvent (cyclomatic 132, cognitive 183) REDACTED:1594 — handleEvent has cyclomatic complexity 132 and cognitive complexity 183; 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 launchExistingAgentMember (cyclomatic 121, cognitive 154) · ×1
  • Complex function launchExistingAgentMember (cyclomatic 121, cognitive 154) packages/daemon/src/domain/rigspec-instantiator.ts:2477 — launchExistingAgentMember has cyclomatic complexity 121 and cognitive complexity 154; 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 handleInput (cyclomatic 116, cognitive 235) · ×1
  • Complex function handleInput (cyclomatic 116, cognitive 235) packages/tui/src/main.ts:554 — handleInput has cyclomatic complexity 116 and cognitive complexity 235; 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 runWakeLadderTick (cyclomatic 113, cognitive 223) · ×1
  • Complex function runWakeLadderTick (cyclomatic 113, cognitive 223) packages/daemon/src/domain/queue-wake-ladder.ts:671 — runWakeLadderTick has cyclomatic complexity 113 and cognitive complexity 223; 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 setRuntime (cyclomatic 112, cognitive 115) · ×1
  • Complex function setRuntime (cyclomatic 112, cognitive 115) packages/daemon/src/domain/seat-runtime-switch-service.ts:200 — setRuntime has cyclomatic complexity 112 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 (anonymous) (cyclomatic 110, cognitive 217) · ×1
  • Complex function (anonymous) (cyclomatic 110, cognitive 217) packages/daemon/src/routes/attention.ts:21 — (anonymous) has cyclomatic complexity 110 and cognitive complexity 217; 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 110, cognitive 141) · ×1
  • Complex function (anonymous) (cyclomatic 110, cognitive 141) packages/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs:361 — (anonymous) has cyclomatic complexity 110 and cognitive complexity 141; 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 renderBody (cyclomatic 109, cognitive 145) · ×1
  • Complex function renderBody (cyclomatic 109, cognitive 145) packages/tui/src/render.ts:1925 — renderBody has cyclomatic complexity 109 and cognitive complexity 145; 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 apply (cyclomatic 107, cognitive 145) · ×1
  • Complex function apply (cyclomatic 107, cognitive 145) packages/daemon/src/domain/terminal/herdr-follow-view.ts:47 — apply has cyclomatic complexity 107 and cognitive complexity 145; 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 engineDeliver (cyclomatic 106, cognitive 166) · ×1
  • Complex function engineDeliver (cyclomatic 106, cognitive 166) packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:1038 — engineDeliver has cyclomatic complexity 106 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 (anonymous) (cyclomatic 106, cognitive 144) · ×1
  • Complex function (anonymous) (cyclomatic 106, cognitive 144) packages/daemon/src/domain/finite-telemetry.ts:138 — (anonymous) has cyclomatic complexity 106 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 buildExecutionView (cyclomatic 104, cognitive 152) · ×1
  • Complex function buildExecutionView (cyclomatic 104, cognitive 152) packages/daemon/src/domain/execution-view.ts:751 — buildExecutionView has cyclomatic complexity 104 and cognitive complexity 152; 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 rebindAndVerifyPaneIdentity (cyclomatic 103, cognitive 127) · ×1
  • Complex function rebindAndVerifyPaneIdentity (cyclomatic 103, cognitive 127) packages/daemon/src/domain/seat-attention-reconciler.ts:134 — rebindAndVerifyPaneIdentity has cyclomatic complexity 103 and cognitive complexity 127; 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 102, cognitive 110) · ×1
  • Complex function (anonymous) (cyclomatic 102, cognitive 110) packages/daemon/src/routes/startup.ts:397 — (anonymous) has cyclomatic complexity 102 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 handleResponse (cyclomatic 100, cognitive 170) · ×1
  • Complex function handleResponse (cyclomatic 100, cognitive 170) REDACTED:1254 — handleResponse has cyclomatic complexity 100 and cognitive complexity 170; 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 launchHarness (cyclomatic 100, cognitive 121) · ×1
  • Complex function launchHarness (cyclomatic 100, cognitive 121) packages/daemon/src/adapters/claude-code-adapter.ts:325 — launchHarness has cyclomatic complexity 100 and cognitive complexity 121; 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 addNode (cyclomatic 99, cognitive 121) · ×1
  • Complex function addNode (cyclomatic 99, cognitive 121) packages/daemon/src/domain/rig-repository.ts:654 — addNode has cyclomatic complexity 99 and cognitive complexity 121; 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 handleNodes (cyclomatic 97, cognitive 153) · ×1
  • Complex function handleNodes (cyclomatic 97, cognitive 153) packages/cli/src/commands/ps.ts:1362 — handleNodes has cyclomatic complexity 97 and cognitive complexity 153; 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 97, cognitive 128) · ×1
  • Complex function (anonymous) (cyclomatic 97, cognitive 128) packages/cli/src/commands/import.ts:59 — (anonymous) has cyclomatic complexity 97 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.
R2 · Cyclomatic Complexity · Complex function validateAgentSpec (cyclomatic 96, cognitive 243) · ×1
  • Complex function validateAgentSpec (cyclomatic 96, cognitive 243) packages/daemon/src/domain/agent-manifest.ts:151 — validateAgentSpec has cyclomatic complexity 96 and cognitive complexity 243; 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 recoverAfterRestart (cyclomatic 96, cognitive 108) · ×1
  • Complex function recoverAfterRestart (cyclomatic 96, cognitive 108) packages/daemon/src/domain/claude-compaction-enforcer.ts:2113 — recoverAfterRestart has cyclomatic complexity 96 and cognitive complexity 108; 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 95, cognitive 94) · ×1
  • Complex function (anonymous) (cyclomatic 95, cognitive 94) packages/cli/src/commands/ps.ts:1066 — (anonymous) has cyclomatic complexity 95 and cognitive complexity 94; 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.
R3 · Large Files · packages/daemon/src/domain/queue-repository.ts · ×1
  • packages/daemon/src/domain/queue-repository.ts: 6154 lines of code packages/daemon/src/domain/queue-repository.ts:1 — packages/daemon/src/domain/queue-repository.ts has 6154 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 · packages/daemon/src/domain/session-transport.ts · ×1
  • packages/daemon/src/domain/session-transport.ts: 5199 lines of code packages/daemon/src/domain/session-transport.ts:1 — packages/daemon/src/domain/session-transport.ts has 5199 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 · packages/daemon/src/domain/rigspec-instantiator.ts · ×1
  • packages/daemon/src/domain/rigspec-instantiator.ts: 3145 lines of code packages/daemon/src/domain/rigspec-instantiator.ts:1 — packages/daemon/src/domain/rigspec-instantiator.ts has 3145 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 · packages/daemon/src/startup.ts · ×1
  • packages/daemon/src/startup.ts: 3063 lines of code packages/daemon/src/startup.ts:1 — packages/daemon/src/startup.ts has 3063 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 · packages/daemon/src/domain/restore-orchestrator.ts · ×1
  • packages/daemon/src/domain/restore-orchestrator.ts: 3052 lines of code packages/daemon/src/domain/restore-orchestrator.ts:1 — packages/daemon/src/domain/restore-orchestrator.ts has 3052 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 · packages/daemon/src/adapters/codex-runtime-adapter.ts · ×1
  • packages/daemon/src/adapters/codex-runtime-adapter.ts: 2907 lines of code packages/daemon/src/adapters/codex-runtime-adapter.ts:1 — packages/daemon/src/adapters/codex-runtime-adapter.ts has 2907 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 · packages/daemon/src/adapters/tmux.ts · ×1
  • packages/daemon/src/adapters/tmux.ts: 2892 lines of code packages/daemon/src/adapters/tmux.ts:1 — packages/daemon/src/adapters/tmux.ts has 2892 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 · packages/cli/src/commands/queue.ts · ×1
  • packages/cli/src/commands/queue.ts: 2636 lines of code packages/cli/src/commands/queue.ts:1 — packages/cli/src/commands/queue.ts has 2636 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 · packages/cli/src/mcp-server.ts · ×1
  • packages/cli/src/mcp-server.ts: 2610 lines of code packages/cli/src/mcp-server.ts:1 — packages/cli/src/mcp-server.ts has 2610 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: 2517 lines of code REDACTED:1 — REDACTED has 2517 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 · packages/daemon/src/domain/seat-lifecycle-service.ts · ×1
  • packages/daemon/src/domain/seat-lifecycle-service.ts: 2472 lines of code packages/daemon/src/domain/seat-lifecycle-service.ts:1 — packages/daemon/src/domain/seat-lifecycle-service.ts has 2472 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 · packages/cli/src/commands/scope.ts · ×1
  • packages/cli/src/commands/scope.ts: 2318 lines of code packages/cli/src/commands/scope.ts:1 — packages/cli/src/commands/scope.ts has 2318 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 · packages/daemon/src/domain/claude-compaction-enforcer.ts · ×1
  • packages/daemon/src/domain/claude-compaction-enforcer.ts: 2304 lines of code packages/daemon/src/domain/claude-compaction-enforcer.ts:1 — packages/daemon/src/domain/claude-compaction-enforcer.ts has 2304 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 · packages/daemon/src/domain/seat-handover-service.ts · ×1
  • packages/daemon/src/domain/seat-handover-service.ts: 2179 lines of code packages/daemon/src/domain/seat-handover-service.ts:1 — packages/daemon/src/domain/seat-handover-service.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 · packages/tui/src/render.ts · ×1
  • packages/tui/src/render.ts: 2077 lines of code packages/tui/src/render.ts:1 — packages/tui/src/render.ts has 2077 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 · packages/daemon/src/domain/workflow-projector.ts · ×1
  • packages/daemon/src/domain/workflow-projector.ts: 2050 lines of code packages/daemon/src/domain/workflow-projector.ts:1 — packages/daemon/src/domain/workflow-projector.ts has 2050 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 · packages/cli/src/commands/seat.ts · ×1
  • packages/cli/src/commands/seat.ts: 2005 lines of code packages/cli/src/commands/seat.ts:1 — packages/cli/src/commands/seat.ts has 2005 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 · packages/daemon/src/domain/workflow-runtime.ts · ×1
  • packages/daemon/src/domain/workflow-runtime.ts: 1974 lines of code packages/daemon/src/domain/workflow-runtime.ts:1 — packages/daemon/src/domain/workflow-runtime.ts has 1974 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 · packages/daemon/src/domain/queue-stuck-sweep.ts · ×1
  • packages/daemon/src/domain/queue-stuck-sweep.ts: 1957 lines of code packages/daemon/src/domain/queue-stuck-sweep.ts:1 — packages/daemon/src/domain/queue-stuck-sweep.ts has 1957 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: 1930 lines of code REDACTED:1 — REDACTED has 1930 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 · packages/cli/src/commands/ps.ts · ×1
  • packages/cli/src/commands/ps.ts: 1922 lines of code packages/cli/src/commands/ps.ts:1 — packages/cli/src/commands/ps.ts has 1922 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 · packages/daemon/src/domain/queue-wake-ladder.ts · ×1
  • packages/daemon/src/domain/queue-wake-ladder.ts: 1896 lines of code packages/daemon/src/domain/queue-wake-ladder.ts:1 — packages/daemon/src/domain/queue-wake-ladder.ts has 1896 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 · packages/daemon/src/routes/queue.ts · ×1
  • packages/daemon/src/routes/queue.ts: 1868 lines of code packages/daemon/src/routes/queue.ts:1 — packages/daemon/src/routes/queue.ts has 1868 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 · packages/cli/src/config-store.ts · ×1
  • packages/cli/src/config-store.ts: 1773 lines of code packages/cli/src/config-store.ts:1 — packages/cli/src/config-store.ts has 1773 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 · packages/daemon/src/domain/restore-check-service.ts · ×1
  • packages/daemon/src/domain/restore-check-service.ts: 1766 lines of code packages/daemon/src/domain/restore-check-service.ts:1 — packages/daemon/src/domain/restore-check-service.ts has 1766 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 · packages/daemon/src/domain/types.ts · ×1
  • packages/daemon/src/domain/types.ts: 1659 lines of code packages/daemon/src/domain/types.ts:1 — packages/daemon/src/domain/types.ts has 1659 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 · packages/daemon/src/domain/slices/slice-indexer.ts · ×1
  • packages/daemon/src/domain/slices/slice-indexer.ts: 1634 lines of code packages/daemon/src/domain/slices/slice-indexer.ts:1 — packages/daemon/src/domain/slices/slice-indexer.ts has 1634 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 · packages/daemon/src/domain/user-settings/settings-store.ts · ×1
  • packages/daemon/src/domain/user-settings/settings-store.ts: 1546 lines of code packages/daemon/src/domain/user-settings/settings-store.ts:1 — packages/daemon/src/domain/user-settings/settings-store.ts has 1546 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 · packages/daemon/src/domain/gateway/slack/slack-subsystem.ts · ×1
  • packages/daemon/src/domain/gateway/slack/slack-subsystem.ts: 1517 lines of code packages/daemon/src/domain/gateway/slack/slack-subsystem.ts:1 — packages/daemon/src/domain/gateway/slack/slack-subsystem.ts has 1517 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: 1488 lines of code REDACTED:1 — REDACTED has 1488 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 · packages/daemon/src/adapters/claude-code-adapter.ts · ×1
  • packages/daemon/src/adapters/claude-code-adapter.ts: 1447 lines of code packages/daemon/src/adapters/claude-code-adapter.ts:1 — packages/daemon/src/adapters/claude-code-adapter.ts has 1447 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 · packages/daemon/src/domain/rigspec-schema.ts · ×1
  • packages/daemon/src/domain/rigspec-schema.ts: 1443 lines of code packages/daemon/src/domain/rigspec-schema.ts:1 — packages/daemon/src/domain/rigspec-schema.ts has 1443 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 · packages/daemon/src/domain/startup-orchestrator.ts · ×1
  • packages/daemon/src/domain/startup-orchestrator.ts: 1406 lines of code packages/daemon/src/domain/startup-orchestrator.ts:1 — packages/daemon/src/domain/startup-orchestrator.ts has 1406 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 · packages/daemon/src/domain/execution-view.ts · ×1
  • packages/daemon/src/domain/execution-view.ts: 1383 lines of code packages/daemon/src/domain/execution-view.ts:1 — packages/daemon/src/domain/execution-view.ts has 1383 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 · packages/daemon/src/domain/skill-catalog.ts · ×1
  • packages/daemon/src/domain/skill-catalog.ts: 1343 lines of code packages/daemon/src/domain/skill-catalog.ts:1 — packages/daemon/src/domain/skill-catalog.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 · packages/ui/src/components/project/ScopePages.tsx · ×1
  • packages/ui/src/components/project/ScopePages.tsx: 1334 lines of code packages/ui/src/components/project/ScopePages.tsx:1 — packages/ui/src/components/project/ScopePages.tsx has 1334 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · packages/daemon/src/domain/rig-repository.ts · ×1
  • packages/daemon/src/domain/rig-repository.ts: 1310 lines of code packages/daemon/src/domain/rig-repository.ts:1 — packages/daemon/src/domain/rig-repository.ts has 1310 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: 1308 lines of code REDACTED:1 — REDACTED has 1308 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 · packages/daemon/src/routes/bundles.ts · ×1
  • packages/daemon/src/routes/bundles.ts: 1230 lines of code packages/daemon/src/routes/bundles.ts:1 — packages/daemon/src/routes/bundles.ts has 1230 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 · packages/daemon/src/domain/seat-skill-storage.ts · ×1
  • packages/daemon/src/domain/seat-skill-storage.ts: 1216 lines of code packages/daemon/src/domain/seat-skill-storage.ts:1 — packages/daemon/src/domain/seat-skill-storage.ts has 1216 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R5 · Dependency Freshness · Dependency Freshness · ×1
  • Dependency Freshness — 42 outdated package(s); JS/npm CVEs scored in D30
R7 · Dead Code · Dead file (~246 LoC) · ×1
  • Dead file (~246 LoC) packages/daemon/src/domain/workspace/getting-started-narrative.ts — no import path from any entry point (224 application, 235 tooling, 2399 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 (~213 LoC) · ×1
  • Dead file (~213 LoC) packages/ui/src/components/mission-control/components/CompactStatusRow.tsx — no import path from any entry point (224 application, 235 tooling, 2399 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 (~197 LoC) · ×1
  • Dead file (~197 LoC) packages/ui/src/components/RigEnvPanel.tsx — no import path from any entry point (224 application, 235 tooling, 2399 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 (~136 LoC) · ×1
  • Dead file (~136 LoC) skills/_canonical/process/systematic-debugging/condition-based-waiting-example.ts — no import path from any entry point (224 application, 235 tooling, 2399 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 (~128 LoC) · ×1
  • Dead file (~128 LoC) packages/ui/src/components/RigCard.tsx — no import path from any entry point (224 application, 235 tooling, 2399 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 (~124 LoC) · ×1
  • Dead file (~124 LoC) packages/daemon/scripts/probe-health-diagnosis.mjs — no import path from any entry point (224 application, 235 tooling, 2399 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 (~117 LoC) · ×1
  • Dead file (~117 LoC) packages/ui/src/components/slices/tabs/DecisionsTab.tsx — no import path from any entry point (224 application, 235 tooling, 2399 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 (~87 LoC) · ×1
  • Dead file (~87 LoC) packages/ui/src/components/slices/tabs/DocsTab.tsx — no import path from any entry point (224 application, 235 tooling, 2399 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 (~57 LoC) · ×1
  • Dead file (~57 LoC) packages/daemon/scripts/capture-send-header.mjs — no import path from any entry point (224 application, 235 tooling, 2399 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 (~52 LoC) · ×1
  • Dead file (~52 LoC) packages/cli/src/release-surface/generate.ts — no import path from any entry point (224 application, 235 tooling, 2399 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 (~42 LoC) · ×1
  • Dead file (~42 LoC) packages/ui/src/components/NodeDetailPlaceholder.tsx — no import path from any entry point (224 application, 235 tooling, 2399 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) packages/ui/src/hooks/useReviewAgents.ts — no import path from any entry point (224 application, 235 tooling, 2399 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 (~36 LoC) · ×1
  • Dead file (~36 LoC) packages/ui/src/components/mission-control/hooks/useMissionControlCliCapabilities.ts — no import path from any entry point (224 application, 235 tooling, 2399 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 (~35 LoC) · ×1
  • Dead file (~35 LoC) packages/ui/src/hooks/useRigEnv.ts — no import path from any entry point (224 application, 235 tooling, 2399 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/ui/src/components/RigEnvPanel.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~16 LoC) · ×1
  • Dead file (~16 LoC) packages/ui/src/components/ExpansionOutcome.tsx — no import path from any entry point (224 application, 235 tooling, 2399 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 (~11 LoC) · ×1
  • Dead file (~11 LoC) packages/ui/src/components/mission-control/MissionControlSurface.tsx — no import path from any entry point (224 application, 235 tooling, 2399 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 (~9 LoC) · ×1
  • Dead file (~9 LoC) packages/ui/src/lib/host-label.ts — no import path from any entry point (224 application, 235 tooling, 2399 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 '@hono/node-ws' · ×1
  • Unused dependency '@hono/node-ws' packages/cli/package.json:49 — Declared in packages/cli/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 '@xterm/addon-fit' · ×1
  • Unused dependency '@xterm/addon-fit' packages/ui/package.json:28 — Declared in packages/ui/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Minor — 350 finding(s)
D24 · Comment Value · redundant comment · ×78
  • redundant comment packages/cli/src/commands/bundle.ts:272 — "rig bundle install <path>" repeats the code it sits on: 4 of its 4 words (rig, bundle, install, path) are already in `cmd.command("install <path>")`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/src/commands/chatroom.ts:71 — "chatroom send <rig> "message" [--sender <name>]" repeats the code it sits on: 5 of its 6 words (send, rig, message, sender, name) are already in `cmd`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/src/commands/setup.ts:628 — "Replace existing managed block" repeats the code it sits on: 4 of its 4 words (replace, existing, managed, block) are already in `const replaced = existing.replace(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/src/commands/snapshot.ts:47 — "rig snapshot list <rig>" repeats the code it sits on: 3 of its 3 words (rig, snapshot, list) are already in `cmd`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/test/agent.test.ts:68 — "POST /api/agents/validate" repeats the code it sits on: 4 of its 4 words (post, api, agents, validate) are already in `if (req.method === "POST" && url.pathname === "/api/agents/validate")`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/test/down.test.ts:444 — "T2c: deleted + snapshot error -> exit 2" repeats the code it sits on: 4 of its 4 words (deleted, snapshot, error, exit) are already in `it("down deleted with snapshot errors exits 2", async () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/test/export-import.test.ts:119 — 5 comments in this file only repeat the code they sit on (lines 119, 135, 142, 162, 180), for example "POST /api/rigs/import/validate". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/test/mcp-person-facing-names.test.ts:207 — "An internal caller sees every member's presence, as before." repeats the code it sits on: 4 of its 5 words (internal, caller, member, presence) are already in `expect((await internal.team()).hostedMembers.find((m: { session: string }) => m.session === CALLER)).toHaveProperty("pre …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/test/mcp-server.test.ts:110 — 5 comments in this file only repeat the code they sit on (lines 110, 1000, 1388, 1412, 1446), for example "rig_add: posts the member fragment to the pod-members route.". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/test/ps-compact.test.ts:367 — "dev1.design is the attention node" repeats the code it sits on: 4 of its 4 words (dev, design, attention, node) are already in `const attentionNode = nodes.find((n: { canonicalSessionName: string }) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/test/rig.test.ts:71 — "POST /api/rigs/import/preflight" repeats the code it sits on: 5 of its 5 words (post, api, rigs, import, preflight) are already in `if (req.method === "POST" && url.pathname === "/api/rigs/import/preflight")`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/test/scope-audit.test.ts:84 — "GHOST vs MISSING-ID DISTINCT" repeats the code it sits on: 4 of its 5 words (ghost, missing, id, distinct) are already in `it("ghost and missing-id are distinct finding kinds", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/cli/test/scope-slice-close-in-place.test.ts:1124 — "Close cited-manifest in place (deferred human output)" repeats the code it sits on: 6 of its 7 words (close, cited, manifest, place, deferred, human) are already in `const closeManifestHuman = await runScope(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/ask-service.ts:197 — "Check transcripts enabled" repeats the code it sits on: 3 of its 3 words (check, transcripts, enabled) are already in `if (!this.deps.transcriptsEnabled)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/bootstrap-orchestrator.ts:130 — "Same-db-handle checks" repeats the code it sits on: 3 of its 3 words (db, handle, checks) are already in `if (deps.bootstrapRepo.db !== deps.db) throw new Error("BootstrapOrchestrator: bootstrapRepo must share the same db hand …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/bundle-assembler.ts:143 — "Write bundle.yaml" repeats the code it sits on: 3 of its 3 words (write, bundle, yaml) are already in `this.fs.writeFile(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/bundle-source-resolver.ts:90 — "Map all original refs to this resolved package" repeats the code it sits on: 5 of its 5 words (map, original, refs, resolved, package) are already in `packageRefMap[entry.originalSource] = result.resolved;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/install-engine.ts:169 — "Journal the rollback action" repeats the code it sits on: 3 of its 3 words (journal, rollback, action) are already in `this.installRepo.createJournalEntry({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/mission-control/notification-dispatcher.ts:123 — "Mandatory trigger: human-gate qitem arrival." repeats the code it sits on: 5 of its 6 words (trigger, human, gate, qitem, arrival) are already in `await this.dispatch({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/node-cmux-service.ts:82 — "Session name from binding or logical id" repeats the code it sits on: 5 of its 5 words (session, name, binding, logical, id) are already in `const sessionName = binding?.tmuxSession ?? binding?.externalSessionName ?? logicalId;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:1375 — "Infrastructure startup command" repeats the code it sits on: 3 of its 3 words (infrastructure, startup, command) are already in `let infrastructureStartupCommand: string | null = null;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/package-resolver.ts:32 — "Resolve to absolute path" repeats the code it sits on: 3 of its 3 words (resolve, absolute, path) are already in `const absoluteRef = path.isAbsolute(sourceRef)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/permission-account.ts:167 — "What the envelope replaces for this seat: a policy's posture and an ambient YOLO setting." repeats the code it sits on: 7 of its 8 words (envelope, replaces, policy, posture, ambient, yolo, setting) are already in `const replacedPosture = envelope ? [bindingPosture !== "floor" ? `the policy's ${bindingPosture} posture` : null,`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/pod-bundle-assembler.ts:125 — "Member startup files" repeats the code it sits on: 3 of its 3 words (member, startup, files) are already in `this.collectStartupFiles(member.startup, opts.rigRoot, opts.outputDir, collectedFiles);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment packages/daemon/src/domain/pod-bundle-assembler.ts:136 — "Resolve agent_ref" repeats the code it sits on: 3 of its 3 words (resolve, agent, ref) are already in `const result = resolveAgentRef(member.agentRef, opts.rigRoot, this.fs);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 53 more in this group — see findings.md.
D10 · Test Quality · Mock-dominated test · ×55
  • Mock-dominated test: unrefs the production timeout handle and cancels that exact handle on close packages/tui/test/live-quiet-refresh.test.ts:126 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: an in-place provider continuation keeps custom settings, config dir and model packages/daemon/test/claude-resume.test.ts:49 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: carries the retained executable and wrapper through restore preparation (managed: %s) packages/daemon/test/claude-resume.test.ts:113 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: the pod-aware managed continuation retains custom options and the current resume marker packages/daemon/test/claude-runtime-adapter.test.ts:93 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: profile-bearing resume uses -p flag after preflight passes packages/daemon/test/codex-resume.test.ts:157 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: a restore on the plain floor adds the seat's own folder after the conversation id; a named profile adds none packages/daemon/test/codex-resume.test.ts:171 — This test sets up 5 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: a restore on the plain floor adds the git dirs, then the seat folder, after the conversation id; a named profile adds none packages/daemon/test/codex-resume.test.ts:189 — This test sets up 6 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: replaces the posture decision with its flags and adds no network or team grants packages/daemon/test/codex-resume.test.ts:446 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 8 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: passes resolved wrapper argv to a capable runner while leaving its command unwrapped packages/daemon/test/community-harness-runtime.test.ts:247 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: clears an inherited wrapper for a runner with no node wrapper selected packages/daemon/test/community-harness-runtime.test.ts:379 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: coalesces overlapping pollOnce calls so one compaction stage is emitted once packages/daemon/test/context-monitor.test.ts:633 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: watches the nearest existing ancestor of a missing input, filtered to the next path segment packages/daemon/test/proof-source-boundary.test.ts:62 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: watches nothing else recursively when the evaluation reads nothing outside the missions root packages/daemon/test/proof-source-boundary.test.ts:97 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: attemptResume forwards effort to claude and codex resume adapters packages/daemon/test/restore-orchestrator.test.ts:1350 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: attemptResume passes a Codex seat's envelope to the legacy resume, in place of kernel and team defaults packages/daemon/test/restore-orchestrator.test.ts:1414 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: attemptResume forwards the resolved effort to the Pi resume adapter packages/daemon/test/restore-orchestrator.test.ts:1427 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: S11-4: null discovery makes one attempt on every configured tick, with no tick-count or time minimum packages/daemon/test/resume-capture-retry.test.ts:68 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: shares snapshot observations across Claude seats while retaining two samples per proof packages/daemon/test/resume-metadata-refresher.test.ts:59 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: refreshes missing Codex resume token from the live child process packages/daemon/test/resume-metadata-refresher.test.ts:113 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: refreshes missing Codex resume token from a nested wrapper -> vendor codex process tree packages/daemon/test/resume-metadata-refresher.test.ts:150 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: refreshes missing Codex resume token from the child process home directory packages/daemon/test/resume-metadata-refresher.test.ts:188 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: refreshes missing Codex resume token from the current versioned logs database packages/daemon/test/resume-metadata-refresher.test.ts:230 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: skips sessions that already have a resume token packages/daemon/test/resume-metadata-refresher.test.ts:272 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: EXCLUSION: the probe/refresh path never applies tmux option defaults packages/daemon/test/resume-metadata-refresher.test.ts:302 — This test sets up 6 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: marks a not-resumable Claude token STALE without clearing it (FR-6 §2.1b) packages/daemon/test/resume-metadata-refresher.test.ts:336 — This test sets up 5 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • + 30 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate packages/daemon/src/domain/agent-activity-store.ts:731 — `!!value && typeof value === "object" && !Array.isArray(value)` appears character-identically in 2 files — packages/daemon/src/domain/agent-activity-store.ts, packages/daemon/src/domain/provider/subscription-move-report.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 packages/cli/src/commands/project-jev.ts:131 — `!!x && typeof x === "object" && !Array.isArray(x)` appears character-identically in 3 files — packages/cli/src/commands/project-jev.ts, packages/cli/src/commands/stream-outcome.ts, packages/cli/src/decisions/decisions.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 packages/daemon/src/domain/workflow-exception-escalation.ts:165 — `!(error instanceof QueueRepositoryError) || error.code !== "unknown_destination_rig" || route.humanRouted` appears character-identically in 2 files — packages/daemon/src/domain/workflow-exception-escalation.ts, packages/daemon/src/domain/workflow-projector.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 packages/cli/src/config-store.ts:950 — `!(part in current) || typeof current[part] !== "object" || current[part] === null` appears character-identically in 2 files — packages/cli/src/config-store.ts, packages/daemon/src/domain/user-settings/settings-store.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 packages/cli/src/config-store.ts:1083 — `!/^\d+$/.test(raw.trim()) || typeof coerced !== "number" || !Number.isInteger(coerced) || coerced < 1 || coerced > 600` appears character-identically in 2 files — packages/cli/src/config-store.ts, packages/daemon/src/domain/user-settings/settings-store.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 packages/cli/src/config-store.ts:1089 — `!/^\d+$/.test(raw.trim()) || typeof coerced !== "number" || !Number.isSafeInteger(coerced) || coerced < 2000 || coerced > 1_000_000` appears character-identically in 2 files — packages/cli/src/config-store.ts, packages/daemon/src/domain/user-settings/settings-store.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 packages/cli/src/config-store.ts:1193 — `!/^\d+$/.test(raw.trim()) || typeof value !== "number" || !Number.isSafeInteger(value) || value < 0` appears character-identically in 2 files — packages/cli/src/config-store.ts, packages/daemon/src/domain/user-settings/settings-store.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 packages/cli/src/config-store.ts:1073 — `!/^\d+$/.test(raw.trim()) || typeof value !== "number" || !Number.isSafeInteger(value) || value < 1 || value > 1_000_000` appears character-identically in 2 files — packages/cli/src/config-store.ts, packages/daemon/src/domain/user-settings/settings-store.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 packages/cli/src/config-store.ts:1078 — `!/^\d+$/.test(raw.trim()) || typeof value !== "number" || !Number.isSafeInteger(value) || value < 1 || value > 3600` appears character-identically in 2 files — packages/cli/src/config-store.ts, packages/daemon/src/domain/user-settings/settings-store.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 packages/cli/src/config-store.ts:1065 — `!/^\d+$/.test(raw.trim()) || typeof value !== "number" || !Number.isSafeInteger(value) || value < 1000 || value > 2000` appears character-identically in 2 files — packages/cli/src/config-store.ts, packages/daemon/src/domain/user-settings/settings-store.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 packages/daemon/src/domain/native-process-arguments.ts:177 — `!Array.isArray(entry) || !requestedPids.has(entry[0])` appears character-identically in 2 files — packages/daemon/src/domain/native-process-arguments.ts, packages/daemon/src/domain/native-process-executable.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 packages/cli/src/commands/project-worker.ts:41 — `!Number.isInteger(limit) || limit < 1 || limit > 100` appears character-identically in 2 files — packages/cli/src/commands/project-worker.ts, packages/cli/src/commands/project.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 packages/daemon/src/domain/health-detectors.ts:196 — `!Number.isInteger(limit) || limit < 1 || limit > 200` appears character-identically in 2 files — packages/daemon/src/domain/health-detectors.ts, packages/daemon/src/routes/provider.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 docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs:172 — `!Number.isSafeInteger(chars) || chars < 1 || chars > Number.MAX_SAFE_INTEGER - overhead` appears character-identically in 2 files — docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs, 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:33 — `!baseUrl && typeof parsed.baseUrl === "string"` appears character-identically in 3 files — REDACTED, REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/cli/src/commands/queue.ts:924 — `!body || typeof body !== "object" || Array.isArray(body)` appears character-identically in 2 files — packages/cli/src/commands/queue.ts, packages/daemon/src/routes/sessions.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 docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs:169 — `!buffer.startsWith(": runner-frame-chars=") || !buffer.includes("\n")` appears character-identically in 2 files — docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs, 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 packages/daemon/src/domain/gateway/slack/state-store.ts:322 — `!data || typeof data !== "object" || Array.isArray(data)` appears character-identically in 3 files — packages/daemon/src/domain/gateway/slack/state-store.ts, packages/daemon/src/domain/rig-mode/operating-posture.ts, packages/tui/src/daemon-client.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/daemon/src/domain/community-harness-launch-result.ts:58 — `!doc || typeof doc !== "object" || Array.isArray(doc)` appears character-identically in 3 files — packages/daemon/src/domain/community-harness-launch-result.ts, packages/daemon/src/domain/community-harness-presets.ts, packages/daemon/src/domain/health-context.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:2399 — `!endpoint || typeof fetch !== "function"` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/cli/src/lib/context-install.ts:117 — `!entry || typeof entry !== "object" || Array.isArray(entry)` appears character-identically in 9 files — packages/cli/src/lib/context-install.ts, packages/daemon/src/domain/agent-manifest.ts, packages/daemon/src/domain/bundle-content-routing.ts, packages/daemon/src/domain/bundle-types.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 packages/daemon/src/domain/slices/slice-detail-projector.ts:452 — `!entry.isFile() || !entry.name.endsWith(".md")` appears character-identically in 2 files — packages/daemon/src/domain/slices/slice-detail-projector.ts, packages/daemon/src/domain/workspace/frontmatter-validator.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 packages/daemon/src/domain/agent-images/manifest-parser.ts:116 — `!f || typeof f !== "object" || Array.isArray(f)` appears character-identically in 2 files — packages/daemon/src/domain/agent-images/manifest-parser.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 packages/daemon/src/domain/bundle-carried-context-pack.ts:29 — `!fs.existsSync(manifestPath) || !fs.statSync(manifestPath).isFile()` appears character-identically in 2 files — packages/daemon/src/domain/bundle-carried-context-pack.ts, packages/daemon/src/domain/bundle-carried-project.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 packages/cli/src/terminal-window.ts:107 — `!inHerdrPane(env) && (env["TERM_PROGRAM"] === "rex" || (env["TERM_PROGRAM"] !== "herdr" && !!env["REX_SESSION"] && !!env["REX_BLOCK"] && !!e…` appears character-identically in 2 files — packages/cli/src/terminal-window.ts, packages/tui/src/terminals/open-window.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.
P2 · Observability · Console output used as the logging channel · ×39
  • Console output used as the logging channel packages/daemon/src/openrig-compat.ts:23 — `packages/daemon/src/openrig-compat.ts` reports through `console.*` at line 23 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:353 — `packages/daemon/src/startup.ts` reports through `console.*` at line 353 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:364 — `packages/daemon/src/startup.ts` reports through `console.*` at line 364 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:436 — `packages/daemon/src/startup.ts` reports through `console.*` at line 436 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:440 — `packages/daemon/src/startup.ts` reports through `console.*` at line 440 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:580 — `packages/daemon/src/startup.ts` reports through `console.*` at line 580 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:586 — `packages/daemon/src/startup.ts` reports through `console.*` at line 586 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:588 — `packages/daemon/src/startup.ts` reports through `console.*` at line 588 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:617 — `packages/daemon/src/startup.ts` reports through `console.*` at line 617 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:640 — `packages/daemon/src/startup.ts` reports through `console.*` at line 640 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:719 — `packages/daemon/src/startup.ts` reports through `console.*` at line 719 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:722 — `packages/daemon/src/startup.ts` reports through `console.*` at line 722 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:979 — `packages/daemon/src/startup.ts` reports through `console.*` at line 979 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:988 — `packages/daemon/src/startup.ts` reports through `console.*` at line 988 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:995 — `packages/daemon/src/startup.ts` reports through `console.*` at line 995 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1001 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1001 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1015 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1015 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1089 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1089 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1143 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1143 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1171 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1171 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1181 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1181 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1195 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1195 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1198 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1198 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1207 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1207 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel packages/daemon/src/startup.ts:1411 — `packages/daemon/src/startup.ts` reports through `console.*` at line 1411 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • + 14 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×38
  • Silent fallback default in catch packages/daemon/src/domain/seat-runtime-home.ts:53 — `seatRuntimeHome` 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 packages/daemon/src/domain/model-divergence/effective-model-readers.ts:36 — `readTailLines` 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 packages/daemon/src/domain/native-process-lineage.ts:595 — `listNativeProcesses` 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 packages/daemon/src/domain/resume-metadata-refresher.ts:500 — `defaultListProcesses` 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 packages/daemon/src/domain/runner-channel.ts:28 — `standing` swallows every exception into `return "unverified"` — 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 packages/daemon/src/domain/seat-skill-storage.ts:378 — `dirs` (in `listSeatSkillRoots`) 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 packages/daemon/src/domain/seat-skill-storage.ts:1053 — `migrateLegacyProjectSkills` 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 packages/daemon/src/domain/seat-launch-additions.ts:302 — `present` (in `seatLaunchAdditionsAt`) 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 packages/daemon/src/adapters/tmux-server.ts:36 — `tmuxServerArgs` 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 packages/daemon/src/domain/gateway/slack/state-store.ts:177 — `readAll` 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 packages/daemon/src/domain/gateway/slack/state-store.ts:275 — `readAll` 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 packages/daemon/src/domain/queue-waiting.ts:133 — `sweepSeconds` swallows every exception into `return 300` — 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 packages/daemon/src/domain/workspace/project-catalog.ts:51 — `catalogEntries` 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 packages/daemon/src/domain/slices/slice-indexer.ts:1672 — `listSliceFiles` 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 packages/daemon/src/domain/community-harness-presets.ts:208 — `listCommunityHarnessPresets` 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:1167 — `startedWithoutRequired` 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 packages/daemon/src/domain/queue-wake-ladder.ts:1269 — `readAt` (in `advancePromptRefusals`) swallows every exception into `return "unknown"` — 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 packages/daemon/src/domain/queue-repository.ts:711 — `defaultHostedMembers` 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 packages/daemon/src/domain/environment-lifecycle.ts:200 — `verifyCheckpoint` 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 packages/daemon/src/domain/startup-orchestrator.ts:1118 — `safeReadFile` 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 packages/daemon/src/adapters/tmux.ts:693 — `dirExists` 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 packages/daemon/src/domain/claude-compaction-enforcer.ts:1681 — `complete` (in `mapReady`) 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 packages/daemon/src/domain/claude-compaction-enforcer.ts:1984 — `inputBoxStatus` swallows every exception into `return "unknown"` — 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 packages/daemon/src/domain/claude-compaction-enforcer.ts:584 — `completedSkippedMap` 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 REDACTED:1195 — `getDaemonStatus` 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.
  • + 13 more in this group — see findings.md.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×5
  • Projects may be oversized for their cohesion packages/daemon/package.json:1 — `packages/daemon` (236808 LoC, 3069 module-visible types across 46 directories) overshoots its size bounds. 5 of 6 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
  • Projects may be oversized for their cohesion packages/cli/package.json:1 — `packages/cli` (61147 LoC, 537 module-visible types across 11 directories) overshoots its size bounds. 5 of 6 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
  • Projects may be oversized for their cohesion packages/ui/package.json:1 — `packages/ui` (47636 LoC, 703 module-visible types across 32 directories) overshoots its size bounds. 5 of 6 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
  • Projects may be oversized for their cohesion packages/tui/package.json:1 — `packages/tui` (14643 LoC, 234 module-visible types across 16 directories) overshoots its size bounds. 5 of 6 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
  • Projects may be oversized for their cohesion package.json:1 — `(repository root)` (11756 LoC, 71 module-visible types across 11 directories) overshoots its size bounds. 5 of 6 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
IC1 · Incompleteness & stubs · Disabled test · ×5
  • Disabled test packages/cli/test/mcp-daemon-endpoint-native.test.ts:86 — 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 packages/cli/test/up.test.ts:1239 — 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 packages/daemon/test/precompact-hook.test.ts:367 — 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 packages/daemon/test/precompact-hook.test.ts:379 — 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 packages/ui/test/topology-view-mode.test.tsx:117 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
D16 · Bus Factor · Off-boarding risk · ×3
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 190 significant file(s) lose their only recent owner: packages/ui/src/components/project/ScopePages.tsx, packages/daemon/src/domain/bundle-types.ts, packages/daemon/src/domain/provider/usage-across-hosts.ts, packages/ui/src/components/LiveNodeDetails.tsx, packages/ui/src/components/LibraryReview.tsx, packages/ui/src/components/feed/cards/storytelling-cards.tsx, packages/ui/src/components/AppShell.tsx, packages/cli/src/commands/bundle.ts (+182 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 65 significant file(s) lose their only recent owner: REDACTED, packages/daemon/src/domain/crash-cart-conductor.ts, packages/ui/src/components/review/MissionReviewTab.tsx, packages/ui/src/components/review/SliceReviewTab.tsx, packages/daemon/src/domain/health-projection.ts, packages/daemon/src/domain/review/fleet-compose.ts, packages/daemon/src/domain/continuity-policy-materializer.ts, packages/tui/src/stylize.ts (+57 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: packages/cli/src/lib/file-transfer.ts, packages/cli/src/commands/workflow-follow.ts, packages/cli/src/lib/scope/slice-claims.ts. Pair on, review, or document these before any departure.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×3
  • No app-layer HTTPS enforcement detected REDACTED:554 — `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 packages/daemon/src/index.ts:379 — `serve(…)` 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 packages/daemon/src/index.ts:387 — `serve(…)` 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.)
D30 · Dependency Vulnerabilities · Low CVE · ×2
  • REDACTED
  • REDACTED
DM9 · Scattered domain decisions · Rule about [pid, startedAt] decided in 2 places · ×2
  • Rule about [pid, startedAt] decided in 2 places — packages.daemon.src.domain.native-process-lineage.ClaudeLaunchedProcess's [pid, startedAt] are judged in packages.daemon.src.domain.native-process-lineage, packages.daemon.src.domain.session-registry — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • Rule about [pid, startedAt] decided in 2 places — packages.daemon.src.domain.native-process-lineage.NativeProcessRow's [pid, startedAt] are judged in packages.daemon.src.domain.native-process-lineage, packages.daemon.src.domain.restore-orchestrator.RestoreOrchestrator — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
M4 · Documentation accuracy · README/code drift · ×2
  • README/code drift README.md:486 — README.md names Node.js 20, but the repository declares engines `^22 || ^24`, engines `>=22`, engines `>=22`, engines `^22 || ^24`. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/reference/getting-started.md:104 — docs/reference/getting-started.md names Node.js 20, but the repository declares engines `^22 || ^24`, engines `>=22`, engines `>=22`, engines `^22 || ^24`. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
X7 · Silent fallback defaults · Pending state with no failure state · ×2
  • Pending state with no failure state packages/ui/src/components/RigChatPanel.tsx:25 — The view draws `Loading messages...` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state packages/ui/src/components/project/WorkspacePortfolioPanel.tsx:96 — The view draws `Loading steering…` under `! selectionKnown || mission . isLoading || brief . isLoading`, but `selectionKnown` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
C3 · Audit Trail · Partial audit-trail evidence · ×1
  • Partial audit-trail evidence — An audit mechanism is present, but the trail is not yet complete — missing: an ORM write hook every change flows through (a TypeORM/MikroORM subscriber, a Sequelize or Mongoose hook, Prisma middleware or a query extension, or an event-store append), per-model coverage (@Audited, or a change-history plugin such as mongoose-history or sequelize-paper-trail applied to each model).
C4 · Data Retention · Partial data-retention evidence · ×1
  • Partial data-retention evidence — A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a cron task that deletes rows past their retention — purgeExpired… / deleteOld…).
C5 · Data-Subject Rights · Erasure leaves personal data in a data store · ×1
  • Erasure leaves personal data in a data store packages/daemon/src/db/migrations/134_claude_token_readings.ts:14 — An erasure path exists (erasureLedgerPath at packages/daemon/src/index.ts:158), but this repository writes personal data to a store ('email' on a SQL INSERT in 'provider_account_readings_next') and the removals here (truncate text at packages/ui/src/components/ActivityFeed.tsx:70, …) reach other stores. When a subject's data is erased, the records in that store survive it.
C5 · Data-Subject Rights · Partial data-subject-rights support · ×1
  • Partial data-subject-rights support — Corroborated rights: erasure ✓ · export ✗ · consent ✗. Each tick means this scan found code in the repository implementing that right — a deletion/anonymisation path for erasure, a data-export or portability path for export, and consent state recorded alongside the personal data it authorises. A ✗ therefore means no such code was recognised HERE, not that the right is unsupported: a capability provided by a platform, a manual runbook, or code spelled in a way this scan does not match is not visible to it. Confirm before treating a cross as a gap; where it is one, the right has to be fulfilled manually.
D12 · Dependency Hygiene · Deprecated · ×1
  • Deprecated: whatwg-encoding REDACTED:7023 — whatwg-encoding 3.1.1 is resolved in REDACTED and is marked deprecated by its publisher: "Use @exodus/bytes instead for a more spec-conformant and faster implementation". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (259 single-owned of 1129 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1129 of the 1603 production source files in this repository met that bar). They are anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: packages/daemon/src/domain/home-isolation.ts.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found packages/ui/package.json:11 — No ADRs found. The recognised ADR directories in this tree were read — `packages/cli/src/decisions` — and none of their files is a decision record (a README, index or template page does not count). What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `packages/ui/package.json` makes this repository a deployable product (line 11).
D21 · Naming Consistency · `queryAgentPIDs` spells `PI` where 37 names in the project spell it `Pi` · ×1
  • `queryAgentPIDs` spells `PI` where 37 names in the project spell it `Pi` REDACTED:301 — 37 of 39 names in project openrig spell the token `Pi` (37 of 39; unit: names in project openrig containing `Pi`). Peers: PiCommunityRuntimeAdapter.fromPiAdapter (packages/daemon/src/adapters/pi-community-runtime-adapter.ts:26); pi-readiness.parsePiModelsJson (packages/daemon/src/adapters/pi-readiness.ts:55); pi-runner-protocol.parsePiRunnerState (packages/daemon/src/adapters/pi-runner-protocol.ts:123); pi-runner-protocol.buildPiChildEnv (packages/daemon/src/adapters/pi-runner-protocol.ts:232); pi-runner-protocol.buildPiRunnerCommand (packages/daemon/src/adapters/pi-runner-protocol.ts:321). Rename to `queryAgentPiDs`. [rule N6]
D21 · Naming Consistency · `getUploadURLExternal` spells `URL` where 89 names in the project spell it `Url` · ×1
  • `getUploadURLExternal` spells `URL` where 89 names in the project spell it `Url` REDACTED:380 — 89 of 90 names in project openrig spell the token `Url` (89 of 90; unit: names in project openrig containing `Url`). Peers: bin-wrapper.resolveBinEntry(moduleUrl) (packages/cli/src/bin-wrapper.ts:18); bin-wrapper.isDirectRun(moduleUrl) (packages/cli/src/bin-wrapper.ts:24); client.formatDaemonHostForUrl (REDACTED:147); client.localDaemonUrl (REDACTED:176); DaemonClient.baseUrl (REDACTED:192). Rename to `getUploadUrlExternal`. [rule N6]
D21 · Naming Consistency · `cachedAgentPIDs` spells `PI` where 37 names in the project spell it `Pi` · ×1
  • `cachedAgentPIDs` spells `PI` where 37 names in the project spell it `Pi` packages/daemon/src/domain/session-fingerprinter.ts:58 — 37 of 39 names in project openrig spell the token `Pi` (37 of 39; unit: names in project openrig containing `Pi`). Peers: PiCommunityRuntimeAdapter.fromPiAdapter (packages/daemon/src/adapters/pi-community-runtime-adapter.ts:26); pi-readiness.parsePiModelsJson (packages/daemon/src/adapters/pi-readiness.ts:55); pi-runner-protocol.parsePiRunnerState (packages/daemon/src/adapters/pi-runner-protocol.ts:123); pi-runner-protocol.buildPiChildEnv (packages/daemon/src/adapters/pi-runner-protocol.ts:232); pi-runner-protocol.buildPiRunnerCommand (packages/daemon/src/adapters/pi-runner-protocol.ts:321). Rename to `cachedAgentPiDs`. [rule N6]
D21 · Naming Consistency · `sourceToolUseID` spells `ID` where 2627 names in the project spell it `Id` · ×1
  • `sourceToolUseID` spells `ID` where 2627 names in the project spell it `Id` packages/daemon/test/helpers/eval-rig-session.ts:179 — 2627 of 2628 names in project openrig spell the token `Id` (2627 of 2628; unit: names in project openrig containing `Id`). Peers: DemoRigSummary.rigId (demo/scripts/common.ts:11); DemoNodeEntry.rigId (demo/scripts/common.ts:18); DemoNodeEntry.logicalId (demo/scripts/common.ts:20); common.getCurrentRigSummary(rigNameOrId) (demo/scripts/common.ts:83); common.listRigNodes(rigNameOrId) (demo/scripts/common.ts:92). Rename to `sourceToolUseId`. [rule N6]
D21 · Naming Consistency · `toJSON` spells `JSON` where 17 names in the project spell it `Json` · ×1
  • `toJSON` spells `JSON` where 17 names in the project spell it `Json` packages/test-system/delivery/harness/oracle.mjs:151 — 17 of 18 names in project openrig spell the token `Json` (17 of 18; unit: names in project openrig containing `Json`). Peers: claude-statusline-context.writeJsonAtomic (packages/daemon/assets/claude-statusline-context.cjs:117); activity-relay.parseJson (REDACTED:33); compaction-restore-bridge.parseJson (packages/daemon/assets/plugins/openrig-core/hooks/scripts/compaction-restore-bridge.cjs:31); restore-from-jsonl.readJsonLines (packages/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs:48); gen-control-plane-json.generateControlPlaneJson (packages/daemon/scripts/gen-control-plane-json.mjs:25). Rename to `toJson`. [rule N6]
DM9 · Scattered domain decisions · Rule about [data, status] decided in 8 places · ×1
  • Rule about [data, status] decided in 8 places — packages.cli.src.client.DaemonResponse's [data, status] are judged in packages.cli.src.commands.ask, packages.cli.src.commands.gateway, packages.cli.src.commands.queue, packages.cli.src.commands.shrink, packages.cli.src.commands.slack, packages.cli.src.commands.stream-outcome, packages.cli.src.commands.terminal, packages.cli.src.lib.bundle-source — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [kind, sourceType] decided in 2 places · ×1
  • Rule about [kind, sourceType] decided in 2 places — packages.cli.src.commands.specs.LibraryEntry's [kind, sourceType] are judged in packages.cli.src.commands.specs, packages.cli.src.commands.up — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [healthy, state] decided in 2 places · ×1
  • Rule about [healthy, state] decided in 2 places — packages.cli.src.daemon-lifecycle.DaemonStatus's [healthy, state] are judged in packages.cli.src.commands.whoami, packages.cli.src.lib.bundle-source — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [port, state] decided in 3 places · ×1
  • Rule about [port, state] decided in 3 places — packages.cli.src.daemon-lifecycle.DaemonStatus's [port, state] are judged in packages.cli.src.commands.queue, packages.cli.src.commands.send, packages.cli.src.system-preflight.SystemPreflight — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [outcome, owner] decided in 2 places · ×1
  • Rule about [outcome, owner] decided in 2 places — packages.daemon.src.domain.escalation-owner.EscalationOwner's [outcome, owner] are judged in packages.daemon.src.domain.queue-stuck-sweep, packages.daemon.src.domain.queue-wake-ladder — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [dir, id] decided in 2 places · ×1
  • Rule about [dir, id] decided in 2 places — packages.daemon.src.domain.execution-view.SliceFacts's [dir, id] are judged in packages.daemon.src.domain.execution-view, packages.tui.src.execution.execution-model — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [nodeId, runtime] decided in 2 places · ×1
  • Rule about [nodeId, runtime] decided in 2 places — packages.daemon.src.domain.expected-conversation.ExpectedConversation's [nodeId, runtime] are judged in packages.daemon.src.domain.expected-conversation, packages.daemon.src.routes.startup — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [kind, role] decided in 3 places · ×1
  • Rule about [kind, role] decided in 3 places — packages.daemon.src.domain.gateway.human-registry.HumanConnectorBinding's [kind, role] are judged in packages.daemon.src.domain.gateway.slack.open-asks, packages.daemon.src.domain.gateway.slack.slack-subsystem, packages.daemon.src.routes.gateway — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [subtype, thread_ts, ts] decided in 2 places · ×1
  • Rule about [subtype, thread_ts, ts] decided in 2 places — packages.daemon.src.domain.gateway.slack.inbound.SlackEvent's [subtype, thread_ts, ts] are judged in packages.daemon.src.domain.gateway.slack.channel-recovery.ChannelRecovery, packages.daemon.src.domain.gateway.slack.inbound — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [thread_ts, ts] decided in 2 places · ×1
  • Rule about [thread_ts, ts] decided in 2 places — packages.daemon.src.domain.gateway.slack.inbound.SlackEvent's [thread_ts, ts] are judged in packages.daemon.src.domain.gateway.slack.channel-recovery.ChannelRecovery, packages.daemon.src.domain.gateway.slack.inbound.InboundRouter — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [blockedOn, state] decided in 2 places · ×1
  • Rule about [blockedOn, state] decided in 2 places — packages.daemon.src.domain.gateway.slack.queue-access.QueueItem's [blockedOn, state] are judged in packages.daemon.src.domain.queue-repository.QueueRepository, packages.daemon.src.domain.workflow-projector.WorkflowProjector — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [closureReason, state] decided in 4 places · ×1
  • Rule about [closureReason, state] decided in 4 places — packages.daemon.src.domain.gateway.slack.queue-access.QueueItem's [closureReason, state] are judged in packages.daemon.src.domain.network.network-connector, packages.daemon.src.domain.runner-permissions.RunnerPermissions, packages.daemon.src.routes.hosts, packages.daemon.src.routes.queue — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [destinationSession, sourceSession] decided in 2 places · ×1
  • Rule about [destinationSession, sourceSession] decided in 2 places — packages.daemon.src.domain.gateway.slack.queue-access.QueueItem's [destinationSession, sourceSession] are judged in packages.daemon.src.domain.environment-artifacts.EnvironmentArtifacts, packages.daemon.src.domain.queue-repository.QueueRepository — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [deadline, entries] decided in 2 places · ×1
  • Rule about [deadline, entries] decided in 2 places — packages.daemon.src.domain.gateway.slack.recovery-budget.RecoveryBudget's [deadline, entries] are judged in packages.daemon.src.domain.gateway.slack.channel-recovery.ChannelRecovery, packages.daemon.src.domain.gateway.slack.thread-recovery.ThreadRecovery — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [pgid, pid, tpgid] decided in 2 places · ×1
  • Rule about [pgid, pid, tpgid] decided in 2 places — packages.daemon.src.domain.native-process-lineage.NativeProcessRow's [pgid, pid, tpgid] are judged in packages.daemon.src.domain.native-process-lineage, packages.daemon.src.domain.seat-handover-service.SeatHandoverService — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [pgid, tpgid] decided in 3 places · ×1
  • Rule about [pgid, tpgid] decided in 3 places — packages.daemon.src.domain.native-process-lineage.NativeProcessRow's [pgid, tpgid] are judged in packages.daemon.src.domain.native-process-lineage, packages.daemon.src.domain.seat-handover-service.SeatHandoverService, packages.daemon.src.domain.seat-identity-reconciler.SeatIdentityReconciler — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [pid, ppid] decided in 2 places · ×1
  • Rule about [pid, ppid] decided in 2 places — packages.daemon.src.domain.native-process-lineage.NativeProcessRow's [pid, ppid] are judged in packages.daemon.src.domain.seat-identity-reconciler.SeatIdentityReconciler, packages.daemon.src.domain.seat-restart-in-place.CodexInPlaceRestart — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [code, status] decided in 3 places · ×1
  • Rule about [code, status] decided in 3 places — packages.daemon.src.domain.native-resume-probe.NativeResumeProbeResult's [code, status] are judged in packages.daemon.src.adapters.claude-code-adapter.ClaudeCodeAdapter, packages.daemon.src.adapters.claude-resume.ClaudeResumeAdapter, packages.daemon.src.adapters.codex-runtime-adapter.CodexRuntimeAdapter — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [state, value] decided in 2 places · ×1
  • Rule about [state, value] decided in 2 places — packages.daemon.src.domain.permission-drift.AppliedLaunchObservation's [state, value] are judged in packages.daemon.src.adapters.codex-resume.CodexResumeAdapter, packages.daemon.src.adapters.codex-runtime-adapter.CodexRuntimeAdapter — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [category, classification] decided in 2 places · ×1
  • Rule about [category, classification] decided in 2 places — packages.daemon.src.domain.projection-planner.ProjectionEntry's [category, classification] are judged in packages.daemon.src.domain.rigspec-instantiator.PodRigInstantiator, packages.daemon.src.domain.runtime-switch-materials — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [category, mergeStrategy] decided in 6 places · ×1
  • Rule about [category, mergeStrategy] decided in 6 places — packages.daemon.src.domain.projection-planner.ProjectionEntry's [category, mergeStrategy] are judged in packages.daemon.src.adapters.claude-code-adapter.ClaudeCodeAdapter, packages.daemon.src.adapters.codex-runtime-adapter.CodexRuntimeAdapter, packages.daemon.src.adapters.pi-runtime-adapter.PiRuntimeAdapter, packages.daemon.src.adapters.stub-runtime-adapter.StubRuntimeAdapter, packages.daemon.src.domain.rigspec-instantiator.PodRigInstantiator, packages.daemon.src.domain.runtime-switch-materials — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [outcome, reason] decided in 2 places · ×1
  • Rule about [outcome, reason] decided in 2 places — packages.daemon.src.domain.provider.provider-types.UsageRefreshOutcome's [outcome, reason] are judged in packages.daemon.src.domain.provider.claude-usage-windows.ClaudeUsageWindows, packages.daemon.src.domain.provider.usage-windows.UsageWindows — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [ownerNotificationKind, ownerNotificationLevel] decided in 2 places · ×1
  • Rule about [ownerNotificationKind, ownerNotificationLevel] decided in 2 places — packages.daemon.src.domain.queue-transition-log.QueueTransition's [ownerNotificationKind, ownerNotificationLevel] are judged in packages.daemon.src.domain.queue-repository, packages.daemon.src.domain.queue-repository.QueueRepository — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [proofDirExists, proofDirHasEntries, proofFileExists] decided in 2 places · ×1
  • Rule about [proofDirExists, proofDirHasEntries, proofFileExists] decided in 2 places — packages.daemon.src.domain.scope.scope-audit.ScopeAuditInput's [proofDirExists, proofDirHasEntries, proofFileExists] are judged in packages.cli.src.lib.scope.scope-audit, packages.daemon.src.domain.scope.scope-audit — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [nodeId, occupant, pane, session] decided in 2 places · ×1
  • Rule about [nodeId, occupant, pane, session] decided in 2 places — packages.daemon.src.domain.seat-delivery-guard.GuardTarget's [nodeId, occupant, pane, session] are judged in packages.daemon.src.domain.queue-repository.QueueRepository, packages.daemon.src.domain.seat-delivery-guard.SeatDeliveryGuard — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [reason, state] decided in 3 places · ×1
  • Rule about [reason, state] decided in 3 places — packages.daemon.src.domain.seat-structural-activity-service.StructuralObservation's [reason, state] are judged in packages.daemon.src.domain.node-inventory, packages.daemon.src.domain.seat-activity-service, packages.daemon.src.domain.seat-structural-activity-service.SeatStructuralActivityService — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [inputPhase, sent] decided in 7 places · ×1
  • Rule about [inputPhase, sent] decided in 7 places — packages.daemon.src.domain.session-transport.SendResult's [inputPhase, sent] are judged in packages.daemon.src.domain.claim-service, packages.daemon.src.domain.draft-aware-delivery.DraftAwareDelivery, packages.daemon.src.domain.pi-compaction-service.PiCompactionService, packages.daemon.src.domain.session-transport, packages.daemon.src.domain.session-transport.SessionTransport, packages.daemon.src.domain.watchdog-delivery, packages.daemon.src.routes.transport — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [reason, sent] decided in 2 places · ×1
  • Rule about [reason, sent] decided in 2 places — packages.daemon.src.domain.session-transport.SendResult's [reason, sent] are judged in packages.daemon.src.domain.session-transport.SessionTransport, packages.daemon.src.routes.transport — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [pane_id, terminal_id, workspace_id] decided in 3 places · ×1
  • Rule about [pane_id, terminal_id, workspace_id] decided in 3 places — packages.daemon.src.domain.terminal.herdr-viewer.ViewerPane's [pane_id, terminal_id, workspace_id] are judged in packages.daemon.src.domain.terminal.herdr-follow-view.HerdrFollowView, packages.daemon.src.domain.terminal.herdr-viewer, packages.daemon.src.domain.terminal.herdr-viewer.HerdrViewer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [paneCommand, readOnly] decided in 2 places · ×1
  • Rule about [paneCommand, readOnly] decided in 2 places — packages.daemon.src.domain.terminal.terminal-provider.ComposedPane's [paneCommand, readOnly] are judged in packages.daemon.src.domain.terminal.herdr-follow-view.HerdrFollowView, packages.daemon.src.domain.terminal.herdr-viewer.HerdrViewer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [evidenceSource, rawEvent, reason, stale] decided in 2 places · ×1
  • Rule about [evidenceSource, rawEvent, reason, stale] decided in 2 places — packages.daemon.src.domain.types.AgentActivity's [evidenceSource, rawEvent, reason, stale] are judged in packages.daemon.src.domain.agent-activity-store, packages.daemon.src.domain.queue-wake-ladder — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [reason, state] decided in 2 places · ×1
  • Rule about [reason, state] decided in 2 places — packages.daemon.src.domain.types.AgentActivity's [reason, state] are judged in packages.daemon.src.domain.node-inventory, packages.daemon.src.domain.session-transport.SessionTransport — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [id, tmuxSession] decided in 2 places · ×1
  • Rule about [id, tmuxSession] decided in 2 places — packages.daemon.src.domain.types.Binding's [id, tmuxSession] are judged in packages.daemon.src.routes.startup, packages.daemon.src.server — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [tmuxPane, tmuxSession] decided in 7 places · ×1
  • Rule about [tmuxPane, tmuxSession] decided in 7 places — packages.daemon.src.domain.types.Binding's [tmuxPane, tmuxSession] are judged in packages.daemon.src.domain.codex-rebuild-permissions, packages.daemon.src.domain.expected-conversation, packages.daemon.src.domain.model-divergence.current-model-reader.CurrentModelReader, packages.daemon.src.domain.node-launcher.NodeLauncher, packages.daemon.src.domain.seat-runtime-switch-service.SeatRuntimeSwitchService, packages.daemon.src.domain.startup-orchestrator.StartupOrchestrator, packages.daemon.src.routes.sessions — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [id, logicalId] decided in 5 places · ×1
  • Rule about [id, logicalId] decided in 5 places — packages.daemon.src.domain.types.Node's [id, logicalId] are judged in packages.daemon.src.domain.node-launcher.NodeLauncher, packages.daemon.src.domain.restore-orchestrator.RestoreOrchestrator, packages.daemon.src.domain.shared-history-selection, packages.daemon.src.routes.sessions, packages.daemon.src.routes.startup — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [canonicalSessionName, logicalId] decided in 2 places · ×1
  • Rule about [canonicalSessionName, logicalId] decided in 2 places — packages.daemon.src.domain.types.NodeInventoryEntry's [canonicalSessionName, logicalId] are judged in packages.daemon.src.domain.seat-lifecycle-service.SeatLifecycleService, packages.daemon.src.domain.seat-status-service.SeatStatusService — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [evidence, sessionName, verdict] decided in 2 places · ×1
  • Rule about [evidence, sessionName, verdict] decided in 2 places — packages.daemon.src.domain.types.SeatIdentityVerdict's [evidence, sessionName, verdict] are judged in packages.daemon.src.domain.expected-conversation, packages.daemon.src.routes.sessions — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [createdAt, id] decided in 2 places · ×1
  • Rule about [createdAt, id] decided in 2 places — packages.daemon.src.domain.types.Session's [createdAt, id] are judged in packages.daemon.src.domain.kernel-boot, packages.daemon.src.domain.kernel-boot-tracker.KernelBootTracker — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 1/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `packages/acp`, `packages/cli`, `packages/tui`.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST .github/workflows/portability-report.yml:11 — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 2 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · Dependabot does not watch npm · ×1
  • Dependabot does not watch npm REDACTED:8 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `npm`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
R7 · Dead Code · Unused export 'setSelfHostId' · ×1
  • Unused export 'setSelfHostId' packages/cli/src/lib/hosts/fanout-contract.ts:30 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getSelfHostId' · ×1
  • Unused export 'getSelfHostId' packages/cli/src/lib/hosts/fanout-contract.ts:35 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'setSelfHostIdSource' · ×1
  • Unused export 'setSelfHostIdSource' packages/cli/src/lib/hosts/fanout-contract.ts:48 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getSelfHostIdSource' · ×1
  • Unused export 'getSelfHostIdSource' packages/cli/src/lib/hosts/fanout-contract.ts:53 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'resolvesToLocalHost' · ×1
  • Unused export 'resolvesToLocalHost' packages/cli/src/lib/hosts/fanout-contract.ts:66 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'classifyPermissionPolicyRef' · ×1
  • Unused export 'classifyPermissionPolicyRef' packages/cli/src/lib/permission-policy/policy-ref.ts:93 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'resolvePermissionPolicyRefValue' · ×1
  • Unused export 'resolvePermissionPolicyRefValue' packages/cli/src/lib/permission-policy/policy-ref.ts:237 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'serializePolicySpec' · ×1
  • Unused export 'serializePolicySpec' packages/cli/src/lib/permission-policy/policy-spec.ts:109 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'isPlaceholderOnlyBlock' · ×1
  • Unused export 'isPlaceholderOnlyBlock' packages/cli/src/lib/scope/scaffold-placeholder.ts:55 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'GENERIC_SCAFFOLD_ACCEPTANCE' · ×1
  • Unused export 'GENERIC_SCAFFOLD_ACCEPTANCE' packages/cli/src/lib/scope/scaffold-placeholder.ts:92 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'MISSION_BRIEF_HEADERS' · ×1
  • Unused export 'MISSION_BRIEF_HEADERS' REDACTED:170 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'joinFrontmatter' · ×1
  • Unused export 'joinFrontmatter' packages/cli/src/lib/scope/scope-fs.ts:60 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'renderImplementationPrdTemplate' · ×1
  • Unused export 'renderImplementationPrdTemplate' packages/cli/src/lib/scope/templates.ts:91 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'loadSkillIndex' · ×1
  • Unused export 'loadSkillIndex' packages/cli/src/release-surface/affected-skills.ts:139 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'nonInterruptiveArg' · ×1
  • Unused export 'nonInterruptiveArg' packages/daemon/src/adapters/non-interruptive.ts:28 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'OPENROUTER_CHARGE_MAX_POSTS' · ×1
  • Unused export 'OPENROUTER_CHARGE_MAX_POSTS' packages/daemon/src/adapters/pi-openrouter-charge.ts:107 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'PI_ENV_BASELINE_VARS' · ×1
  • Unused export 'PI_ENV_BASELINE_VARS' packages/daemon/src/adapters/pi-runner-protocol.ts:209 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'PREPARED_MAP_MAX_GROWTH_PERCENT' · ×1
  • Unused export 'PREPARED_MAP_MAX_GROWTH_PERCENT' packages/daemon/src/domain/claude-compaction-enforcer.ts:75 — Nothing imports this binding — it is safe to review for removal.
R8 · Dependency Hygiene · Test-only dependency '@hono/node-server' in production deps · ×1
  • Test-only dependency '@hono/node-server' in production deps packages/cli/package.json:48 — Only test files import it (first: packages/cli/test/acp-real-queue.test.ts:4) — move it to devDependencies.
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 24/97 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 — ~7.0 `!` null assertions per 1k TypeScript source lines — 2629 assertion(s) across the 373590 source line(s) of the 1523 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: packages/daemon/src/domain/session-transport.ts (158), packages/daemon/src/domain/native-resume-probe.ts (42), packages/daemon/src/domain/queue-repository.ts (41). 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.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×1
  • Hand-rolled JSON/XML parsing via regex REDACTED:1068 — 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.
Minor — 185 finding(s)
D10 · Test Quality · Skipped (documented) · ×153
  • Skipped (documented): staged conventions doc is byte-identical to the repo source (skipped when no assembled package present) scripts/check-packing.test.mjs:150 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): CLI preparation follows file symlinks like the old cp glob scripts/prepare-workspace-build.test.mjs:43 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
  • Skipped (documented): (unnamed test) packages/ui/test/feed-card-drill-ac3.test.tsx:23 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/ui/test/focused-terminal-reconnect.test.tsx:62 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) packages/daemon/test/account-home-snapshot.test.ts:10 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:126 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:152 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:181 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:208 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:230 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:257 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:278 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:294 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:324 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:351 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-archive.test.ts:389 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-binary-bytes.test.ts:89 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-prelaunch-routing.test.ts:326 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/bundle-source-resolver.test.ts:359 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/capture-prompt-pane.test.ts:318 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/claude-context-collector.test.ts:727 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/claude-context-collector.test.ts:745 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/claude-core-plugin-load.test.ts:1133 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/claude-mcp-launch.test.ts:63 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) packages/daemon/test/claude-mcp-launch.test.ts:84 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • + 128 more in this group — see findings.md.
D12 · Dependency Hygiene · Outdated (npm) · ×30
  • Outdated (npm): @fontsource-variable/jetbrains-mono — @fontsource-variable/jetbrains-mono is pinned at 5.2.8; registry.npmjs.org publishes 5.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): @fontsource-variable/space-grotesk — @fontsource-variable/space-grotesk is pinned at 5.2.10; registry.npmjs.org publishes 5.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): @fontsource/inter — @fontsource/inter is pinned at 5.2.8; registry.npmjs.org publishes 5.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): @hono/node-server — @hono/node-server is pinned at 1.19.11; registry.npmjs.org publishes 2.1.9 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): @radix-ui/react-dialog — @radix-ui/react-dialog is pinned at 1.1.15; registry.npmjs.org publishes 1.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): @radix-ui/react-separator — @radix-ui/react-separator is pinned at 1.1.8; registry.npmjs.org publishes 1.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): @radix-ui/react-slot — @radix-ui/react-slot is pinned at 1.2.4; registry.npmjs.org publishes 1.5.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): @radix-ui/react-tabs — @radix-ui/react-tabs is pinned at 1.1.13; registry.npmjs.org publishes 1.2.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): @radix-ui/react-tooltip — @radix-ui/react-tooltip is pinned at 1.2.8; registry.npmjs.org publishes 1.4.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): @tanstack/react-query — @tanstack/react-query is pinned at 5.95.2; registry.npmjs.org publishes 5.107.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): @tanstack/react-router — @tanstack/react-router is pinned at 1.168.3; registry.npmjs.org publishes 1.170.46 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): @tanstack/react-table — @tanstack/react-table is pinned at 8.21.3; registry.npmjs.org publishes 9.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): @xyflow/react — @xyflow/react is pinned at 12.10.1; registry.npmjs.org publishes 13.0.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): ajv — ajv is pinned at 8.18.0; registry.npmjs.org publishes 8.20.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): autoprefixer — autoprefixer is pinned at 10.4.27; registry.npmjs.org publishes 10.6.2 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): better-sqlite3 — better-sqlite3 is pinned at 13.0.3; registry.npmjs.org publishes 13.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): commander — commander is pinned at 13.1.0; registry.npmjs.org publishes 15.1.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): hono — hono is pinned at 4.12.8; registry.npmjs.org publishes 4.13.19 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): lucide-react — lucide-react is pinned at 1.6.0; registry.npmjs.org publishes 1.74.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): postcss — postcss is pinned at 8.5.8; registry.npmjs.org publishes 8.5.33 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 19.2.4; 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 19.2.4; 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): smol-toml — smol-toml is pinned at 1.8.0; registry.npmjs.org publishes 1.9.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): string-width — string-width is pinned at 8.3.0; registry.npmjs.org publishes 9.0.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): tailwind-merge — tailwind-merge is pinned at 3.5.0; registry.npmjs.org publishes 3.7.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.
  • + 5 more in this group — see findings.md.
D24 · Comment Value · doc comments repeat the names · ×2
  • doc comments repeat the names packages/cli/src/restore-packet/packet-writer.ts:58 — 0 of 8 documented parameters and 1 of 1314 summaries in `@openrig/cli` only repeat the member or parameter name (e.g. "Source session id." for `sourceSessionId`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names packages/daemon/src/domain/bootstrap-orchestrator.ts:36 — 1 of 69 documented parameters and 10 of 9161 summaries in `@openrig/daemon` only repeat the member or parameter name (e.g. "Bootstrap mode" for `BootstrapMode`). 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 --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-7a24e03992f94f06920f0202f7ade600/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-7a24e03992f94f06920f0202f7ade600/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-7a24e03992f94f06920f0202f7ade600/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=1951" --report-format json --report-path /tmp/watchdog-gitleaks-7a24e03992f94f06920f0202f7ade600/history-3.json --exit-code 0 --source .1artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-7a24e03992f94f06920f0202f7ade600/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .73artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .18artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .4artifacts/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 72 file(s) — `packages/cli/src/bin-wrapper.ts`, `packages/cli/src/commands/exec.ts`, `packages/cli/src/commands/project-worker.ts`, `packages/cli/src/commands/ps.ts`, `packages/cli/src/commands/rig-mode.ts`, … (+67 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files).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 01a1e91e-b4f7-7249-bd39-9db0d91e4887 · 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