Public report of BradGroux/veritas-kanban, 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, 11:44 UTC · Survey ID cd_41e0178b7f5b43718bc635495084ea81

BradGroux/veritas-kanban

Measured 17 November 2026, 11:42 UTC, at code version 1d2d45e

First survey, so nothing to compare with yet
CAI score 56.7out of 100 Adequate
CriticalWeakAdequateStrongExemplary

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: 298,397 lines of product code in 7 projects, tests not counted · Estimated rebuild effort: about 3.1 person-years · Weakest lens: Code Health, 50.0

Findings by how serious they are

56 critical 2411 serious 334 minor

2 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, 11:42 UTC

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

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

88of 88 dimensions measured by tools.
2767of 2801 findings point to an exact file and line, so you can open each one in the code. The other 34 concern the repository as a whole, such as missing documentation.
88dimensions across 7 lenses, read from 298,397 lines of product code in 7 projects.
Chapters

Executive summary

BradGroux/veritas-kanban falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 56.7 out of 100 and is rated Adequate, and 19 of its 56 critical findings are security problems.

Code Health, at 50.0, is the weakest lens and counts most in the score. The best first step is splitting the oversized files, worth about 3.3 points. Fixing the 175 functions that are too long comes next, worth about 2.5 points. Raising Code Health to 70 would lift the score to about 61.9.

Thirteen weaknesses in the code could be used by an attacker. Two automatic updates take new releases before a bad one can be spotted, and ten form fields can't be read by a screen reader. Fixing the weaknesses the scanner points to, setting a waiting period for automatic updates and labelling the form fields would close these risks. Loading the key from a secret store instead of the code would fix the two encryption keys written into the code, and the password or key in the code's history needs replacing, with the old one switched off. The 12 labels or groups of fields with no name need connecting to their fields or naming.

The product code is 298,397 lines, about €450,000 to rebuild.

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

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

If Code Health rose from 50.0 to 70, the lowest score rated Strong, the score would rise from 56.7 to about 61.9.

Code composition: what the lines of code are
Product code 67%Tests 33%
Rebuild cost: about €450,000 · Estimate
Cost to rebuild€150,000 to €750,000, for 2,504 to 7,942 hours of work, about 3.1 person-years for 1 to 6 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 57. 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: 298,397 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
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 3.3 points · Medium effort · Large Files
2
Resolve the 175 FunctionTooLong finding(s) in God Classes — start with AgentsTab.tsx (10), AgentRunTimelinePanel.tsx (3), AdmissionQueuePanel.tsx (3).
Raises the score by about 2.5 points · High effort · God Classes
3
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.
Raises the score by about 2.0 points · Medium effort · Async & latency 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
11 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 (94 files) · Code Coverage (182 files under half tested) · The files: clawdbot-agent-service.ts, PolicyManager.tsx and MultiUserTab.tsx
What to do: Add tests to these files and have a second person review every change to them, starting with clawdbot-agent-service.ts, PolicyManager.tsx and MultiUserTab.tsx.
Where the investment is most exposed · Value at risk
This code would cost about €450,000 to build again, about 3.1 person-years of work. Its weakest lens is Code Health, at 50.0 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package. Of all the actions in this report, it raises the score most for the work it takes: about 3.3 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 7% to 16% on every change. The history of the code shows how much it changes: about 149,237 lines over the last 90 days, which is about 605,239 lines a year. At that pace, the extra work comes to an estimated 104.5 to 626.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch @veritas-kanban/cli cli @veritas-kanban/shared shared @veritas-kanban/cli->@veritas-kanban/shared @veritas-kanban/desktop desktop @veritas-kanban/desktop->@veritas-kanban/shared @veritas-kanban/mcp mcp @veritas-kanban/mcp->@veritas-kanban/shared @veritas-kanban/server server @veritas-kanban/server->@veritas-kanban/shared @veritas-kanban/web web @veritas-kanban/web->@veritas-kanban/shared

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.

734 modules, with 1674 dependencies between them. 5 loops run through 14 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 694 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 desktop.src.main2 mcp.src.tools.projects3 server.src.services.metrics.types4 server.src.storage.sqlite.database5 server.src.types.workflow6 shared.src.types.agent-budget_types7 shared.src.types.phase-capability_types8 shared.src.types.provider-runtime_types9 shared.src.types.run-event_types10 shared.src.types.sandbox-policy_types11 shared.src.types.task-envelope_types12 shared.src.types.work-product_types13 shared.src.types.run-launch-manifest_types14 shared.src.types.task_types15 web.src.components.dashboard16 shared.src.types.admission-control_types17 shared.src.types.telemetry_types18 shared.src.types.template_types19 cli.src.commands20 server.src.services.workflow-run-service21 server.src.storage22 shared.src.types.config_types23 web.src.components.task24 web.src.hooks25 server.src.services.agent-provider-adapter-registry26 server.src.services.config-service27 server.src.services.queue-intake-monitor-service28 server.src.storage.interfaces29 server.src.storage.sqlite30 server.src.utils31 web.src.components.settings.tabs32 server.src.services.run-event-journal-service33 server.src.services.task-service34 server.src.services.run-approval-broker-service35 server.src.services.run-recovery-coordinator36 server.src.storage.file-storage37 server.src.services.clawdbot-agent-service38 server.src.storage.sqlite.sqlite-storage39 server.src.routes40 server.src.services
1 desktop.src.main
2 mcp.src.tools.projects
3 server.src.services.metrics.types
4 server.src.storage.sqlite.database
5 server.src.types.workflow
6 shared.src.types.agent-budget_types
7 shared.src.types.phase-capability_types
8 shared.src.types.provider-runtime_types
9 shared.src.types.run-event_types
10 shared.src.types.sandbox-policy_types
11 shared.src.types.task-envelope_types
12 shared.src.types.work-product_types
13 shared.src.types.run-launch-manifest_types112
14 shared.src.types.task_types1
15 web.src.components.dashboard13
16 shared.src.types.admission-control_types22
17 shared.src.types.telemetry_types122
18 shared.src.types.template_types2
19 cli.src.commands12112
20 server.src.services.workflow-run-service2634
21 server.src.storage12315
22 shared.src.types.config_types21711
23 web.src.components.task23316
24 web.src.hooks2611
25 server.src.services.agent-provider-adapter-registry121211
26 server.src.services.config-service213
27 server.src.services.queue-intake-monitor-service2
28 server.src.storage.interfaces13312231
29 server.src.storage.sqlite2311
30 server.src.utils112122
31 web.src.components.settings.tabs1111
32 server.src.services.run-event-journal-service41
33 server.src.services.task-service1272
34 server.src.services.run-approval-broker-service1112
35 server.src.services.run-recovery-coordinator2223112
36 server.src.storage.file-storage12313203
37 server.src.services.clawdbot-agent-service1514213534413111111
38 server.src.storage.sqlite.sqlite-storage211
39 server.src.routes111411
40 server.src.services11135172191282116261171382112
Uses a module listed above itPart of a loopThe module itself
1 desktop.src.main2 mcp.src.tools.projects3 server.src.services.metrics.types4 server.src.storage.sqlite.database5 server.src.types.workflow6 shared.src.types.agent-budget_types7 shared.src.types.phase-capability_types8 shared.src.types.provider-runtime_types9 shared.src.types.run-event_types10 shared.src.types.sandbox-policy_types11 shared.src.types.task-envelope_types12 shared.src.types.work-product_types13 shared.src.types.run-launch-manifest_types14 shared.src.types.task_types15 web.src.components.dashboard16 shared.src.types.admission-control_types17 shared.src.types.telemetry_types18 shared.src.types.template_types19 cli.src.commands20 server.src.services.workflow-run-service21 server.src.storage22 shared.src.types.config_types23 web.src.components.task24 web.src.hooks25 server.src.services.agent-provider-adapter-registry26 server.src.services.config-service27 server.src.services.queue-intake-monitor-service28 server.src.storage.interfaces29 server.src.storage.sqlite30 server.src.utils31 web.src.components.settings.tabs32 server.src.services.run-event-journal-service33 server.src.services.task-service34 server.src.services.run-approval-broker-service35 server.src.services.run-recovery-coordinator36 server.src.storage.file-storage37 server.src.services.clawdbot-agent-service38 server.src.storage.sqlite.sqlite-storage39 server.src.routes40 server.src.servicesdesktop.src.main1mcp.src.tools.projects2server.src.services.metrics.types3server.src.storage.sqlite.database4server.src.types.workflow5shared.src.types.agent-budget_types6shared.src.types.phase-capability_types7shared.src.types.provider-runtime_types8shared.src.types.run-event_types9shared.src.types.sandbox-policy_types10shared.src.types.task-envelope_types11shared.src.types.work-product_types12shared.src.types.run-launch-manifest_types13shared.src.types.task_types14web.src.components.dashboard15shared.src.types.admission-control_types16shared.src.types.telemetry_types17shared.src.types.template_types18cli.src.commands19server.src.services.workflow-run-service20server.src.storage21shared.src.types.config_types22web.src.components.task23web.src.hooks24server.src.services.agent-provider-adapter-registry25server.src.services.config-service26server.src.services.queue-intake-monitor-service27server.src.storage.interfaces28server.src.storage.sqlite29server.src.utils30web.src.components.settings.tabs31server.src.services.run-event-journal-service32server.src.services.task-service33server.src.services.run-approval-broker-service34server.src.services.run-recovery-coordinator35server.src.storage.file-storage36server.src.services.clawdbot-agent-service37server.src.storage.sqlite.sqlite-storage38server.src.routes39server.src.services401121132212221211226341231521711233162611121211213213312231231111212211114112721112222311212313203151421353441311111121111141111135172191282116261171382112+694 more modules (most-connected shown)

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

At a glance — Architecture · 78.9 · Adequate · gated by D26 ·

At a glance — Maturity · 88.7 · Strong ·

At a glance — Readiness · 74.5 · Adequate · gated by P7 ·

At a glance — Security · 65.2 · Adequate · gated by D29 ·

At a glance — Domain Modelling · — · — ·

At a glance — Accessibility · 57.7 · Adequate · gated by AC2, AC4 ·

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 — Injection641High / Critical
A03:2025 — Software Supply Chain Failures9Medium
A07:2025 — Authentication Failures3High / Critical
A02:2025 — Security Misconfiguration3Medium

Roadmap

Top priorities: Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Resolve the 175 FunctionTooLong finding(s) in God Classes — start with AgentsTab.tsx (10), AgentRunTimelinePanel.tsx (3), AdmissionQueuePanel.tsx (3); 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.

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

Do thisHelpsEffortDimension
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+3.3 ptsMediumLarge Files
Resolve the 175 FunctionTooLong finding(s) in God Classes — start with AgentsTab.tsx (10), AgentRunTimelinePanel.tsx (3), AdmissionQueuePanel.tsx (3).+2.5 ptsHighGod Classes
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.+2.0 ptsMediumAsync & latency hygiene
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+1.8 ptsMediumKeyboard semantics
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.+1.7 ptsMediumCode Duplication
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+1.6 ptsMediumForms & labels
Resolve the 100 FileTooLong finding(s) in God Classes — start with REDACTED (2), knowledge-collection-repository.ts (2), REDACTED (2).+1.4 ptsHighGod Classes
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.+1.2 ptsMediumVisual & motion safety

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.3MixedStatic 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 — 56

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

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

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

Could not be resolved — 2

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 88 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 88 dimensions across the health lenses
D1D2D3D5D6D7D8D10D11D12D13D14D15D17D19D20D21D23D24D26D27D28D29D30D31D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX4AX6AX8C2DM9GD1IC1M1M2M3M4P1P10P2P3P4P5P6P7PF3R1R10R11R2R3R4R6R7R8R9S1X1X12X13X14X16X17X18X19X2X21X23X24X25X28X29X3X4X5

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, 2767 of 2801 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 01a1e950-c852-72d1-bb9f-2fbedb6d1c3d.

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.

  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (10 contributor(s) across 1902 commit(s) sampled, automation and bot accounts excluded). One of them holds 99% of the history; the other 9 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (mcp/package.json), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
  • 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.
  • D27 Navigability — 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. Tracing effort is measured over resolved call sites, and all 1096 sampled here came from .mjs/.ts files. This repository's .tsx source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
  • 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. `cli/src/commands/tool-servers.ts`, `desktop/src/shared/desktop-bridge-contracts.ts`, `server/src/services/acp-stdio-adapter.ts`, `server/src/services/api-token-service.ts`, `server/src/services/automation-activation-service.ts`, … (+36 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AC2 Forms & labels — 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. 40 further occurrence(s) are not listed individually; the score already reflects all 80.
  • AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in server/src/services/agent-registry-service.ts, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
  • 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.
  • 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. 1171 further occurrence(s) are not listed individually; the score already reflects all 1211.
  • 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. 726 further occurrence(s) are not listed individually; the score already reflects all 766.
  • 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. 156 further occurrence(s) are not listed individually; the score already reflects all 196.
  • 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. 9 further occurrence(s) are not listed individually; the score already reflects all 49.
  • 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. 102 further occurrence(s) are not listed individually; the score already reflects all 142.
  • 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. 110 further occurrence(s) are not listed individually; the score already reflects all 150.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • 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 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • 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.
  • 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".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • 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 Complexity3.5 / 10Weak✓ 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 3.5 / 10 · rule-coverage 100% · ceiling Prevented

374 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ClawdbotAgentService.startCodexAppServer at 140. A further 14 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 commands.commandLabel at 23 — they are counted neither in the figure above nor in this dimension's score. 10 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: desktop/src/main/commands.ts (commands.commandLabel at 23), server/src/services/workspace-checkpoint-ownership-service.ts (WorkspaceCheckpointOwnershipService.verify at 21), server/src/services/harness-conformance-service.ts (harness-conformance-service.evaluateAssertion at 19), server/src/services/openclaw-completion-service.ts (openclaw-completion-service.assertOpenClawRunBinding at 19), server/src/storage/sqlite/work-product-artifact-repository.ts (work-product-artifact-repository.sameIdentity at 18), and 5 more not listed here. 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.

ClawdbotAgentService.startCodexAppServer (cyclomatic 140)server/src/services/clawdbot-agent-service.ts:5554
ClawdbotAgentService.startReservedAgent (cyclomatic 128)server/src/services/clawdbot-agent-service.ts:1384
TaskCard.TaskCard (cyclomatic 125)web/src/components/task/TaskCard.tsx:195
AgentPanel.AgentPanel (cyclomatic 121)web/src/components/task/AgentPanel.tsx:77
agents.registerAgentCommands (cyclomatic 119)cli/src/commands/agents.ts:205

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

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with ClawdbotAgentService.startCodexAppServer (cyclomatic 140), ClawdbotAgentService.startReservedAgent (cyclomatic 128), TaskCard.TaskCard (cyclomatic 125). — 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 4 together lifts Cyclomatic Complexity from 3.5 to about 3.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.3 / 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.3 / 10 · rule-coverage 100% · ceiling Prevented

438 method(s) exceeded the cognitive complexity threshold of 15; the worst was ClawdbotAgentService.startReservedAgent at 165.

ClawdbotAgentService.startReservedAgent (cognitive 165)server/src/services/clawdbot-agent-service.ts:1384
NeedsAttentionQueue.buildNeedsAttentionItems (cognitive 156)web/src/components/dashboard/NeedsAttentionQueue.tsx:283
TaskService.updateTaskMutation (cognitive 153)server/src/services/task-service.ts:866
agents.registerAgentCommands (cognitive 144)cli/src/commands/agents.ts:205
TaskCard.areTaskCardPropsEqual (cognitive 140)web/src/components/task/TaskCard.tsx:84

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

What to do

  1. Bring the 6 bodies over 120 down to 120 or less in Cognitive Complexity — start with ClawdbotAgentService.startReservedAgent (cognitive 165), NeedsAttentionQueue.buildNeedsAttentionItems (cognitive 156), TaskService.updateTaskMutation (cognitive 153). — 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 6 together lifts Cognitive Complexity from 2.3 to about 3.1/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

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

409 god class(es) detected.

FunctionTooLong: MultiUserTab.MultiUserTab · ×175web/src/components/settings/tabs/MultiUserTab.tsx:197
FileTooLong: services/clawdbot-agent-service.ts · ×100server/src/services/clawdbot-agent-service.ts
MethodTooLong: RunLaunchCompiler.compile · ×69server/src/services/run-launch-compiler.ts:138
ClassTooLong: ClawdbotAgentService · ×51server/src/services/clawdbot-agent-service.ts:562
TooManyMethods: ClawdbotAgentService · ×14server/src/services/clawdbot-agent-service.ts:562

What to do

  1. Resolve the 175 FunctionTooLong finding(s) in God Classes — start with AgentsTab.tsx (10), AgentRunTimelinePanel.tsx (3), AdmissionQueuePanel.tsx (3). — One of this dimension's main actionable groups (175 warning-level).
  2. Resolve the 100 FileTooLong finding(s) in God Classes — start with REDACTED (2), knowledge-collection-repository.ts (2), REDACTED (2). — One of this dimension's main actionable groups (100 warning-level).
  3. Resolve the 69 MethodTooLong finding(s) in God Classes — start with clawdbot-agent-service.ts (11), REDACTED (6), admission-control-service.ts (4). — One of this dimension's main actionable groups (69 warning-level).

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

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

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

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

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

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

6 production modules (npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.

Off the main sequence: @veritas-kanban/shared

✓ On the Gold path — maintain.

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

D6 · Cohesion (LCOM4)10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

1 of 262 classes have LCOM4 above 3.

Low cohesion: AuditFileRepository (LCOM4 4)server/src/storage/audit-file-repository.ts:26

What to do

  1. Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with audit-file-repository.ts. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

Detailed fixes: d7_recommendation.md.

D8 · Code Coverage9.6 / 10Stronggated by 196 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.6 / 10 · rule-coverage 100% · ceiling Verified

Line coverage 68.7% — 196 file(s) below 50%. Measured from the JavaScript/TypeScript suite (node:test via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root, the 3 run(s) test reliability made; vitest + @vitest/coverage-v8 via `pnpm install --frozen-lockfile --ignore-scripts` in cli/, the 3 run(s) test reliability made; vitest + @vitest/coverage-v8 via `pnpm install --frozen-lockfile --ignore-scripts` in desktop/, the 3 run(s) test reliability made; vitest + @vitest/coverage-v8 via `pnpm install --frozen-lockfile --ignore-scripts` in mcp/, the 3 run(s) test reliability made; vitest + @vitest/coverage-v8 via `pnpm install --frozen-lockfile --ignore-scripts` in server/, the 3 run(s) test reliability made; vitest + @vitest/coverage-v8 via `pnpm install --frozen-lockfile --ignore-scripts` in web/, 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. 10 line(s) in 5 file(s) were executed in some runs and not in others, so they are not counted.

Low coverage: cli/src/commands/agent-status.ts · ×196cli/src/commands/agent-status.ts:1
Tests reach code only in some runs: server/src/services/acp-stdio-adapter.ts · ×5server/src/services/acp-stdio-adapter.ts:408

What to do

  1. Resolve the 196 Low coverage finding(s) in Code Coverage — start with index.ts (4), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (196 warning-level).
  2. Resolve the 5 Tests reach code only in some runs finding(s) in Code Coverage — start with acp-stdio-adapter.ts, admission-control-service.ts, clawdbot-agent-service.ts. — One of this dimension's main actionable groups (5 recommendation-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

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

No assertions (empty test): getStorage throws before initStorage is calledserver/src/__tests__/storage/file-storage.test.ts:307
Fixed-sleep synchronisation: queues a versioned agent launch and replays its exact options exactly once · ×5server/src/__tests__/codex-provider-service.test.ts:1327
No assertions: does not throw when hook unmounts during an in-flight fetch · ×3web/src/__tests__/useRealtimeAgentStatus.test.ts:255
Mock-dominated test: applies a saved board view from the saved view selector · ×6web/src/__tests__/board-chrome-mantine.test.tsx:293
Skipped (documented): (unnamed test) · ×9server/src/__tests__/codex-provider-service.test.ts:1068

What to do

  1. Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with file-storage.test.ts. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 5 Fixed-sleep synchronisation finding(s) in Test Quality — start with task-revision-atomicity.test.ts (3), codex-provider-service.test.ts, file-lock.test.ts. — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 3 No assertions finding(s) in Test Quality — start with useRealtimeAgentStatus.test.ts, broadcast-service.test.ts, trace-service.test.ts. — One of this dimension's main actionable groups (3 warning-level).

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

D11 · Test Reliability8.0 / 10Adequategated by 1 critical finding✓ 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 8.0 / 10 · rule-coverage 100% · ceiling Verified

1 flaky across 1 measured tier(s). JavaScript/TypeScript (node:test via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root (3 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in cli/ (123 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in desktop/ (139 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in mcp/ (110 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in server/ (4004 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in web/ (1114 tests)): measured (1 flaky).

Flaky test: cli/src/__tests__/client-body-deadlines.test.ts::real CLI text/binary callers bounds 'standup' through a 'headers' stall after successful preflight

What to do

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

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

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

21 outdated direct production npm dependency(ies) of 57 graded, 1 pinning defect(s), across 8 package.json (8 of them the product) and 1 committed lockfile(s). Development dependencies are deliberately not graded for currency: that grade is about what SHIPS. 1 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: @types/react-grid-layoutweb/package.json:25
Floating npm dependency: remote-helper
Deprecated: @ungap/structured-clone · ×9REDACTED:1686
Outdated (npm): @mantine/core · ×21

What to do

  1. Resolve the 9 Deprecated finding(s) in Dependency Hygiene — start with REDACTED (9). — One of this dimension's main actionable groups (9 recommendation-level).
  2. Resolve the 1 Deprecated finding(s) in Dependency Hygiene — start with package.json. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Floating npm dependency finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).

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

D13 · REDACTED 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

REDACTED scan ran and found no leaked secrets. 2 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

✓ 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 496 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 496 package(s) this repository's committed lockfile installs for a consumer — its 57 production, optional and peer dependency(ies), across 8 product package.json manifest(s), and everything those install in turn. Its 64 `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. 1 of them publish no licence this pass can read on registry.npmjs.org — an absent field, `UNLICENSED`, or a `SEE LICENSE IN <file>` pointer into a tarball this pass does not download; that is missing data, not a violation, and none of them is charged. No third-party code was found shipping without a manifest entry (vendored or copied-in directories, licence comments preserved in committed bundles, bundled module paths, compiled wasm modules). This repository publishes itself under MIT, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.4 / 10Stronggated by 97 serious findings✓ Tool-verified

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

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

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

Top hotspots: server/src/services/clawdbot-agent-service.ts (13×128=1664); web/src/components/task/TaskWorkView.tsx (11×108=1188); web/src/components/layout/Header.tsx (12×94=1128) Repeated repair below the complexity floor: scripts/docs-media/run.mjs (8 of 12 changes were fixes); web/src/App.tsx (7 of 10 changes were fixes); web/src/components/ui/UiOverlay.tsx (7 of 7 changes were fixes)

Hotspot: server/src/services/clawdbot-agent-service.ts · ×80server/src/services/clawdbot-agent-service.ts:1384
Repeated repair: scripts/docs-media/run.mjs · ×17scripts/docs-media/run.mjs:163

What to do

  1. Resolve the 80 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), clawdbot-agent-service.ts, TaskWorkView.tsx. — One of this dimension's main actionable groups (80 warning-level).
  2. Resolve the 17 Repeated repair finding(s) in Churn × Complexity Hotspots — start with api.ts (2), run.mjs, App.tsx. — One of this dimension's main actionable groups (17 warning-level).

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

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

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

0 deducted task-comment markers across 285708 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.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.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. 165 document(s) read across 7 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality8.0 / 10Strong✓ 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 8.0 / 10 · rule-coverage 100% · ceiling Documented

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

ADR has no Context section · ×2docs/architecture/ADR-0002-v5-remote-server-security-posture.md:1detected by adr-integrity

What to do

  1. Resolve the 2 ADR has no Context section finding(s) in ADR Quality — start with ADR-0002-v5-remote-server-security-posture.md, ADR-0004-post-ga-cloud-sync-hosted-saas.md. — One of this dimension's main actionable groups (2 recommendation-level).

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

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

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

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

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

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

`extractJSON` spells `JSON` where 74 names in the project spell it `Json`server/src/services/text-extraction-service.ts:194
`toJSON` spells `JSON` where 74 names in the project spell it `Json`shared/src/utils/api-errors.ts:56

What to do

  1. Resolve the 1 `extractJSON` spells `JSON` where 74 names in the project spell it… finding(s) in Naming Consistency — start with text-extraction-service.ts. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `toJSON` spells `JSON` where 74 names in the project spell it `Json` finding(s) in Naming Consistency — start with api-errors.ts. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

2 domain type(s) cross context boundaries across 6 contexts; they are measured and withheld (not published, not scored). Contexts: cli, desktop, mcp, server, shared, web.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D24 · Comment Value6.0 5.8 / 10Adequate✓ 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 5.8 / 10 · rule-coverage 97% · ceiling Documented

123 of 3038 judged comments only repeat the code they sit on (4.0 %). 137 comment(s) in another language or script were not judged.

redundant comment · ×100cli/src/commands/agent-status.ts:17
doc comments repeat the names · ×3server/src/config/env.ts:135

What to do

  1. Resolve the 100 redundant comment finding(s) in Comment Value — start with REDACTED (5), REDACTED (4), transition-hooks-service.ts (4). — One of this dimension's main actionable groups (100 recommendation-level).

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

D26 · Project Cohesion1.4 / 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 1.4 / 10 · rule-coverage 100% · ceiling Documented

3 of 7 build units (npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×3server/package.json:1

What to do

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

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

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

31 % of calls cross a namespace and 4 % go through an interface, but 85 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated. Measured over the .mjs/.ts source only — this repository's .tsx was not sampled for call sites, so this score covers part of the tree, not all of it.

Pass-through layer · ×4server/src/storage/file-storage.ts:172

✓ On the Gold path — maintain.

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

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

Method: REDACTED 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 9.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

642 finding(s): 0 critical, 17 high, 624 medium, 1 low. semgrep hit a parse error in 67 file(s) — `cli/src/commands/tool-servers.ts` (line 223), `desktop/src/shared/desktop-bridge-contracts.ts` (line 277, line 349, line 380), `scripts/emit-telemetry.sh` (line 56, line 57, line 71, …), `scripts/squad-event.sh` (line 30, line 31, line 32, …), `scripts/squad-log.sh` (line 95), … (+62 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

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

What to do

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

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

D30 · Dependency Vulnerabilities9.1 / 10Stronggated by 5 serious findings✓ Tool-verified

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

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

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

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

REDACTED

What to do

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

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

D31 · IaC & Container Security9.7 / 10Stronggated by 3 serious findings✓ 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.7 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED

What to do

  1. Resolve the 3 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3). — 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

2 of 817 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is web/src/components/layout/SystemHealthBar.tsx. Counted over 817 of the 1091 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×2web/src/components/layout/SystemHealthBar.tsx:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.7 / 10Adequategated by 3 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: migrations.ts↔sqlite-storage.ts 83%; file-storage.ts↔migrations.ts 73%; useTasks.ts↔REDACTED 73%

Boundary-crossing change coupling: index.ts ↔ api-permissions.ts · ×3server/src/routes/v1/index.ts:1
Change coupling: useTasks.ts ↔ REDACTED · ×8web/src/hooks/useTasks.ts:1
Change-coupling hub: migrations.ts → file-storage.ts, interfaces.ts, sqlite-storage.tsserver/src/storage/sqlite/migrations.ts

What to do

  1. Resolve the 3 Boundary-crossing change coupling finding(s) in Change Coupling — start with index.ts, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 8 Change coupling finding(s) in Change Coupling — start with useTasks.ts, REDACTED, REDACTED. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with migrations.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.

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

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.

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

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

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

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

  • This 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. (×13) — web/src/components/decisions/DecisionDetail.tsx:138, web/src/components/decisions/DecisionExplorer.tsx:231, web/src/components/decisions/DecisionExplorer.tsx:245, …
  • This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it 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. (×3) — web/src/components/decisions/DecisionExplorer.tsx:214, web/src/components/policies/PolicyManager.tsx:863, web/src/components/policies/PolicyManager.tsx:883
  • 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. (×5) — web/src/components/docs/DocsViewer.tsx:140, web/src/components/docs/DocsViewer.tsx:195, web/src/components/prompts/PromptRegistry.tsx:70, …
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×2) — web/src/components/docs/DocsViewer.tsx:156, web/src/components/docs/DocsViewer.tsx:302
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×5) — web/src/components/docs/DocsViewer.tsx:320, web/src/components/prompts/PromptRegistry.tsx:88, web/src/components/prompts/PromptRegistry.tsx:162, …
  • 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) — web/src/components/prompts/PromptRegistry.tsx:69, web/src/components/prompts/PromptRegistry.tsx:78, web/src/components/prompts/PromptRegistry.tsx:87, …

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 semantics3.0 / 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) — web/src/components/layout/ArchiveSidebar.tsx:91, web/src/components/prompts/PromptRegistry.tsx:120, web/src/components/task/AgentPanel.tsx:566, …
  • A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×2) — web/src/components/settings/SortableListItem.tsx:145, web/src/components/task/MultiAgentSelector.tsx:97

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 safety6.0 / 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.

  • This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. (×4) — web/src/components/dashboard/StatusTimeline.tsx:33, web/src/components/dashboard/StatusTimeline.tsx:42, web/src/components/dashboard/StatusTimeline.tsx:51, …
  • <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). — web/src/components/docs/DocsViewer.tsx:320

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

  • `VeritasDesktopApi` declares 24 required operations: `getAppInfo`, `getConnectionStatus`, `getSetupDiagnostics`, `validateConnectionConfig`, `restartLocalServer`, `getSupportSnapshot`, `getUpdateStatus`, `dispatchCommand`, `pickUploadFiles`, `createDiagnosticsBundle`, `performNotificationAction`, `exportWorkProduct`, `openExternal`, `performTitlebarAction`, `onSetupProgress`, `onCommunicationCheck`, `onServerStatus`, `onRunProgress`, `onUpdateStatus`, `onNotificationAction`, `onMenuCommand`, `onUploadProgress`, `onWorkProductExportProgress`, `onExternalDeliveryVerification`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — desktop/src/preload/index.ts:71
  • `KnowledgeCollectionRepository` declares 18 required operations: `createCollection`, `getCollection`, `listCollections`, `createSource`, `getSource`, `listSources`, `readSourceContent`, `getPage`, `listPages`, `applyPageBatch`, `createProposal`, `getProposal`, `listProposals`, `transitionProposal`, `listKnowledgeActivity`, `syncIntegrityFindings`, `listIntegrityFindings`, `transitionIntegrityFinding`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — server/src/storage/knowledge-collection-repository.ts:62

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

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.

DM9 · Scattered domain decisions9.2 / 10Exemplary✓ 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.

  • server.src.storage.execution-tree-budget.ExecutionTreeBudgetLimits's [retryable, terminal] are judged in server.src.storage.admission-reservation-repository.FileAdmissionReservationRepository, server.src.storage.sqlite.admission-reservation-repository.SqliteAdmissionReservationRepository — 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.
  • server.src.storage.knowledge-collection-repository.KnowledgeProposalTransitionBatch's [collectionId, workspaceId] are judged in server.src.storage.knowledge-collection-repository.FileKnowledgeCollectionRepository, server.src.storage.sqlite.knowledge-collection-repository.SqliteKnowledgeCollectionRepository — 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✓ Tool-verified

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

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

  • A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in. — REDACTED:241

What to do

  • Finish or delete the functions that still throw "not implemented", and replace placeholder text before shipping.
IC1 · Incompleteness & stubs6.9 / 10Adequate✓ 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.

  • 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. (×2) — server/src/services/agent-host-service.ts:214, server/src/services/run-output-spill-service.ts:181
  • `revokeRun` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — server/src/services/clawdbot-agent-service.ts:540
  • `stopPreview` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:287
  • The guard above `return 'skipped';` also returns `'skipped'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — server/src/services/scheduler-service.ts:1007
  • The guard above `return null;` also returns `null`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — server/src/services/text-extraction-service.ts:74
  • `validateAcceptanceCriteria` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — REDACTED:1378
  • `save` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. (×2) — server/src/storage/sqlite/governance-repositories.ts:50, server/src/storage/sqlite/governance-repositories.ts:330
  • `delete` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — server/src/storage/sqlite/governance-repositories.ts:375
  • `saveProfile` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — server/src/storage/sqlite/governance-repositories.ts:426
  • `deleteProfile` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — server/src/storage/sqlite/governance-repositories.ts:459
  • `saveEvaluation` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — server/src/storage/sqlite/governance-repositories.ts:474
  • `saveAlert` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — server/src/storage/sqlite/governance-repositories.ts:602
  • `saveBaseline` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — server/src/storage/sqlite/governance-repositories.ts:671
  • `appendEvent` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — server/src/storage/sqlite/journal-maintenance-service.ts:999
  • The guard above `return 'gray';` also returns `'gray'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — web/src/components/workflows/WorkflowRunView.tsx:138
  • `toggleSelecting` has an empty body — confirm it's an intentional no-op and not an unfinished method. — web/src/hooks/useBulkActions.tsx:90
  • `toggleSelect` has an empty body — confirm it's an intentional no-op and not an unfinished method. — web/src/hooks/useBulkActions.tsx:91
  • `selectAll` has an empty body — confirm it's an intentional no-op and not an unfinished method. — web/src/hooks/useBulkActions.tsx:92
  • `toggleGroup` has an empty body — confirm it's an intentional no-op and not an unfinished method. — web/src/hooks/useBulkActions.tsx:93
  • `clearSelection` has an empty body — confirm it's an intentional no-op and not an unfinished method. — web/src/hooks/useBulkActions.tsx:94
  • `switchWorkspace` has an empty body — confirm it's an intentional no-op and not an unfinished method. — web/src/hooks/useIdentity.tsx:139
  • `subscribe` has an empty body — confirm it's an intentional no-op and not an unfinished method. — web/src/theme/MantineRoot.tsx:31
  • `unsubscribe` has an empty body — confirm it's an intentional no-op and not an unfinished method. — web/src/theme/MantineRoot.tsx:32

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

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

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

M2 · Architecture documentation8.0 / 10Strong✓ Tool-verified

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

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

M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • Only 1/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `cli`, `desktop`, `mcp`.
  • `REDACTED` reports through `console.*` at line 269 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — REDACTED:269
  • `server/src/config/security.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. — server/src/config/security.ts:436

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

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.

P4 · Deployment & Rollback10.0 / 10Exemplary✓ 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.

P5 · DR & Backup10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

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. (×2) — server/runtime/run-tool-bridge.mjs:123, REDACTED:384

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

  • `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. (×4) — cli/src/commands/agents.ts:515, cli/src/commands/agents.ts:548, cli/src/commands/workspaces.ts:85, …
  • `writeFileSync` 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. — cli/src/commands/agents.ts:583
  • `readFileSync` in `callback to execute` blocks the event 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) — cli/src/commands/tool-servers.ts:53, cli/src/commands/tool-servers.ts:69
  • `existsSync` in `fileExists` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/check-coverage-policy.mjs:234
  • `lstatSync` in `inspectFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:208
  • `existsSync` in `schedule` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:526
  • `existsSync` in `executeScheduledOperation` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:636
  • `unlinkSync` in `executeScheduledOperation` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:636
  • `existsSync` in `recoverInterruptedOperation` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:911
  • `lstatSync` in `recoverInterruptedOperation` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:912
  • `existsSync` in `appendEvent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:1016
  • `lstatSync` in `appendEvent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:1017
  • `openSync` in `appendEvent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:1033
  • `fstatSync` in `appendEvent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:1039
  • `writeFileSync` in `appendEvent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:1050
  • `fsyncSync` in `appendEvent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:1051
  • `closeSync` in `appendEvent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — server/src/storage/sqlite/journal-maintenance-service.ts:1053

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.4 / 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 Duplication4.5 / 10Weak✓ 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.

  • 87 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, desktop, mcp, scripts, server, shared (+1 more sibling(s) not listed) — 34 of them are reported below, and 53 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 87 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 87 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 87 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. — server/src/types/workflow.ts:10
  • 85 duplicated blocks under web/src/components/ have copies in at least two of the sibling directories activity, archive, auth, backlog, board, chat (+16 more sibling(s) not listed) — 48 of them are reported below, and 37 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 85 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 85 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 85 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. — web/src/components/archive/ArchivePage.tsx:272
  • 83 duplicated blocks under server/src/ have copies in at least two of the sibling directories config, routes, schemas, services, storage, utils — 51 of them are reported below, and 32 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 83 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 83 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 83 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. — server/src/services/telemetry-service.ts:164
  • 10 duplicated blocks under web/src/ have copies in at least two of the sibling directories components, contexts, hooks, lib — 6 of them are reported below, and 4 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 10 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 10 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 10 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. — web/src/components/layout/DesktopShellContext.tsx:387
  • 5 duplicated blocks under scripts/ have copies in at least two of the sibling directories docs-media, native-ui — 4 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 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. — scripts/docs-media/run.mjs:33
  • server/src/types/workflow.ts:10 · shared/src/types/workflow.ts:8 — the two spans are one implementation copied and then locally edited — 1261 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. — server/src/types/workflow.ts:10
  • web/src/components/dashboard/Dashboard.tsx:279 · web/src/components/dashboard/DashboardPage.tsx:199 — the two spans are one implementation copied and then locally edited — 1095 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. — web/src/components/dashboard/Dashboard.tsx:279
  • web/src/components/settings/tabs/QueueMonitorsTab.tsx:41 · web/src/components/settings/tabs/SchedulerTab.tsx:57 — the two spans are one implementation copied and then locally edited — 859 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. — web/src/components/settings/tabs/QueueMonitorsTab.tsx:41
  • web/src/components/archive/ArchivePage.tsx:272 · web/src/components/backlog/BacklogPage.tsx:222 — the two spans are one implementation copied and then locally edited — 707 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. — web/src/components/archive/ArchivePage.tsx:272
  • cli/src/commands/queue-monitors.ts:19 · cli/src/commands/scheduler.ts:253 — the two spans are one implementation copied and then locally edited — 842 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. — cli/src/commands/queue-monitors.ts:19
  • server/src/services/durable-goal-service.ts:145 · server/src/services/reflection-extraction-job-service.ts:52 — the two spans are one implementation copied and then locally edited — 687 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. — server/src/services/durable-goal-service.ts:145
  • web/src/components/task/CommentsSection.tsx:62 · web/src/components/task/DeliverablesSection.tsx:67 — the two spans are one implementation copied and then locally edited — 639 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. — web/src/components/task/CommentsSection.tsx:62
  • web/src/components/task/SubtasksSection.tsx:37 · web/src/components/task/VerificationSection.tsx:28 — the two spans are one implementation copied and then locally edited — 654 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. — web/src/components/task/SubtasksSection.tsx:37
  • server/src/storage/durable-goal-repository.ts:17 · server/src/storage/run-supervisor-repository.ts:17 — the two spans are one implementation copied and then locally edited — 1084 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. — server/src/storage/durable-goal-repository.ts:17
  • server/src/storage/knowledge-collection-repository.ts:305 · server/src/storage/sqlite/knowledge-collection-repository.ts:332 — the two spans are one implementation copied and then locally edited — 610 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. — server/src/storage/knowledge-collection-repository.ts:305
  • server/src/storage/run-output-artifact-repository.ts:33 · server/src/storage/sqlite/run-output-artifact-repository.ts:30 — the two spans are one implementation copied and then locally edited — 681 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. — server/src/storage/run-output-artifact-repository.ts:33
  • server/src/storage/sqlite/api-token-repository.ts:14 · server/src/storage/sqlite/device-session-repository.ts:63 — the two spans are one implementation copied and then locally edited — 558 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. — server/src/storage/sqlite/api-token-repository.ts:14
  • server/src/storage/credential-broker-state-lock.ts:17 · server/src/storage/worktree-manifest-lock.ts:17 — 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. — server/src/storage/credential-broker-state-lock.ts:17
  • web/src/components/archive/ArchivePage.tsx:103 · web/src/components/backlog/BacklogPage.tsx:67 — the two spans are one implementation copied and then locally edited — 609 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. — web/src/components/archive/ArchivePage.tsx:103
  • web/src/components/ui/dialog.tsx:116 · web/src/components/ui/sheet.tsx:114 — the two spans are one implementation copied and then locally edited — 485 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. — web/src/components/ui/dialog.tsx:116
  • REDACTED:81 · server/src/services/template-service.ts:44 — the two spans are one implementation copied and then locally edited — 626 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:81
  • cli/src/commands/backlog.ts:7 · cli/src/commands/sprints.ts:27 — the two spans are one implementation copied and then locally edited — 583 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. — cli/src/commands/backlog.ts:7
  • server/src/services/telemetry-service.ts:164 · server/src/storage/sqlite/telemetry-repository.ts:62 — the two spans are one implementation copied and then locally edited — 694 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. — server/src/services/telemetry-service.ts:164
  • web/src/components/ui/alert-dialog.tsx:12 · web/src/components/ui/dialog.tsx:13 — 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. — web/src/components/ui/alert-dialog.tsx:12
  • web/src/components/settings/tabs/GeneralTab.tsx:278 · web/src/components/settings/tabs/TemplateComponents.tsx:68 — the two spans are one implementation copied and then locally edited — 417 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. — web/src/components/settings/tabs/GeneralTab.tsx:278
  • server/src/services/metrics/run-metrics.ts:16 · server/src/services/metrics/token-metrics.ts:9 — the two spans are one implementation copied and then locally edited — 441 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. — server/src/services/metrics/run-metrics.ts:16
  • web/src/components/auth/LoginScreen.tsx:53 · web/src/components/auth/SetupScreen.tsx:87 — 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. — web/src/components/auth/LoginScreen.tsx:53
  • server/src/storage/delegation-repository.ts:19 · server/src/storage/lifecycle-hooks-repository.ts:18 — the two spans are one implementation copied and then locally edited — 631 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. — server/src/storage/delegation-repository.ts:19
  • server/src/storage/dependency-circuit-override-repository.ts:25 · server/src/storage/dependency-circuit-state-repository.ts:56 — the two spans are one implementation copied and then locally edited — 631 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. — server/src/storage/dependency-circuit-override-repository.ts:25
  • web/src/components/dashboard/DurationDrillDown.tsx:65 · web/src/components/dashboard/TokensDrillDown.tsx:67 — the two spans are one implementation copied and then locally edited — 408 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. — web/src/components/dashboard/DurationDrillDown.tsx:65
  • server/src/storage/sqlite/durable-goal-repository.ts:11 · server/src/storage/sqlite/run-supervisor-repository.ts:11 — the two spans are one implementation copied and then locally edited — 517 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. — server/src/storage/sqlite/durable-goal-repository.ts:11
  • web/src/components/settings/shared/SettingsErrorBoundary.tsx:8 · web/src/components/shared/FeatureErrorBoundary.tsx:7 — the two spans are one implementation copied and then locally edited — 374 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. — web/src/components/settings/shared/SettingsErrorBoundary.tsx:8
  • server/src/services/digest-service.ts:76 · web/src/lib/api/digest.ts:4 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — server/src/services/digest-service.ts:76
  • REDACTED:286 · REDACTED:124 — the two spans are one implementation copied and then locally edited — 490 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:286
  • web/src/components/dashboard/Dashboard.tsx:40 · web/src/components/dashboard/DashboardPage.tsx:42 — 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. — web/src/components/dashboard/Dashboard.tsx:40
  • REDACTED:307 · REDACTED:579 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:307
  • server/src/services/status-history-service.ts:144 · server/src/storage/sqlite/status-history-repository.ts:119 — the two spans are one implementation copied and then locally edited — 415 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. — server/src/services/status-history-service.ts:144
  • web/src/components/auth/SetupScreen.tsx:12 · web/src/components/settings/tabs/SecurityTab.tsx:14 — the two spans are one implementation copied and then locally edited — 501 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. — web/src/components/auth/SetupScreen.tsx:12
  • web/src/components/settings/tabs/QueueMonitorsTab.tsx:247 · web/src/components/settings/tabs/SchedulerTab.tsx:403 — the two spans are one implementation copied and then locally edited — 368 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. — web/src/components/settings/tabs/QueueMonitorsTab.tsx:247
  • web/src/components/board/BoardSidebar.tsx:88 · web/src/components/shared/AgentStatusIndicator.tsx:136 — the two spans are one implementation copied and then locally edited — 558 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. — web/src/components/board/BoardSidebar.tsx:88

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 Boundaries9.7 / 10Exemplary✓ 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.

  • e2e/html-artifact-preview-security.spec.ts:2 reaches past another workspace package's public entry into its internals with a relative path (../server/src/services/work-product-artifact-preview-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. — e2e/html-artifact-preview-security.spec.ts:2
  • e2e/task-artifact-format-popouts.spec.ts:3 reaches past another workspace package's public entry into its internals with a relative path (../shared/src/types/work-product.types) — 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. — e2e/task-artifact-format-popouts.spec.ts:3
  • server/src/__tests__/shared-api-client.test.ts:3 reaches past another workspace package's public entry into its internals with a relative path (../../../shared/src/utils/api-client.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. — server/src/__tests__/shared-api-client.test.ts:3
  • server/src/__tests__/shared-api-permissions.test.ts:3 reaches past another workspace package's public entry into its internals with a relative path (../../../shared/src/utils/api-permissions.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. — server/src/__tests__/shared-api-permissions.test.ts:3

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity6.0 / 10Adequate✓ 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.

  • startReservedAgent has cyclomatic complexity 152 and cognitive complexity 192; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — server/src/services/clawdbot-agent-service.ts:1384
  • buildNeedsAttentionItems has cyclomatic complexity 134 and cognitive complexity 191; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/dashboard/NeedsAttentionQueue.tsx:283
  • compile has cyclomatic complexity 126 and cognitive complexity 125; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — server/src/services/run-launch-compiler.ts:138
  • TaskCard has cyclomatic complexity 100 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/task/TaskCard.tsx:195
  • (anonymous) has cyclomatic complexity 98 and cognitive complexity 174; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — server/src/services/task-service.ts:908
  • TaskWorkView has cyclomatic complexity 90 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/src/components/task/TaskWorkView.tsx:425
  • project has cyclomatic complexity 87 and cognitive complexity 72; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — server/src/services/run-access-summary-service.ts:164
  • buildAgentRunTimelineEvents has cyclomatic complexity 85 and cognitive complexity 116; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/task/AgentRunTimelinePanel.tsx:531
  • areTaskCardPropsEqual has cyclomatic complexity 84 and cognitive complexity 136; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/components/task/TaskCard.tsx:84
  • AgentPanel has cyclomatic complexity 84 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/src/components/task/AgentPanel.tsx:77
  • main has cyclomatic complexity 74 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/validate-release.mjs:469
  • admitInternal has cyclomatic complexity 74 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — server/src/services/admission-control-service.ts:698
  • mediaEvidenceFailures has cyclomatic complexity 71 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/docs-media/verify.mjs:62
  • evidenceFailures has cyclomatic complexity 68 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/native-ui/contract.mjs:229
  • AgentRunTimelinePanel has cyclomatic complexity 65 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/src/components/task/AgentRunTimelinePanel.tsx:1094
  • rewindLocked has cyclomatic complexity 61 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — server/src/storage/workspace-checkpoint-repository.ts:701
  • (anonymous) has cyclomatic complexity 58 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — server/src/services/automation-activation-service.ts:497
  • NotificationsTab has cyclomatic complexity 55 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/src/components/settings/tabs/NotificationsTab.tsx:179
  • exercise has cyclomatic complexity 54 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/native-ui/run.mjs:275
  • handleStepFailure has cyclomatic complexity 54 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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:1849
  • runDoctorChecks has cyclomatic complexity 54 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — cli/src/commands/doctor.ts:697
  • classifyCodexAppServerServerRequest has cyclomatic complexity 52 and cognitive complexity 82; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — server/src/services/codex-app-server-adapter.ts:622
  • TaskDetailPanel has cyclomatic complexity 51 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — web/src/components/task/TaskDetailPanel.tsx:81
  • evaluateHarnessSupportStatus has cyclomatic complexity 50 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — server/src/services/harness-support-service.ts:66
  • (anonymous) has cyclomatic complexity 50 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — server/src/schemas/run-launch-manifest-schemas.ts:429
  • WorktreeStatus has cyclomatic complexity 50 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/src/components/task/git/WorktreeStatus.tsx:37
  • RunSessionShareView has cyclomatic complexity 49 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — web/src/components/task/RunSessionSharesSection.tsx:212
  • validateCoveragePolicy has cyclomatic complexity 48 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/check-coverage-policy.mjs:56
  • lintDefinition has cyclomatic complexity 47 and cognitive complexity 65; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — server/src/services/workflow-authoring-service.ts:1096
  • normalizeHarnessSupportProfile has cyclomatic complexity 47 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — server/src/services/harness-support-profile-registry.ts:301
  • handleKeyDown has cyclomatic complexity 47 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — web/src/hooks/useKeyboard.tsx:119
  • aggregateMetrics has cyclomatic complexity 46 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/src/hooks/useTaskMetrics.ts:52
  • Header has cyclomatic complexity 45 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — web/src/components/layout/Header.tsx:141
  • buildDefaultChecks has cyclomatic complexity 45 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — shared/src/utils/task-readiness.ts:56
  • KanbanBoard has cyclomatic complexity 45 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — web/src/components/board/KanbanBoard.tsx:111
  • executeRun has cyclomatic complexity 44 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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:1553
  • (anonymous) has cyclomatic complexity 44 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — server/src/services/worktree-service.ts:799
  • capture has cyclomatic complexity 41 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — server/src/storage/workspace-checkpoint-repository.ts:204
  • planTaskRecovery has cyclomatic complexity 41 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — server/src/services/run-recovery-coordinator.ts:482
  • itemKind has cyclomatic complexity 40 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — server/src/services/provider-run-event-mappers.ts:119
R3 · Large Files3.0 / 10Weak✓ Tool-verified

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

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

  • server/src/services/clawdbot-agent-service.ts has 9225 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/clawdbot-agent-service.ts:1
  • web/src/components/settings/tabs/AgentsTab.tsx has 2987 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/settings/tabs/AgentsTab.tsx:1
  • REDACTED has 2639 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
  • server/src/services/communication-adapter-service.ts has 2333 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/communication-adapter-service.ts:1
  • server/src/services/knowledge-collection-service.ts has 2202 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/knowledge-collection-service.ts:1
  • server/src/services/admission-control-service.ts has 2177 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/admission-control-service.ts:1
  • server/src/services/sqlite-portability-service.ts has 2078 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/sqlite-portability-service.ts:1
  • REDACTED has 2036 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
  • server/src/services/task-service.ts has 2011 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/task-service.ts:1
  • server/src/services/worktree-service.ts has 1953 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/worktree-service.ts:1
  • server/src/storage/workspace-checkpoint-repository.ts has 1943 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/storage/workspace-checkpoint-repository.ts:1
  • server/src/services/workflow-authoring-service.ts has 1833 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/workflow-authoring-service.ts:1
  • REDACTED has 1799 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
  • server/src/services/tool-control-plane-service.ts has 1753 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/tool-control-plane-service.ts:1
  • web/src/components/task/AgentRunTimelinePanel.tsx has 1735 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/task/AgentRunTimelinePanel.tsx:1
  • server/src/services/credential-broker-service.ts has 1614 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/credential-broker-service.ts:1
  • server/src/storage/sqlite/migrations.ts has 1477 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/storage/sqlite/migrations.ts:1
  • web/src/components/workflows/WorkflowAuthoringPanel.tsx has 1464 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/workflows/WorkflowAuthoringPanel.tsx:1
  • server/src/services/buzz-definition-import-service.ts has 1352 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/buzz-definition-import-service.ts:1
  • server/src/services/queue-intake-monitor-service.ts has 1337 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/queue-intake-monitor-service.ts:1
  • server/src/services/search-service.ts has 1316 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/search-service.ts:1
  • REDACTED has 1263 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
  • server/src/services/run-launch-compiler.ts has 1209 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/run-launch-compiler.ts:1
  • web/src/components/settings/tabs/MultiUserTab.tsx has 1206 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/settings/tabs/MultiUserTab.tsx:1
  • cli/src/commands/agents.ts has 1188 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — cli/src/commands/agents.ts:1
  • server/src/services/run-terminal-service.ts has 1164 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/run-terminal-service.ts:1
  • REDACTED has 1134 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 1110 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
  • server/src/storage/sqlite/journal-maintenance-service.ts has 1110 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/storage/sqlite/journal-maintenance-service.ts:1
  • server/src/services/automation-activation-service.ts has 1088 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/automation-activation-service.ts:1
  • server/src/storage/knowledge-collection-repository.ts has 1088 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/storage/knowledge-collection-repository.ts:1
  • web/src/components/dashboard/NeedsAttentionQueue.tsx has 1086 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/dashboard/NeedsAttentionQueue.tsx:1
  • server/src/services/skill-security-service.ts has 1081 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/skill-security-service.ts:1
  • server/src/services/filesystem-sandbox-service.ts has 1076 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/filesystem-sandbox-service.ts:1
  • server/src/services/digest-service.ts has 1072 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/digest-service.ts:1
  • web/src/components/task/TaskWorkView.tsx has 1061 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/task/TaskWorkView.tsx:1
  • REDACTED has 1040 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
  • server/src/services/scheduler-service.ts has 996 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — server/src/services/scheduler-service.ts:1
  • web/src/components/policies/PolicyManager.tsx has 979 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/components/policies/PolicyManager.tsx:1
  • REDACTED has 970 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

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage10.0 / 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. (×2) — server/src/scripts/run-harness-conformance.ts:1, server/src/scripts/reset-password.ts:1
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 269 application, 61 tooling and 661 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (269 application, 61 tooling, 661 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 (×3) — shared/src/types/task.types.ts, server/src/schemas/index.ts, desktop/scripts/desktop-after-pack.mjs
  • no import path from any entry point (269 application, 61 tooling, 661 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (desktop/scripts/desktop-after-pack.mjs) — 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 — scripts/desktop-after-pack.mjs
  • Nothing imports this binding — it is safe to review for removal. (×25) — desktop/src/main/app-metadata.ts:3, server/src/config/env.ts:229, server/src/lib/logger.ts:57, …
  • Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists. (×10) — server/src/schemas/agent-schemas.ts:19, server/src/schemas/agent-schemas.ts:30, server/src/schemas/agent-schemas.ts:45, …

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

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

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

R9 · Circular Imports6.1 / 10Adequate✓ Tool-verified

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

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

  • server/src/services/automation-activation-service.ts → REDACTED → server/src/services/scheduler-service.ts → server/src/services/automation-activation-service.ts — server/src/services/automation-activation-service.ts:29
  • web/src/components/workflows/WorkflowDashboard.tsx → web/src/components/workflows/WorkflowRunView.tsx → web/src/contexts/ViewContext.tsx → web/src/lib/views.ts → web/src/components/workflows/WorkflowsPage.tsx → web/src/components/workflows/WorkflowDashboard.tsx (one verified cycle inside a mutually-dependent group of 6 files) — web/src/components/workflows/WorkflowDashboard.tsx:25

What to do

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

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

  • The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash. (×2) — REDACTED:1110, server/src/services/run-file-provenance-service.ts:494
  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. — server/src/services/skill-security-service.ts:709
  • This code fixes scrypt at N=16,384 (r=8, p=1). A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price. — REDACTED:1110
  • This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price. — server/src/services/run-file-provenance-service.ts:494

What to do

  • Load cryptographic key and salt material from configuration, an environment variable or a secrets manager rather than fixing it in the source, and fail fast at startup when it is absent — a default that silently works is the one that reaches production. Rotate anything already committed: it must be treated as disclosed. Salts should be generated per password and stored with the hash, never shared across installations. This repository constructs key or salt material fixed at compile time at 2 sites, not one: `REDACTED:1110` (key-derivation salt), `server/src/services/run-file-provenance-service.ts:494` (key-derivation salt). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
  • Raise the cost parameter to current guidance — PBKDF2 at 1,300,000 (HMAC-SHA1), 600,000 (SHA-256) or 210,000 (SHA-512) iterations; scrypt at N=2^17, r=8, p=1; bcrypt at a work factor of 10 or more — or move to a memory-hard KDF (Argon2id, scrypt) where the platform offers one. Read the parameter from configuration and tune it to roughly 100 ms per derivation on the slowest hardware that must run it, so the price can be raised again without shipping new code. This repository constructs a key derivation priced below the floor at 2 sites, not one: `REDACTED:1110` (scrypt, N=16,384 (r=8, p=1)), `server/src/services/run-file-provenance-service.ts:494` (scrypt, N=16,384 (r=8, p=1), Node's default). Each is a separate decision — fixing only the line this row cites leaves the others in place.
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 classification5.5 / 10Adequate✓ Tool-verified

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.

  • This function unwraps IPv4-MAPPED IPv6 (`::ffff:`, line 283) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 300 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright. — server/src/services/egress-policy-service.ts:300

What to do

  • Each finding names the IPv4 branch that rejects the host and the IPv6 branch that accepts the same host in another notation. Confirm from the two, then unwrap every IPv4-in-IPv6 embedding before classifying, or reject non-native IPv6 outright.
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 document4.6 / 10Weak✓ Tool-verified

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

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

  • `validateManifest` is exported, takes a document from its caller (line 123) and hands it to `findSensitiveFieldIssues`, which calls itself at line 505 (`this.findSensitiveFieldIssues`) with a piece of `value` (and at line 519) — and nowhere in `findSensitiveFieldIssues` 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 `findSensitiveFieldIssues` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — server/src/services/workspace-capability-service.ts:505
  • `redactDesktopBridgeValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 820 (`redactDesktopBridgeValue`) with a piece of `value` (and at line 830) — and nowhere in `redactDesktopBridgeValue` 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 `redactDesktopBridgeValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — desktop/src/shared/desktop-bridge-contracts.ts:820

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 propagation9.4 / 10Exemplary✓ 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 9/10 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.
  • `waitForReady` 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 })`. — desktop/src/main/runtime.ts:130

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.

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

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

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

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

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

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

X25 · Inert configuration knob8.0 / 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.

  • `ActivityService` accepts `options.activityFile` from the caller and keeps it in `this.activityFile` on line 84, where only it can read the value — but nothing ever reads `this.activityFile`. Setting `options.activityFile` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.activityFile` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `options.activityFile` from the accepted options so callers stop setting a knob that does nothing. — server/src/services/activity-service.ts:84

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

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

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

X3 · Exception handling5.5 / 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. (×20) — web/src/lib/product-modes.ts:124, web/src/lib/product-modes.ts:143, web/src/hooks/useDashboardLayout.ts:91, …
  • `.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. (×18) — web/src/components/task/ArtifactPreviewModal.tsx:61, web/src/components/task/ArtifactPreviewModal.tsx:65, web/src/components/task/ArtifactPreviewModal.tsx:99, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. (×2) — server/src/utils/migrate-legacy-files.ts:37, server/src/storage/search-file-repository.ts:32

What to do

  • Swallowed exception (empty catch)
X4 · Structured logging6.5 / 10Adequate✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. 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 `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `info` at line 164 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:164
  • `info` at line 577 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:577
  • `warn` at line 1378 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:1378
  • `warn` at line 1388 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:1388
  • `info` at line 44 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/utils/migrate-legacy-files.ts:44
  • `warn` at line 48 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/utils/migrate-legacy-files.ts:48
  • `debug` at line 315 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/storage/append-activity-repository.ts:315
  • `info` at line 243 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/agent-registry-service.ts:243
  • `info` at line 331 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/agent-routing-service.ts:331
  • `info` at line 377 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/agent-routing-service.ts:377
  • `warn` at line 459 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/agent-routing-service.ts:459
  • `warn` at line 486 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/agent-routing-service.ts:486
  • `info` at line 492 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/agent-routing-service.ts:492
  • `error` at line 66 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/attachment-service.ts:66
  • `info` at line 2639 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/clawdbot-agent-service.ts:2639
  • `warn` at line 249 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/diff-service.ts:249
  • `info` at line 133 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/failure-alert-service.ts:133
  • `info` at line 167 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/failure-alert-service.ts:167
  • `error` at line 173 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/failure-alert-service.ts:173
  • `warn` at line 232 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/failure-alert-service.ts:232
  • `info` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/migration-service.ts:62
  • `info` at line 103 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/project-service.ts:103
  • `error` at line 178 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:178
  • `error` at line 380 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:380
  • `info` at line 87 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/sprint-service.ts:87
  • `info` at line 253 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/status-history-service.ts:253
  • `warn` at line 183 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/telemetry-service.ts:183
  • `error` at line 595 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/telemetry-service.ts:595
  • `error` at line 149 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/template-service.ts:149
  • `error` at line 250 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/metrics/run-metrics.ts:250
  • `error` at line 97 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/metrics/telemetry-reader.ts:97
  • `error` at line 176 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/services/metrics/token-metrics.ts:176
  • `info` at line 60 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:60
  • `info` at line 297 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — server/src/config/security.ts:297

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.9 / 10Exemplary✓ 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.

  • ~0.2 `!` null assertions per 1k TypeScript source lines — 49 assertion(s) across the 310808 source line(s) of the 1068 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: web/src/hooks/useDiff.ts (5), server/src/services/credential-broker-service.ts (4), REDACTED (2). 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 Health50.0Adequate — gated by D1, D2, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture78.9Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity88.7StrongStrongest area.
Readiness74.5Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security65.2Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility57.7Adequate — gated by AC2, AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60.0AdequateAcceptable, with room to improve.
Unscored — 4 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.

  • P12 CI test-gate honesty — 4 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 32 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 45 check(s) not relevant to this codebase

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

  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • 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 — compose up failed (exit 17 — an image could not be built) — failed to solve: process "/bin/sh -c corepack enable && corepack prepare pnpm@11.1.1 --activate" did not complete successfully: exit code: 1; likely cause (the repository): a RUN step of the repository's REDACTED exited with code 1 (`/bin/sh -c corepack enable && corepack prepare pnpm@11.1.1 --activate`): the build's own command failed, for example a compile or test error; runtime evidence skipped The cause is in the repository, not in our sandbox: a RUN step of the repository's REDACTED exited with code 1 (`/bin/sh -c corepack enable && corepack prepare pnpm@11.1.1 --activate`): the build's own command failed, for example a compile or test error. Nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D25 ADR Conformance — None of 4 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D32 Data Compliance (PII/GDPR) — 41 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D4 Code Duplication — This repository's production source (.ts, .tsx) is not read by D4's token comparison, which compares .NET source: duplication in it is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream. Not scored here — read the R10 card for this repository's duplication.
  • 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.
  • 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
  • DM6 Domain ↔ infrastructure boundary — this TypeScript/JavaScript repository maps no type to a persistence framework (TypeORM/Prisma/MikroORM/Sequelize/Mongoose), so DM6's domain↔infrastructure fusion read has no population to be taken over
  • 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
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 875 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. Not a gap in the analyzer and not a finding about your code.
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • 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 — 56 finding(s)
AC2 · Forms & labels · <label> that labels no control · ×12
  • <label> that labels no control web/src/components/prompts/PromptRegistry.tsx:69 — 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 web/src/components/prompts/PromptRegistry.tsx:78 — 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 web/src/components/prompts/PromptRegistry.tsx:87 — 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 web/src/components/prompts/PromptRegistry.tsx:99 — 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 web/src/components/prompts/PromptRegistry.tsx:161 — 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 web/src/components/prompts/PromptRegistry.tsx:211 — 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 web/src/components/prompts/PromptRegistry.tsx:274 — 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 web/src/components/prompts/PromptRegistry.tsx:278 — 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 web/src/components/prompts/PromptRegistry.tsx:282 — 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 web/src/components/prompts/PromptRegistry.tsx:286 — 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 web/src/components/prompts/PromptRegistry.tsx:318 — 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 web/src/components/prompts/PromptRegistry.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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×5
  • Click handler on a non-interactive <div> web/src/components/layout/ArchiveSidebar.tsx:91 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/src/components/prompts/PromptRegistry.tsx:120 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/src/components/settings/SortableListItem.tsx:145 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> web/src/components/task/AgentPanel.tsx:566 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/src/components/templates/TemplatesPage.tsx:158 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×4
  • <input> without a programmatic label web/src/components/docs/DocsViewer.tsx:140 — 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 web/src/components/docs/DocsViewer.tsx:195 — 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 web/src/components/prompts/PromptRegistry.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 web/src/components/prompts/PromptRegistry.tsx:79 — 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.
AC2 · Forms & labels · <select> without a programmatic label · ×4
  • <select> without a programmatic label web/src/components/prompts/PromptRegistry.tsx:88 — 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 web/src/components/prompts/PromptRegistry.tsx:162 — 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 web/src/components/prompts/PromptRegistry.tsx:212 — 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 web/src/components/prompts/PromptRegistry.tsx:319 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
D35 · Change Coupling · Boundary-crossing change coupling · ×3
  • Boundary-crossing change coupling: index.ts ↔ api-permissions.ts server/src/routes/v1/index.ts:1 — `server/src/routes/v1/index.ts` (context routes) and `shared/src/utils/api-permissions.ts` (context shared) sit in DIFFERENT parts of the tree yet change together 58% of the time (19 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 19 shared commits counted here, the most recent 3 are `9e46e0d1` feat: add knowledge collection source catalog (#1124); `71bfd482` feat: expose scoped run terminal controls (#1111); `4bf1b132` feat: expose durable goal controls (#1082) — run `git show` on any of them.
  • Boundary-crossing change coupling: REDACTED ↔ clawdbot-agent-service.ts REDACTED:1 — `REDACTED` (context routes) and `server/src/services/clawdbot-agent-service.ts` (context services) sit in DIFFERENT parts of the tree yet change together 54% of the time (7 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) — 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 `37d256a3` feat: add harness compatibility matrix (#976); `f6ffa7c4` Add generic ACP stdio provider (#961); `e6f21a84` feat: add first-class harness support profiles (#925) — run `git show` on any of them.
  • Boundary-crossing change coupling: REDACTED ↔ clawdbot-agent-service.ts cli/src/commands/agents.ts:1 — `cli/src/commands/agents.ts` (context cli) and `server/src/services/clawdbot-agent-service.ts` (context services) sit in DIFFERENT parts of the tree yet 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) — 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 5 shared commits counted here, the most recent 3 are `a8f74268` fix(clients): distinguish queued agent launches from execution; `49b03e37` feat: unify all agent launch admission paths (#1073); `4f8e5dc1` feat: propagate phase authority through launches (#1043) — run `git show` on any of them.
AC2 · Forms & labels · <button> with no accessible text · ×2
  • <button> with no accessible text web/src/components/docs/DocsViewer.tsx:156 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/src/components/docs/DocsViewer.tsx:302 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC2 · Forms & labels · <textarea> without a programmatic label · ×2
  • <textarea> without a programmatic label web/src/components/docs/DocsViewer.tsx:320 — 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 web/src/components/prompts/PromptRegistry.tsx:100 — 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.
S1 · Web-Security Posture · Cryptographic key material is a compile-time constant · ×2
  • Cryptographic key material is a compile-time constant REDACTED:1110 — The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
  • Cryptographic key material is a compile-time constant server/src/services/run-file-provenance-service.ts:494 — The value is the key-derivation salt and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
AC4 · Keyboard semantics · Click handler on a non-interactive <span> · ×1
  • Click handler on a non-interactive <span> web/src/components/task/MultiAgentSelector.tsx:97 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
D10 · Test Quality · No assertions (empty test) · ×1
  • No assertions (empty test): getStorage throws before initStorage is called server/src/__tests__/storage/file-storage.test.ts:307 — Test method has an empty body — it asserts nothing and exercises no code.
D11 · Test Reliability · Flaky test · ×1
  • Flaky test: cli/src/__tests__/client-body-deadlines.test.ts::real CLI text/binary callers bounds 'standup' through a 'headers' stall after successful preflight — Passed 2×, failed 1× across repeated runs.
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) server/src/services/automation-activation-service.ts:29 — server/src/services/automation-activation-service.ts → REDACTED → server/src/services/scheduler-service.ts → server/src/services/automation-activation-service.ts
R9 · Circular Imports · Import cycle (5 files) · ×1
  • Import cycle (5 files) web/src/components/workflows/WorkflowDashboard.tsx:25 — web/src/components/workflows/WorkflowDashboard.tsx → web/src/components/workflows/WorkflowRunView.tsx → web/src/contexts/ViewContext.tsx → web/src/lib/views.ts → web/src/components/workflows/WorkflowsPage.tsx → web/src/components/workflows/WorkflowDashboard.tsx (one verified cycle inside a mutually-dependent group of 6 files)
Serious — 2411 finding(s)
D29 · Static Analysis (SAST) · REDACTED · ×587
  • 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
  • + 562 more in this group — see findings.md.
D8 · Code Coverage · Low coverage · ×196
  • Low coverage: cli/src/commands/agent-status.ts cli/src/commands/agent-status.ts:1 — 0.0% line coverage (0/54).
  • Low coverage: cli/src/commands/automation.ts cli/src/commands/automation.ts:1 — 0.0% line coverage (0/52).
  • Low coverage: cli/src/commands/backlog.ts cli/src/commands/backlog.ts:1 — 20.3% line coverage (13/64).
  • Low coverage: cli/src/commands/comments.ts cli/src/commands/comments.ts:1 — 0.0% line coverage (0/14).
  • Low coverage: cli/src/commands/github.ts cli/src/commands/github.ts:1 — 39.4% line coverage (26/66).
  • Low coverage: cli/src/commands/notifications.ts cli/src/commands/notifications.ts:1 — 0.0% line coverage (0/58).
  • Low coverage: cli/src/commands/projects.ts cli/src/commands/projects.ts:1 — 0.0% line coverage (0/33).
  • Low coverage: cli/src/commands/queue-monitors.ts cli/src/commands/queue-monitors.ts:1 — 0.0% line coverage (0/65).
  • Low coverage: cli/src/commands/scheduler.ts cli/src/commands/scheduler.ts:1 — 36.2% line coverage (54/149).
  • Low coverage: cli/src/commands/setup.ts cli/src/commands/setup.ts:1 — 0.0% line coverage (0/72).
  • Low coverage: cli/src/commands/sprints.ts cli/src/commands/sprints.ts:1 — 19.4% line coverage (19/98).
  • Low coverage: cli/src/commands/sqlite.ts cli/src/commands/sqlite.ts:1 — 28.6% line coverage (18/63).
  • Low coverage: cli/src/commands/summary.ts cli/src/commands/summary.ts:1 — 37.3% line coverage (22/59).
  • Low coverage: cli/src/commands/time.ts cli/src/commands/time.ts:1 — 0.0% line coverage (0/65).
  • Low coverage: cli/src/commands/tool-servers.ts cli/src/commands/tool-servers.ts:1 — 0.0% line coverage (0/69).
  • Low coverage: cli/src/commands/usage.ts cli/src/commands/usage.ts:1 — 0.0% line coverage (0/113).
  • Low coverage: cli/src/commands/workflow.ts cli/src/commands/workflow.ts:1 — 0.0% line coverage (0/91).
  • Low coverage: cli/src/commands/workspaces.ts cli/src/commands/workspaces.ts:1 — 0.0% line coverage (0/63).
  • Low coverage: cli/src/index.ts cli/src/index.ts:1 — 0.0% line coverage (0/31).
  • Low coverage: cli/src/utils/format.ts cli/src/utils/format.ts:1 — 3.8% line coverage (1/26).
  • Low coverage: desktop/src/main/index.ts desktop/src/main/index.ts:1 — 0.0% line coverage (0/225).
  • Low coverage: desktop/src/main/runtime.ts desktop/src/main/runtime.ts:1 — 25.8% line coverage (16/62).
  • Low coverage: desktop/src/preload/index.ts desktop/src/preload/index.ts:1 — 0.0% line coverage (0/51).
  • Low coverage: mcp/src/index.ts mcp/src/index.ts:1 — 0.0% line coverage (0/52).
  • Low coverage: mcp/src/tools/automation.ts mcp/src/tools/automation.ts:1 — 0.0% line coverage (0/21).
  • + 171 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×175
  • FunctionTooLong: MultiUserTab.MultiUserTab web/src/components/settings/tabs/MultiUserTab.tsx:197 — FunctionTooLong — MultiUserTab runs 915 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 815 over it, 9.15× 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: agents.registerAgentCommands cli/src/commands/agents.ts:205 — FunctionTooLong — registerAgentCommands runs 800 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 700 over it, 8.00× 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: ScoringProfiles.ScoringProfiles web/src/components/scoring/ScoringProfiles.tsx:97 — FunctionTooLong — ScoringProfiles runs 705 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 605 over it, 7.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: AgentRunTimelinePanel.AgentRunTimelinePanel web/src/components/task/AgentRunTimelinePanel.tsx:1094 — FunctionTooLong — AgentRunTimelinePanel runs 650 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 550 over it, 6.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: TaskWorkView.TaskWorkView web/src/components/task/TaskWorkView.tsx:425 — FunctionTooLong — TaskWorkView runs 622 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 522 over it, 6.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: PolicyManager.PolicyManager web/src/components/policies/PolicyManager.tsx:296 — FunctionTooLong — PolicyManager runs 620 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 520 over it, 6.20× 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: AgentPanel.AgentPanel web/src/components/task/AgentPanel.tsx:77 — FunctionTooLong — AgentPanel runs 582 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 482 over it, 5.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.
  • FunctionTooLong: CreateTaskDialog.CreateTaskDialog web/src/components/task/CreateTaskDialog.tsx:60 — FunctionTooLong — CreateTaskDialog runs 566 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 466 over it, 5.66× 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: KanbanBoard.KanbanBoard web/src/components/board/KanbanBoard.tsx:111 — FunctionTooLong — KanbanBoard runs 553 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 453 over it, 5.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.
  • FunctionTooLong: Header.Header web/src/components/layout/Header.tsx:141 — FunctionTooLong — Header runs 551 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 451 over it, 5.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SettingsDialog.SettingsDialog web/src/components/settings/SettingsDialog.tsx:266 — FunctionTooLong — SettingsDialog runs 546 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 446 over it, 5.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.
  • FunctionTooLong: NotificationsTab.NotificationsTab web/src/components/settings/tabs/NotificationsTab.tsx:179 — FunctionTooLong — NotificationsTab runs 536 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 436 over it, 5.36× 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: TaskCard.TaskCard web/src/components/task/TaskCard.tsx:195 — FunctionTooLong — TaskCard runs 528 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 428 over it, 5.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.
  • FunctionTooLong: WorkflowAuthoringPanel.WorkflowDefinitionEditor web/src/components/workflows/WorkflowAuthoringPanel.tsx:762 — FunctionTooLong — WorkflowDefinitionEditor runs 456 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 356 over it, 4.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: TaskDetailPanel.TaskDetailPanel web/src/components/task/TaskDetailPanel.tsx:81 — FunctionTooLong — TaskDetailPanel runs 428 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 328 over it, 4.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.
  • FunctionTooLong: WorkProductsSection.WorkProductsSection web/src/components/task/WorkProductsSection.tsx:108 — FunctionTooLong — WorkProductsSection runs 421 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 321 over it, 4.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: WorktreeStatus.WorktreeStatus web/src/components/task/git/WorktreeStatus.tsx:37 — FunctionTooLong — WorktreeStatus runs 411 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 311 over it, 4.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ConflictResolver.ConflictResolver web/src/components/task/ConflictResolver.tsx:45 — FunctionTooLong — ConflictResolver runs 408 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 308 over it, 4.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.
  • FunctionTooLong: ArchivePage.ArchivePage web/src/components/archive/ArchivePage.tsx:63 — FunctionTooLong — ArchivePage runs 386 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 286 over it, 3.86× 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: BuzzConnectionPanel.BuzzConnectionPanel web/src/components/settings/tabs/BuzzConnectionPanel.tsx:87 — FunctionTooLong — BuzzConnectionPanel runs 386 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 286 over it, 3.86× 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: ApplyTemplateDialog.ApplyTemplateDialog web/src/components/task/ApplyTemplateDialog.tsx:60 — FunctionTooLong — ApplyTemplateDialog runs 385 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 285 over it, 3.85× 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: RunSessionSharesSection.RunSessionShareView web/src/components/task/RunSessionSharesSection.tsx:212 — FunctionTooLong — RunSessionShareView runs 369 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: OperationsDigestPage.OperationsDigestPage web/src/components/digest/OperationsDigestPage.tsx:62 — FunctionTooLong — OperationsDigestPage runs 368 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 268 over it, 3.68× 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: MaintenanceTab.MaintenanceTab web/src/components/settings/tabs/MaintenanceTab.tsx:201 — FunctionTooLong — MaintenanceTab runs 368 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 268 over it, 3.68× 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: NeedsAttentionQueue.NeedsAttentionQueue web/src/components/dashboard/NeedsAttentionQueue.tsx:750 — FunctionTooLong — NeedsAttentionQueue runs 357 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 257 over it, 3.57× 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.
  • + 150 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×100
  • FileTooLong: services/clawdbot-agent-service.ts server/src/services/clawdbot-agent-service.ts — FileTooLong — 7540 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: ClawdbotAgentService (562-9140). The bar is 500 significant lines; this is 7040 over it, 15.08× 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: tabs/AgentsTab.tsx web/src/components/settings/tabs/AgentsTab.tsx — FileTooLong — 2676 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2176 over it, 5.35× 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 — 2122 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: WorkflowRunService (118-2732). The bar is 500 significant lines; this is 1622 over it, 4.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: services/communication-adapter-service.ts server/src/services/communication-adapter-service.ts — FileTooLong — 2000 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: CommunicationAdapterService (412-2435). The bar is 500 significant lines; this is 1500 over it, 4.00× 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: services/knowledge-collection-service.ts server/src/services/knowledge-collection-service.ts — FileTooLong — 1829 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: KnowledgeCollectionService (117-1721). The bar is 500 significant lines; this is 1329 over it, 3.66× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: services/admission-control-service.ts server/src/services/admission-control-service.ts — FileTooLong — 1781 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: AdmissionControlService (180-2235). The bar is 500 significant lines; this is 1281 over it, 3.56× 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: services/sqlite-portability-service.ts server/src/services/sqlite-portability-service.ts — FileTooLong — 1735 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: SqlitePortabilityService (274-2270). The bar is 500 significant lines; this is 1235 over it, 3.47× 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: storage/workspace-checkpoint-repository.ts server/src/storage/workspace-checkpoint-repository.ts — FileTooLong — 1561 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: FileWorkspaceCheckpointRepository (187-1642). The bar is 500 significant lines; this is 1061 over it, 3.12× 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 — 1543 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1043 over it, 3.09× 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: task/AgentRunTimelinePanel.tsx web/src/components/task/AgentRunTimelinePanel.tsx — FileTooLong — 1540 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1040 over it, 3.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: services/worktree-service.ts server/src/services/worktree-service.ts — FileTooLong — 1526 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: WorktreeService (206-1947). The bar is 500 significant lines; this is 1026 over it, 3.05× 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: services/task-service.ts server/src/services/task-service.ts — FileTooLong — 1438 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: TaskService (123-2256). The bar is 500 significant lines; this is 938 over it, 2.88× 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: services/tool-control-plane-service.ts server/src/services/tool-control-plane-service.ts — FileTooLong — 1410 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: ToolControlPlaneService (152-1275). The bar is 500 significant lines; this is 910 over it, 2.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: services/workflow-authoring-service.ts server/src/services/workflow-authoring-service.ts — FileTooLong — 1386 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 886 over it, 2.77× 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: services/credential-broker-service.ts server/src/services/credential-broker-service.ts — FileTooLong — 1275 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: CredentialBrokerService (171-1300). 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: workflows/WorkflowAuthoringPanel.tsx web/src/components/workflows/WorkflowAuthoringPanel.tsx — FileTooLong — 1267 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 767 over it, 2.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1121 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 621 over it, 2.24× 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: services/queue-intake-monitor-service.ts server/src/services/queue-intake-monitor-service.ts — FileTooLong — 1120 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: QueueIntakeMonitorService (129-1003). The bar is 500 significant lines; this is 620 over it, 2.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: services/buzz-definition-import-service.ts server/src/services/buzz-definition-import-service.ts — FileTooLong — 1105 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: BuzzDefinitionImportService (555-1388). The bar is 500 significant lines; this is 605 over it, 2.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: tabs/MultiUserTab.tsx web/src/components/settings/tabs/MultiUserTab.tsx — FileTooLong — 1073 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: MultiUserTab (197-1259). The bar is 500 significant lines; this is 573 over it, 2.15× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: services/search-service.ts server/src/services/search-service.ts — FileTooLong — 1067 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: SearchService (120-1459). The bar is 500 significant lines; this is 567 over it, 2.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: dashboard/NeedsAttentionQueue.tsx web/src/components/dashboard/NeedsAttentionQueue.tsx — FileTooLong — 973 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 473 over it, 1.95× 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: services/run-launch-compiler.ts server/src/services/run-launch-compiler.ts — FileTooLong — 965 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: RunLaunchCompiler (88-1207). The bar is 500 significant lines; this is 465 over it, 1.93× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: commands/agents.ts cli/src/commands/agents.ts — FileTooLong — 961 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: registerAgentCommands (205-1243). The bar is 500 significant lines; this is 461 over it, 1.92× 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: services/run-terminal-service.ts server/src/services/run-terminal-service.ts — FileTooLong — 960 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: RunTerminalService (112-940). The bar is 500 significant lines; this is 460 over it, 1.92× 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.
  • + 75 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×80
  • Hotspot: server/src/services/clawdbot-agent-service.ts server/src/services/clawdbot-agent-service.ts:1384 — server/src/services/clawdbot-agent-service.ts changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 128 in ClawdbotAgentService.startReservedAgent at line 1384. 3 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- server/src/services/clawdbot-agent-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: web/src/components/task/TaskWorkView.tsx web/src/components/task/TaskWorkView.tsx:425 — web/src/components/task/TaskWorkView.tsx changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in TaskWorkView.TaskWorkView at line 425. 3 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/task/TaskWorkView.tsx`: 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: web/src/components/layout/Header.tsx web/src/components/layout/Header.tsx:141 — web/src/components/layout/Header.tsx changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in Header.Header at line 141. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/layout/Header.tsx`: 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: web/src/components/task/TaskCard.tsx web/src/components/task/TaskCard.tsx:195 — web/src/components/task/TaskCard.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 125 in TaskCard.TaskCard at line 195. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/task/TaskCard.tsx`: 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: web/src/components/board/KanbanBoard.tsx web/src/components/board/KanbanBoard.tsx:111 — web/src/components/board/KanbanBoard.tsx changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in KanbanBoard.KanbanBoard at line 111. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/board/KanbanBoard.tsx`: 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: web/src/components/task/TaskDetailPanel.tsx web/src/components/task/TaskDetailPanel.tsx:81 — web/src/components/task/TaskDetailPanel.tsx changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in TaskDetailPanel.TaskDetailPanel at line 81. 4 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/task/TaskDetailPanel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/native-ui/run.mjs scripts/native-ui/run.mjs:275 — scripts/native-ui/run.mjs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in run.exercise at line 275. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- scripts/native-ui/run.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.
  • Hotspot: web/src/components/task/AgentRunTimelinePanel.tsx web/src/components/task/AgentRunTimelinePanel.tsx:1094 — web/src/components/task/AgentRunTimelinePanel.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in AgentRunTimelinePanel.AgentRunTimelinePanel at line 1094. 2 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/task/AgentRunTimelinePanel.tsx`: 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: server/src/services/task-service.ts server/src/services/task-service.ts:866 — server/src/services/task-service.ts changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in TaskService.updateTaskMutation at line 866. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- server/src/services/task-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: web/src/components/task/AgentPanel.tsx web/src/components/task/AgentPanel.tsx:77 — web/src/components/task/AgentPanel.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 121 in AgentPanel.AgentPanel at line 77. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/task/AgentPanel.tsx`: 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: cli/src/commands/agents.ts cli/src/commands/agents.ts:205 — cli/src/commands/agents.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 119 in agents.registerAgentCommands at line 205. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- cli/src/commands/agents.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: web/src/components/settings/SettingsDialog.tsx web/src/components/settings/SettingsDialog.tsx:266 — web/src/components/settings/SettingsDialog.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in SettingsDialog.SettingsDialog at line 266. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/settings/SettingsDialog.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/docs-media/verify.mjs scripts/docs-media/verify.mjs:62 — scripts/docs-media/verify.mjs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in verify.mediaEvidenceFailures at line 62. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- scripts/docs-media/verify.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.
  • Hotspot: web/src/components/layout/DesktopShellContext.tsx web/src/components/layout/DesktopShellContext.tsx:134 — web/src/components/layout/DesktopShellContext.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in DesktopShellContext.DesktopShellProvider at line 134. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/layout/DesktopShellContext.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/native-ui/contract.mjs scripts/native-ui/contract.mjs:229 — scripts/native-ui/contract.mjs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in contract.evidenceFailures at line 229. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- scripts/native-ui/contract.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.
  • Hotspot: web/src/components/layout/CommandPalette.tsx web/src/components/layout/CommandPalette.tsx:106 — web/src/components/layout/CommandPalette.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in CommandPalette.CommandPalette at line 106. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/layout/CommandPalette.tsx`: 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: web/src/hooks/useKeyboard.tsx web/src/hooks/useKeyboard.tsx:55 — web/src/hooks/useKeyboard.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in useKeyboard.KeyboardProvider 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/hooks/useKeyboard.tsx`: 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: web/src/components/scoring/ScoringProfiles.tsx web/src/components/scoring/ScoringProfiles.tsx:97 — web/src/components/scoring/ScoringProfiles.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in ScoringProfiles.ScoringProfiles at line 97. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/scoring/ScoringProfiles.tsx`: 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: server/src/services/automation-activation-service.ts server/src/services/automation-activation-service.ts:480 — server/src/services/automation-activation-service.ts changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in AutomationActivationService.claimRun at line 480. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- server/src/services/automation-activation-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: web/src/components/policies/PolicyManager.tsx web/src/components/policies/PolicyManager.tsx:296 — web/src/components/policies/PolicyManager.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in PolicyManager.PolicyManager at line 296. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/policies/PolicyManager.tsx`: 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: web/src/components/task/WorkProductsSection.tsx web/src/components/task/WorkProductsSection.tsx:108 — web/src/components/task/WorkProductsSection.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in WorkProductsSection.WorkProductsSection at line 108. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/task/WorkProductsSection.tsx`: 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: web/src/components/templates/TemplateEditorDialog.tsx web/src/components/templates/TemplateEditorDialog.tsx:57 — web/src/components/templates/TemplateEditorDialog.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in TemplateEditorDialog.TemplateEditorDialog at line 57. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/templates/TemplateEditorDialog.tsx`: 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: web/src/components/digest/OperationsDigestPage.tsx web/src/components/digest/OperationsDigestPage.tsx:62 — web/src/components/digest/OperationsDigestPage.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in OperationsDigestPage.OperationsDigestPage at line 62. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/digest/OperationsDigestPage.tsx`: 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: web/src/components/task/ConflictResolver.tsx web/src/components/task/ConflictResolver.tsx:45 — web/src/components/task/ConflictResolver.tsx changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in ConflictResolver.ConflictResolver at line 45. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/task/ConflictResolver.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: scripts/validate-release.mjs scripts/validate-release.mjs:469 — scripts/validate-release.mjs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in validate-release.main at line 469. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- scripts/validate-release.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.
  • + 55 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×69
  • MethodTooLong: RunLaunchCompiler.compile server/src/services/run-launch-compiler.ts:138 — MethodTooLong — compile runs 588 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 488 over it, 5.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ClawdbotAgentService.startCodexAppServer server/src/services/clawdbot-agent-service.ts:5554 — MethodTooLong — startCodexAppServer runs 571 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 471 over it, 5.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: ClawdbotAgentService.startClaudeCode server/src/services/clawdbot-agent-service.ts:6479 — MethodTooLong — startClaudeCode runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× 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: TaskService.updateTaskMutation server/src/services/task-service.ts:866 — MethodTooLong — updateTaskMutation runs 300 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 200 over it, 3.00× 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: ClawdbotAgentService.completePendingAgent server/src/services/clawdbot-agent-service.ts:3105 — MethodTooLong — completePendingAgent runs 267 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 167 over it, 2.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: AdmissionControlService.admitInternal server/src/services/admission-control-service.ts:698 — MethodTooLong — admitInternal runs 245 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 145 over it, 2.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: CommunicationAdapterService.ingestBuzzEvent server/src/services/communication-adapter-service.ts:1008 — MethodTooLong — ingestBuzzEvent runs 243 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 143 over it, 2.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WorktreeService.mergeWorktree server/src/services/worktree-service.ts:797 — MethodTooLong — mergeWorktree runs 236 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× 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: RunAccessSummaryService.project server/src/services/run-access-summary-service.ts:164 — MethodTooLong — project runs 226 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 126 over it, 2.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.
  • MethodTooLong: WorkflowRunService.executeRun REDACTED:1553 — MethodTooLong — executeRun runs 215 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 115 over it, 2.15× 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: FileWorkspaceCheckpointRepository.rewindLocked server/src/storage/workspace-checkpoint-repository.ts:701 — MethodTooLong — rewindLocked runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× 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: ToolControlPlaneService.invoke server/src/services/tool-control-plane-service.ts:475 — MethodTooLong — invoke runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BuzzCompatibilityService.probe server/src/services/buzz-compatibility-service.ts:573 — MethodTooLong — probe runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ClawdbotAgentService.executeRunTerminal server/src/services/clawdbot-agent-service.ts:8245 — MethodTooLong — executeRunTerminal runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× 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: RunLaunchManifestService.compile server/src/services/run-launch-manifest-service.ts:109 — MethodTooLong — compile runs 194 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 94 over it, 1.94× 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: FileWorkspaceCheckpointRepository.capture server/src/storage/workspace-checkpoint-repository.ts:204 — MethodTooLong — capture 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: WorkspaceCheckpointRewindPreviewService.preview server/src/services/workspace-checkpoint-rewind-preview-service.ts:55 — MethodTooLong — preview runs 188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CommunicationAdapterService.sendBuzz server/src/services/communication-adapter-service.ts:1315 — MethodTooLong — sendBuzz runs 184 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 84 over it, 1.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ClawdbotAgentService.startCodexCli server/src/services/clawdbot-agent-service.ts:7168 — MethodTooLong — startCodexCli runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SqliteOperationalProvenanceRepository.baseQuery server/src/storage/sqlite/provenance-repository.ts:95 — MethodTooLong — baseQuery runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WorkflowAuthoringService.lintDefinition server/src/services/workflow-authoring-service.ts:1096 — MethodTooLong — lintDefinition 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: AutomationActivationService.claimRun server/src/services/automation-activation-service.ts:480 — MethodTooLong — claimRun runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× 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: WorkflowRunService.handleStepFailure REDACTED:1849 — MethodTooLong — handleStepFailure runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× 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: AdmissionControlService.executionTreeBreakerEvidence server/src/services/admission-control-service.ts:316 — MethodTooLong — executionTreeBreakerEvidence runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RunRecoveryCoordinator.reconcileRunningAttempts server/src/services/run-recovery-coordinator.ts:130 — MethodTooLong — reconcileRunningAttempts runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.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.
  • + 44 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×51
  • ClassTooLong: ClawdbotAgentService server/src/services/clawdbot-agent-service.ts:562 — ClassTooLong — 6749 significant lines (blank, comment-only and punctuation-only lines excluded), 139 methods. The bar is 400 significant lines; this is 6349 over it, 16.87× 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: WorkflowRunService REDACTED:118 — ClassTooLong — 1967 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 1567 over it, 4.92× 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: CommunicationAdapterService server/src/services/communication-adapter-service.ts:412 — ClassTooLong — 1660 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 1260 over it, 4.15× 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: AdmissionControlService server/src/services/admission-control-service.ts:180 — ClassTooLong — 1608 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 1208 over it, 4.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: SqlitePortabilityService server/src/services/sqlite-portability-service.ts:274 — ClassTooLong — 1495 significant lines (blank, comment-only and punctuation-only lines excluded), 69 methods. The bar is 400 significant lines; this is 1095 over it, 3.74× 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: TaskService server/src/services/task-service.ts:123 — ClassTooLong — 1331 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 931 over it, 3.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.
  • ClassTooLong: KnowledgeCollectionService server/src/services/knowledge-collection-service.ts:117 — ClassTooLong — 1295 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 895 over it, 3.24× 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: WorktreeService server/src/services/worktree-service.ts:206 — ClassTooLong — 1284 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 884 over it, 3.21× 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: FileWorkspaceCheckpointRepository server/src/storage/workspace-checkpoint-repository.ts:187 — ClassTooLong — 1130 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 730 over it, 2.83× 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: SearchService server/src/services/search-service.ts:120 — ClassTooLong — 962 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 562 over it, 2.41× 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: MultiUserTab web/src/components/settings/tabs/MultiUserTab.tsx:1 — ClassTooLong — 915 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 515 over it, 2.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: CredentialBrokerService server/src/services/credential-broker-service.ts:171 — ClassTooLong — 868 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 468 over it, 2.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.
  • ClassTooLong: RunLaunchCompiler server/src/services/run-launch-compiler.ts:88 — ClassTooLong — 868 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 468 over it, 2.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.
  • ClassTooLong: ToolControlPlaneService server/src/services/tool-control-plane-service.ts:152 — ClassTooLong — 861 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 461 over it, 2.15× 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: WorkflowAuthoringService server/src/services/workflow-authoring-service.ts:918 — ClassTooLong — 708 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 308 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ScoringProfiles web/src/components/scoring/ScoringProfiles.tsx:1 — ClassTooLong — 705 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 305 over it, 1.76× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: QueueIntakeMonitorService server/src/services/queue-intake-monitor-service.ts:129 — ClassTooLong — 691 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 291 over it, 1.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.
  • ClassTooLong: AutomationActivationService server/src/services/automation-activation-service.ts:77 — ClassTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded), 16 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: SchedulerService server/src/services/scheduler-service.ts:72 — ClassTooLong — 672 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 272 over it, 1.68× 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: WorkProductService server/src/services/work-product-service.ts:42 — ClassTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 268 over it, 1.67× 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: BuzzDefinitionImportService server/src/services/buzz-definition-import-service.ts:555 — ClassTooLong — 667 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 267 over it, 1.67× 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: RunTerminalService server/src/services/run-terminal-service.ts:112 — ClassTooLong — 653 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 253 over it, 1.63× 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: AgentRunTimelinePanel web/src/components/task/AgentRunTimelinePanel.tsx:1 — ClassTooLong — 650 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 250 over it, 1.63× 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: TaskWorkView web/src/components/task/TaskWorkView.tsx:1 — ClassTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 222 over it, 1.56× 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: PolicyManager web/src/components/policies/PolicyManager.tsx:1 — ClassTooLong — 620 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 220 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.
  • + 26 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×38
  • Swallowed exception (empty catch) web/src/lib/product-modes.ts:124 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/lib/product-modes.ts:143 — 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) web/src/hooks/useDashboardLayout.ts:91 — 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) web/src/components/task/ArtifactPreviewModal.tsx:61 — `.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) web/src/components/task/ArtifactPreviewModal.tsx:65 — `.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) web/src/components/task/ArtifactPreviewModal.tsx:99 — `.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) web/src/components/task/ArtifactPreviewModal.tsx:120 — `.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) web/src/components/task/TimeTrackingSection.tsx:116 — 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) web/src/components/layout/DesktopShellContext.tsx:113 — 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) web/src/components/layout/DesktopShellContext.tsx:121 — 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) web/src/components/chat/SquadChatPanel.tsx: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) web/src/components/board/ArchiveSuggestionBanner.tsx:34 — 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) web/src/components/board/KanbanBoard.tsx:414 — 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) web/src/components/board/KanbanBoard.tsx:452 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/src/components/auth/DesktopOnboarding.tsx:160 — 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) web/src/components/archive/ArchivePage.tsx:176 — 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) shared/src/utils/acp-json-rpc-peer.ts:124 — `.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) REDACTED:324 — 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) server/src/utils/filesystem-sandbox-runtime.ts:178 — 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) server/src/utils/migrate-legacy-files.ts:26 — 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) server/src/utils/package-version.ts:22 — 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) server/src/utils/package-version.ts:27 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) server/src/utils/paths.ts:44 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) server/src/storage/admission-reservation-repository.ts:568 — `.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) server/src/storage/admission-reservation-repository.ts:569 — `.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.
  • + 13 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×21
  • Sync-over-async blocking cli/src/commands/agents.ts:515 — `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 cli/src/commands/agents.ts:548 — `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 cli/src/commands/agents.ts:583 — `writeFileSync` 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 cli/src/commands/tool-servers.ts:53 — `readFileSync` in `callback to execute` blocks the event 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 cli/src/commands/tool-servers.ts:69 — `readFileSync` in `callback to execute` blocks the event 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 cli/src/commands/workspaces.ts:85 — `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 cli/src/commands/workspaces.ts:119 — `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 scripts/check-coverage-policy.mjs:234 — `existsSync` in `fileExists` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:208 — `lstatSync` in `inspectFile` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:526 — `existsSync` in `schedule` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:636 — `existsSync` in `executeScheduledOperation` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:636 — `unlinkSync` in `executeScheduledOperation` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:911 — `existsSync` in `recoverInterruptedOperation` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:912 — `lstatSync` in `recoverInterruptedOperation` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:1016 — `existsSync` in `appendEvent` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:1017 — `lstatSync` in `appendEvent` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:1033 — `openSync` in `appendEvent` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:1039 — `fstatSync` in `appendEvent` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:1050 — `writeFileSync` in `appendEvent` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:1051 — `fsyncSync` in `appendEvent` blocks the event 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 server/src/storage/sqlite/journal-maintenance-service.ts:1053 — `closeSync` in `appendEvent` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
D15 · Churn × Complexity Hotspots · Repeated repair · ×17
  • Repeated repair: scripts/docs-media/run.mjs scripts/docs-media/run.mjs:163 — scripts/docs-media/run.mjs changed 12 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 5 (its worst body is run.recordAsset at line 163), 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: record the actual capture host comparison”; “fix: target the mobile appearance control in capture readiness”; “fix: wait for mobile Settings content before capture”; “fix: synchronize native capture with the rendered frame”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- scripts/docs-media/run.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: web/src/App.tsx web/src/App.tsx:146 — web/src/App.tsx 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 7 (its worst body is App.DesktopAwareAppShell at line 146), 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: retain task-owned autosave through navigation”; “fix: preserve pending Settings edits across navigation (#1552)”; “fix: acknowledge native menu actions in the mounted renderer”; “fix: keep mobile chat entry clear of task content”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/App.tsx`: 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: web/src/components/ui/UiOverlay.tsx web/src/components/ui/UiOverlay.tsx:40 — web/src/components/ui/UiOverlay.tsx 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 11 (its worst body is UiOverlay.resolveFocusTarget at line 40), 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: restore owned dock focus after compact layout collapse”; “fix: retain correct focus across interrupted overlay exits”; “fix: enforce shared heading and drawer geometry”; “fix: restore overlay focus after responsive toolbar changes”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/ui/UiOverlay.tsx`: 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:1790 — REDACTED 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 12 (its worst body is tasks.sanitizeCheckpointState at line 1790), 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: preserve managed attempt ownership during task edits”; “fix: preserve template task fields on creation (#1431)”; “fix: accept critical priority in task APIs (#1429)”; “fix: make board drag moves atomic (#1314)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05: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: desktop/src/main/index.ts desktop/src/main/index.ts:261 — desktop/src/main/index.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 15 (its worst body is index.boot at line 261), 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: deliver native task links after authenticated readiness”; “fix: honor the macOS titlebar double-click preference”; “fix: restore normal window bounds within available displays”; “fix: restore standard macOS menus and window lifecycle”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- desktop/src/main/index.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: web/src/components/layout/MobileShell.tsx web/src/components/layout/MobileShell.tsx:28 — web/src/components/layout/MobileShell.tsx 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 12 (its worst body is MobileShell.MobileShell at line 28), 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: preserve enlarged mobile navigation label width”; “fix: prevent fractional mobile board scroll overlap”; “fix: keep mobile chat entry clear of task content”; “fix: keep mobile navigation and task summaries readable”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/layout/MobileShell.tsx`: 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: server/src/storage/fs-helpers.ts server/src/storage/fs-helpers.ts:118 — server/src/storage/fs-helpers.ts changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is fs-helpers.writeAll at line 118), 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(storage): preserve shared resources on persistence failure (#1683)”; “fix(storage): complete durable journal writes (#1682)”; “fix: bind repository publication to managed worktrees (#1308)”; “fix: harden file and input handling (#1234)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- server/src/storage/fs-helpers.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: scripts/native-ui/menu-commands.mjs scripts/native-ui/menu-commands.mjs:9 — scripts/native-ui/menu-commands.mjs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is menu-commands.verifyNativeMenuCommands at line 9), 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: give native titlebar capture room to zoom”; “fix: honor the macOS titlebar double-click preference”; “fix: restore normal window bounds within available displays”; “fix: restore standard macOS menus and window lifecycle”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- scripts/native-ui/menu-commands.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: desktop/src/main/menu.ts desktop/src/main/menu.ts:164 — desktop/src/main/menu.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is menu.isCommandEnabled at line 164), 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: restore standard macOS menus and window lifecycle”; “fix: acknowledge native menu actions in the mounted renderer”; “fix: preserve diagnostics ampersand in macOS Help menu (#1292)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- desktop/src/main/menu.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: web/src/components/task/ObservationsSection.tsx web/src/components/task/ObservationsSection.tsx:169 — web/src/components/task/ObservationsSection.tsx changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ObservationsSection.ObservationsSection at line 169), 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: retain task confirmations during pending requests”; “fix: unify task overlay stack and nested tool geometry”; “fix: reveal secondary actions for keyboard and touch (#1272)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/task/ObservationsSection.tsx`: 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: server/src/services/template-service.ts server/src/services/template-service.ts:50 — server/src/services/template-service.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is TemplateService.cleanForYaml at line 50), 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: persist clearing optional template fields”; “fix: harden request and logging boundaries (#1233)”; “fix: centralize runtime state under DATA_DIR (#1184)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- server/src/services/template-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.
  • Repeated repair: server/src/storage/admission-reservation-repository.ts server/src/storage/admission-reservation-repository.ts:199 — server/src/storage/admission-reservation-repository.ts changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is FileAdmissionReservationRepository.claimMaterialized at line 199), 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(storage): complete durable journal writes (#1682)”; “fix: serialize admission repository reads”; “fix: complete admission snapshot appends”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- server/src/storage/admission-reservation-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: cli/src/utils/api.ts cli/src/utils/api.ts:29 — cli/src/utils/api.ts changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is api.assertApiPermissionForRequest at line 29), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve client resource identities (#1662)”; “fix: enforce client API transport policy (#1661)”; “fix: make CLI and MCP task requests safe and bounded (#1548)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- cli/src/utils/api.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: mcp/src/utils/api.ts mcp/src/utils/api.ts:29 — mcp/src/utils/api.ts changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is api.assertApiPermissionForRequest at line 29), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve client resource identities (#1662)”; “fix: enforce client API transport policy (#1661)”; “fix: make CLI and MCP task requests safe and bounded (#1548)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- mcp/src/utils/api.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: web/src/components/chat/FloatingChat.tsx web/src/components/chat/FloatingChat.tsx:18 — web/src/components/chat/FloatingChat.tsx changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is FloatingChat.FloatingChat 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: separate filled action colors from dark-mode accent text”; “fix: keep mobile chat entry clear of task content”; “fix: constrain shared interface motion”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/chat/FloatingChat.tsx`: 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: web/src/components/layout/DesktopLeftSidebar.tsx web/src/components/layout/DesktopLeftSidebar.tsx:43 — web/src/components/layout/DesktopLeftSidebar.tsx changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is DesktopLeftSidebar.DesktopLeftSidebar at line 43), 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: separate filled action colors from dark-mode accent text”; “fix: clarify desktop header controls (#1391)”; “fix: unify page action and navigation styling (#1369)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- web/src/components/layout/DesktopLeftSidebar.tsx`: 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: server/src/config/security.ts server/src/config/security.ts:229 — server/src/config/security.ts changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is security.rotateJwtSecret at line 229), 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: stabilize release validation boundaries (#1239)”; “fix: harden file and input handling (#1234)”; “fix: centralize runtime state under DATA_DIR (#1184)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 16:50:16 -05:00' --until='2026-10-25 16:50:16 -05:00' --full-history --no-merges -- server/src/config/security.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.
D3 · God Classes · TooManyMethods · ×14
  • TooManyMethods: ClawdbotAgentService server/src/services/clawdbot-agent-service.ts:562 — TooManyMethods — 139 methods. The bar is 30 methods; this is 109 over it, 4.63× 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: SqlitePortabilityService server/src/services/sqlite-portability-service.ts:274 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.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: TaskService server/src/services/task-service.ts:123 — 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: AdmissionControlService server/src/services/admission-control-service.ts:180 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× 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: SearchService server/src/services/search-service.ts:120 — 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: CommunicationAdapterService server/src/services/communication-adapter-service.ts:412 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× 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: WorkflowStepExecutor REDACTED:140 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× 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: WorkProductService server/src/services/work-product-service.ts:42 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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: WorkflowRunService REDACTED:118 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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: WorktreeService server/src/services/worktree-service.ts:206 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× 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: FileTaskRepository server/src/storage/task-file-repository.ts:60 — 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: KnowledgeCollectionService server/src/services/knowledge-collection-service.ts:117 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.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: FileWorkspaceCheckpointRepository server/src/storage/workspace-checkpoint-repository.ts:187 — 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: SqliteTaskRepository server/src/storage/sqlite/task-repository.ts:11 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.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.
D29 · Static Analysis (SAST) · REDACTED · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Fake-async · ×11
  • Fake-async — async method never awaits REDACTED:287 — `stopPreview` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
  • Fake-async — async method never awaits REDACTED:1378 — `validateAcceptanceCriteria` 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 server/src/storage/sqlite/governance-repositories.ts:50 — `save` 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 server/src/storage/sqlite/governance-repositories.ts:330 — `save` 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 server/src/storage/sqlite/governance-repositories.ts:375 — `delete` 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 server/src/storage/sqlite/governance-repositories.ts:426 — `saveProfile` 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 server/src/storage/sqlite/governance-repositories.ts:459 — `deleteProfile` 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 server/src/storage/sqlite/governance-repositories.ts:474 — `saveEvaluation` 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 server/src/storage/sqlite/governance-repositories.ts:602 — `saveAlert` 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 server/src/storage/sqlite/governance-repositories.ts:671 — `saveBaseline` 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 server/src/storage/sqlite/journal-maintenance-service.ts:999 — `appendEvent` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
AC2 · Forms & labels · <Select> field component without a label · ×9
  • <Select> field component without a label web/src/components/decisions/DecisionExplorer.tsx:245 — 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.
  • <Select> field component without a label web/src/components/decisions/DecisionExplorer.tsx:256 — 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.
  • <Select> field component without a label web/src/components/decisions/DecisionExplorer.tsx:269 — 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.
  • <Select> field component without a label web/src/components/decisions/DecisionExplorer.tsx:284 — 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.
  • <Select> field component without a label web/src/components/decisions/DecisionExplorer.tsx:292 — 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.
  • <Select> field component without a label web/src/components/feedback/FeedbackPanel.tsx:285 — 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.
  • <Select> field component without a label web/src/components/feedback/FeedbackPanel.tsx:298 — 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.
  • <Select> field component without a label web/src/components/feedback/FeedbackPanel.tsx:311 — 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.
  • <Select> field component without a label web/src/components/layout/ActivitySidebar.tsx:299 — 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.
D35 · Change Coupling · Change coupling · ×8
  • Change coupling: useTasks.ts ↔ REDACTED web/src/hooks/useTasks.ts:1 — `web/src/hooks/useTasks.ts` and `web/src/lib/api/tasks.ts` change together 73% of the time (8 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 — 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 `f4b2c304` perf: bound board card data and large-column rendering; `0aa7bc8f` fix: keep board task revisions current; `baf2ee19` fix: make board drag moves atomic (#1314) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ REDACTED REDACTED:1 — `REDACTED` and `web/src/lib/api/tasks.ts` change together 73% of the time (8 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 — 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 `f4b2c304` perf: bound board card data and large-column rendering; `baf2ee19` fix: make board drag moves atomic (#1314); `28aee90b` feat: add actor attribution and optimistic concurrency — run `git show` on any of them.
  • Change coupling: REDACTED ↔ clawdbot-agent-service.ts REDACTED:1 — `REDACTED` and `server/src/services/clawdbot-agent-service.ts` change together 64% of the time (7 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 — 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 7 shared commits counted here, the most recent 3 are `7abe012f` fix: harden request and logging boundaries (#1233); `8219fefa` feat: enforce progress watchdog decisions (#1095); `3450f603` feat: process durable reflection extraction jobs (#1086) — run `git show` on any of them.
  • Change coupling: workflow-service.ts ↔ REDACTED server/src/services/workflow-service.ts:1 — `server/src/services/workflow-service.ts` and `REDACTED` change together 60% of the time (6 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 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 `4f8e5dc1` feat: propagate phase authority through launches (#1043); `933e4145` Allowlist Codex workflow commands (#621); `24b3ec45` Phase 2 Review Fixes: Type safety, input validation, security hardening — run `git show` on any of them.
  • Change coupling: REDACTED ↔ useAgent.ts REDACTED:1 — `REDACTED` and `web/src/hooks/useAgent.ts` 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) 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 7 shared commits counted here, the most recent 3 are `62fcee5c` feat: govern active Run Access transitions (#1279); `8dc7ecd6` feat: add effective Run Access summary (#1275); `907d46e3` feat: add causal run file provenance — run `git show` on any of them.
  • Change coupling: REDACTED ↔ AgentsTab.tsx REDACTED:1 — `REDACTED` and `web/src/components/settings/tabs/AgentsTab.tsx` change together 54% of the time (7 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 7 shared commits counted here, the most recent 3 are `37d256a3` feat: add harness compatibility matrix (#976); `f6ffa7c4` Add generic ACP stdio provider (#961); `e6f21a84` feat: add first-class harness support profiles (#925) — run `git show` on any of them.
  • Change coupling: CommandPalette.tsx ↔ Header.tsx web/src/components/layout/CommandPalette.tsx:1 — `web/src/components/layout/CommandPalette.tsx` and `web/src/components/layout/Header.tsx` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `3a97f12f` fix: acknowledge native menu actions in the mounted renderer; `0b336996` Add editable time breakdown exports (#635); `f7d44259` Add operations digest UI and filters (#632) — run `git show` on any of them.
  • Change coupling: index.ts ↔ ViewContext.tsx server/src/routes/v1/index.ts:1 — `server/src/routes/v1/index.ts` and `web/src/contexts/ViewContext.tsx` 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 `45cfc822` feat: Behavioral Drift Detection & Alerting (#181) (#218); `ac647853` feat: Decision Audit Trail with Assumption Tracking (#179) (#216); `50f76f81` feat: Agent Output Evaluation & Scoring Framework (#180) (#217) — run `git show` on any of them.
D29 · Static Analysis (SAST) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D10 · Test Quality · Fixed-sleep synchronisation · ×5
  • Fixed-sleep synchronisation: queues a versioned agent launch and replays its exact options exactly once server/src/__tests__/codex-provider-service.test.ts:1327 — This test starts work it did not wait for (`service`, 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: does not let an older finisher clear a newer queued waiter server/src/__tests__/task-revision-atomicity.test.ts:143 — 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: serializes %s behind an existing task mutation server/src/__tests__/task-revision-atomicity.test.ts:189 — This test starts work it did not wait for (`blocker`, 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: serializes restoreTask behind an existing task mutation server/src/__tests__/task-revision-atomicity.test.ts:219 — This test starts work it did not wait for (`blocker`, 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: should queue concurrent locks (second waits for first) server/src/__tests__/services/file-lock.test.ts:46 — This test starts work it did not wait for (`lock2Promise`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
P12 · CI test-gate honesty · Workspace package's tests never run by CI · ×4
  • Workspace package's tests never run by CI cli/package.json:12 — `cli` is a workspace package with 99 test(s) in 17 file(s) (e.g. `cli/src/__tests__/acp.test.ts`, `cli/src/__tests__/admission.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
  • Workspace package's tests never run by CI desktop/package.json:28 — `desktop` is a workspace package with 116 test(s) in 21 file(s) (e.g. `desktop/src/main/__tests__/bridge-contracts.test.ts`, `desktop/src/main/__tests__/commands.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
  • Workspace package's tests never run by CI mcp/package.json:13 — `mcp` is a workspace package with 106 test(s) in 10 file(s) (e.g. `mcp/src/__tests__/agent-tools.test.ts`, `mcp/src/__tests__/api-permissions.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
  • Workspace package's tests never run by CI server/package.json:13 — `server` is a workspace package with 3487 test(s) in 363 file(s) (e.g. `server/src/__tests__/acp-json-rpc-peer.test.ts`, `server/src/__tests__/acp-stdio-provider.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
R10 · Code Duplication · Duplicated block with local edits (128 matched lines × 2 locations) · ×4
  • Duplicated block with local edits (128 matched lines × 2 locations) cli/src/commands/queue-monitors.ts:19 — cli/src/commands/queue-monitors.ts:19 · cli/src/commands/scheduler.ts:253 — the two spans are one implementation copied and then locally edited — 842 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (128 matched lines × 2 locations) server/src/services/durable-goal-service.ts:145 — server/src/services/durable-goal-service.ts:145 · server/src/services/reflection-extraction-job-service.ts:52 — the two spans are one implementation copied and then locally edited — 687 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (128 matched lines × 2 locations) web/src/components/task/CommentsSection.tsx:62 — web/src/components/task/CommentsSection.tsx:62 · web/src/components/task/DeliverablesSection.tsx:67 — the two spans are one implementation copied and then locally edited — 639 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (128 matched lines × 2 locations) web/src/components/task/SubtasksSection.tsx:37 — web/src/components/task/SubtasksSection.tsx:37 · web/src/components/task/VerificationSection.tsx:28 — the two spans are one implementation copied and then locally edited — 654 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.
R11 · Import Boundaries · Boundary violation [package · ×4
  • Boundary violation [package:test-cross-package-internals] e2e/html-artifact-preview-security.spec.ts:2 — e2e/html-artifact-preview-security.spec.ts:2 reaches past another workspace package's public entry into its internals with a relative path (../server/src/services/work-product-artifact-preview-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] e2e/task-artifact-format-popouts.spec.ts:3 — e2e/task-artifact-format-popouts.spec.ts:3 reaches past another workspace package's public entry into its internals with a relative path (../shared/src/types/work-product.types) — 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] server/src/__tests__/shared-api-client.test.ts:3 — server/src/__tests__/shared-api-client.test.ts:3 reaches past another workspace package's public entry into its internals with a relative path (../../../shared/src/utils/api-client.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] server/src/__tests__/shared-api-permissions.test.ts:3 — server/src/__tests__/shared-api-permissions.test.ts:3 reaches past another workspace package's public entry into its internals with a relative path (../../../shared/src/utils/api-permissions.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.
AC2 · Forms & labels · <TextInput> field component without a label · ×3
  • <TextInput> field component without a label web/src/components/decisions/DecisionExplorer.tsx:231 — 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.
  • <TextInput> field component without a label web/src/components/feedback/FeedbackPanel.tsx:279 — 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.
  • <TextInput> field component without a label web/src/components/policies/PolicyManager.tsx:529 — 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.
D10 · Test Quality · No assertions · ×3
  • No assertions: does not throw when hook unmounts during an in-flight fetch web/src/__tests__/useRealtimeAgentStatus.test.ts:255 — 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: should do nothing when wss is not initialized server/src/__tests__/broadcast-service.test.ts:423 — 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: should do nothing when disabled server/src/__tests__/trace-service.test.ts:159 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D31 · IaC & Container Security · Medium IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Guard cannot change the result · ×3
  • Guard cannot change the result — returns what the code already falls through to server/src/services/scheduler-service.ts:1007 — The guard above `return 'skipped';` also returns `'skipped'`, 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 server/src/services/text-extraction-service.ts:74 — The guard above `return null;` also returns `null`, 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 web/src/components/workflows/WorkflowRunView.tsx:138 — The guard above `return 'gray';` also returns `'gray'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
AC2 · Forms & labels · <Switch> field component without a label · ×2
  • <Switch> field component without a label web/src/components/policies/PolicyManager.tsx:863 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it 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.
  • <Switch> field component without a label web/src/components/policies/PolicyManager.tsx:883 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Both branches are identical · ×2
  • Both branches are identical — the condition decides nothing server/src/services/agent-host-service.ts:214 — 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 server/src/services/run-output-spill-service.ts:181 — 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×2
  • Outbound HTTP without resilience server/runtime/run-tool-bridge.mjs:123 — `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:384 — `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.
R10 · Code Duplication · Duplicated block with local edits (82 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (82 matched lines × 2 locations) server/src/storage/delegation-repository.ts:19 — server/src/storage/delegation-repository.ts:19 · server/src/storage/lifecycle-hooks-repository.ts:18 — the two spans are one implementation copied and then locally edited — 631 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (82 matched lines × 2 locations) server/src/storage/dependency-circuit-override-repository.ts:25 — server/src/storage/dependency-circuit-override-repository.ts:25 · server/src/storage/dependency-circuit-state-repository.ts:56 — the two spans are one implementation copied and then locally edited — 631 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 (67 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (67 matched lines × 2 locations) web/src/components/auth/SetupScreen.tsx:12 — web/src/components/auth/SetupScreen.tsx:12 · web/src/components/settings/tabs/SecurityTab.tsx:14 — the two spans are one implementation copied and then locally edited — 501 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (67 matched lines × 2 locations) web/src/components/settings/tabs/QueueMonitorsTab.tsx:247 — web/src/components/settings/tabs/QueueMonitorsTab.tsx:247 · web/src/components/settings/tabs/SchedulerTab.tsx:403 — the two spans are one implementation copied and then locally edited — 368 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.
R4 · Test Coverage · No test reaches this file · ×2
  • No test reaches this file server/src/scripts/run-harness-conformance.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 server/src/scripts/reset-password.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.
S1 · Web-Security Posture · Password key derivation is priced too cheaply · ×2
  • Password key derivation is priced too cheaply REDACTED:1110 — This code fixes scrypt at N=16,384 (r=8, p=1). A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
  • Password key derivation is priced too cheaply server/src/services/run-file-provenance-service.ts:494 — This code fixes scrypt at N=16,384 (r=8, p=1), Node's default. A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×2
  • Recursive walk over a caller-supplied document has no depth cap server/src/services/workspace-capability-service.ts:505 — `validateManifest` is exported, takes a document from its caller (line 123) and hands it to `findSensitiveFieldIssues`, which calls itself at line 505 (`this.findSensitiveFieldIssues`) with a piece of `value` (and at line 519) — and nowhere in `findSensitiveFieldIssues` 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 `findSensitiveFieldIssues` 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 desktop/src/shared/desktop-bridge-contracts.ts:820 — `redactDesktopBridgeValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 820 (`redactDesktopBridgeValue`) with a piece of `value` (and at line 830) — and nowhere in `redactDesktopBridgeValue` 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 `redactDesktopBridgeValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×2
  • Swallowed exception (caught, then discarded) server/src/utils/migrate-legacy-files.ts:37 — `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) server/src/storage/search-file-repository.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.
AC2 · Forms & labels · <Textarea> field component without a label · ×1
  • <Textarea> field component without a label web/src/components/decisions/DecisionDetail.tsx:138 — 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.
AC2 · Forms & labels · <SegmentedControl> field component without a label · ×1
  • <SegmentedControl> field component without a label web/src/components/decisions/DecisionExplorer.tsx:214 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it 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.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (2.3 · ×1
  • Low contrast Tailwind colour pair (2.3:1) web/src/components/dashboard/StatusTimeline.tsx:33 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (2.6 · ×1
  • Low contrast Tailwind colour pair (2.6:1) web/src/components/dashboard/StatusTimeline.tsx:42 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (3.8 · ×1
  • Low contrast Tailwind colour pair (3.8:1) web/src/components/dashboard/StatusTimeline.tsx:51 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (3.3 · ×1
  • Low contrast Tailwind colour pair (3.3:1) web/src/components/docs/DocsViewer.tsx:277 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Focus outline removed inline · ×1
  • Focus outline removed inline web/src/components/docs/DocsViewer.tsx:320 — <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).
D1 · Cyclomatic Complexity · ClawdbotAgentService.startCodexAppServer (cyclomatic 140) · ×1
  • ClawdbotAgentService.startCodexAppServer (cyclomatic 140) server/src/services/clawdbot-agent-service.ts:5554 — ClawdbotAgentService.startCodexAppServer has cyclomatic complexity 140 (threshold 15). Of this number, 37 points are the body's own statements and 103 belong to 26 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 · ClawdbotAgentService.startReservedAgent (cyclomatic 128) · ×1
  • ClawdbotAgentService.startReservedAgent (cyclomatic 128) server/src/services/clawdbot-agent-service.ts:1384 — ClawdbotAgentService.startReservedAgent has cyclomatic complexity 128 (threshold 15). Of this number, 125 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 · TaskCard.TaskCard (cyclomatic 125) · ×1
  • TaskCard.TaskCard (cyclomatic 125) web/src/components/task/TaskCard.tsx:195 — TaskCard.TaskCard has cyclomatic complexity 125 (threshold 15). Of this number, 94 points are the body's own statements and 31 belong to 13 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 · AgentPanel.AgentPanel (cyclomatic 121) · ×1
  • AgentPanel.AgentPanel (cyclomatic 121) web/src/components/task/AgentPanel.tsx:77 — AgentPanel.AgentPanel has cyclomatic complexity 121 (threshold 15). Of this number, 84 points are the body's own statements and 37 belong to 16 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 · agents.registerAgentCommands (cyclomatic 119) · ×1
  • agents.registerAgentCommands (cyclomatic 119) cli/src/commands/agents.ts:205 — agents.registerAgentCommands has cyclomatic complexity 119 (threshold 15). Most of this is not in the body itself: 1 of the 119 points is its own statement and the rest belongs to 23 function literals inside it that branch (lines 904, 814, 227, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · TaskWorkView.TaskWorkView (cyclomatic 108) · ×1
  • TaskWorkView.TaskWorkView (cyclomatic 108) web/src/components/task/TaskWorkView.tsx:425 — TaskWorkView.TaskWorkView has cyclomatic complexity 108 (threshold 15). Of this number, 87 points are the body's own statements and 21 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 · RunLaunchCompiler.compile (cyclomatic 105) · ×1
  • RunLaunchCompiler.compile (cyclomatic 105) server/src/services/run-launch-compiler.ts:138 — RunLaunchCompiler.compile has cyclomatic complexity 105 (threshold 15). Of this number, 101 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 · NeedsAttentionQueue.buildNeedsAttentionItems (cyclomatic 95) · ×1
  • NeedsAttentionQueue.buildNeedsAttentionItems (cyclomatic 95) web/src/components/dashboard/NeedsAttentionQueue.tsx:283 — NeedsAttentionQueue.buildNeedsAttentionItems has cyclomatic complexity 95 (threshold 15). Of this number, 94 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 · Header.Header (cyclomatic 94) · ×1
  • Header.Header (cyclomatic 94) web/src/components/layout/Header.tsx:141 — Header.Header has cyclomatic complexity 94 (threshold 15). Of this number, 45 points are the body's own statements and 49 belong to 15 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 · TaskService.updateTaskMutation (cyclomatic 91) · ×1
  • TaskService.updateTaskMutation (cyclomatic 91) server/src/services/task-service.ts:866 — TaskService.updateTaskMutation has cyclomatic complexity 91 (threshold 15). Most of this is not in the body itself: 6 of the 91 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 908, runMutation, a function literal at line 1093, …). 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 · KanbanBoard.KanbanBoard (cyclomatic 91) · ×1
  • KanbanBoard.KanbanBoard (cyclomatic 91) web/src/components/board/KanbanBoard.tsx:111 — KanbanBoard.KanbanBoard has cyclomatic complexity 91 (threshold 15). Of this number, 36 points are the body's own statements and 55 belong to 21 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 · AgentRunTimelinePanel.AgentRunTimelinePanel (cyclomatic 88) · ×1
  • AgentRunTimelinePanel.AgentRunTimelinePanel (cyclomatic 88) web/src/components/task/AgentRunTimelinePanel.tsx:1094 — AgentRunTimelinePanel.AgentRunTimelinePanel has cyclomatic complexity 88 (threshold 15). Of this number, 60 points are the body's own statements and 28 belong to 13 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 · MultiUserTab.MultiUserTab (cyclomatic 85) · ×1
  • MultiUserTab.MultiUserTab (cyclomatic 85) web/src/components/settings/tabs/MultiUserTab.tsx:197 — MultiUserTab.MultiUserTab has cyclomatic complexity 85 (threshold 15). Of this number, 24 points are the body's own statements and 61 belong to 30 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 · TaskCard.areTaskCardPropsEqual (cyclomatic 82) · ×1
  • TaskCard.areTaskCardPropsEqual (cyclomatic 82) web/src/components/task/TaskCard.tsx:84 — TaskCard.areTaskCardPropsEqual has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentRunTimelinePanel.buildAgentRunTimelineEvents (cyclomatic 79) · ×1
  • AgentRunTimelinePanel.buildAgentRunTimelineEvents (cyclomatic 79) web/src/components/task/AgentRunTimelinePanel.tsx:531 — AgentRunTimelinePanel.buildAgentRunTimelineEvents has cyclomatic complexity 79 (threshold 15). Of this number, 77 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClawdbotAgentService.startClaudeCode (cyclomatic 77) · ×1
  • ClawdbotAgentService.startClaudeCode (cyclomatic 77) server/src/services/clawdbot-agent-service.ts:6479 — ClawdbotAgentService.startClaudeCode has cyclomatic complexity 77 (threshold 15). Of this number, 29 points are the body's own statements and 48 belong to 12 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 · ScoringProfiles.ScoringProfiles (cyclomatic 74) · ×1
  • ScoringProfiles.ScoringProfiles (cyclomatic 74) web/src/components/scoring/ScoringProfiles.tsx:97 — ScoringProfiles.ScoringProfiles has cyclomatic complexity 74 (threshold 15). Of this number, 21 points are the body's own statements and 53 belong to 21 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 · TaskDetailPanel.TaskDetailPanel (cyclomatic 74) · ×1
  • TaskDetailPanel.TaskDetailPanel (cyclomatic 74) web/src/components/task/TaskDetailPanel.tsx:81 — TaskDetailPanel.TaskDetailPanel has cyclomatic complexity 74 (threshold 15). Of this number, 46 points are the body's own statements and 28 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 · CreateTaskDialog.CreateTaskDialog (cyclomatic 73) · ×1
  • CreateTaskDialog.CreateTaskDialog (cyclomatic 73) web/src/components/task/CreateTaskDialog.tsx:60 — CreateTaskDialog.CreateTaskDialog has cyclomatic complexity 73 (threshold 15). Of this number, 33 points are the body's own statements and 40 belong to 17 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 · RunSessionSharesSection.RunSessionShareView (cyclomatic 72) · ×1
  • RunSessionSharesSection.RunSessionShareView (cyclomatic 72) web/src/components/task/RunSessionSharesSection.tsx:212 — RunSessionSharesSection.RunSessionShareView has cyclomatic complexity 72 (threshold 15). Of this number, 50 points are the body's own statements and 22 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 · AdmissionControlService.admitInternal (cyclomatic 71) · ×1
  • AdmissionControlService.admitInternal (cyclomatic 71) server/src/services/admission-control-service.ts:698 — AdmissionControlService.admitInternal 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 · AgentStatusIndicator.AgentStatusIndicator (cyclomatic 68) · ×1
  • AgentStatusIndicator.AgentStatusIndicator (cyclomatic 68) web/src/components/shared/AgentStatusIndicator.tsx:175 — AgentStatusIndicator.AgentStatusIndicator has cyclomatic complexity 68 (threshold 15). Of this number, 35 points are the body's own statements and 33 belong to 11 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 · server.wss.on("connection") (cyclomatic 65) · ×1
  • server.wss.on("connection") (cyclomatic 65) REDACTED:757 — server.wss.on("connection") has cyclomatic complexity 65 (threshold 15). Most of this is not in the body itself: 5 of the 65 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 898, sendRunEvent, a function literal at line 1176, …). 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 · FileWorkspaceCheckpointRepository.rewindLocked (cyclomatic 61) · ×1
  • FileWorkspaceCheckpointRepository.rewindLocked (cyclomatic 61) server/src/storage/workspace-checkpoint-repository.ts:701 — FileWorkspaceCheckpointRepository.rewindLocked has cyclomatic complexity 61 (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 · ConflictResolver.ConflictResolver (cyclomatic 61) · ×1
  • ConflictResolver.ConflictResolver (cyclomatic 61) web/src/components/task/ConflictResolver.tsx:45 — ConflictResolver.ConflictResolver has cyclomatic complexity 61 (threshold 15). Of this number, 33 points are the body's own statements and 28 belong to 12 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 · WorktreeStatus.WorktreeStatus (cyclomatic 61) · ×1
  • WorktreeStatus.WorktreeStatus (cyclomatic 61) web/src/components/task/git/WorktreeStatus.tsx:37 — WorktreeStatus.WorktreeStatus has cyclomatic complexity 61 (threshold 15). Of this number, 49 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 · AutomationActivationService.claimRun (cyclomatic 55) · ×1
  • AutomationActivationService.claimRun (cyclomatic 55) server/src/services/automation-activation-service.ts:480 — AutomationActivationService.claimRun has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 3 of the 55 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 497, 519, 662). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · CommandPalette.CommandPalette (cyclomatic 55) · ×1
  • CommandPalette.CommandPalette (cyclomatic 55) web/src/components/layout/CommandPalette.tsx:106 — CommandPalette.CommandPalette has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 12 of the 55 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 402, a function literal at line 140, handleKeyDown, …). 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 · ArchivePage.ArchivePage (cyclomatic 54) · ×1
  • ArchivePage.ArchivePage (cyclomatic 54) web/src/components/archive/ArchivePage.tsx:63 — ArchivePage.ArchivePage has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 12 of the 54 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 295, a function literal at line 111, handleBulkRestore, …). 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 · run-launch-manifest-schemas.RunLaunchManifestSchema (cyclomatic 52) · ×1
  • run-launch-manifest-schemas.RunLaunchManifestSchema (cyclomatic 52) server/src/schemas/run-launch-manifest-schemas.ts:429 — run-launch-manifest-schemas.RunLaunchManifestSchema has cyclomatic complexity 52 (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 · RunAccessSummaryService.project (cyclomatic 52) · ×1
  • RunAccessSummaryService.project (cyclomatic 52) server/src/services/run-access-summary-service.ts:164 — RunAccessSummaryService.project 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 · PreviewPanel.PreviewPanel (cyclomatic 52) · ×1
  • PreviewPanel.PreviewPanel (cyclomatic 52) web/src/components/task/PreviewPanel.tsx:38 — PreviewPanel.PreviewPanel has cyclomatic complexity 52 (threshold 15). Of this number, 39 points are the body's own statements and 13 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 · SquadChatPanel.SquadChatPanel (cyclomatic 51) · ×1
  • SquadChatPanel.SquadChatPanel (cyclomatic 51) web/src/components/chat/SquadChatPanel.tsx:91 — SquadChatPanel.SquadChatPanel has cyclomatic complexity 51 (threshold 15). Of this number, 24 points are the body's own statements and 27 belong to 14 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 · WorkProductsSection.WorkProductsSection (cyclomatic 51) · ×1
  • WorkProductsSection.WorkProductsSection (cyclomatic 51) web/src/components/task/WorkProductsSection.tsx:108 — WorkProductsSection.WorkProductsSection has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 10 of the 51 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 329, saveEdit, downloadArtifact, …). 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 · useKeyboard.KeyboardProvider (cyclomatic 50) · ×1
  • useKeyboard.KeyboardProvider (cyclomatic 50) web/src/hooks/useKeyboard.tsx:55 — useKeyboard.KeyboardProvider 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 3 function literals inside it that branch (lines 119, 61, 142). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · DesktopShellContext.DesktopShellProvider (cyclomatic 49) · ×1
  • DesktopShellContext.DesktopShellProvider (cyclomatic 49) web/src/components/layout/DesktopShellContext.tsx:134 — DesktopShellContext.DesktopShellProvider 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 18 function literals inside it that branch (lines 227, 155, 327, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · AgentsTab.SandboxPoliciesSection (cyclomatic 48) · ×1
  • AgentsTab.SandboxPoliciesSection (cyclomatic 48) web/src/components/settings/tabs/AgentsTab.tsx:1579 — AgentsTab.SandboxPoliciesSection has cyclomatic complexity 48 (threshold 15). Of this number, 26 points are the body's own statements and 22 belong to 8 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 · FilterBar.FilterBar (cyclomatic 48) · ×1
  • FilterBar.FilterBar (cyclomatic 48) web/src/components/board/FilterBar.tsx:39 — FilterBar.FilterBar has cyclomatic complexity 48 (threshold 15). Of this number, 30 points are the body's own statements and 18 belong to 10 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 · WorkflowAuthoringService.lintDefinition (cyclomatic 47) · ×1
  • WorkflowAuthoringService.lintDefinition (cyclomatic 47) server/src/services/workflow-authoring-service.ts:1096 — WorkflowAuthoringService.lintDefinition has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatPanel.ChatPanel (cyclomatic 47) · ×1
  • ChatPanel.ChatPanel (cyclomatic 47) web/src/components/chat/ChatPanel.tsx:42 — ChatPanel.ChatPanel has cyclomatic complexity 47 (threshold 15). Of this number, 20 points are the body's own statements and 27 belong to 10 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 · WorkflowAuthoringPanel.WorkflowAuthoringPanel (cyclomatic 46) · ×1
  • WorkflowAuthoringPanel.WorkflowAuthoringPanel (cyclomatic 46) web/src/components/workflows/WorkflowAuthoringPanel.tsx:180 — WorkflowAuthoringPanel.WorkflowAuthoringPanel has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 15 of the 46 points are its own statements and the rest belongs to 16 function items inside it that branch (saveWorkflow, materializeRecipe, runBuilderDryRun, …). 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 · useTaskMetrics.aggregateMetrics (cyclomatic 46) · ×1
  • useTaskMetrics.aggregateMetrics (cyclomatic 46) web/src/hooks/useTaskMetrics.ts:52 — useTaskMetrics.aggregateMetrics has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codex-app-server-adapter.classifyCodexAppServerServerRequest (cyclomatic 45) · ×1
  • codex-app-server-adapter.classifyCodexAppServerServerRequest (cyclomatic 45) server/src/services/codex-app-server-adapter.ts:622 — codex-app-server-adapter.classifyCodexAppServerServerRequest 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 · WorkflowRunService.handleStepFailure (cyclomatic 44) · ×1
  • WorkflowRunService.handleStepFailure (cyclomatic 44) REDACTED:1849 — WorkflowRunService.handleStepFailure 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 · SchedulerTab.SchedulerTab (cyclomatic 44) · ×1
  • SchedulerTab.SchedulerTab (cyclomatic 44) web/src/components/settings/tabs/SchedulerTab.tsx:34 — SchedulerTab.SchedulerTab has cyclomatic complexity 44 (threshold 15). Of this number, 18 points are the body's own statements and 26 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 · Dashboard.Dashboard (cyclomatic 44) · ×1
  • Dashboard.Dashboard (cyclomatic 44) web/src/components/dashboard/Dashboard.tsx:139 — Dashboard.Dashboard has cyclomatic complexity 44 (threshold 15). Of this number, 39 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 · admission.registerAdmissionCommands (cyclomatic 42) · ×1
  • admission.registerAdmissionCommands (cyclomatic 42) cli/src/commands/admission.ts:25 — admission.registerAdmissionCommands 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 8 function literals inside it that branch (lines 163, 47, 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.
D1 · Cyclomatic Complexity · FileWorkspaceCheckpointRepository.capture (cyclomatic 42) · ×1
  • FileWorkspaceCheckpointRepository.capture (cyclomatic 42) server/src/storage/workspace-checkpoint-repository.ts:204 — FileWorkspaceCheckpointRepository.capture has cyclomatic complexity 42 (threshold 15). Of this number, 40 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 · scheduler.registerSchedulerCommands (cyclomatic 41) · ×1
  • scheduler.registerSchedulerCommands (cyclomatic 41) cli/src/commands/scheduler.ts:19 — scheduler.registerSchedulerCommands has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 6 of the 41 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 173, 300, 43, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · WorktreeService.mergeWorktree (cyclomatic 41) · ×1
  • WorktreeService.mergeWorktree (cyclomatic 41) server/src/services/worktree-service.ts:797 — WorktreeService.mergeWorktree 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 one function literal inside it that branches (line 799). 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 · NeedsAttentionQueue.NeedsAttentionQueue (cyclomatic 41) · ×1
  • NeedsAttentionQueue.NeedsAttentionQueue (cyclomatic 41) web/src/components/dashboard/NeedsAttentionQueue.tsx:750 — NeedsAttentionQueue.NeedsAttentionQueue has cyclomatic complexity 41 (threshold 15). Of this number, 17 points are the body's own statements and 24 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 · PolicyManager.PolicyManager (cyclomatic 41) · ×1
  • PolicyManager.PolicyManager (cyclomatic 41) web/src/components/policies/PolicyManager.tsx:296 — PolicyManager.PolicyManager has cyclomatic complexity 41 (threshold 15). Of this number, 16 points are the body's own statements and 25 belong to 14 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 · harness-support-service.evaluateHarnessSupportStatus (cyclomatic 40) · ×1
  • harness-support-service.evaluateHarnessSupportStatus (cyclomatic 40) server/src/services/harness-support-service.ts:66 — harness-support-service.evaluateHarnessSupportStatus has cyclomatic complexity 40 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SearchDialog.SearchDialog (cyclomatic 40) · ×1
  • SearchDialog.SearchDialog (cyclomatic 40) web/src/components/search/SearchDialog.tsx:156 — SearchDialog.SearchDialog has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 14 of the 40 points are its own statements and the rest belongs to 9 function items inside it that branch (executeTarget, a function literal at line 388, a function literal at line 193, …). 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 · tasks.registerTaskCommands (cyclomatic 39) · ×1
  • tasks.registerTaskCommands (cyclomatic 39) cli/src/commands/tasks.ts:9 — tasks.registerTaskCommands 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 6 function literals inside it that branch (lines 148, 21, 59, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · harness-support-profile-registry.normalizeHarnessSupportProfile (cyclomatic 39) · ×1
  • harness-support-profile-registry.normalizeHarnessSupportProfile (cyclomatic 39) server/src/services/harness-support-profile-registry.ts:301 — harness-support-profile-registry.normalizeHarnessSupportProfile has cyclomatic complexity 39 (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-run-event-mappers.itemKind (cyclomatic 39) · ×1
  • provider-run-event-mappers.itemKind (cyclomatic 39) server/src/services/provider-run-event-mappers.ts:119 — provider-run-event-mappers.itemKind 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 · gateway-chat-client.sendGatewayChat (cyclomatic 39) · ×1
  • gateway-chat-client.sendGatewayChat (cyclomatic 39) REDACTED:44 — gateway-chat-client.sendGatewayChat 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 6 function literals inside it that branch (lines 100, 61, 71, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · task-readiness.buildDefaultChecks (cyclomatic 39) · ×1
  • task-readiness.buildDefaultChecks (cyclomatic 39) shared/src/utils/task-readiness.ts:56 — task-readiness.buildDefaultChecks 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 · credential-broker-service.containsCredentialMaterial · ×1
  • credential-broker-service.containsCredentialMaterial::visit (cyclomatic 38) server/src/services/credential-broker-service.ts:1568 — credential-broker-service.containsCredentialMaterial::visit has cyclomatic complexity 38 (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 · ToolControlPlaneService.invoke (cyclomatic 38) · ×1
  • ToolControlPlaneService.invoke (cyclomatic 38) server/src/services/tool-control-plane-service.ts:475 — ToolControlPlaneService.invoke has cyclomatic complexity 38 (threshold 15). Of this number, 33 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 · DigestService.generateOperationsDigest (cyclomatic 38) · ×1
  • DigestService.generateOperationsDigest (cyclomatic 38) server/src/services/digest-service.ts:349 — DigestService.generateOperationsDigest has cyclomatic complexity 38 (threshold 15). Of this number, 30 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 · NotificationsTab.NotificationsTab (cyclomatic 38) · ×1
  • NotificationsTab.NotificationsTab (cyclomatic 38) web/src/components/settings/tabs/NotificationsTab.tsx:179 — NotificationsTab.NotificationsTab has cyclomatic complexity 38 (threshold 15). Of this number, 35 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 · OperationsDigestPage.OperationsDigestPage (cyclomatic 38) · ×1
  • OperationsDigestPage.OperationsDigestPage (cyclomatic 38) web/src/components/digest/OperationsDigestPage.tsx:62 — OperationsDigestPage.OperationsDigestPage has cyclomatic complexity 38 (threshold 15). Of this number, 24 points are the body's own statements and 14 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ReviewPanel.ReviewPanel (cyclomatic 38) · ×1
  • ReviewPanel.ReviewPanel (cyclomatic 38) web/src/components/task/ReviewPanel.tsx:47 — ReviewPanel.ReviewPanel has cyclomatic complexity 38 (threshold 15). Of this number, 29 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 · TemplateEditorDialog.TemplateEditorDialog (cyclomatic 38) · ×1
  • TemplateEditorDialog.TemplateEditorDialog (cyclomatic 38) web/src/components/templates/TemplateEditorDialog.tsx:57 — TemplateEditorDialog.TemplateEditorDialog has cyclomatic complexity 38 (threshold 15). Of this number, 16 points are the body's own statements and 22 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · phase-capability-service.compilePhaseCapabilityAuthority (cyclomatic 37) · ×1
  • phase-capability-service.compilePhaseCapabilityAuthority (cyclomatic 37) server/src/services/phase-capability-service.ts:134 — phase-capability-service.compilePhaseCapabilityAuthority has cyclomatic complexity 37 (threshold 15). Of this number, 33 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 · ClawdbotAgentService.startCodexCli (cyclomatic 37) · ×1
  • ClawdbotAgentService.startCodexCli (cyclomatic 37) server/src/services/clawdbot-agent-service.ts:7168 — ClawdbotAgentService.startCodexCli has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 9 of the 37 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 7327, 7262, 7248, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · AgentsTab.RoutingRuleForm (cyclomatic 37) · ×1
  • AgentsTab.RoutingRuleForm (cyclomatic 37) web/src/components/settings/tabs/AgentsTab.tsx:2754 — AgentsTab.RoutingRuleForm has cyclomatic complexity 37 (threshold 15). Of this number, 26 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 · transition-hooks-service.checkGate (cyclomatic 36) · ×1
  • transition-hooks-service.checkGate (cyclomatic 36) server/src/services/transition-hooks-service.ts:152 — transition-hooks-service.checkGate 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 · ToolControlPlaneService.prepareRunCatalog (cyclomatic 36) · ×1
  • ToolControlPlaneService.prepareRunCatalog (cyclomatic 36) server/src/services/tool-control-plane-service.ts:305 — ToolControlPlaneService.prepareRunCatalog has cyclomatic complexity 36 (threshold 15). Of this number, 21 points are the body's own statements and 15 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkflowRunService.executeRun (cyclomatic 36) · ×1
  • WorkflowRunService.executeRun (cyclomatic 36) REDACTED:1553 — WorkflowRunService.executeRun 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 · DesktopOnboarding.DesktopOnboardingPanel (cyclomatic 36) · ×1
  • DesktopOnboarding.DesktopOnboardingPanel (cyclomatic 36) web/src/components/auth/DesktopOnboarding.tsx:289 — DesktopOnboarding.DesktopOnboardingPanel has cyclomatic complexity 36 (threshold 15). Of this number, 23 points are the body's own statements and 13 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 · BuzzConnectionPanel.BuzzConnectionPanel (cyclomatic 36) · ×1
  • BuzzConnectionPanel.BuzzConnectionPanel (cyclomatic 36) web/src/components/settings/tabs/BuzzConnectionPanel.tsx:87 — BuzzConnectionPanel.BuzzConnectionPanel has cyclomatic complexity 36 (threshold 15). Of this number, 25 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BulkActionsBar.BulkActionsBar (cyclomatic 36) · ×1
  • BulkActionsBar.BulkActionsBar (cyclomatic 36) web/src/components/board/BulkActionsBar.tsx:48 — BulkActionsBar.BulkActionsBar has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 10 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (handleMoveToStatus, handleArchiveSelected, handleMoveToBacklog, …). 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 · TaskMetadataSection.TaskMetadataSection (cyclomatic 36) · ×1
  • TaskMetadataSection.TaskMetadataSection (cyclomatic 36) web/src/components/task/detail/TaskMetadataSection.tsx:40 — TaskMetadataSection.TaskMetadataSection has cyclomatic complexity 36 (threshold 15). Of this number, 20 points are the body's own statements and 16 belong to 9 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 · admission-control-schemas.AdmissionQueueEntrySchema (cyclomatic 35) · ×1
  • admission-control-schemas.AdmissionQueueEntrySchema (cyclomatic 35) server/src/schemas/admission-control-schemas.ts:531 — admission-control-schemas.AdmissionQueueEntrySchema has cyclomatic complexity 35 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · WorkspaceCheckpointRewindPreviewService.preview (cyclomatic 35) · ×1
  • WorkspaceCheckpointRewindPreviewService.preview (cyclomatic 35) server/src/services/workspace-checkpoint-rewind-preview-service.ts:55 — WorkspaceCheckpointRewindPreviewService.preview has cyclomatic complexity 35 (threshold 15). Of this number, 26 points are the body's own statements and 9 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 · knowledge-collection-repository.assertKnowledgeProposalTransition (cyclomatic 35) · ×1
  • knowledge-collection-repository.assertKnowledgeProposalTransition (cyclomatic 35) server/src/storage/knowledge-collection-repository.ts:1007 — knowledge-collection-repository.assertKnowledgeProposalTransition has cyclomatic complexity 35 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BoardSidebar.AgentStatusPanel (cyclomatic 35) · ×1
  • BoardSidebar.AgentStatusPanel (cyclomatic 35) web/src/components/board/BoardSidebar.tsx:134 — BoardSidebar.AgentStatusPanel has cyclomatic complexity 35 (threshold 15). Of this number, 23 points are the body's own statements and 12 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DecisionExplorer.DecisionExplorer (cyclomatic 35) · ×1
  • DecisionExplorer.DecisionExplorer (cyclomatic 35) web/src/components/decisions/DecisionExplorer.tsx:62 — DecisionExplorer.DecisionExplorer has cyclomatic complexity 35 (threshold 15). Of this number, 18 points are the body's own statements and 17 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 · WorkflowSection.WorkflowSection (cyclomatic 35) · ×1
  • WorkflowSection.WorkflowSection (cyclomatic 35) web/src/components/task/WorkflowSection.tsx:135 — WorkflowSection.WorkflowSection has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 7 of the 35 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 201, a function literal at line 161, handleStartWorkflow, …). 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 · openclaw-gateway-rpc.waitForOpenClawRun (cyclomatic 34) · ×1
  • openclaw-gateway-rpc.waitForOpenClawRun (cyclomatic 34) server/src/utils/openclaw-gateway-rpc.ts:33 — openclaw-gateway-rpc.waitForOpenClawRun has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 11 of the 34 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 91, a function literal at line 73, lookup). 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 · run-launch-manifest-service.collectBlockers (cyclomatic 34) · ×1
  • run-launch-manifest-service.collectBlockers (cyclomatic 34) server/src/services/run-launch-manifest-service.ts:545 — run-launch-manifest-service.collectBlockers has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WorkflowService.validateWorkflow (cyclomatic 34) · ×1
  • WorkflowService.validateWorkflow (cyclomatic 34) server/src/services/workflow-service.ts:218 — WorkflowService.validateWorkflow 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 · dashboard-metrics.computeAllMetrics (cyclomatic 34) · ×1
  • dashboard-metrics.computeAllMetrics (cyclomatic 34) server/src/services/metrics/dashboard-metrics.ts:66 — dashboard-metrics.computeAllMetrics has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 100, 293). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · BuzzDefinitionImportService.importPersona (cyclomatic 34) · ×1
  • BuzzDefinitionImportService.importPersona (cyclomatic 34) server/src/services/buzz-definition-import-service.ts:1214 — BuzzDefinitionImportService.importPersona 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 3 function literals inside it that branch (lines 1221, 1248, 1296). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · LoginScreen.LoginScreen (cyclomatic 34) · ×1
  • LoginScreen.LoginScreen (cyclomatic 34) web/src/components/auth/LoginScreen.tsx:7 — LoginScreen.LoginScreen has cyclomatic complexity 34 (threshold 15). Of this number, 20 points are the body's own statements and 14 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 · AgentsTab.AgentForm (cyclomatic 34) · ×1
  • AgentsTab.AgentForm (cyclomatic 34) web/src/components/settings/tabs/AgentsTab.tsx:2952 — AgentsTab.AgentForm has cyclomatic complexity 34 (threshold 15). Of this number, 22 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · RunModeGateSection.RunModeGateSection (cyclomatic 34) · ×1
  • RunModeGateSection.RunModeGateSection (cyclomatic 34) web/src/components/task/RunModeGateSection.tsx:48 — RunModeGateSection.RunModeGateSection has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to 5 function items inside it that branch (handleQaRequiredToggle, handleQaPassToggle, handleRunModeChange, …). 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 · WorkflowAuthoringService.lintPipeline (cyclomatic 33) · ×1
  • WorkflowAuthoringService.lintPipeline (cyclomatic 33) server/src/services/workflow-authoring-service.ts:1361 — WorkflowAuthoringService.lintPipeline 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 · ArtifactPreviewModal.ArtifactPreviewModal (cyclomatic 33) · ×1
  • ArtifactPreviewModal.ArtifactPreviewModal (cyclomatic 33) web/src/components/task/ArtifactPreviewModal.tsx:35 — ArtifactPreviewModal.ArtifactPreviewModal has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 14 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 55, download, openCausalEvent, …). 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 · doctor.runDoctorChecks (cyclomatic 32) · ×1
  • doctor.runDoctorChecks (cyclomatic 32) cli/src/commands/doctor.ts:697 — doctor.runDoctorChecks 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 · sprints.registerSprintCommands (cyclomatic 32) · ×1
  • sprints.registerSprintCommands (cyclomatic 32) cli/src/commands/sprints.ts:27 — sprints.registerSprintCommands has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 106, 142, 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 · AdmissionControlService.executionTreeBreakerEvidence (cyclomatic 32) · ×1
  • AdmissionControlService.executionTreeBreakerEvidence (cyclomatic 32) server/src/services/admission-control-service.ts:316 — AdmissionControlService.executionTreeBreakerEvidence 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ClawdbotAgentService.executeRunTerminal (cyclomatic 32) · ×1
  • ClawdbotAgentService.executeRunTerminal (cyclomatic 32) server/src/services/clawdbot-agent-service.ts:8245 — ClawdbotAgentService.executeRunTerminal has cyclomatic complexity 32 (threshold 15). Of this number, 25 points are the body's own statements and 7 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 · CommunicationAdapterService.reconcileBuzzDeliveries (cyclomatic 32) · ×1
  • CommunicationAdapterService.reconcileBuzzDeliveries (cyclomatic 32) server/src/services/communication-adapter-service.ts:1527 — CommunicationAdapterService.reconcileBuzzDeliveries has cyclomatic complexity 32 (threshold 15). Of this number, 27 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 · knowledge-collection-schemas.KnowledgeIngestionProposalSchema (cyclomatic 32) · ×1
  • knowledge-collection-schemas.KnowledgeIngestionProposalSchema (cyclomatic 32) server/src/schemas/knowledge-collection-schemas.ts:595 — knowledge-collection-schemas.KnowledgeIngestionProposalSchema 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 · TrackersTab.TrackersTab (cyclomatic 32) · ×1
  • TrackersTab.TrackersTab (cyclomatic 32) web/src/components/settings/tabs/TrackersTab.tsx:113 — TrackersTab.TrackersTab has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 12 of the 32 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 364, 215, 137, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · AdmissionQueuePanel.AdmissionQueuePanel (cyclomatic 32) · ×1
  • AdmissionQueuePanel.AdmissionQueuePanel (cyclomatic 32) web/src/components/digest/AdmissionQueuePanel.tsx:64 — AdmissionQueuePanel.AdmissionQueuePanel has cyclomatic complexity 32 (threshold 15). Of this number, 21 points are the body's own statements and 11 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 · RunAccessPanel.RunAccessPanel (cyclomatic 32) · ×1
  • RunAccessPanel.RunAccessPanel (cyclomatic 32) web/src/components/task/RunAccessPanel.tsx:43 — RunAccessPanel.RunAccessPanel has cyclomatic complexity 32 (threshold 15). Of this number, 23 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AdmissionControlService.projectQueueInspection (cyclomatic 31) · ×1
  • AdmissionControlService.projectQueueInspection (cyclomatic 31) server/src/services/admission-control-service.ts:1306 — AdmissionControlService.projectQueueInspection 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 · ConversationLifecycleService.assertCompatible (cyclomatic 31) · ×1
  • ConversationLifecycleService.assertCompatible (cyclomatic 31) server/src/services/conversation-lifecycle-service.ts:95 — ConversationLifecycleService.assertCompatible 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 · SetupScreen.SetupScreen (cyclomatic 31) · ×1
  • SetupScreen.SetupScreen (cyclomatic 31) web/src/components/auth/SetupScreen.tsx:27 — SetupScreen.SetupScreen has cyclomatic complexity 31 (threshold 15). Of this number, 21 points are the body's own statements and 10 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentRunTimelinePanel.EventRow (cyclomatic 31) · ×1
  • AgentRunTimelinePanel.EventRow (cyclomatic 31) web/src/components/task/AgentRunTimelinePanel.tsx:953 — AgentRunTimelinePanel.EventRow 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 · WorkflowRunView.WorkflowRunView (cyclomatic 31) · ×1
  • WorkflowRunView.WorkflowRunView (cyclomatic 31) web/src/components/workflows/WorkflowRunView.tsx:164 — WorkflowRunView.WorkflowRunView has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 15 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 203, handleDistillTemplate, a function literal at line 175, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · goals.registerGoalCommands (cyclomatic 30) · ×1
  • goals.registerGoalCommands (cyclomatic 30) cli/src/commands/goals.ts:35 — goals.registerGoalCommands 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 6 function literals inside it that branch (lines 102, 48, 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 · SqliteJournalMaintenanceService.executeScheduledOperation (cyclomatic 30) · ×1
  • SqliteJournalMaintenanceService.executeScheduledOperation (cyclomatic 30) server/src/storage/sqlite/journal-maintenance-service.ts:586 — SqliteJournalMaintenanceService.executeScheduledOperation 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 · WorktreeService.buildCleanupPreview (cyclomatic 30) · ×1
  • WorktreeService.buildCleanupPreview (cyclomatic 30) server/src/services/worktree-service.ts:1250 — WorktreeService.buildCleanupPreview has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkflowStepExecutor.executeCodexAgentStep (cyclomatic 30) · ×1
  • WorkflowStepExecutor.executeCodexAgentStep (cyclomatic 30) REDACTED:971 — WorkflowStepExecutor.executeCodexAgentStep has cyclomatic complexity 30 (threshold 15). Of this number, 28 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 · WorkflowStepExecutor.executeLoopStep (cyclomatic 30) · ×1
  • WorkflowStepExecutor.executeLoopStep (cyclomatic 30) REDACTED:1475 — WorkflowStepExecutor.executeLoopStep 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 · ClawdbotAgentService.completePendingAgent (cyclomatic 30) · ×1
  • ClawdbotAgentService.completePendingAgent (cyclomatic 30) server/src/services/clawdbot-agent-service.ts:3105 — ClawdbotAgentService.completePendingAgent has cyclomatic complexity 30 (threshold 15). Of this number, 19 points are the body's own statements and 11 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 · BuzzSubscriptionWorker.handleMessage (cyclomatic 30) · ×1
  • BuzzSubscriptionWorker.handleMessage (cyclomatic 30) server/src/services/buzz-subscription-worker.ts:217 — BuzzSubscriptionWorker.handleMessage 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 · SqlitePortabilityService.migrateFilesToSqlite (cyclomatic 30) · ×1
  • SqlitePortabilityService.migrateFilesToSqlite (cyclomatic 30) server/src/services/sqlite-portability-service.ts:275 — SqlitePortabilityService.migrateFilesToSqlite 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 · ManageTab.ManageTab (cyclomatic 30) · ×1
  • ManageTab.ManageTab (cyclomatic 30) web/src/components/settings/tabs/ManageTab.tsx:29 — ManageTab.ManageTab 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 8 function items inside it that branch (handleFileSelect, handleExportTemplates, 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 · BudgetCard.BudgetCard (cyclomatic 30) · ×1
  • BudgetCard.BudgetCard (cyclomatic 30) web/src/components/dashboard/BudgetCard.tsx:75 — BudgetCard.BudgetCard has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TimeTrackingSection.TimeTrackingSection (cyclomatic 30) · ×1
  • TimeTrackingSection.TimeTrackingSection (cyclomatic 30) web/src/components/task/TimeTrackingSection.tsx:67 — TimeTrackingSection.TimeTrackingSection has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to 8 function items inside it that branch (handleStartStop, handleAddEntry, a function literal at line 322, …). 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 · TaskMetricsPanel.TaskMetricsPanel (cyclomatic 30) · ×1
  • TaskMetricsPanel.TaskMetricsPanel (cyclomatic 30) web/src/components/task/TaskMetricsPanel.tsx:240 — TaskMetricsPanel.TaskMetricsPanel 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 · EgressPolicyService.evaluate (cyclomatic 29) · ×1
  • EgressPolicyService.evaluate (cyclomatic 29) server/src/services/egress-policy-service.ts:66 — EgressPolicyService.evaluate 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 · AgentHostService.buildHosts (cyclomatic 29) · ×1
  • AgentHostService.buildHosts (cyclomatic 29) server/src/services/agent-host-service.ts:95 — AgentHostService.buildHosts has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · ClawdbotAgentService.startHermesCli (cyclomatic 29) · ×1
  • ClawdbotAgentService.startHermesCli (cyclomatic 29) server/src/services/clawdbot-agent-service.ts:6990 — ClawdbotAgentService.startHermesCli has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 8 of the 29 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 7134, 7074, 7050, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · run-access-summary-service.projectIntegrations (cyclomatic 29) · ×1
  • run-access-summary-service.projectIntegrations (cyclomatic 29) server/src/services/run-access-summary-service.ts:599 — run-access-summary-service.projectIntegrations has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 625, 633). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · AgentHealthClassifierService.classifyAgent (cyclomatic 29) · ×1
  • AgentHealthClassifierService.classifyAgent (cyclomatic 29) server/src/services/agent-health-classifier-service.ts:51 — AgentHealthClassifierService.classifyAgent has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · CommunicationAdapterService.ingestBuzzEvent (cyclomatic 29) · ×1
  • CommunicationAdapterService.ingestBuzzEvent (cyclomatic 29) server/src/services/communication-adapter-service.ts:1008 — CommunicationAdapterService.ingestBuzzEvent 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 · WorkspaceCapabilitiesTab.WorkspaceCapabilitiesTab (cyclomatic 29) · ×1
  • WorkspaceCapabilitiesTab.WorkspaceCapabilitiesTab (cyclomatic 29) web/src/components/settings/tabs/WorkspaceCapabilitiesTab.tsx:31 — WorkspaceCapabilitiesTab.WorkspaceCapabilitiesTab has cyclomatic complexity 29 (threshold 15). Of this number, 16 points are the body's own statements and 13 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 · SquadChatPanel.SquadMessageBubble (cyclomatic 29) · ×1
  • SquadChatPanel.SquadMessageBubble (cyclomatic 29) web/src/components/chat/SquadChatPanel.tsx:526 — SquadChatPanel.SquadMessageBubble has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 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 · DependenciesSection.DependenciesSection (cyclomatic 29) · ×1
  • DependenciesSection.DependenciesSection (cyclomatic 29) web/src/components/task/DependenciesSection.tsx:16 — DependenciesSection.DependenciesSection has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 14 function items inside it that branch (handleAddDependency, a function literal at line 40, a function literal at line 47, …). 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 · SqliteDatabase.open (cyclomatic 28) · ×1
  • SqliteDatabase.open (cyclomatic 28) server/src/storage/sqlite/database.ts:185 — SqliteDatabase.open 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 · WorkProductArtifactService.registerUnlocked (cyclomatic 28) · ×1
  • WorkProductArtifactService.registerUnlocked (cyclomatic 28) server/src/services/work-product-artifact-service.ts:114 — WorkProductArtifactService.registerUnlocked 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into 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-product-artifact-preview-service.parseCsv (cyclomatic 28) · ×1
  • work-product-artifact-preview-service.parseCsv (cyclomatic 28) server/src/services/work-product-artifact-preview-service.ts:573 — work-product-artifact-preview-service.parseCsv 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 · BuzzCompatibilityService.probe (cyclomatic 28) · ×1
  • BuzzCompatibilityService.probe (cyclomatic 28) server/src/services/buzz-compatibility-service.ts:573 — BuzzCompatibilityService.probe has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · buzz-communication-service.parseBuzzInboundEvent (cyclomatic 28) · ×1
  • buzz-communication-service.parseBuzzInboundEvent (cyclomatic 28) server/src/services/buzz-communication-service.ts:155 — buzz-communication-service.parseBuzzInboundEvent has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AutomationActivationService.finishRunClaim (cyclomatic 28) · ×1
  • AutomationActivationService.finishRunClaim (cyclomatic 28) server/src/services/automation-activation-service.ts:755 — AutomationActivationService.finishRunClaim 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 762). 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 · useWebSocket.useWebSocket.connect (cyclomatic 28) · ×1
  • useWebSocket.useWebSocket.connect (cyclomatic 28) web/src/hooks/useWebSocket.ts:181 — useWebSocket.useWebSocket.connect has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 236, a function literal at line 208, a function literal at line 270, …). 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 · AgentsTab.BuzzDefinitionImportSection (cyclomatic 28) · ×1
  • AgentsTab.BuzzDefinitionImportSection (cyclomatic 28) web/src/components/settings/tabs/AgentsTab.tsx:433 — AgentsTab.BuzzDefinitionImportSection has cyclomatic complexity 28 (threshold 15). Of this number, 18 points are the body's own statements and 10 belong to 6 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 · KanbanColumn.KanbanColumn (cyclomatic 28) · ×1
  • KanbanColumn.KanbanColumn (cyclomatic 28) web/src/components/board/KanbanColumn.tsx:50 — KanbanColumn.KanbanColumn has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 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 · ActivityFeed.StatusHistoryPanel (cyclomatic 28) · ×1
  • ActivityFeed.StatusHistoryPanel (cyclomatic 28) web/src/components/activity/ActivityFeed.tsx:142 — ActivityFeed.StatusHistoryPanel has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 4 of the 28 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 244, 170, 261, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · DashboardPage.DashboardPage (cyclomatic 28) · ×1
  • DashboardPage.DashboardPage (cyclomatic 28) web/src/components/dashboard/DashboardPage.tsx:121 — DashboardPage.DashboardPage has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EvidenceTimelinePanel.EvidenceTimelinePanel (cyclomatic 28) · ×1
  • EvidenceTimelinePanel.EvidenceTimelinePanel (cyclomatic 28) web/src/components/evidence/EvidenceTimelinePanel.tsx:145 — EvidenceTimelinePanel.EvidenceTimelinePanel has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 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 · ArchiveSidebar.ArchiveSidebar (cyclomatic 28) · ×1
  • ArchiveSidebar.ArchiveSidebar (cyclomatic 28) web/src/components/layout/ArchiveSidebar.tsx:143 — ArchiveSidebar.ArchiveSidebar has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 207, handleRestore, handleRestoreFromDetail, …). 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 · SubtasksSection.SubtasksSection (cyclomatic 28) · ×1
  • SubtasksSection.SubtasksSection (cyclomatic 28) web/src/components/task/SubtasksSection.tsx:30 — SubtasksSection.SubtasksSection has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 142, getCriteriaProgress, handleAddSubtask, …). 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 · TemplatePreviewPanel.TemplatePreviewPanel (cyclomatic 28) · ×1
  • TemplatePreviewPanel.TemplatePreviewPanel (cyclomatic 28) web/src/components/templates/TemplatePreviewPanel.tsx:10 — TemplatePreviewPanel.TemplatePreviewPanel has cyclomatic complexity 28 (threshold 15). Of this number, 23 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 · useBoardDragDrop.createBoardKeyboardCoordinates.<returned closure> (cyclomatic 28) · ×1
  • useBoardDragDrop.createBoardKeyboardCoordinates.<returned closure> (cyclomatic 28) web/src/hooks/useBoardDragDrop.ts:61 — useBoardDragDrop.createBoardKeyboardCoordinates.<returned closure> has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 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 · SecureWorkProductArtifactSourceReader.read (cyclomatic 27) · ×1
  • SecureWorkProductArtifactSourceReader.read (cyclomatic 27) server/src/storage/work-product-artifact-repository.ts:90 — SecureWorkProductArtifactSourceReader.read has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FileWorkspaceCheckpointRepository.prune (cyclomatic 27) · ×1
  • FileWorkspaceCheckpointRepository.prune (cyclomatic 27) server/src/storage/workspace-checkpoint-repository.ts:581 — FileWorkspaceCheckpointRepository.prune has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · FilesystemSandboxService.compile (cyclomatic 27) · ×1
  • FilesystemSandboxService.compile (cyclomatic 27) server/src/services/filesystem-sandbox-service.ts:236 — FilesystemSandboxService.compile 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 · PhaseTransitionService.transition (cyclomatic 27) · ×1
  • PhaseTransitionService.transition (cyclomatic 27) server/src/services/phase-transition-service.ts:102 — PhaseTransitionService.transition 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 · ClawdbotAgentService.startAcpStdio (cyclomatic 27) · ×1
  • ClawdbotAgentService.startAcpStdio (cyclomatic 27) server/src/services/clawdbot-agent-service.ts:5139 — ClawdbotAgentService.startAcpStdio has cyclomatic complexity 27 (threshold 15). Of this number, 20 points are the body's own statements and 7 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 · task-metrics.computeVelocityMetrics (cyclomatic 27) · ×1
  • task-metrics.computeVelocityMetrics (cyclomatic 27) server/src/services/metrics/task-metrics.ts:103 — task-metrics.computeVelocityMetrics has cyclomatic complexity 27 (threshold 15). Of this number, 24 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 · api-client.createApiClient.api (cyclomatic 27) · ×1
  • api-client.createApiClient.api (cyclomatic 27) shared/src/utils/api-client.ts:177 — api-client.createApiClient.api has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 188, 186). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · BacklogPage.BacklogPage (cyclomatic 27) · ×1
  • BacklogPage.BacklogPage (cyclomatic 27) web/src/components/backlog/BacklogPage.tsx:41 — BacklogPage.BacklogPage has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 75, handleBulkPromote, handleDelete, …). 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 · GitSelectionForm.GitSelectionForm (cyclomatic 27) · ×1
  • GitSelectionForm.GitSelectionForm (cyclomatic 27) web/src/components/task/git/GitSelectionForm.tsx:22 — GitSelectionForm.GitSelectionForm has cyclomatic complexity 27 (threshold 15). Of this number, 16 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.
D1 · Cyclomatic Complexity · WorkflowEditorRoute.WorkflowEditorRoute (cyclomatic 27) · ×1
  • WorkflowEditorRoute.WorkflowEditorRoute (cyclomatic 27) web/src/components/workflows/WorkflowEditorRoute.tsx:52 — WorkflowEditorRoute.WorkflowEditorRoute has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · CredentialBrokerService.reconcile (cyclomatic 26) · ×1
  • CredentialBrokerService.reconcile (cyclomatic 26) server/src/services/credential-broker-service.ts:920 — CredentialBrokerService.reconcile has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 972, 931, 949). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · RunRecoveryCoordinator.reconcileRunningAttempts (cyclomatic 26) · ×1
  • RunRecoveryCoordinator.reconcileRunningAttempts (cyclomatic 26) server/src/services/run-recovery-coordinator.ts:130 — RunRecoveryCoordinator.reconcileRunningAttempts 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 · RunRecoveryCoordinator.planTaskRecovery (cyclomatic 26) · ×1
  • RunRecoveryCoordinator.planTaskRecovery (cyclomatic 26) server/src/services/run-recovery-coordinator.ts:482 — RunRecoveryCoordinator.planTaskRecovery 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 · WorkflowRunService.dispatchQueuedWorkflowStep (cyclomatic 26) · ×1
  • WorkflowRunService.dispatchQueuedWorkflowStep (cyclomatic 26) REDACTED:933 — WorkflowRunService.dispatchQueuedWorkflowStep 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 · PreviewService.startPreview (cyclomatic 26) · ×1
  • PreviewService.startPreview (cyclomatic 26) REDACTED:132 — PreviewService.startPreview has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 202, 254, 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 · AutomationDraftService.validateResolvedFields (cyclomatic 26) · ×1
  • AutomationDraftService.validateResolvedFields (cyclomatic 26) REDACTED:318 — AutomationDraftService.validateResolvedFields 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 · knowledge-integrity-service.lintKnowledgeCollection (cyclomatic 26) · ×1
  • knowledge-integrity-service.lintKnowledgeCollection (cyclomatic 26) server/src/services/knowledge-integrity-service.ts:35 — knowledge-integrity-service.lintKnowledgeCollection 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 · ToolPoliciesTab.ToolPoliciesTab (cyclomatic 26) · ×1
  • ToolPoliciesTab.ToolPoliciesTab (cyclomatic 26) web/src/components/settings/tabs/ToolPoliciesTab.tsx:27 — ToolPoliciesTab.ToolPoliciesTab has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 188, handleSavePolicy, handleDeletePolicy, …). 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 · AgentComparison.AgentComparison (cyclomatic 26) · ×1
  • AgentComparison.AgentComparison (cyclomatic 26) web/src/components/dashboard/AgentComparison.tsx:97 — AgentComparison.AgentComparison has cyclomatic complexity 26 (threshold 15). Of this number, 14 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TemplatesPage.TemplatesPage (cyclomatic 26) · ×1
  • TemplatesPage.TemplatesPage (cyclomatic 26) web/src/components/templates/TemplatesPage.tsx:30 — TemplatesPage.TemplatesPage has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 7 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 157, a function literal at line 52, handleDeleteConfirm). 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 · useBulkTaskMetrics.aggregateTaskMetrics (cyclomatic 26) · ×1
  • useBulkTaskMetrics.aggregateTaskMetrics (cyclomatic 26) web/src/hooks/useBulkTaskMetrics.ts:27 — useBulkTaskMetrics.aggregateTaskMetrics 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 · setup.registerSetupCommands (cyclomatic 25) · ×1
  • setup.registerSetupCommands (cyclomatic 25) cli/src/commands/setup.ts:17 — setup.registerSetupCommands 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 one function literal inside it that branches (line 23). 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 · OutboundIntegrationService.deliver (cyclomatic 25) · ×1
  • OutboundIntegrationService.deliver (cyclomatic 25) server/src/services/outbound-integration-service.ts:260 — OutboundIntegrationService.deliver has cyclomatic complexity 25 (threshold 15). Of this number, 18 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 · task-envelope-service.captureCompletionGitState (cyclomatic 25) · ×1
  • task-envelope-service.captureCompletionGitState (cyclomatic 25) server/src/services/task-envelope-service.ts:571 — task-envelope-service.captureCompletionGitState 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 · AttemptLifecycleCoordinator.assertCompletionBinding (cyclomatic 25) · ×1
  • AttemptLifecycleCoordinator.assertCompletionBinding (cyclomatic 25) server/src/services/attempt-lifecycle-coordinator.ts:162 — AttemptLifecycleCoordinator.assertCompletionBinding 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 · RunTerminalService.projectReconciliationEvent (cyclomatic 25) · ×1
  • RunTerminalService.projectReconciliationEvent (cyclomatic 25) server/src/services/run-terminal-service.ts:642 — RunTerminalService.projectReconciliationEvent 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 · AgentProviderAdapterRegistry.stop (cyclomatic 25) · ×1
  • AgentProviderAdapterRegistry.stop (cyclomatic 25) REDACTED:199 — AgentProviderAdapterRegistry.stop has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, 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 · token-metrics.computeBudgetMetrics (cyclomatic 25) · ×1
  • token-metrics.computeBudgetMetrics (cyclomatic 25) server/src/services/metrics/token-metrics.ts:115 — token-metrics.computeBudgetMetrics 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 · dashboard-metrics.computeTrends (cyclomatic 25) · ×1
  • dashboard-metrics.computeTrends (cyclomatic 25) server/src/services/metrics/dashboard-metrics.ts:336 — dashboard-metrics.computeTrends has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 403). 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 · CommunicationAdapterService.sendBuzz (cyclomatic 25) · ×1
  • CommunicationAdapterService.sendBuzz (cyclomatic 25) server/src/services/communication-adapter-service.ts:1315 — CommunicationAdapterService.sendBuzz has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BuzzDefinitionImportService.previewPersona (cyclomatic 25) · ×1
  • BuzzDefinitionImportService.previewPersona (cyclomatic 25) server/src/services/buzz-definition-import-service.ts:770 — BuzzDefinitionImportService.previewPersona 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 · BuzzDefinitionImportService.previewTeam (cyclomatic 25) · ×1
  • BuzzDefinitionImportService.previewTeam (cyclomatic 25) server/src/services/buzz-definition-import-service.ts:1004 — BuzzDefinitionImportService.previewTeam has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileKnowledgeCollectionRepository.readState (cyclomatic 25) · ×1
  • FileKnowledgeCollectionRepository.readState (cyclomatic 25) server/src/storage/knowledge-collection-repository.ts:635 — FileKnowledgeCollectionRepository.readState 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 · BoardSidebar.RecentStatusChanges (cyclomatic 25) · ×1
  • BoardSidebar.RecentStatusChanges (cyclomatic 25) web/src/components/board/BoardSidebar.tsx:298 — BoardSidebar.RecentStatusChanges has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 352, 338, 333, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · mime-validation.validateMimeType (cyclomatic 24) · ×1
  • mime-validation.validateMimeType (cyclomatic 24) server/src/services/mime-validation.ts:173 — mime-validation.validateMimeType 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 · AgentRoutingService.resolveAgentWithTrace (cyclomatic 24) · ×1
  • AgentRoutingService.resolveAgentWithTrace (cyclomatic 24) server/src/services/agent-routing-service.ts:102 — AgentRoutingService.resolveAgentWithTrace 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 · RunLaunchCompiler.buildRunLaunchRuntime (cyclomatic 24) · ×1
  • RunLaunchCompiler.buildRunLaunchRuntime (cyclomatic 24) server/src/services/run-launch-compiler.ts:904 — RunLaunchCompiler.buildRunLaunchRuntime 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 · run-file-execution-policy-service.snapshotCandidate (cyclomatic 24) · ×1
  • run-file-execution-policy-service.snapshotCandidate (cyclomatic 24) server/src/services/run-file-execution-policy-service.ts:449 — run-file-execution-policy-service.snapshotCandidate 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 · ClawdbotAgentService.startCodexSdk (cyclomatic 24) · ×1
  • ClawdbotAgentService.startCodexSdk (cyclomatic 24) server/src/services/clawdbot-agent-service.ts:7447 — ClawdbotAgentService.startCodexSdk 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 · dashboard-metrics.computeAgentComparison (cyclomatic 24) · ×1
  • dashboard-metrics.computeAgentComparison (cyclomatic 24) server/src/services/metrics/dashboard-metrics.ts:499 — dashboard-metrics.computeAgentComparison has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ViewContext.ViewProvider (cyclomatic 24) · ×1
  • ViewContext.ViewProvider (cyclomatic 24) web/src/contexts/ViewContext.tsx:109 — ViewContext.ViewProvider 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 12 function literals inside it that branch (lines 118, 196, 314, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · GeneralTab.AddRepoForm (cyclomatic 24) · ×1
  • GeneralTab.AddRepoForm (cyclomatic 24) web/src/components/settings/tabs/GeneralTab.tsx:250 — GeneralTab.AddRepoForm has cyclomatic complexity 24 (threshold 15). Of this number, 16 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 · SystemHealthBar.SystemHealthBar (cyclomatic 24) · ×1
  • SystemHealthBar.SystemHealthBar (cyclomatic 24) web/src/components/layout/SystemHealthBar.tsx:72 — SystemHealthBar.SystemHealthBar 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TaskDetailsTab.TaskDetailsTab (cyclomatic 24) · ×1
  • TaskDetailsTab.TaskDetailsTab (cyclomatic 24) web/src/components/task/detail/TaskDetailsTab.tsx:28 — TaskDetailsTab.TaskDetailsTab has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 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 · MarkdownEditor.MarkdownEditor (cyclomatic 24) · ×1
  • MarkdownEditor.MarkdownEditor (cyclomatic 24) web/src/components/ui/MarkdownEditor.tsx:34 — MarkdownEditor.MarkdownEditor has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 131, handleKeyDown, a function literal at line 48, …). 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 · WorkflowsPage.WorkflowsPage (cyclomatic 24) · ×1
  • WorkflowsPage.WorkflowsPage (cyclomatic 24) web/src/components/workflows/WorkflowsPage.tsx:96 — WorkflowsPage.WorkflowsPage has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 141, a function literal at line 176, a function literal at line 110, …). 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 · TaskService.addDependency (cyclomatic 23) · ×1
  • TaskService.addDependency (cyclomatic 23) server/src/services/task-service.ts:1751 — TaskService.addDependency 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 · run-event-journal-service.normalizeJson (cyclomatic 23) · ×1
  • run-event-journal-service.normalizeJson (cyclomatic 23) server/src/services/run-event-journal-service.ts:64 — run-event-journal-service.normalizeJson 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 · egress-policy-service.classifyAddress (cyclomatic 23) · ×1
  • egress-policy-service.classifyAddress (cyclomatic 23) server/src/services/egress-policy-service.ts:277 — egress-policy-service.classifyAddress 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 · buzz-definition-import-service.parseEventShape (cyclomatic 23) · ×1
  • buzz-definition-import-service.parseEventShape (cyclomatic 23) server/src/services/buzz-definition-import-service.ts:253 — buzz-definition-import-service.parseEventShape 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 · QueueMonitorsTab.QueueMonitorsTab (cyclomatic 23) · ×1
  • QueueMonitorsTab.QueueMonitorsTab (cyclomatic 23) web/src/components/settings/tabs/QueueMonitorsTab.tsx:33 — QueueMonitorsTab.QueueMonitorsTab has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 115, mutate). 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 · notifications.registerNotificationCommands (cyclomatic 22) · ×1
  • notifications.registerNotificationCommands (cyclomatic 22) cli/src/commands/notifications.ts:5 — notifications.registerNotificationCommands 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 6 function literals inside it that branch (lines 18, 83, 125, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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.registerWorkflowCommands (cyclomatic 22) · ×1
  • workflow.registerWorkflowCommands (cyclomatic 22) cli/src/commands/workflow.ts:13 — workflow.registerWorkflowCommands has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 77, 19, 149, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · durable-goal-schemas.DurableGoalRecordSchema (cyclomatic 22) · ×1
  • durable-goal-schemas.DurableGoalRecordSchema (cyclomatic 22) server/src/schemas/durable-goal-schemas.ts:173 — durable-goal-schemas.DurableGoalRecordSchema 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 · ClawdbotAgentService.handleClaudeCodeJsonLine (cyclomatic 22) · ×1
  • ClawdbotAgentService.handleClaudeCodeJsonLine (cyclomatic 22) server/src/services/clawdbot-agent-service.ts:6851 — ClawdbotAgentService.handleClaudeCodeJsonLine 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 · clawdbot-agent-service.parseProviderConversationCursor (cyclomatic 22) · ×1
  • clawdbot-agent-service.parseProviderConversationCursor (cyclomatic 22) server/src/services/clawdbot-agent-service.ts:9443 — clawdbot-agent-service.parseProviderConversationCursor has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KnowledgeCollectionService.validateSearchEvidence (cyclomatic 22) · ×1
  • KnowledgeCollectionService.validateSearchEvidence (cyclomatic 22) server/src/services/knowledge-collection-service.ts:1287 — KnowledgeCollectionService.validateSearchEvidence 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 · MaintenanceTab.MaintenanceTab (cyclomatic 22) · ×1
  • MaintenanceTab.MaintenanceTab (cyclomatic 22) web/src/components/settings/tabs/MaintenanceTab.tsx:201 — MaintenanceTab.MaintenanceTab 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 9 function literals inside it that branch (lines 556, 220, 242, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · DriftMonitor.DriftMonitor (cyclomatic 22) · ×1
  • DriftMonitor.DriftMonitor (cyclomatic 22) web/src/components/drift/DriftMonitor.tsx:304 — DriftMonitor.DriftMonitor has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 340, a function literal at line 322, a function literal at line 331, …). 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 · DecisionReviewSessionsSection.DecisionReviewSessionDetail (cyclomatic 22) · ×1
  • DecisionReviewSessionsSection.DecisionReviewSessionDetail (cyclomatic 22) web/src/components/task/DecisionReviewSessionsSection.tsx:344 — DecisionReviewSessionsSection.DecisionReviewSessionDetail has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 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 · WorkflowAuthoringPanel.WorkflowDefinitionEditor (cyclomatic 22) · ×1
  • WorkflowAuthoringPanel.WorkflowDefinitionEditor (cyclomatic 22) web/src/components/workflows/WorkflowAuthoringPanel.tsx:762 — WorkflowAuthoringPanel.WorkflowDefinitionEditor has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 13 function items inside it that branch (updateWorkflowBudgetLimit, updateAgentBudgetLimit, a function literal at line 1021, …). 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 · WorkflowDetailView.WorkflowDetailView (cyclomatic 22) · ×1
  • WorkflowDetailView.WorkflowDetailView (cyclomatic 22) web/src/components/workflows/WorkflowDetailView.tsx:60 — WorkflowDetailView.WorkflowDetailView has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 5 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 · github.registerGitHubCommands (cyclomatic 21) · ×1
  • github.registerGitHubCommands (cyclomatic 21) cli/src/commands/github.ts:28 — github.registerGitHubCommands 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 4 function literals inside it that branch (lines 97, 63, 144, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · sqlite.registerSqliteCommands (cyclomatic 21) · ×1
  • sqlite.registerSqliteCommands (cyclomatic 21) cli/src/commands/sqlite.ts:34 — sqlite.registerSqliteCommands 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 4 function literals inside it that branch (lines 52, 130, 100, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · IdentityService.resolveExternalIdentity (cyclomatic 21) · ×1
  • IdentityService.resolveExternalIdentity (cyclomatic 21) server/src/services/identity-service.ts:103 — IdentityService.resolveExternalIdentity 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 · acp-stdio-adapter.buildGrokBuildAcpArgs (cyclomatic 21) · ×1
  • acp-stdio-adapter.buildGrokBuildAcpArgs (cyclomatic 21) server/src/services/acp-stdio-adapter.ts:130 — acp-stdio-adapter.buildGrokBuildAcpArgs 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 · workspace-execution-trust-repository.recursiveCandidates · ×1
  • workspace-execution-trust-repository.recursiveCandidates::visit (cyclomatic 21) server/src/storage/workspace-execution-trust-repository.ts:405 — workspace-execution-trust-repository.recursiveCandidates::visit 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 · FileWorkspaceCheckpointRepository.inspectCurrentFile (cyclomatic 21) · ×1
  • FileWorkspaceCheckpointRepository.inspectCurrentFile (cyclomatic 21) server/src/storage/workspace-checkpoint-repository.ts:1378 — FileWorkspaceCheckpointRepository.inspectCurrentFile 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 · RunOutputSpillService.prepare (cyclomatic 21) · ×1
  • RunOutputSpillService.prepare (cyclomatic 21) server/src/services/run-output-spill-service.ts:206 — RunOutputSpillService.prepare 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 · TeamRosterService.resolveRoute (cyclomatic 21) · ×1
  • TeamRosterService.resolveRoute (cyclomatic 21) server/src/services/team-roster-service.ts:127 — TeamRosterService.resolveRoute has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DurableGoalSupervisorService.handleRunCompletion (cyclomatic 21) · ×1
  • DurableGoalSupervisorService.handleRunCompletion (cyclomatic 21) server/src/services/durable-goal-supervisor-service.ts:100 — DurableGoalSupervisorService.handleRunCompletion 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 · run-file-execution-policy-service.referenceCandidates (cyclomatic 21) · ×1
  • run-file-execution-policy-service.referenceCandidates (cyclomatic 21) server/src/services/run-file-execution-policy-service.ts:296 — run-file-execution-policy-service.referenceCandidates 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 · WorkflowRunService.startRun (cyclomatic 21) · ×1
  • WorkflowRunService.startRun (cyclomatic 21) REDACTED:1376 — WorkflowRunService.startRun 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WorkflowRunService.getStats (cyclomatic 21) · ×1
  • WorkflowRunService.getStats (cyclomatic 21) REDACTED:2543 — WorkflowRunService.getStats has cyclomatic complexity 21 (threshold 15). Of this number, 16 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 · ClawdbotAgentService.previewAgentLaunch (cyclomatic 21) · ×1
  • ClawdbotAgentService.previewAgentLaunch (cyclomatic 21) server/src/services/clawdbot-agent-service.ts:1110 — ClawdbotAgentService.previewAgentLaunch 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 · ClawdbotAgentService.normalizeConversationLaunch (cyclomatic 21) · ×1
  • ClawdbotAgentService.normalizeConversationLaunch (cyclomatic 21) server/src/services/clawdbot-agent-service.ts:9031 — ClawdbotAgentService.normalizeConversationLaunch 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 · AnalyticsService.getMetrics (cyclomatic 21) · ×1
  • AnalyticsService.getMetrics (cyclomatic 21) server/src/services/analytics-service.ts:127 — AnalyticsService.getMetrics has cyclomatic complexity 21 (threshold 15). Of this number, 13 points are the body's own statements and 8 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 · CommunicationAdapterService.applyBuzzRuntimeHealth (cyclomatic 21) · ×1
  • CommunicationAdapterService.applyBuzzRuntimeHealth (cyclomatic 21) server/src/services/communication-adapter-service.ts:1997 — CommunicationAdapterService.applyBuzzRuntimeHealth 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 · ExternalTrackerService.validateProfileAgainstSchema (cyclomatic 21) · ×1
  • ExternalTrackerService.validateProfileAgainstSchema (cyclomatic 21) server/src/services/external-tracker-service.ts:769 — ExternalTrackerService.validateProfileAgainstSchema 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 · BuzzDefinitionImportService.importTeam (cyclomatic 21) · ×1
  • BuzzDefinitionImportService.importTeam (cyclomatic 21) server/src/services/buzz-definition-import-service.ts:1317 — BuzzDefinitionImportService.importTeam 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 1323, 1327). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · SettingsDialog.SettingsDialog · ×1
  • SettingsDialog.SettingsDialog::renderTab (cyclomatic 21) web/src/components/settings/SettingsDialog.tsx:518 — SettingsDialog.SettingsDialog::renderTab 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 · ApplyTemplateDialog.ApplyTemplateDialog · ×1
  • ApplyTemplateDialog.ApplyTemplateDialog::handleApply (cyclomatic 21) web/src/components/task/ApplyTemplateDialog.tsx:237 — ApplyTemplateDialog.ApplyTemplateDialog::handleApply 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 · DecisionReviewSessionsSection.DecisionReviewSessionsSection (cyclomatic 21) · ×1
  • DecisionReviewSessionsSection.DecisionReviewSessionsSection (cyclomatic 21) web/src/components/task/DecisionReviewSessionsSection.tsx:71 — DecisionReviewSessionsSection.DecisionReviewSessionsSection has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 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 · DeliverablesSection.DeliverableItem (cyclomatic 21) · ×1
  • DeliverablesSection.DeliverableItem (cyclomatic 21) web/src/components/task/DeliverablesSection.tsx:61 — DeliverablesSection.DeliverableItem has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 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 · time.registerTimeCommands (cyclomatic 20) · ×1
  • time.registerTimeCommands (cyclomatic 20) cli/src/commands/time.ts:12 — time.registerTimeCommands 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 4 function literals inside it that branch (lines 111, 76, 20, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · agents.handleAgentTool (cyclomatic 20) · ×1
  • agents.handleAgentTool (cyclomatic 20) mcp/src/tools/agents.ts:197 — agents.handleAgentTool 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-app-server-adapter.responseForServerRequest (cyclomatic 20) · ×1
  • codex-app-server-adapter.responseForServerRequest (cyclomatic 20) server/src/services/codex-app-server-adapter.ts:775 — codex-app-server-adapter.responseForServerRequest 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 · AgentRegistryService.reconcileFromTasks (cyclomatic 20) · ×1
  • AgentRegistryService.reconcileFromTasks (cyclomatic 20) server/src/services/agent-registry-service.ts:342 — AgentRegistryService.reconcileFromTasks 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 · WorkProductArtifactPreviewService.preview (cyclomatic 20) · ×1
  • WorkProductArtifactPreviewService.preview (cyclomatic 20) server/src/services/work-product-artifact-preview-service.ts:87 — WorkProductArtifactPreviewService.preview 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 · provider-runtime-resolution.buildProviderRuntimeProbeRequest (cyclomatic 20) · ×1
  • provider-runtime-resolution.buildProviderRuntimeProbeRequest (cyclomatic 20) server/src/services/provider-runtime-resolution.ts:33 — provider-runtime-resolution.buildProviderRuntimeProbeRequest 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 · RunRecoveryPolicyService.classify (cyclomatic 20) · ×1
  • RunRecoveryPolicyService.classify (cyclomatic 20) server/src/services/run-recovery-policy-service.ts:79 — RunRecoveryPolicyService.classify 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 · WorkspaceExecutionTrustService.evaluateForLaunch (cyclomatic 20) · ×1
  • WorkspaceExecutionTrustService.evaluateForLaunch (cyclomatic 20) server/src/services/workspace-execution-trust-service.ts:71 — WorkspaceExecutionTrustService.evaluateForLaunch 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 · GitHubService.delegateToCodexCloud (cyclomatic 20) · ×1
  • GitHubService.delegateToCodexCloud (cyclomatic 20) server/src/services/github-service.ts:231 — GitHubService.delegateToCodexCloud 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 · run-metrics.computeFailedRuns (cyclomatic 20) · ×1
  • run-metrics.computeFailedRuns (cyclomatic 20) server/src/services/metrics/run-metrics.ts:198 — run-metrics.computeFailedRuns 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 · KnowledgeCollectionService.preparePageBatch (cyclomatic 20) · ×1
  • KnowledgeCollectionService.preparePageBatch (cyclomatic 20) server/src/services/knowledge-collection-service.ts:1362 — KnowledgeCollectionService.preparePageBatch 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 · AgentsTab.RoutingRulesSection (cyclomatic 20) · ×1
  • AgentsTab.RoutingRulesSection (cyclomatic 20) web/src/components/settings/tabs/AgentsTab.tsx:2382 — AgentsTab.RoutingRulesSection has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SecurityTab.SecurityTab (cyclomatic 20) · ×1
  • SecurityTab.SecurityTab (cyclomatic 20) web/src/components/settings/tabs/SecurityTab.tsx:29 — SecurityTab.SecurityTab has cyclomatic complexity 20 (threshold 15). Of this number, 11 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 · DelegationTab.DelegationTab (cyclomatic 20) · ×1
  • DelegationTab.DelegationTab (cyclomatic 20) web/src/components/settings/tabs/DelegationTab.tsx:37 — DelegationTab.DelegationTab has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 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 · ReflectionTab.ReflectionCandidateItem (cyclomatic 20) · ×1
  • ReflectionTab.ReflectionCandidateItem (cyclomatic 20) web/src/components/settings/tabs/ReflectionTab.tsx:183 — ReflectionTab.ReflectionCandidateItem 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, name the conditions: bind each compound test to a 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 · AdmissionQueuePanel.QueueRow (cyclomatic 20) · ×1
  • AdmissionQueuePanel.QueueRow (cyclomatic 20) web/src/components/digest/AdmissionQueuePanel.tsx:740 — AdmissionQueuePanel.QueueRow 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 · TaskWorkView.getTaskOverviewComposition (cyclomatic 20) · ×1
  • TaskWorkView.getTaskOverviewComposition (cyclomatic 20) web/src/components/task/TaskWorkView.tsx:138 — TaskWorkView.getTaskOverviewComposition 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 · WorkflowAuthoringPanel.DryRunResultPanel (cyclomatic 20) · ×1
  • WorkflowAuthoringPanel.DryRunResultPanel (cyclomatic 20) web/src/components/workflows/WorkflowAuthoringPanel.tsx:1402 — WorkflowAuthoringPanel.DryRunResultPanel has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useTasks.useUpdateTask (cyclomatic 20) · ×1
  • useTasks.useUpdateTask (cyclomatic 20) web/src/hooks/useTasks.ts:263 — useTasks.useUpdateTask 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 7 function literals inside it that branch (lines 320, 286, 267, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · backlog.registerBacklogCommands (cyclomatic 19) · ×1
  • backlog.registerBacklogCommands (cyclomatic 19) cli/src/commands/backlog.ts:7 — backlog.registerBacklogCommands 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 6 function literals inside it that branch (lines 19, 129, 52, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · work-products.registerWorkProductCommands (cyclomatic 19) · ×1
  • work-products.registerWorkProductCommands (cyclomatic 19) cli/src/commands/work-products.ts:72 — work-products.registerWorkProductCommands 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 5 function literals inside it that branch (lines 140, 164, 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 · migrate-legacy-runtime.copyMissingTree (cyclomatic 19) · ×1
  • migrate-legacy-runtime.copyMissingTree (cyclomatic 19) server/src/utils/migrate-legacy-runtime.ts:11 — migrate-legacy-runtime.copyMissingTree 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 · auth.authenticateWebSocket (cyclomatic 19) · ×1
  • auth.authenticateWebSocket (cyclomatic 19) REDACTED:895 — auth.authenticateWebSocket 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 · acp-stdio-adapter.buildCopilotAcpArgs (cyclomatic 19) · ×1
  • acp-stdio-adapter.buildCopilotAcpArgs (cyclomatic 19) server/src/services/acp-stdio-adapter.ts:241 — acp-stdio-adapter.buildCopilotAcpArgs 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 · FileChatRepository.listSquadMessages (cyclomatic 19) · ×1
  • FileChatRepository.listSquadMessages (cyclomatic 19) server/src/storage/chat-repository.ts:193 — FileChatRepository.listSquadMessages has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkProductService.list (cyclomatic 19) · ×1
  • WorkProductService.list (cyclomatic 19) server/src/services/work-product-service.ts:105 — WorkProductService.list 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 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 · GovernanceTraceService.list (cyclomatic 19) · ×1
  • GovernanceTraceService.list (cyclomatic 19) server/src/services/governance-trace-service.ts:85 — GovernanceTraceService.list 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 2 function literals inside it that branch (lines 104, 120). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · workspace-checkpoint-schemas.WorkspaceCheckpointSchema (cyclomatic 19) · ×1
  • workspace-checkpoint-schemas.WorkspaceCheckpointSchema (cyclomatic 19) server/src/schemas/workspace-checkpoint-schemas.ts:126 — workspace-checkpoint-schemas.WorkspaceCheckpointSchema 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 · work-product-artifact-preview-service.workbookTable (cyclomatic 19) · ×1
  • work-product-artifact-preview-service.workbookTable (cyclomatic 19) server/src/services/work-product-artifact-preview-service.ts:642 — work-product-artifact-preview-service.workbookTable 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 · run-egress-gateway-service.handleSocksConnection (cyclomatic 19) · ×1
  • run-egress-gateway-service.handleSocksConnection (cyclomatic 19) REDACTED:525 — run-egress-gateway-service.handleSocksConnection 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 · provider-completion-service.evaluateCompletionPolicy (cyclomatic 19) · ×1
  • provider-completion-service.evaluateCompletionPolicy (cyclomatic 19) server/src/services/provider-completion-service.ts:288 — provider-completion-service.evaluateCompletionPolicy 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 · RunApprovalBrokerService.decide (cyclomatic 19) · ×1
  • RunApprovalBrokerService.decide (cyclomatic 19) server/src/services/run-approval-broker-service.ts:244 — RunApprovalBrokerService.decide 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 · provider-event-evidence.extractProviderEventHunkRanges · ×1
  • provider-event-evidence.extractProviderEventHunkRanges::visit (cyclomatic 19) server/src/services/provider-event-evidence.ts:53 — provider-event-evidence.extractProviderEventHunkRanges::visit 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 · WorkflowRunService.admitWorkflowStep (cyclomatic 19) · ×1
  • WorkflowRunService.admitWorkflowStep (cyclomatic 19) REDACTED:569 — WorkflowRunService.admitWorkflowStep 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 · WorkflowRunService.reconcileWorkflowRootQueue (cyclomatic 19) · ×1
  • WorkflowRunService.reconcileWorkflowRootQueue (cyclomatic 19) REDACTED:1114 — WorkflowRunService.reconcileWorkflowRootQueue 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 · DiffService.parseUnifiedDiff (cyclomatic 19) · ×1
  • DiffService.parseUnifiedDiff (cyclomatic 19) server/src/services/diff-service.ts:167 — DiffService.parseUnifiedDiff 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 · ContextProviderHealthService.openClawProvider (cyclomatic 19) · ×1
  • ContextProviderHealthService.openClawProvider (cyclomatic 19) server/src/services/context-provider-health-service.ts:135 — ContextProviderHealthService.openClawProvider 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 · DigestService.formatOperationsDigestMarkdown (cyclomatic 19) · ×1
  • DigestService.formatOperationsDigestMarkdown (cyclomatic 19) server/src/services/digest-service.ts:613 — DigestService.formatOperationsDigestMarkdown 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 · lessons.router.get("/") (cyclomatic 19) · ×1
  • lessons.router.get("/") (cyclomatic 19) REDACTED:35 — lessons.router.get("/") has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · MaintenanceService.buildHealthChecks (cyclomatic 19) · ×1
  • MaintenanceService.buildHealthChecks (cyclomatic 19) server/src/services/maintenance-service.ts:425 — MaintenanceService.buildHealthChecks 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 · KnowledgeCollectionService.createIngestionProposalInternal (cyclomatic 19) · ×1
  • KnowledgeCollectionService.createIngestionProposalInternal (cyclomatic 19) server/src/services/knowledge-collection-service.ts:530 — KnowledgeCollectionService.createIngestionProposalInternal 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 · UserMenu.UserMenu (cyclomatic 19) · ×1
  • UserMenu.UserMenu (cyclomatic 19) web/src/components/layout/UserMenu.tsx:30 — UserMenu.UserMenu 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 3 function items inside it that branch (formatExpiry, a function literal at line 86, handleMenuKeyDown). 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 · AgentsTab.AgentsTab (cyclomatic 19) · ×1
  • AgentsTab.AgentsTab (cyclomatic 19) web/src/components/settings/tabs/AgentsTab.tsx:119 — AgentsTab.AgentsTab has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 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 · MultiAgentPanel.AgentCard (cyclomatic 19) · ×1
  • MultiAgentPanel.AgentCard (cyclomatic 19) web/src/components/board/MultiAgentPanel.tsx:50 — MultiAgentPanel.AgentCard 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 · MultiAgentPanel.MultiAgentPanel (cyclomatic 19) · ×1
  • MultiAgentPanel.MultiAgentPanel (cyclomatic 19) web/src/components/board/MultiAgentPanel.tsx:164 — MultiAgentPanel.MultiAgentPanel 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 4 function literals inside it that branch (lines 236, 190, 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.
D1 · Cyclomatic Complexity · WallTimeToggle.WallTimeToggle (cyclomatic 19) · ×1
  • WallTimeToggle.WallTimeToggle (cyclomatic 19) web/src/components/dashboard/WallTimeToggle.tsx:30 — WallTimeToggle.WallTimeToggle 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 · DocsViewer.DocsViewer (cyclomatic 19) · ×1
  • DocsViewer.DocsViewer (cyclomatic 19) web/src/components/docs/DocsViewer.tsx:43 — DocsViewer.DocsViewer has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 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 · AgentRunTimelinePanel.summarizeTimelineRun (cyclomatic 19) · ×1
  • AgentRunTimelinePanel.summarizeTimelineRun (cyclomatic 19) web/src/components/task/AgentRunTimelinePanel.tsx:461 — AgentRunTimelinePanel.summarizeTimelineRun has cyclomatic complexity 19 (threshold 15). 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, name the conditions: bind each compound test to a 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 · WorkflowDashboard.WorkflowDashboard (cyclomatic 19) · ×1
  • WorkflowDashboard.WorkflowDashboard (cyclomatic 19) web/src/components/workflows/WorkflowDashboard.tsx:54 — WorkflowDashboard.WorkflowDashboard has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 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 · summary.registerSummaryCommands (cyclomatic 18) · ×1
  • summary.registerSummaryCommands (cyclomatic 18) cli/src/commands/summary.ts:5 — summary.registerSummaryCommands 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 5 function literals inside it that branch (lines 66, 112, 10, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · workspaces.registerWorkspaceCommands (cyclomatic 18) · ×1
  • workspaces.registerWorkspaceCommands (cyclomatic 18) cli/src/commands/workspaces.ts:32 — workspaces.registerWorkspaceCommands 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 4 function literals inside it that branch (lines 42, 83, 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 · paths.migrationCompleted (cyclomatic 18) · ×1
  • paths.migrationCompleted (cyclomatic 18) desktop/src/main/paths.ts:85 — paths.migrationCompleted 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 · tasks.handleTaskTool (cyclomatic 18) · ×1
  • tasks.handleTaskTool (cyclomatic 18) mcp/src/tools/tasks.ts:214 — tasks.handleTaskTool 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 · FileWorkProductArtifactRepository.create (cyclomatic 18) · ×1
  • FileWorkProductArtifactRepository.create (cyclomatic 18) server/src/storage/work-product-artifact-repository.ts:187 — FileWorkProductArtifactRepository.create 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: work-product-artifact-repository.sameIdentity (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · FileChatRepository.parseSquadMessages (cyclomatic 18) · ×1
  • FileChatRepository.parseSquadMessages (cyclomatic 18) server/src/storage/chat-repository.ts:364 — FileChatRepository.parseSquadMessages has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorktreeService.adoptLegacyWorktree (cyclomatic 18) · ×1
  • WorktreeService.adoptLegacyWorktree (cyclomatic 18) server/src/services/worktree-service.ts:364 — WorktreeService.adoptLegacyWorktree 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 5 function literals inside it that branch (lines 375, 435, 366, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · WorktreeService.deleteWorktree (cyclomatic 18) · ×1
  • WorktreeService.deleteWorktree (cyclomatic 18) server/src/services/worktree-service.ts:656 — WorktreeService.deleteWorktree 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 661). 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 · DelegationService.canApprove (cyclomatic 18) · ×1
  • DelegationService.canApprove (cyclomatic 18) server/src/services/delegation-service.ts:104 — DelegationService.canApprove 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 · FileWorkspaceCheckpointRepository.applyCheckpointFiles (cyclomatic 18) · ×1
  • FileWorkspaceCheckpointRepository.applyCheckpointFiles (cyclomatic 18) server/src/storage/workspace-checkpoint-repository.ts:1149 — FileWorkspaceCheckpointRepository.applyCheckpointFiles 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 · run-file-provenance-service.projectEvents (cyclomatic 18) · ×1
  • run-file-provenance-service.projectEvents (cyclomatic 18) server/src/services/run-file-provenance-service.ts:343 — run-file-provenance-service.projectEvents 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 · DecisionService.list (cyclomatic 18) · ×1
  • DecisionService.list (cyclomatic 18) server/src/services/decision-service.ts:119 — DecisionService.list 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 one function literal inside it that branches (line 133). 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 · RunLaunchManifestService.compile (cyclomatic 18) · ×1
  • RunLaunchManifestService.compile (cyclomatic 18) server/src/services/run-launch-manifest-service.ts:109 — RunLaunchManifestService.compile has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into 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-event-evidence.extractProviderEventToolName · ×1
  • provider-event-evidence.extractProviderEventToolName::visit (cyclomatic 18) server/src/services/provider-event-evidence.ts:99 — provider-event-evidence.extractProviderEventToolName::visit 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 · WorkflowRunService.dispatchQueuedWorkflowRoot (cyclomatic 18) · ×1
  • WorkflowRunService.dispatchQueuedWorkflowRoot (cyclomatic 18) REDACTED:855 — WorkflowRunService.dispatchQueuedWorkflowRoot 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 · WorkflowRunService.reconcileWorkflowStepQueue (cyclomatic 18) · ×1
  • WorkflowRunService.reconcileWorkflowStepQueue (cyclomatic 18) REDACTED:1231 — WorkflowRunService.reconcileWorkflowStepQueue 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 · WorkflowRunService.reconcilePendingRecoveries (cyclomatic 18) · ×1
  • WorkflowRunService.reconcilePendingRecoveries (cyclomatic 18) REDACTED:2075 — WorkflowRunService.reconcilePendingRecoveries 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 · ClawdbotAgentService.finalizePendingAgent (cyclomatic 18) · ×1
  • ClawdbotAgentService.finalizePendingAgent (cyclomatic 18) server/src/services/clawdbot-agent-service.ts:3010 — ClawdbotAgentService.finalizePendingAgent has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClawdbotAgentService.evaluatePendingBudget (cyclomatic 18) · ×1
  • ClawdbotAgentService.evaluatePendingBudget (cyclomatic 18) server/src/services/clawdbot-agent-service.ts:4340 — ClawdbotAgentService.evaluatePendingBudget has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 4359). 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 · ClawdbotAgentService.recordCodexEvent (cyclomatic 18) · ×1
  • ClawdbotAgentService.recordCodexEvent (cyclomatic 18) server/src/services/clawdbot-agent-service.ts:7968 — ClawdbotAgentService.recordCodexEvent 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-intake-monitor-service.scoreCandidate (cyclomatic 18) · ×1
  • queue-intake-monitor-service.scoreCandidate (cyclomatic 18) server/src/services/queue-intake-monitor-service.ts:1168 — queue-intake-monitor-service.scoreCandidate 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 · AttachmentsSection.AttachmentsSection (cyclomatic 18) · ×1
  • AttachmentsSection.AttachmentsSection (cyclomatic 18) web/src/components/task/AttachmentsSection.tsx:218 — AttachmentsSection.AttachmentsSection has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · CommentsSection.CommentItem (cyclomatic 18) · ×1
  • CommentsSection.CommentItem (cyclomatic 18) web/src/components/task/CommentsSection.tsx:52 — CommentsSection.CommentItem 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 5 function items inside it that branch (a function literal at line 148, a function literal at line 163, handleDelete, …). 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 · TimeBreakdownPage.TimeBreakdownPage (cyclomatic 18) · ×1
  • TimeBreakdownPage.TimeBreakdownPage (cyclomatic 18) web/src/components/time/TimeBreakdownPage.tsx:71 — TimeBreakdownPage.TimeBreakdownPage has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 95, openSource, a function literal at line 89, …). 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 · WorkflowStartDialog.WorkflowStartDialog (cyclomatic 18) · ×1
  • WorkflowStartDialog.WorkflowStartDialog (cyclomatic 18) web/src/components/workflows/WorkflowStartDialog.tsx:19 — WorkflowStartDialog.WorkflowStartDialog 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 4 function items inside it that branch (startRun, a function literal at line 27, a function literal at line 34, …). 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 · useAgent.useAgentStream.handleMessage (cyclomatic 18) · ×1
  • useAgent.useAgentStream.handleMessage (cyclomatic 18) web/src/hooks/useAgent.ts:370 — useAgent.useAgentStream.handleMessage 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 · agent-status.registerAgentStatusCommands (cyclomatic 17) · ×1
  • agent-status.registerAgentStatusCommands (cyclomatic 17) cli/src/commands/agent-status.ts:14 — agent-status.registerAgentStatusCommands 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 literals inside it that branch (lines 22, 122, 66, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · auth.authenticate (cyclomatic 17) · ×1
  • auth.authenticate (cyclomatic 17) REDACTED:587 — auth.authenticate 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 · claude-code-adapter.classifyClaudeCodeStreamRecord (cyclomatic 17) · ×1
  • claude-code-adapter.classifyClaudeCodeStreamRecord (cyclomatic 17) server/src/services/claude-code-adapter.ts:359 — claude-code-adapter.classifyClaudeCodeStreamRecord 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 · ChatService.sendSquadMessage (cyclomatic 17) · ×1
  • ChatService.sendSquadMessage (cyclomatic 17) server/src/services/chat-service.ts:332 — ChatService.sendSquadMessage 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 · url-validation.validateWebhookUrl (cyclomatic 17) · ×1
  • url-validation.validateWebhookUrl (cyclomatic 17) server/src/utils/url-validation.ts:260 — url-validation.validateWebhookUrl 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 · transition-hooks-service.executeAction (cyclomatic 17) · ×1
  • transition-hooks-service.executeAction (cyclomatic 17) server/src/services/transition-hooks-service.ts:285 — transition-hooks-service.executeAction 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 · filesystem-sandbox-runtime.assertNoExternalHardLinksRuntime · ×1
  • filesystem-sandbox-runtime.assertNoExternalHardLinksRuntime::scan (cyclomatic 17) server/src/utils/filesystem-sandbox-runtime.ts:316 — filesystem-sandbox-runtime.assertNoExternalHardLinksRuntime::scan 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 · TextExtractionService.extractText (cyclomatic 17) · ×1
  • TextExtractionService.extractText (cyclomatic 17) server/src/services/text-extraction-service.ts:18 — TextExtractionService.extractText 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 · AgentHealthService.checkAuth (cyclomatic 17) · ×1
  • AgentHealthService.checkAuth (cyclomatic 17) server/src/services/agent-health-service.ts:120 — AgentHealthService.checkAuth 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 · ReflectionService.retrieveForTask (cyclomatic 17) · ×1
  • ReflectionService.retrieveForTask (cyclomatic 17) server/src/services/reflection-service.ts:180 — ReflectionService.retrieveForTask has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 213, 205, 195). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · HttpOpenClawWorkflowAdapter.invokeTool (cyclomatic 17) · ×1
  • HttpOpenClawWorkflowAdapter.invokeTool (cyclomatic 17) REDACTED:261 — HttpOpenClawWorkflowAdapter.invokeTool 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. This shape REPEATS in the file: one other method here (HttpOpenClawTaskAdapter.invokeTool) 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 · HttpOpenClawTaskAdapter.invokeTool (cyclomatic 17) · ×1
  • HttpOpenClawTaskAdapter.invokeTool (cyclomatic 17) REDACTED:541 — HttpOpenClawTaskAdapter.invokeTool 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. This shape REPEATS in the file: one other method here (HttpOpenClawWorkflowAdapter.invokeTool) 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 · CredentialBrokerService.withCredential (cyclomatic 17) · ×1
  • CredentialBrokerService.withCredential (cyclomatic 17) server/src/services/credential-broker-service.ts:555 — CredentialBrokerService.withCredential has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HttpRpcSession.post (cyclomatic 17) · ×1
  • HttpRpcSession.post (cyclomatic 17) server/src/services/tool-control-plane-service.ts:1486 — HttpRpcSession.post 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 · tool-control-plane-service.assertSafeSchema (cyclomatic 17) · ×1
  • tool-control-plane-service.assertSafeSchema (cyclomatic 17) server/src/services/tool-control-plane-service.ts:1646 — tool-control-plane-service.assertSafeSchema 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 · tool-control-plane-service.terminateStdioProcessGroup (cyclomatic 17) · ×1
  • tool-control-plane-service.terminateStdioProcessGroup (cyclomatic 17) server/src/services/tool-control-plane-service.ts:1752 — tool-control-plane-service.terminateStdioProcessGroup 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 · RunLaunchCompiler.buildRunLaunchEnvironment (cyclomatic 17) · ×1
  • RunLaunchCompiler.buildRunLaunchEnvironment (cyclomatic 17) server/src/services/run-launch-compiler.ts:1058 — RunLaunchCompiler.buildRunLaunchEnvironment has cyclomatic complexity 17 (threshold 15). Of this number, 14 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 · AdmissionControlService.claimNextQueued (cyclomatic 17) · ×1
  • AdmissionControlService.claimNextQueued (cyclomatic 17) server/src/services/admission-control-service.ts:1000 — AdmissionControlService.claimNextQueued 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 · AdmissionControlService.cancelExecutionTree (cyclomatic 17) · ×1
  • AdmissionControlService.cancelExecutionTree (cyclomatic 17) server/src/services/admission-control-service.ts:1578 — AdmissionControlService.cancelExecutionTree 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 · RunRecoveryPolicyService.decide (cyclomatic 17) · ×1
  • RunRecoveryPolicyService.decide (cyclomatic 17) server/src/services/run-recovery-policy-service.ts:140 — RunRecoveryPolicyService.decide 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 · ClawdbotAgentService.drainAdmissionQueue (cyclomatic 17) · ×1
  • ClawdbotAgentService.drainAdmissionQueue (cyclomatic 17) server/src/services/clawdbot-agent-service.ts:817 — ClawdbotAgentService.drainAdmissionQueue 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 · ClawdbotAgentService.completeAgent (cyclomatic 17) · ×1
  • ClawdbotAgentService.completeAgent (cyclomatic 17) server/src/services/clawdbot-agent-service.ts:2675 — ClawdbotAgentService.completeAgent 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 · SummaryService.generateStandupMarkdown (cyclomatic 17) · ×1
  • SummaryService.generateStandupMarkdown (cyclomatic 17) server/src/services/summary-service.ts:395 — SummaryService.generateStandupMarkdown 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 · telemetry-reader.visitTelemetryEvents (cyclomatic 17) · ×1
  • telemetry-reader.visitTelemetryEvents (cyclomatic 17) server/src/services/metrics/telemetry-reader.ts:110 — telemetry-reader.visitTelemetryEvents 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 · time-breakdown-service.eventToBlocks (cyclomatic 17) · ×1
  • time-breakdown-service.eventToBlocks (cyclomatic 17) server/src/services/time-breakdown-service.ts:80 — time-breakdown-service.eventToBlocks 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 · CommunicationAdapterService.configureBuzzChannelMapping (cyclomatic 17) · ×1
  • CommunicationAdapterService.configureBuzzChannelMapping (cyclomatic 17) server/src/services/communication-adapter-service.ts:544 — CommunicationAdapterService.configureBuzzChannelMapping has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · AutomationActivationService.apply (cyclomatic 17) · ×1
  • AutomationActivationService.apply (cyclomatic 17) server/src/services/automation-activation-service.ts:254 — AutomationActivationService.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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · KnowledgeCollectionService.transitionClaim (cyclomatic 17) · ×1
  • KnowledgeCollectionService.transitionClaim (cyclomatic 17) server/src/services/knowledge-collection-service.ts:395 — KnowledgeCollectionService.transitionClaim has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · KnowledgeCollectionService.searchCollection (cyclomatic 17) · ×1
  • KnowledgeCollectionService.searchCollection (cyclomatic 17) server/src/services/knowledge-collection-service.ts:1016 — KnowledgeCollectionService.searchCollection 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useTaskSync.useTaskSync (cyclomatic 17) · ×1
  • useTaskSync.useTaskSync (cyclomatic 17) web/src/hooks/useTaskSync.ts:18 — useTaskSync.useTaskSync 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 2 function literals inside it that branch (lines 39, 31). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · SettingsSearch.SettingsSearch (cyclomatic 17) · ×1
  • SettingsSearch.SettingsSearch (cyclomatic 17) web/src/components/settings/SettingsSearch.tsx:6 — SettingsSearch.SettingsSearch has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 46, 72). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · SortableListItem.SortableListItem (cyclomatic 17) · ×1
  • SortableListItem.SortableListItem (cyclomatic 17) web/src/components/settings/SortableListItem.tsx:29 — SortableListItem.SortableListItem 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TemplateComponents.AddTemplateForm (cyclomatic 17) · ×1
  • TemplateComponents.AddTemplateForm (cyclomatic 17) web/src/components/settings/tabs/TemplateComponents.tsx:31 — TemplateComponents.AddTemplateForm has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (handleSubmit, a function literal at line 114). 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 · SkillRiskDashboardPanel.SkillRiskDashboardPanel (cyclomatic 17) · ×1
  • SkillRiskDashboardPanel.SkillRiskDashboardPanel (cyclomatic 17) web/src/components/settings/tabs/SkillRiskDashboardPanel.tsx:93 — SkillRiskDashboardPanel.SkillRiskDashboardPanel has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 240, a function literal at line 106, a function literal at line 130, …). 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 · NativeSettingsWindow.NativeSettingsWindow (cyclomatic 17) · ×1
  • NativeSettingsWindow.NativeSettingsWindow (cyclomatic 17) web/src/components/settings/NativeSettingsWindow.tsx:10 — NativeSettingsWindow.NativeSettingsWindow has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 20, 18, 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 · BacklogPage.BacklogTaskCard (cyclomatic 17) · ×1
  • BacklogPage.BacklogTaskCard (cyclomatic 17) web/src/components/backlog/BacklogPage.tsx:276 — BacklogPage.BacklogTaskCard has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 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 · ScoreExplorer.ScoreExplorer (cyclomatic 17) · ×1
  • ScoreExplorer.ScoreExplorer (cyclomatic 17) web/src/components/scoring/ScoreExplorer.tsx:30 — ScoreExplorer.ScoreExplorer has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 53, 97, 210, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AttachmentsSection.AttachmentItem (cyclomatic 17) · ×1
  • AttachmentsSection.AttachmentItem (cyclomatic 17) web/src/components/task/AttachmentsSection.tsx:54 — AttachmentsSection.AttachmentItem has cyclomatic complexity 17 (threshold 15). Of this number, 9 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 · MultiAgentSelector.MultiAgentSelector (cyclomatic 17) · ×1
  • MultiAgentSelector.MultiAgentSelector (cyclomatic 17) web/src/components/task/MultiAgentSelector.tsx:38 — MultiAgentSelector.MultiAgentSelector has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 93, removeAgent, addCustom, …). 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 · TaskMetricsPanel.AttemptRow (cyclomatic 17) · ×1
  • TaskMetricsPanel.AttemptRow (cyclomatic 17) web/src/components/task/TaskMetricsPanel.tsx:123 — TaskMetricsPanel.AttemptRow has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a 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 · useBoardDragDrop.useBoardDragDrop.handleDragEnd (cyclomatic 17) · ×1
  • useBoardDragDrop.useBoardDragDrop.handleDragEnd (cyclomatic 17) web/src/hooks/useBoardDragDrop.ts:387 — useBoardDragDrop.useBoardDragDrop.handleDragEnd 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 · automation.registerAutomationCommands (cyclomatic 16) · ×1
  • automation.registerAutomationCommands (cyclomatic 16) cli/src/commands/automation.ts:8 — automation.registerAutomationCommands 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 4 function literals inside it that branch (lines 107, 64, 15, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · TelemetryService.getEvents (cyclomatic 16) · ×1
  • TelemetryService.getEvents (cyclomatic 16) server/src/services/telemetry-service.ts:222 — TelemetryService.getEvents 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 one function literal inside it that branches (line 241). 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-code-adapter.normalizeExtraArgs (cyclomatic 16) · ×1
  • claude-code-adapter.normalizeExtraArgs (cyclomatic 16) server/src/services/claude-code-adapter.ts:278 — claude-code-adapter.normalizeExtraArgs 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 · WorktreeService.createWorktree (cyclomatic 16) · ×1
  • WorktreeService.createWorktree (cyclomatic 16) server/src/services/worktree-service.ts:229 — WorktreeService.createWorktree has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 234). 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 · LifecycleHooksService.fireEvent (cyclomatic 16) · ×1
  • LifecycleHooksService.fireEvent (cyclomatic 16) server/src/services/lifecycle-hooks-service.ts:275 — LifecycleHooksService.fireEvent 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 literals inside it that branch (lines 280, 279). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · broadcast-repository.parseBroadcastFile (cyclomatic 16) · ×1
  • broadcast-repository.parseBroadcastFile (cyclomatic 16) server/src/storage/broadcast-repository.ts:102 — broadcast-repository.parseBroadcastFile 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 · FileWorkspaceCheckpointRepository.inspectCurrent (cyclomatic 16) · ×1
  • FileWorkspaceCheckpointRepository.inspectCurrent (cyclomatic 16) server/src/storage/workspace-checkpoint-repository.ts:512 — FileWorkspaceCheckpointRepository.inspectCurrent 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 · AgentRoutingService.getFallback (cyclomatic 16) · ×1
  • AgentRoutingService.getFallback (cyclomatic 16) server/src/services/agent-routing-service.ts:437 — AgentRoutingService.getFallback 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 · SandboxPolicyService.dryRun (cyclomatic 16) · ×1
  • SandboxPolicyService.dryRun (cyclomatic 16) server/src/services/sandbox-policy-service.ts:272 — SandboxPolicyService.dryRun 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DurableGoalService.recordRunOutcome (cyclomatic 16) · ×1
  • DurableGoalService.recordRunOutcome (cyclomatic 16) server/src/services/durable-goal-service.ts:293 — DurableGoalService.recordRunOutcome 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 · PolicyService.runWebhookCheck (cyclomatic 16) · ×1
  • PolicyService.runWebhookCheck (cyclomatic 16) server/src/services/policy-service.ts:590 — PolicyService.runWebhookCheck 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 · GitCompletionEvidenceSource.captureCompletionEvidence (cyclomatic 16) · ×1
  • GitCompletionEvidenceSource.captureCompletionEvidence (cyclomatic 16) server/src/services/task-envelope-service.ts:138 — GitCompletionEvidenceSource.captureCompletionEvidence 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 · TaskEnvelopeService.build (cyclomatic 16) · ×1
  • TaskEnvelopeService.build (cyclomatic 16) server/src/services/task-envelope-service.ts:268 — TaskEnvelopeService.build 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 · ProviderRuntimeManifestService.probe (cyclomatic 16) · ×1
  • ProviderRuntimeManifestService.probe (cyclomatic 16) server/src/services/provider-runtime-manifest-service.ts:106 — ProviderRuntimeManifestService.probe 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 · CredentialBrokerService.issueLease (cyclomatic 16) · ×1
  • CredentialBrokerService.issueLease (cyclomatic 16) server/src/services/credential-broker-service.ts:372 — CredentialBrokerService.issueLease 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · credential-broker-service.assertActionWithinScope (cyclomatic 16) · ×1
  • credential-broker-service.assertActionWithinScope (cyclomatic 16) server/src/services/credential-broker-service.ts:1460 — credential-broker-service.assertActionWithinScope has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · tool-control-plane-service.listAllTools (cyclomatic 16) · ×1
  • tool-control-plane-service.listAllTools (cyclomatic 16) server/src/services/tool-control-plane-service.ts:1586 — tool-control-plane-service.listAllTools 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 · AttemptLifecycleCoordinator.persistCompletion (cyclomatic 16) · ×1
  • AttemptLifecycleCoordinator.persistCompletion (cyclomatic 16) server/src/services/attempt-lifecycle-coordinator.ts:230 — AttemptLifecycleCoordinator.persistCompletion 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 · RunSupervisorService.recover (cyclomatic 16) · ×1
  • RunSupervisorService.recover (cyclomatic 16) server/src/services/run-supervisor-service.ts:321 — RunSupervisorService.recover 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 · WorkspaceCheckpointAttributionService.loadEventWindow (cyclomatic 16) · ×1
  • WorkspaceCheckpointAttributionService.loadEventWindow (cyclomatic 16) server/src/services/workspace-checkpoint-attribution-service.ts:84 — WorkspaceCheckpointAttributionService.loadEventWindow 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 · WorkspaceCheckpointRewindService.execute (cyclomatic 16) · ×1
  • WorkspaceCheckpointRewindService.execute (cyclomatic 16) server/src/services/workspace-checkpoint-rewind-service.ts:102 — WorkspaceCheckpointRewindService.execute 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 · WorkflowStepExecutor.recordWorkflowGateTrace (cyclomatic 16) · ×1
  • WorkflowStepExecutor.recordWorkflowGateTrace (cyclomatic 16) REDACTED:1919 — WorkflowStepExecutor.recordWorkflowGateTrace 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 · ContextProviderHealthService.openClawPrivacyPosture (cyclomatic 16) · ×1
  • ContextProviderHealthService.openClawPrivacyPosture (cyclomatic 16) server/src/services/context-provider-health-service.ts:351 — ContextProviderHealthService.openClawPrivacyPosture 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 · buzz-compatibility-service.stripTerminalControlSequences (cyclomatic 16) · ×1
  • buzz-compatibility-service.stripTerminalControlSequences (cyclomatic 16) server/src/services/buzz-compatibility-service.ts:261 — buzz-compatibility-service.stripTerminalControlSequences 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 · communication-adapter-service.sanitizeUrl (cyclomatic 16) · ×1
  • communication-adapter-service.sanitizeUrl (cyclomatic 16) server/src/services/communication-adapter-service.ts:253 — communication-adapter-service.sanitizeUrl 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 · knowledge-collection-service.resolvePageCandidates (cyclomatic 16) · ×1
  • knowledge-collection-service.resolvePageCandidates (cyclomatic 16) server/src/services/knowledge-collection-service.ts:2013 — knowledge-collection-service.resolvePageCandidates 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 · health.buildDeepHealthPayload (cyclomatic 16) · ×1
  • health.buildDeepHealthPayload (cyclomatic 16) REDACTED:253 — health.buildDeepHealthPayload 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 · progress-watchdog-service.suppressedByExpectedRepetition (cyclomatic 16) · ×1
  • progress-watchdog-service.suppressedByExpectedRepetition (cyclomatic 16) server/src/services/progress-watchdog-service.ts:196 — progress-watchdog-service.suppressedByExpectedRepetition 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 · ExportDialog.ExportDialog · ×1
  • ExportDialog.ExportDialog::handleExport (cyclomatic 16) web/src/components/dashboard/ExportDialog.tsx:66 — ExportDialog.ExportDialog::handleExport 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 · helpers.handleResponse (cyclomatic 16) · ×1
  • helpers.handleResponse (cyclomatic 16) web/src/lib/api/helpers.ts:38 — helpers.handleResponse 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 · AgentRunTimelinePanel.getTimelineEventType (cyclomatic 16) · ×1
  • AgentRunTimelinePanel.getTimelineEventType (cyclomatic 16) web/src/components/task/AgentRunTimelinePanel.tsx:333 — AgentRunTimelinePanel.getTimelineEventType 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.
D12 · Dependency Hygiene · Deprecated · ×1
  • Deprecated: @types/react-grid-layout web/package.json:25 — @types/react-grid-layout 2.1.0, declared in web/package.json, is marked deprecated by its publisher: "This is a stub types definition. react-grid-layout provides its own type definitions, so you do not need this installed.". Replace it with the package or version that message names, or record why this one must stay.
D12 · Dependency Hygiene · Floating npm dependency · ×1
  • Floating npm dependency: remote-helper — `remote-helper` is declared as `git+ssh://example.invalid/remote-helper.git` in server/src/__fixtures__/skill-security/malicious/unpinned-dependency/package.json, which names no releasable version: a git source with no ref tracks whatever the default branch holds today. A production dependency that cannot be resolved to one immutable release makes the build non-reproducible — two installs a day apart can ship different code — and leaves nothing for a vulnerability scanner to match against.
D2 · Cognitive Complexity · ClawdbotAgentService.startReservedAgent (cognitive 165) · ×1
  • ClawdbotAgentService.startReservedAgent (cognitive 165) server/src/services/clawdbot-agent-service.ts:1384 — ClawdbotAgentService.startReservedAgent has cognitive complexity 165 (threshold 15). Drivers by points: ternaries 50 (76 pts), if/else 37 (47 pts), boolean chains 28, error handling 8 (12 pts), loops 1 (2 pts) (nesting depth added 41). Of this number, 161 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 · NeedsAttentionQueue.buildNeedsAttentionItems (cognitive 156) · ×1
  • NeedsAttentionQueue.buildNeedsAttentionItems (cognitive 156) web/src/components/dashboard/NeedsAttentionQueue.tsx:283 — NeedsAttentionQueue.buildNeedsAttentionItems has cognitive complexity 156 (threshold 15). Drivers by points: ternaries 38 (88 pts), if/else 21 (42 pts), boolean chains 15, loops 11 (nesting depth added 71). Of this number, 155 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 · TaskService.updateTaskMutation (cognitive 153) · ×1
  • TaskService.updateTaskMutation (cognitive 153) server/src/services/task-service.ts:866 — TaskService.updateTaskMutation has cognitive complexity 153 (threshold 15). Drivers by points: if/else 47 (88 pts), ternaries 8 (34 pts), boolean chains 26, error handling 2 (5 pts) (nesting depth added 70). Most of this is not in the body itself: 6 of the 153 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 908, runMutation, a function literal at line 1093, …). 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 · agents.registerAgentCommands (cognitive 144) · ×1
  • agents.registerAgentCommands (cognitive 144) cli/src/commands/agents.ts:205 — agents.registerAgentCommands has cognitive complexity 144 (threshold 15). Drivers by points: if/else 67 (70 pts), ternaries 21 (30 pts), error handling 22, boolean chains 12, loops 8 (10 pts) (nesting depth added 14). None of this is in the body itself: all 144 points belong to 23 function literals inside it that branch (lines 904, 227, 814, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · TaskCard.areTaskCardPropsEqual (cognitive 140) · ×1
  • TaskCard.areTaskCardPropsEqual (cognitive 140) web/src/components/task/TaskCard.tsx:84 — TaskCard.areTaskCardPropsEqual has cognitive complexity 140 (threshold 15). Drivers by points: if/else 56 (109 pts), boolean chains 20, loops 5 (11 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RunLaunchCompiler.compile (cognitive 129) · ×1
  • RunLaunchCompiler.compile (cognitive 129) server/src/services/run-launch-compiler.ts:138 — RunLaunchCompiler.compile has cognitive complexity 129 (threshold 15). Drivers by points: ternaries 81 (110 pts), boolean chains 16, if/else 2 (3 pts) (nesting depth added 30). Of this number, 119 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 · MultiUserTab.MultiUserTab (cognitive 112) · ×1
  • MultiUserTab.MultiUserTab (cognitive 112) web/src/components/settings/tabs/MultiUserTab.tsx:197 — MultiUserTab.MultiUserTab has cognitive complexity 112 (threshold 15). Drivers by points: ternaries 31 (56 pts), boolean chains 23, if/else 17 (23 pts), error handling 10 (nesting depth added 31). Of this number, 31 points are the body's own statements and 81 belong to 30 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 · AgentRunTimelinePanel.buildAgentRunTimelineEvents (cognitive 111) · ×1
  • AgentRunTimelinePanel.buildAgentRunTimelineEvents (cognitive 111) web/src/components/task/AgentRunTimelinePanel.tsx:531 — AgentRunTimelinePanel.buildAgentRunTimelineEvents has cognitive complexity 111 (threshold 15). Drivers by points: ternaries 22 (51 pts), if/else 17 (27 pts), boolean chains 24, loops 8 (9 pts) (nesting depth added 40). Of this number, 109 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 · server.wss.on("connection") (cognitive 106) · ×1
  • server.wss.on("connection") (cognitive 106) REDACTED:757 — server.wss.on("connection") has cognitive complexity 106 (threshold 15). Drivers by points: if/else 45 (83 pts), ternaries 7 (13 pts), boolean chains 9, error handling 1 (nesting depth added 44). Most of this is not in the body itself: 4 of the 106 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 898, a function literal at line 1176, sendRunEvent, …). 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 · ClawdbotAgentService.startCodexAppServer (cognitive 101) · ×1
  • ClawdbotAgentService.startCodexAppServer (cognitive 101) server/src/services/clawdbot-agent-service.ts:5554 — ClawdbotAgentService.startCodexAppServer has cognitive complexity 101 (threshold 15). Drivers by points: boolean chains 46, if/else 32 (36 pts), ternaries 12 (13 pts), error handling 3 (5 pts), loops 1 (nesting depth added 7). Of this number, 35 points are the body's own statements and 66 belong to 26 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 · TaskCard.TaskCard (cognitive 96) · ×1
  • TaskCard.TaskCard (cognitive 96) web/src/components/task/TaskCard.tsx:195 — TaskCard.TaskCard has cognitive complexity 96 (threshold 15). Drivers by points: boolean chains 67, ternaries 20 (21 pts), if/else 8 (nesting depth added 1). Of this number, 67 points are the body's own statements and 29 belong to 13 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 · AgentPanel.AgentPanel (cognitive 85) · ×1
  • AgentPanel.AgentPanel (cognitive 85) web/src/components/task/AgentPanel.tsx:77 — AgentPanel.AgentPanel has cognitive complexity 85 (threshold 15). Drivers by points: boolean chains 49, ternaries 15 (19 pts), if/else 14 (15 pts), error handling 2 (nesting depth added 5). Of this number, 53 points are the body's own statements and 32 belong to 16 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 · KanbanBoard.KanbanBoard (cognitive 83) · ×1
  • KanbanBoard.KanbanBoard (cognitive 83) web/src/components/board/KanbanBoard.tsx:111 — KanbanBoard.KanbanBoard has cognitive complexity 83 (threshold 15). Drivers by points: boolean chains 39, if/else 27, ternaries 11 (15 pts), error handling 2 (nesting depth added 4). Of this number, 28 points are the body's own statements and 55 belong to 21 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 · WorkflowRunService.executeRun (cognitive 81) · ×1
  • WorkflowRunService.executeRun (cognitive 81) REDACTED:1553 — WorkflowRunService.executeRun has cognitive complexity 81 (threshold 15). Drivers by points: if/else 26 (64 pts), ternaries 3 (9 pts), error handling 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateTaskDialog.CreateTaskDialog (cognitive 80) · ×1
  • CreateTaskDialog.CreateTaskDialog (cognitive 80) web/src/components/task/CreateTaskDialog.tsx:60 — CreateTaskDialog.CreateTaskDialog has cognitive complexity 80 (threshold 15). Drivers by points: boolean chains 29, if/else 19 (28 pts), ternaries 13 (21 pts), error handling 2 (nesting depth added 17). Of this number, 27 points are the body's own statements and 53 belong to 17 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 · AdmissionControlService.admitInternal (cognitive 77) · ×1
  • AdmissionControlService.admitInternal (cognitive 77) server/src/services/admission-control-service.ts:698 — AdmissionControlService.admitInternal has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 23 (36 pts), if/else 20 (28 pts), boolean chains 13 (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 · ScoringProfiles.ScoringProfiles (cognitive 77) · ×1
  • ScoringProfiles.ScoringProfiles (cognitive 77) web/src/components/scoring/ScoringProfiles.tsx:97 — ScoringProfiles.ScoringProfiles has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 29, ternaries 16 (23 pts), if/else 22, error handling 3 (nesting depth added 7). Of this number, 18 points are the body's own statements and 59 belong to 21 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 · AgentRunTimelinePanel.AgentRunTimelinePanel (cognitive 77) · ×1
  • AgentRunTimelinePanel.AgentRunTimelinePanel (cognitive 77) web/src/components/task/AgentRunTimelinePanel.tsx:1094 — AgentRunTimelinePanel.AgentRunTimelinePanel has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 37, ternaries 16 (23 pts), if/else 15 (16 pts), error handling 1 (nesting depth added 8). Of this number, 46 points are the body's own statements and 31 belong to 13 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 · codex-app-server-adapter.classifyCodexAppServerServerRequest (cognitive 76) · ×1
  • codex-app-server-adapter.classifyCodexAppServerServerRequest (cognitive 76) server/src/services/codex-app-server-adapter.ts:622 — codex-app-server-adapter.classifyCodexAppServerServerRequest has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 34 (68 pts), if/else 6, boolean chains 2 (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 · Header.Header (cognitive 76) · ×1
  • Header.Header (cognitive 76) web/src/components/layout/Header.tsx:141 — Header.Header has cognitive complexity 76 (threshold 15). Drivers by points: if/else 22 (27 pts), ternaries 17 (27 pts), boolean chains 20, error handling 1, match/switch 1 (nesting depth added 15). Of this number, 33 points are the body's own statements and 43 belong to 15 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 · TaskDetailPanel.TaskDetailPanel (cognitive 72) · ×1
  • TaskDetailPanel.TaskDetailPanel (cognitive 72) web/src/components/task/TaskDetailPanel.tsx:81 — TaskDetailPanel.TaskDetailPanel has cognitive complexity 72 (threshold 15). Drivers by points: ternaries 15 (30 pts), if/else 19 (22 pts), boolean chains 20 (nesting depth added 18). Of this number, 45 points are the body's own statements and 27 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 · TaskWorkView.TaskWorkView (cognitive 71) · ×1
  • TaskWorkView.TaskWorkView (cognitive 71) web/src/components/task/TaskWorkView.tsx:425 — TaskWorkView.TaskWorkView has cognitive complexity 71 (threshold 15). Drivers by points: boolean chains 47, ternaries 10 (16 pts), if/else 5 (6 pts), error handling 1, loops 1 (nesting depth added 7). Of this number, 60 points are the body's own statements and 11 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 · WorktreeService.mergeWorktree (cognitive 68) · ×1
  • WorktreeService.mergeWorktree (cognitive 68) server/src/services/worktree-service.ts:797 — WorktreeService.mergeWorktree has cognitive complexity 68 (threshold 15). Drivers by points: if/else 27 (44 pts), error handling 5 (11 pts), boolean chains 10, ternaries 1 (3 pts) (nesting depth added 25). None of this is in the body itself: all 68 points belong to one function literal inside it that branches (line 799). 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 · gateway-chat-client.sendGatewayChat (cognitive 65) · ×1
  • gateway-chat-client.sendGatewayChat (cognitive 65) REDACTED:44 — gateway-chat-client.sendGatewayChat has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 12, loops 2 (9 pts), error handling 2 (nesting depth added 30). None of this is in the body itself: all 65 points belong to 6 function literals inside it that branch (lines 100, 61, 71, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · WorkflowAuthoringService.lintDefinition (cognitive 65) · ×1
  • WorkflowAuthoringService.lintDefinition (cognitive 65) server/src/services/workflow-authoring-service.ts:1096 — WorkflowAuthoringService.lintDefinition has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 22, loops 6 (10 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 · ClawdbotAgentService.startClaudeCode (cognitive 64) · ×1
  • ClawdbotAgentService.startClaudeCode (cognitive 64) server/src/services/clawdbot-agent-service.ts:6479 — ClawdbotAgentService.startClaudeCode has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 18 (21 pts), boolean chains 20, if/else 19 (20 pts), error handling 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 28 points are the body's own statements and 36 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.
D2 · Cognitive Complexity · useTaskMetrics.aggregateMetrics (cognitive 64) · ×1
  • useTaskMetrics.aggregateMetrics (cognitive 64) web/src/hooks/useTaskMetrics.ts:52 — useTaskMetrics.aggregateMetrics has cognitive complexity 64 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 21, loops 5 (11 pts), ternaries 2 (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 · AgentHostService.buildHosts (cognitive 63) · ×1
  • AgentHostService.buildHosts (cognitive 63) server/src/services/agent-host-service.ts:95 — AgentHostService.buildHosts has cognitive complexity 63 (threshold 15). Drivers by points: loops 15 (34 pts), if/else 10 (27 pts), boolean chains 2 (nesting depth added 36). Of this number, 61 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · RunSessionSharesSection.RunSessionShareView (cognitive 63) · ×1
  • RunSessionSharesSection.RunSessionShareView (cognitive 63) web/src/components/task/RunSessionSharesSection.tsx:212 — RunSessionSharesSection.RunSessionShareView has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 34, ternaries 16 (22 pts), if/else 4, error handling 3 (nesting depth added 6). Of this number, 39 points are the body's own statements and 24 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 · ArchivePage.ArchivePage (cognitive 63) · ×1
  • ArchivePage.ArchivePage (cognitive 63) web/src/components/archive/ArchivePage.tsx:63 — ArchivePage.ArchivePage has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 30, ternaries 8 (21 pts), if/else 6 (8 pts), error handling 2 (3 pts), loops 1 (nesting depth added 16). Most of this is not in the body itself: 13 of the 63 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 295, a function literal at line 111, handleBulkRestore, …). 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 · DigestService.generateOperationsDigest (cognitive 62) · ×1
  • DigestService.generateOperationsDigest (cognitive 62) server/src/services/digest-service.ts:349 — DigestService.generateOperationsDigest has cognitive complexity 62 (threshold 15). Drivers by points: if/else 21 (44 pts), boolean chains 8, loops 5, ternaries 3 (5 pts) (nesting depth added 25). Of this number, 55 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 · phase-capability-service.compilePhaseCapabilityAuthority (cognitive 60) · ×1
  • phase-capability-service.compilePhaseCapabilityAuthority (cognitive 60) server/src/services/phase-capability-service.ts:134 — phase-capability-service.compilePhaseCapabilityAuthority has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (35 pts), ternaries 9 (18 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 26). Of this number, 58 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 · FileWorkspaceCheckpointRepository.capture (cognitive 59) · ×1
  • FileWorkspaceCheckpointRepository.capture (cognitive 59) server/src/storage/workspace-checkpoint-repository.ts:204 — FileWorkspaceCheckpointRepository.capture has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (40 pts), ternaries 5 (7 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 27). Of this number, 54 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 · ConflictResolver.ConflictResolver (cognitive 59) · ×1
  • ConflictResolver.ConflictResolver (cognitive 59) web/src/components/task/ConflictResolver.tsx:45 — ConflictResolver.ConflictResolver has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 17 (22 pts), boolean chains 21, if/else 14 (15 pts), error handling 1 (nesting depth added 6). Of this number, 27 points are the body's own statements and 32 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 · CommandPalette.CommandPalette (cognitive 57) · ×1
  • CommandPalette.CommandPalette (cognitive 57) web/src/components/layout/CommandPalette.tsx:106 — CommandPalette.CommandPalette has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 14 (25 pts), if/else 14 (16 pts), boolean chains 14, loops 1, match/switch 1 (nesting depth added 13). Most of this is not in the body itself: 15 of the 57 points are its own statements and the rest belongs to 16 function items inside it that branch (a function literal at line 402, a function literal at line 197, handleKeyDown, …). 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 · scheduler.registerSchedulerCommands (cognitive 56) · ×1
  • scheduler.registerSchedulerCommands (cognitive 56) cli/src/commands/scheduler.ts:19 — scheduler.registerSchedulerCommands has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (18 pts), ternaries 10 (18 pts), error handling 12 (14 pts), loops 5 (6 pts) (nesting depth added 12). Most of this is not in the body itself: 9 of the 56 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 173, 43, 206, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · WorkflowRunService.handleStepFailure (cognitive 54) · ×1
  • WorkflowRunService.handleStepFailure (cognitive 54) REDACTED:1849 — WorkflowRunService.handleStepFailure has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 10, ternaries 7, error handling 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchDialog.SearchDialog (cognitive 54) · ×1
  • SearchDialog.SearchDialog (cognitive 54) web/src/components/search/SearchDialog.tsx:156 — SearchDialog.SearchDialog has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 10 (18 pts), boolean chains 10, error handling 1, loops 1 (nesting depth added 13). Most of this is not in the body itself: 12 of the 54 points are its own statements and the rest belongs to 9 function items inside it that branch (executeTarget, a function literal at line 193, runSearch, …). 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 · AgentStatusIndicator.AgentStatusIndicator (cognitive 54) · ×1
  • AgentStatusIndicator.AgentStatusIndicator (cognitive 54) web/src/components/shared/AgentStatusIndicator.tsx:175 — AgentStatusIndicator.AgentStatusIndicator has cognitive complexity 54 (threshold 15). Drivers by points: boolean chains 35, if/else 14, ternaries 5. Of this number, 27 points are the body's own statements and 27 belong to 11 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 · ToolControlPlaneService.prepareRunCatalog (cognitive 53) · ×1
  • ToolControlPlaneService.prepareRunCatalog (cognitive 53) server/src/services/tool-control-plane-service.ts:305 — ToolControlPlaneService.prepareRunCatalog has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (29 pts), ternaries 4 (8 pts), boolean chains 7, loops 3 (5 pts), error handling 2 (4 pts) (nesting depth added 25). Of this number, 42 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SquadChatPanel.SquadChatPanel (cognitive 53) · ×1
  • SquadChatPanel.SquadChatPanel (cognitive 53) web/src/components/chat/SquadChatPanel.tsx:91 — SquadChatPanel.SquadChatPanel has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 16 (20 pts), boolean chains 19, if/else 11 (13 pts), loops 1 (nesting depth added 6). Of this number, 22 points are the body's own statements and 31 belong to 14 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 · WorktreeStatus.WorktreeStatus (cognitive 53) · ×1
  • WorktreeStatus.WorktreeStatus (cognitive 53) web/src/components/task/git/WorktreeStatus.tsx:37 — WorktreeStatus.WorktreeStatus has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 24, ternaries 12 (16 pts), if/else 11, error handling 2 (nesting depth added 4). Of this number, 39 points are the body's own statements and 14 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 · WorkProductsSection.WorkProductsSection (cognitive 53) · ×1
  • WorkProductsSection.WorkProductsSection (cognitive 53) web/src/components/task/WorkProductsSection.tsx:108 — WorkProductsSection.WorkProductsSection has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 15 (25 pts), boolean chains 17, if/else 6, error handling 5 (nesting depth added 10). Most of this is not in the body itself: 11 of the 53 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 329, saveEdit, downloadArtifact, …). 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 · tasks.registerTaskCommands (cognitive 51) · ×1
  • tasks.registerTaskCommands (cognitive 51) cli/src/commands/tasks.ts:9 — tasks.registerTaskCommands has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (31 pts), ternaries 7 (13 pts), error handling 6, boolean chains 1 (nesting depth added 7). None of this is in the body itself: all 51 points belong to 6 function literals inside it that branch (lines 148, 21, 59, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · TaskMetadataSection.TaskMetadataSection (cognitive 49) · ×1
  • TaskMetadataSection.TaskMetadataSection (cognitive 49) web/src/components/task/detail/TaskMetadataSection.tsx:40 — TaskMetadataSection.TaskMetadataSection has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 11 (15 pts), boolean chains 12 (nesting depth added 16). Of this number, 19 points are the body's own statements and 30 belong to 9 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 · RunAccessSummaryService.project (cognitive 47) · ×1
  • RunAccessSummaryService.project (cognitive 47) server/src/services/run-access-summary-service.ts:164 — RunAccessSummaryService.project has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 13 (18 pts), boolean chains 15, if/else 11, loops 3 (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 · setup.registerSetupCommands (cognitive 46) · ×1
  • setup.registerSetupCommands (cognitive 46) cli/src/commands/setup.ts:17 — setup.registerSetupCommands has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (37 pts), error handling 3 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 19). None of this is in the body itself: all 46 points belong to one function literal inside it that branches (line 23). 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 · run-launch-manifest-schemas.RunLaunchManifestSchema (cognitive 46) · ×1
  • run-launch-manifest-schemas.RunLaunchManifestSchema (cognitive 46) server/src/schemas/run-launch-manifest-schemas.ts:429 — run-launch-manifest-schemas.RunLaunchManifestSchema has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 17, 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 · CommunicationAdapterService.reconcileBuzzDeliveries (cognitive 46) · ×1
  • CommunicationAdapterService.reconcileBuzzDeliveries (cognitive 46) server/src/services/communication-adapter-service.ts:1527 — CommunicationAdapterService.reconcileBuzzDeliveries has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (30 pts), ternaries 4 (7 pts), boolean chains 5, error handling 1 (3 pts), loops 1 (nesting depth added 22). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DesktopShellContext.DesktopShellProvider (cognitive 46) · ×1
  • DesktopShellContext.DesktopShellProvider (cognitive 46) web/src/components/layout/DesktopShellContext.tsx:134 — DesktopShellContext.DesktopShellProvider has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28, boolean chains 13, ternaries 5. None of this is in the body itself: all 46 points belong to 18 function literals inside it that branch (lines 227, 155, 327, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · SchedulerTab.SchedulerTab (cognitive 46) · ×1
  • SchedulerTab.SchedulerTab (cognitive 46) web/src/components/settings/tabs/SchedulerTab.tsx:34 — SchedulerTab.SchedulerTab has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 12 (24 pts), boolean chains 14, error handling 4, if/else 4 (nesting depth added 12). Most of this is not in the body itself: 12 of the 46 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 313, requestOrApplyActivation, compileDraft, …). 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 · WorkflowSection.WorkflowSection (cognitive 46) · ×1
  • WorkflowSection.WorkflowSection (cognitive 46) web/src/components/task/WorkflowSection.tsx:135 — WorkflowSection.WorkflowSection has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 9 (20 pts), if/else 14 (15 pts), boolean chains 8, error handling 3 (nesting depth added 12). Most of this is not in the body itself: 9 of the 46 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 201, handleStartWorkflow, a function literal at line 161, …). 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 · WorkflowAuthoringPanel.WorkflowAuthoringPanel (cognitive 46) · ×1
  • WorkflowAuthoringPanel.WorkflowAuthoringPanel (cognitive 46) web/src/components/workflows/WorkflowAuthoringPanel.tsx:180 — WorkflowAuthoringPanel.WorkflowAuthoringPanel has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 13 (19 pts), if/else 13, boolean chains 8, error handling 5, loops 1 (nesting depth added 6). Most of this is not in the body itself: 10 of the 46 points are its own statements and the rest belongs to 16 function items inside it that branch (saveWorkflow, materializeRecipe, runBuilderDryRun, …). 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 · SqliteDatabase.open (cognitive 45) · ×1
  • SqliteDatabase.open (cognitive 45) server/src/storage/sqlite/database.ts:185 — SqliteDatabase.open has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 9 (21 pts), if/else 10 (16 pts), boolean chains 6, error handling 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 · RunRecoveryCoordinator.reconcileRunningAttempts (cognitive 45) · ×1
  • RunRecoveryCoordinator.reconcileRunningAttempts (cognitive 45) server/src/services/run-recovery-coordinator.ts:130 — RunRecoveryCoordinator.reconcileRunningAttempts has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 3 (10 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (nesting depth added 20). Of this number, 44 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 · WorkflowService.validateWorkflow (cognitive 45) · ×1
  • WorkflowService.validateWorkflow (cognitive 45) server/src/services/workflow-service.ts:218 — WorkflowService.validateWorkflow has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (33 pts), boolean chains 10, loops 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 · WorkflowStepExecutor.executeLoopStep (cognitive 45) · ×1
  • WorkflowStepExecutor.executeLoopStep (cognitive 45) REDACTED:1475 — WorkflowStepExecutor.executeLoopStep has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 12, ternaries 1 (3 pts), error handling 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 · dashboard-metrics.computeAllMetrics (cognitive 45) · ×1
  • dashboard-metrics.computeAllMetrics (cognitive 45) server/src/services/metrics/dashboard-metrics.ts:66 — dashboard-metrics.computeAllMetrics has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 9 (12 pts), boolean chains 9, loops 3 (nesting depth added 10). Of this number, 17 points are the body's own statements and 28 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 · AgentsTab.SandboxPoliciesSection (cognitive 45) · ×1
  • AgentsTab.SandboxPoliciesSection (cognitive 45) web/src/components/settings/tabs/AgentsTab.tsx:1579 — AgentsTab.SandboxPoliciesSection has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 24, ternaries 8 (10 pts), if/else 7 (9 pts), error handling 1, loops 1 (nesting depth added 4). Of this number, 20 points are the body's own statements and 25 belong to 8 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 · BulkActionsBar.BulkActionsBar (cognitive 45) · ×1
  • BulkActionsBar.BulkActionsBar (cognitive 45) web/src/components/board/BulkActionsBar.tsx:48 — BulkActionsBar.BulkActionsBar has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 11 (17 pts), if/else 15 (16 pts), boolean chains 8, error handling 3, loops 1 (nesting depth added 7). Most of this is not in the body itself: 8 of the 45 points are its own statements and the rest belongs to 8 function items inside it that branch (handleMoveToStatus, handleArchiveSelected, handleMoveToBacklog, …). 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 · mime-validation.validateMimeType (cognitive 44) · ×1
  • mime-validation.validateMimeType (cognitive 44) server/src/services/mime-validation.ts:173 — mime-validation.validateMimeType has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 5 (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 · skill-capability-service.parseDeclaredCapabilities (cognitive 44) · ×1
  • skill-capability-service.parseDeclaredCapabilities (cognitive 44) server/src/services/skill-capability-service.ts:299 — skill-capability-service.parseDeclaredCapabilities has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (32 pts), loops 5 (12 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DecisionExplorer.DecisionExplorer (cognitive 44) · ×1
  • DecisionExplorer.DecisionExplorer (cognitive 44) web/src/components/decisions/DecisionExplorer.tsx:62 — DecisionExplorer.DecisionExplorer has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22, ternaries 14 (20 pts), boolean chains 2 (nesting depth added 6). Of this number, 23 points are the body's own statements and 21 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, 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 · useBulkTaskMetrics.aggregateTaskMetrics (cognitive 44) · ×1
  • useBulkTaskMetrics.aggregateTaskMetrics (cognitive 44) web/src/hooks/useBulkTaskMetrics.ts:27 — useBulkTaskMetrics.aggregateTaskMetrics has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 9, loops 4 (8 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 · work-product-artifact-preview-service.parseCsv (cognitive 43) · ×1
  • work-product-artifact-preview-service.parseCsv (cognitive 43) server/src/services/work-product-artifact-preview-service.ts:573 — work-product-artifact-preview-service.parseCsv has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 7, ternaries 4, 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 · AgentRoutingService.resolveAgentWithTrace (cognitive 43) · ×1
  • AgentRoutingService.resolveAgentWithTrace (cognitive 43) server/src/services/agent-routing-service.ts:102 — AgentRoutingService.resolveAgentWithTrace has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 6 (13 pts), boolean chains 5, loops 1 (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 · run-launch-manifest-service.diffRunLaunchManifests.changes (cognitive 43) · ×1
  • run-launch-manifest-service.diffRunLaunchManifests.changes (cognitive 43) server/src/services/run-launch-manifest-service.ts:370 — run-launch-manifest-service.diffRunLaunchManifests.changes has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 13 (43 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ToolControlPlaneService.invoke (cognitive 43) · ×1
  • ToolControlPlaneService.invoke (cognitive 43) server/src/services/tool-control-plane-service.ts:475 — ToolControlPlaneService.invoke has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 9 (13 pts), boolean chains 10, error handling 1, loops 1 (nesting depth added 8). Of this number, 37 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdmissionControlService.projectQueueInspection (cognitive 43) · ×1
  • AdmissionControlService.projectQueueInspection (cognitive 43) server/src/services/admission-control-service.ts:1306 — AdmissionControlService.projectQueueInspection has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 22 (36 pts), if/else 3 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatPanel.ChatPanel (cognitive 43) · ×1
  • ChatPanel.ChatPanel (cognitive 43) web/src/components/chat/ChatPanel.tsx:42 — ChatPanel.ChatPanel has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 15, ternaries 11 (15 pts), if/else 11 (12 pts), loops 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 27 belong to 10 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 · doctor.runDoctorChecks (cognitive 42) · ×1
  • doctor.runDoctorChecks (cognitive 42) cli/src/commands/doctor.ts:697 — doctor.runDoctorChecks has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 17 (33 pts), boolean chains 6, if/else 3 (nesting depth added 16). 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 · FileWorkspaceCheckpointRepository.rewindLocked (cognitive 42) · ×1
  • FileWorkspaceCheckpointRepository.rewindLocked (cognitive 42) server/src/storage/workspace-checkpoint-repository.ts:701 — FileWorkspaceCheckpointRepository.rewindLocked has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 6 (14 pts), boolean chains 6, error handling 2 (3 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowAuthoringService.lintPipeline (cognitive 42) · ×1
  • WorkflowAuthoringService.lintPipeline (cognitive 42) server/src/services/workflow-authoring-service.ts:1361 — WorkflowAuthoringService.lintPipeline has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 14, loops 3 (4 pts), ternaries 1 (nesting depth added 10). 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 · AutomationActivationService.claimRun (cognitive 42) · ×1
  • AutomationActivationService.claimRun (cognitive 42) server/src/services/automation-activation-service.ts:480 — AutomationActivationService.claimRun has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 20, if/else 12, ternaries 7 (10 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 42 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 497, 519, 662). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · NeedsAttentionQueue.NeedsAttentionQueue (cognitive 42) · ×1
  • NeedsAttentionQueue.NeedsAttentionQueue (cognitive 42) web/src/components/dashboard/NeedsAttentionQueue.tsx:750 — NeedsAttentionQueue.NeedsAttentionQueue has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 11 (23 pts), boolean chains 12, if/else 7 (nesting depth added 12). Most of this is not in the body itself: 8 of the 42 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 1047, openItem, dismissItem, …). 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 · admission.registerAdmissionCommands (cognitive 41) · ×1
  • admission.registerAdmissionCommands (cognitive 41) cli/src/commands/admission.ts:25 — admission.registerAdmissionCommands has cognitive complexity 41 (threshold 15). Drivers by points: if/else 27, error handling 8, loops 6. None of this is in the body itself: all 41 points belong to 8 function literals inside it that branch (lines 163, 47, 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 · transition-hooks-service.checkGate (cognitive 41) · ×1
  • transition-hooks-service.checkGate (cognitive 41) server/src/services/transition-hooks-service.ts:152 — transition-hooks-service.checkGate has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 15, match/switch 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 · DigestService.formatOperationsDigestMarkdown (cognitive 41) · ×1
  • DigestService.formatOperationsDigestMarkdown (cognitive 41) server/src/services/digest-service.ts:613 — DigestService.formatOperationsDigestMarkdown has cognitive complexity 41 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 8 (13 pts), ternaries 4 (13 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 · SqlitePortabilityService.migrateFilesToSqlite (cognitive 41) · ×1
  • SqlitePortabilityService.migrateFilesToSqlite (cognitive 41) server/src/services/sqlite-portability-service.ts:275 — SqlitePortabilityService.migrateFilesToSqlite has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 10, ternaries 3 (4 pts), loops 1 (2 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 · sprints.registerSprintCommands (cognitive 40) · ×1
  • sprints.registerSprintCommands (cognitive 40) cli/src/commands/sprints.ts:27 — sprints.registerSprintCommands has cognitive complexity 40 (threshold 15). Drivers by points: if/else 26 (30 pts), error handling 6, boolean chains 2, ternaries 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 106, 142, 205, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · token-metrics.computeBudgetMetrics (cognitive 40) · ×1
  • token-metrics.computeBudgetMetrics (cognitive 40) server/src/services/metrics/token-metrics.ts:115 — token-metrics.computeBudgetMetrics has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 11, error handling 2 (5 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.
D2 · Cognitive Complexity · task-readiness.buildDefaultChecks (cognitive 40) · ×1
  • task-readiness.buildDefaultChecks (cognitive 40) shared/src/utils/task-readiness.ts:56 — task-readiness.buildDefaultChecks has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 17 (24 pts), boolean chains 16 (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 · work-product-artifact-preview-service.workbookTable (cognitive 39) · ×1
  • work-product-artifact-preview-service.workbookTable (cognitive 39) server/src/services/work-product-artifact-preview-service.ts:642 — work-product-artifact-preview-service.workbookTable has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 2 (9 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuzzSubscriptionWorker.handleMessage (cognitive 39) · ×1
  • BuzzSubscriptionWorker.handleMessage (cognitive 39) server/src/services/buzz-subscription-worker.ts:217 — BuzzSubscriptionWorker.handleMessage has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 5 (12 pts), boolean chains 6, error handling 1, match/switch 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 · knowledge-integrity-service.lintKnowledgeCollection (cognitive 39) · ×1
  • knowledge-integrity-service.lintKnowledgeCollection (cognitive 39) server/src/services/knowledge-integrity-service.ts:35 — knowledge-integrity-service.lintKnowledgeCollection has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 8 (12 pts), boolean chains 4, ternaries 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 · api-client.createApiClient.api (cognitive 39) · ×1
  • api-client.createApiClient.api (cognitive 39) shared/src/utils/api-client.ts:177 — api-client.createApiClient.api has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 6 (13 pts), boolean chains 6, error handling 3 (4 pts) (nesting depth added 14). 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 literals inside it that branch (lines 188, 186). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · useKeyboard.KeyboardProvider (cognitive 39) · ×1
  • useKeyboard.KeyboardProvider (cognitive 39) web/src/hooks/useKeyboard.tsx:55 — useKeyboard.KeyboardProvider has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 5 (9 pts), boolean chains 8, match/switch 1 (nesting depth added 12). None of this is in the body itself: all 39 points belong to 3 function literals inside it that branch (lines 119, 61, 142). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · FilesystemSandboxService.compile (cognitive 38) · ×1
  • FilesystemSandboxService.compile (cognitive 38) server/src/services/filesystem-sandbox-service.ts:236 — FilesystemSandboxService.compile has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 9 (17 pts), if/else 8 (13 pts), boolean chains 6, 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 · dashboard-metrics.computeAgentComparison (cognitive 38) · ×1
  • dashboard-metrics.computeAgentComparison (cognitive 38) server/src/services/metrics/dashboard-metrics.ts:499 — dashboard-metrics.computeAgentComparison has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 4 (8 pts), boolean chains 6, loops 1 (nesting depth added 14). Of this number, 20 points are the body's own statements and 18 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NotificationsTab.NotificationsTab (cognitive 38) · ×1
  • NotificationsTab.NotificationsTab (cognitive 38) web/src/components/settings/tabs/NotificationsTab.tsx:179 — NotificationsTab.NotificationsTab has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 15 (20 pts), boolean chains 17, if/else 1 (nesting depth added 5). Of this number, 35 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 · BoardSidebar.RecentStatusChanges (cognitive 38) · ×1
  • BoardSidebar.RecentStatusChanges (cognitive 38) web/src/components/board/BoardSidebar.tsx:298 — BoardSidebar.RecentStatusChanges has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 5, ternaries 3 (nesting depth added 15). Most of this is not in the body itself: 4 of the 38 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 352, 338, 333, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · Dashboard.Dashboard (cognitive 38) · ×1
  • Dashboard.Dashboard (cognitive 38) web/src/components/dashboard/Dashboard.tsx:139 — Dashboard.Dashboard has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 27, ternaries 5 (8 pts), if/else 2, match/switch 1 (nesting depth added 3). 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, name the conditions: bind each compound test to a 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 · PolicyManager.PolicyManager (cognitive 38) · ×1
  • PolicyManager.PolicyManager (cognitive 38) web/src/components/policies/PolicyManager.tsx:296 — PolicyManager.PolicyManager has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 15, ternaries 11 (14 pts), if/else 6, error handling 3 (nesting depth added 3). Most of this is not in the body itself: 15 of the 38 points are its own statements and the rest belongs to 14 function items inside it that branch (handleSave, handleToggle, handleDelete, …). 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 · TemplateEditorDialog.TemplateEditorDialog (cognitive 38) · ×1
  • TemplateEditorDialog.TemplateEditorDialog (cognitive 38) web/src/components/templates/TemplateEditorDialog.tsx:57 — TemplateEditorDialog.TemplateEditorDialog has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 23, if/else 8, ternaries 5 (6 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 14 of the 38 points are its own statements and the rest belongs to 5 function items inside it that branch (handleSubmit, requestClose, a function literal at line 135, …). 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 · SqliteJournalMaintenanceService.executeScheduledOperation (cognitive 37) · ×1
  • SqliteJournalMaintenanceService.executeScheduledOperation (cognitive 37) server/src/storage/sqlite/journal-maintenance-service.ts:586 — SqliteJournalMaintenanceService.executeScheduledOperation has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 4, ternaries 1 (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 · CredentialBrokerService.reconcile (cognitive 37) · ×1
  • CredentialBrokerService.reconcile (cognitive 37) server/src/services/credential-broker-service.ts:920 — CredentialBrokerService.reconcile has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 7, ternaries 3 (5 pts), loops 1 (nesting depth added 12). Most of this is not in the body itself: 2 of the 37 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 972, 931, 949). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · run-metrics.computeFailedRuns (cognitive 37) · ×1
  • run-metrics.computeFailedRuns (cognitive 37) server/src/services/metrics/run-metrics.ts:198 — run-metrics.computeFailedRuns has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 8, error handling 2 (5 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 · buzz-compatibility-service.stripTerminalControlSequences (cognitive 37) · ×1
  • buzz-compatibility-service.stripTerminalControlSequences (cognitive 37) server/src/services/buzz-compatibility-service.ts:261 — buzz-compatibility-service.stripTerminalControlSequences has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 3 (9 pts), boolean chains 4 (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 · LoginScreen.LoginScreen (cognitive 37) · ×1
  • LoginScreen.LoginScreen (cognitive 37) web/src/components/auth/LoginScreen.tsx:7 — LoginScreen.LoginScreen has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 13, if/else 10 (nesting depth added 6). Of this number, 24 points are the body's own statements and 13 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 · codex-app-server-adapter.responseForServerRequest (cognitive 36) · ×1
  • codex-app-server-adapter.responseForServerRequest (cognitive 36) server/src/services/codex-app-server-adapter.ts:775 — codex-app-server-adapter.responseForServerRequest has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (28 pts), if/else 6, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentsTab.RoutingRuleForm (cognitive 36) · ×1
  • AgentsTab.RoutingRuleForm (cognitive 36) web/src/components/settings/tabs/AgentsTab.tsx:2754 — AgentsTab.RoutingRuleForm has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 15 (19 pts), boolean chains 15, if/else 2 (nesting depth added 4). Of this number, 24 points are the body's own statements and 12 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.
D2 · Cognitive Complexity · RunModeGateSection.RunModeGateSection (cognitive 36) · ×1
  • RunModeGateSection.RunModeGateSection (cognitive 36) web/src/components/task/RunModeGateSection.tsx:48 — RunModeGateSection.RunModeGateSection has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 18 (26 pts), boolean chains 4, error handling 3, if/else 2 (3 pts) (nesting depth added 9). Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 5 function items inside it that branch (handleQaRequiredToggle, handleQaPassToggle, handleRunModeChange, …). 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 · auth.authenticateWebSocket (cognitive 35) · ×1
  • auth.authenticateWebSocket (cognitive 35) REDACTED:895 — auth.authenticateWebSocket has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (25 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 16). Of this number, 30 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TaskService.addDependency (cognitive 35) · ×1
  • TaskService.addDependency (cognitive 35) server/src/services/task-service.ts:1751 — TaskService.addDependency has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 4, ternaries 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 · WorktreeService.buildCleanupPreview (cognitive 35) · ×1
  • WorktreeService.buildCleanupPreview (cognitive 35) server/src/services/worktree-service.ts:1250 — WorktreeService.buildCleanupPreview has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (16 pts), ternaries 4 (9 pts), boolean chains 8, error handling 2 (nesting depth added 7). Of this number, 34 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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-launch-manifest-service.collectBlockers (cognitive 35) · ×1
  • run-launch-manifest-service.collectBlockers (cognitive 35) server/src/services/run-launch-manifest-service.ts:545 — run-launch-manifest-service.collectBlockers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 10, ternaries 2 (4 pts), loops 2 (nesting depth added 4). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · RunTerminalService.projectReconciliationEvent (cognitive 35) · ×1
  • RunTerminalService.projectReconciliationEvent (cognitive 35) server/src/services/run-terminal-service.ts:642 — RunTerminalService.projectReconciliationEvent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 7, 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 · AdmissionControlService.claimNextQueued (cognitive 35) · ×1
  • AdmissionControlService.claimNextQueued (cognitive 35) server/src/services/admission-control-service.ts:1000 — AdmissionControlService.claimNextQueued has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 3 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 19). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConversationLifecycleService.assertCompatible (cognitive 35) · ×1
  • ConversationLifecycleService.assertCompatible (cognitive 35) server/src/services/conversation-lifecycle-service.ts:95 — ConversationLifecycleService.assertCompatible has cognitive complexity 35 (threshold 15). Drivers by points: if/else 29 (33 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, 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 · ClawdbotAgentService.startCodexCli (cognitive 35) · ×1
  • ClawdbotAgentService.startCodexCli (cognitive 35) server/src/services/clawdbot-agent-service.ts:7168 — ClawdbotAgentService.startCodexCli has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 16, if/else 11 (15 pts), ternaries 3, loops 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 7327, 7262, 7296, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · harness-support-service.evaluateHarnessSupportStatus (cognitive 35) · ×1
  • harness-support-service.evaluateHarnessSupportStatus (cognitive 35) server/src/services/harness-support-service.ts:66 — harness-support-service.evaluateHarnessSupportStatus has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 15, if/else 13, ternaries 6 (7 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · telemetry-reader.visitTelemetryEvents (cognitive 35) · ×1
  • telemetry-reader.visitTelemetryEvents (cognitive 35) server/src/services/metrics/telemetry-reader.ts:110 — telemetry-reader.visitTelemetryEvents has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 2 (5 pts), boolean chains 4, ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilterBar.FilterBar (cognitive 35) · ×1
  • FilterBar.FilterBar (cognitive 35) web/src/components/board/FilterBar.tsx:39 — FilterBar.FilterBar has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 21, ternaries 8, if/else 6. Of this number, 20 points are the body's own statements and 15 belong to 10 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · OperationsDigestPage.OperationsDigestPage (cognitive 35) · ×1
  • OperationsDigestPage.OperationsDigestPage (cognitive 35) web/src/components/digest/OperationsDigestPage.tsx:62 — OperationsDigestPage.OperationsDigestPage has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 16 (17 pts), boolean chains 12, if/else 6 (nesting depth added 1). Of this number, 22 points are the body's own statements and 13 belong to 7 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 · PreviewPanel.PreviewPanel (cognitive 35) · ×1
  • PreviewPanel.PreviewPanel (cognitive 35) web/src/components/task/PreviewPanel.tsx:38 — PreviewPanel.PreviewPanel has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 22, if/else 6, ternaries 5 (6 pts), error handling 1 (nesting depth added 1). Of this number, 22 points are the body's own statements and 13 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 · WorkflowRunView.WorkflowRunView (cognitive 35) · ×1
  • WorkflowRunView.WorkflowRunView (cognitive 35) web/src/components/workflows/WorkflowRunView.tsx:164 — WorkflowRunView.WorkflowRunView has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 9 (10 pts), boolean chains 9, error handling 4 (nesting depth added 5). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 203, handleDistillTemplate, a function literal at line 175, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · harness-support-profile-registry.normalizeHarnessSupportProfile (cognitive 34) · ×1
  • harness-support-profile-registry.normalizeHarnessSupportProfile (cognitive 34) server/src/services/harness-support-profile-registry.ts:301 — harness-support-profile-registry.normalizeHarnessSupportProfile has cognitive complexity 34 (threshold 15). Drivers by points: error handling 5 (10 pts), ternaries 8 (10 pts), boolean chains 9, if/else 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutboundIntegrationService.deliver (cognitive 34) · ×1
  • OutboundIntegrationService.deliver (cognitive 34) server/src/services/outbound-integration-service.ts:260 — OutboundIntegrationService.deliver has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 8 (18 pts), boolean chains 8, if/else 7, error handling 1 (nesting depth added 10). Of this number, 27 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 · openclaw-gateway-rpc.waitForOpenClawRun (cognitive 34) · ×1
  • openclaw-gateway-rpc.waitForOpenClawRun (cognitive 34) server/src/utils/openclaw-gateway-rpc.ts:33 — openclaw-gateway-rpc.waitForOpenClawRun has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 8, ternaries 2 (3 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 34 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 91, a function literal at line 73, lookup). 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 · WorkflowStepExecutor.executeCodexAgentStep (cognitive 34) · ×1
  • WorkflowStepExecutor.executeCodexAgentStep (cognitive 34) REDACTED:971 — WorkflowStepExecutor.executeCodexAgentStep has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (13 pts), ternaries 5 (7 pts), loops 1 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch 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-access-summary-service.projectIntegrations (cognitive 34) · ×1
  • run-access-summary-service.projectIntegrations (cognitive 34) server/src/services/run-access-summary-service.ts:599 — run-access-summary-service.projectIntegrations has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 9, if/else 6 (8 pts), loops 1 (nesting depth added 10). Most of this is not in the body itself: 3 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 625, 633). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · task-metrics.computeVelocityMetrics (cognitive 34) · ×1
  • task-metrics.computeVelocityMetrics (cognitive 34) server/src/services/metrics/task-metrics.ts:103 — task-metrics.computeVelocityMetrics has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 8, ternaries 3 (6 pts), loops 4, error handling 1 (nesting depth added 10). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuzzDefinitionImportService.previewPersona (cognitive 34) · ×1
  • BuzzDefinitionImportService.previewPersona (cognitive 34) server/src/services/buzz-definition-import-service.ts:770 — BuzzDefinitionImportService.previewPersona has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 5, ternaries 3 (nesting depth added 11). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · migrate-legacy-runtime.copyMissingTree (cognitive 33) · ×1
  • migrate-legacy-runtime.copyMissingTree (cognitive 33) server/src/utils/migrate-legacy-runtime.ts:11 — migrate-legacy-runtime.copyMissingTree has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (20 pts), error handling 3 (6 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · acp-stdio-adapter.buildGrokBuildAcpArgs (cognitive 33) · ×1
  • acp-stdio-adapter.buildGrokBuildAcpArgs (cognitive 33) server/src/services/acp-stdio-adapter.ts:130 — acp-stdio-adapter.buildGrokBuildAcpArgs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 4 (8 pts), boolean chains 5, 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 · provider-run-event-mappers.itemKind (cognitive 33) · ×1
  • provider-run-event-mappers.itemKind (cognitive 33) server/src/services/provider-run-event-mappers.ts:119 — provider-run-event-mappers.itemKind has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 12, if/else 11, ternaries 5 (10 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SummaryService.generateStandupMarkdown (cognitive 33) · ×1
  • SummaryService.generateStandupMarkdown (cognitive 33) server/src/services/summary-service.ts:395 — SummaryService.generateStandupMarkdown has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 6 (19 pts), loops 4 (8 pts), if/else 6 (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 · TrackersTab.TrackersTab (cognitive 33) · ×1
  • TrackersTab.TrackersTab (cognitive 33) web/src/components/settings/tabs/TrackersTab.tsx:113 — TrackersTab.TrackersTab has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 17 (20 pts), boolean chains 8, if/else 5 (nesting depth added 3). Most of this is not in the body itself: 13 of the 33 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 364, 215, 137, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · WorkflowsPage.WorkflowsPage (cognitive 33) · ×1
  • WorkflowsPage.WorkflowsPage (cognitive 33) web/src/components/workflows/WorkflowsPage.tsx:96 — WorkflowsPage.WorkflowsPage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 6 (13 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 10). Most of this is not in the body itself: 11 of the 33 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 141, a function literal at line 110, a function literal at line 330, …). 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 · FileWorkspaceCheckpointRepository.applyCheckpointFiles (cognitive 32) · ×1
  • FileWorkspaceCheckpointRepository.applyCheckpointFiles (cognitive 32) server/src/storage/workspace-checkpoint-repository.ts:1149 — FileWorkspaceCheckpointRepository.applyCheckpointFiles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 5, error handling 2 (5 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 · run-event-journal-service.normalizeJson (cognitive 32) · ×1
  • run-event-journal-service.normalizeJson (cognitive 32) server/src/services/run-event-journal-service.ts:64 — run-event-journal-service.normalizeJson has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 4 (9 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 · RunLaunchCompiler.buildRunLaunchRuntime (cognitive 32) · ×1
  • RunLaunchCompiler.buildRunLaunchRuntime (cognitive 32) server/src/services/run-launch-compiler.ts:904 — RunLaunchCompiler.buildRunLaunchRuntime has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (20 pts), boolean chains 6, if/else 6 (nesting depth added 9). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClawdbotAgentService.drainAdmissionQueue (cognitive 32) · ×1
  • ClawdbotAgentService.drainAdmissionQueue (cognitive 32) server/src/services/clawdbot-agent-service.ts:817 — ClawdbotAgentService.drainAdmissionQueue has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 4, ternaries 2 (4 pts), 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 · ClawdbotAgentService.completePendingAgent (cognitive 32) · ×1
  • ClawdbotAgentService.completePendingAgent (cognitive 32) server/src/services/clawdbot-agent-service.ts:3105 — ClawdbotAgentService.completePendingAgent has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 12 (16 pts), if/else 8 (9 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 6). Of this number, 24 points are the body's own statements and 8 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 · ClawdbotAgentService.recordAcpSessionUpdate (cognitive 32) · ×1
  • ClawdbotAgentService.recordAcpSessionUpdate (cognitive 32) server/src/services/clawdbot-agent-service.ts:5296 — ClawdbotAgentService.recordAcpSessionUpdate has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 10 (30 pts), boolean chains 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.
D2 · Cognitive Complexity · ClawdbotAgentService.executeRunTerminal (cognitive 32) · ×1
  • ClawdbotAgentService.executeRunTerminal (cognitive 32) server/src/services/clawdbot-agent-service.ts:8245 — ClawdbotAgentService.executeRunTerminal has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 10, boolean chains 6, loops 1 (nesting depth added 1). Of this number, 25 points are the body's own statements and 7 belong to 5 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 · BuzzDefinitionImportService.importPersona (cognitive 32) · ×1
  • BuzzDefinitionImportService.importPersona (cognitive 32) server/src/services/buzz-definition-import-service.ts:1214 — BuzzDefinitionImportService.importPersona has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 15, if/else 10, ternaries 5 (7 pts) (nesting depth added 2). None of this is in the body itself: all 32 points belong to 3 function literals inside it that branch (lines 1221, 1248, 1296). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · KnowledgeCollectionService.preparePageBatch (cognitive 32) · ×1
  • KnowledgeCollectionService.preparePageBatch (cognitive 32) server/src/services/knowledge-collection-service.ts:1362 — KnowledgeCollectionService.preparePageBatch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 6 (7 pts), ternaries 3 (7 pts), boolean chains 1 (nesting depth added 13). 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 · SetupScreen.SetupScreen (cognitive 32) · ×1
  • SetupScreen.SetupScreen (cognitive 32) web/src/components/auth/SetupScreen.tsx:27 — SetupScreen.SetupScreen has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 12, if/else 10, ternaries 8 (10 pts) (nesting depth added 2). Of this number, 22 points are the body's own statements and 10 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 · ManageTab.ManageTab (cognitive 32) · ×1
  • ManageTab.ManageTab (cognitive 32) web/src/components/settings/tabs/ManageTab.tsx:29 — ManageTab.ManageTab has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 11, ternaries 8 (11 pts), if/else 7 (8 pts), error handling 1, loops 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 32 points are its own statements and the rest belongs to 8 function items inside it that branch (handleFileSelect, handleExportTemplates, 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 · ToolPoliciesTab.ToolPoliciesTab (cognitive 32) · ×1
  • ToolPoliciesTab.ToolPoliciesTab (cognitive 32) web/src/components/settings/tabs/ToolPoliciesTab.tsx:27 — ToolPoliciesTab.ToolPoliciesTab has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 7, if/else 5, error handling 3 (nesting depth added 6). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 188, handleSavePolicy, handleDeletePolicy, …). 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 · BacklogPage.BacklogPage (cognitive 32) · ×1
  • BacklogPage.BacklogPage (cognitive 32) web/src/components/backlog/BacklogPage.tsx:41 — BacklogPage.BacklogPage has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 9 (17 pts), boolean chains 6, if/else 6, error handling 3 (nesting depth added 8). Most of this is not in the body itself: 9 of the 32 points are its own statements and the rest belongs to 7 function items inside it that branch (handleBulkPromote, a function literal at line 75, handleDelete, …). 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 · DashboardPage.DashboardPage (cognitive 32) · ×1
  • DashboardPage.DashboardPage (cognitive 32) web/src/components/dashboard/DashboardPage.tsx:121 — DashboardPage.DashboardPage has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 12 (21 pts), boolean chains 9, if/else 1, match/switch 1 (nesting depth added 9). Of this number, 30 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · summary.registerSummaryCommands (cognitive 31) · ×1
  • summary.registerSummaryCommands (cognitive 31) cli/src/commands/summary.ts:5 — summary.registerSummaryCommands has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (21 pts), ternaries 2 (6 pts), error handling 3, boolean chains 1 (nesting depth added 9). None of this is in the body itself: all 31 points belong to 5 function literals inside it that branch (lines 112, 66, 10, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · agents.handleAgentTool (cognitive 31) · ×1
  • agents.handleAgentTool (cognitive 31) mcp/src/tools/agents.ts:197 — agents.handleAgentTool has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 5 (12 pts), boolean chains 2, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AgentRegistryService.reconcileFromTasks (cognitive 31) · ×1
  • AgentRegistryService.reconcileFromTasks (cognitive 31) server/src/services/agent-registry-service.ts:342 — AgentRegistryService.reconcileFromTasks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 7, 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 · PhaseTransitionService.transition (cognitive 31) · ×1
  • PhaseTransitionService.transition (cognitive 31) server/src/services/phase-transition-service.ts:102 — PhaseTransitionService.transition has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 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 · AttemptLifecycleCoordinator.persistCompletion (cognitive 31) · ×1
  • AttemptLifecycleCoordinator.persistCompletion (cognitive 31) server/src/services/attempt-lifecycle-coordinator.ts:230 — AttemptLifecycleCoordinator.persistCompletion has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 2 (5 pts), ternaries 4 (5 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 · dashboard-metrics.computeTrends (cognitive 31) · ×1
  • dashboard-metrics.computeTrends (cognitive 31) server/src/services/metrics/dashboard-metrics.ts:336 — dashboard-metrics.computeTrends has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, ternaries 3 (5 pts), loops 2 (nesting depth added 6). Most of this is not in the body itself: 14 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 403). 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 · AgentsTab.AgentForm (cognitive 31) · ×1
  • AgentsTab.AgentForm (cognitive 31) web/src/components/settings/tabs/AgentsTab.tsx:2952 — AgentsTab.AgentForm has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 19, ternaries 11, if/else 1. Of this number, 19 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a 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 · BuzzConnectionPanel.BuzzConnectionPanel (cognitive 31) · ×1
  • BuzzConnectionPanel.BuzzConnectionPanel (cognitive 31) web/src/components/settings/tabs/BuzzConnectionPanel.tsx:87 — BuzzConnectionPanel.BuzzConnectionPanel has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 12 (14 pts), boolean chains 11, if/else 4 (5 pts), error handling 1 (nesting depth added 3). Of this number, 21 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · github.registerGitHubCommands (cognitive 30) · ×1
  • github.registerGitHubCommands (cognitive 30) cli/src/commands/github.ts:28 — github.registerGitHubCommands has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (20 pts), ternaries 3 (6 pts), error handling 4 (nesting depth added 5). None of this is in the body itself: all 30 points belong to 4 function literals inside it that branch (lines 97, 63, 144, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · goals.registerGoalCommands (cognitive 30) · ×1
  • goals.registerGoalCommands (cognitive 30) cli/src/commands/goals.ts:35 — goals.registerGoalCommands has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12, ternaries 9 (10 pts), error handling 6, loops 2 (nesting depth added 1). None of this is in the body itself: all 30 points belong to 6 function literals inside it that branch (lines 102, 48, 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 · durable-goal-schemas.DurableGoalRecordSchema (cognitive 30) · ×1
  • durable-goal-schemas.DurableGoalRecordSchema (cognitive 30) server/src/schemas/durable-goal-schemas.ts:173 — durable-goal-schemas.DurableGoalRecordSchema has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (6 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 · run-file-provenance-service.projectEvents (cognitive 30) · ×1
  • run-file-provenance-service.projectEvents (cognitive 30) server/src/services/run-file-provenance-service.ts:343 — run-file-provenance-service.projectEvents has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4 (8 pts), boolean chains 3, error handling 1 (3 pts), loops 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 · credential-broker-service.containsCredentialMaterial · ×1
  • credential-broker-service.containsCredentialMaterial::visit (cognitive 30) server/src/services/credential-broker-service.ts:1568 — credential-broker-service.containsCredentialMaterial::visit has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 15. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ClawdbotAgentService.completeAgent (cognitive 30) · ×1
  • ClawdbotAgentService.completeAgent (cognitive 30) server/src/services/clawdbot-agent-service.ts:2675 — ClawdbotAgentService.completeAgent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 2 (11 pts), boolean chains 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 · PreviewService.startPreview (cognitive 30) · ×1
  • PreviewService.startPreview (cognitive 30) REDACTED:132 — PreviewService.startPreview has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 9, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 9 of the 30 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 254, 202, 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.
D2 · Cognitive Complexity · AdmissionQueuePanel.AdmissionQueuePanel (cognitive 30) · ×1
  • AdmissionQueuePanel.AdmissionQueuePanel (cognitive 30) web/src/components/digest/AdmissionQueuePanel.tsx:64 — AdmissionQueuePanel.AdmissionQueuePanel has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 14, boolean chains 8, if/else 7, error handling 1. Of this number, 19 points are the body's own statements and 11 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 · WorkflowRunService.reconcilePendingRecoveries (cognitive 29) · ×1
  • WorkflowRunService.reconcilePendingRecoveries (cognitive 29) REDACTED:2075 — WorkflowRunService.reconcilePendingRecoveries has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 2 (5 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 14). 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 · telemetry-reader.streamEvents (cognitive 29) · ×1
  • telemetry-reader.streamEvents (cognitive 29) server/src/services/metrics/telemetry-reader.ts:64 — telemetry-reader.streamEvents has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (18 pts), error handling 2 (5 pts), boolean chains 3, 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 · DesktopOnboarding.DesktopOnboardingPanel (cognitive 29) · ×1
  • DesktopOnboarding.DesktopOnboardingPanel (cognitive 29) web/src/components/auth/DesktopOnboarding.tsx:289 — DesktopOnboarding.DesktopOnboardingPanel has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, ternaries 13, if/else 3. Of this number, 17 points are the body's own statements and 12 belong to 8 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 · BudgetCard.BudgetCard (cognitive 29) · ×1
  • BudgetCard.BudgetCard (cognitive 29) web/src/components/dashboard/BudgetCard.tsx:75 — BudgetCard.BudgetCard has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 12, if/else 4 (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 · EvidenceTimelinePanel.EvidenceTimelinePanel (cognitive 29) · ×1
  • EvidenceTimelinePanel.EvidenceTimelinePanel (cognitive 29) web/src/components/evidence/EvidenceTimelinePanel.tsx:145 — EvidenceTimelinePanel.EvidenceTimelinePanel has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 9, if/else 4 (nesting depth added 2). Of this number, 15 points are the body's own statements and 14 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 · RunAccessPanel.RunAccessPanel (cognitive 29) · ×1
  • RunAccessPanel.RunAccessPanel (cognitive 29) web/src/components/task/RunAccessPanel.tsx:43 — RunAccessPanel.RunAccessPanel has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 12, if/else 2 (nesting depth added 3). Of this number, 19 points are the body's own statements and 10 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · acp-stdio-adapter.buildCopilotAcpArgs (cognitive 28) · ×1
  • acp-stdio-adapter.buildCopilotAcpArgs (cognitive 28) server/src/services/acp-stdio-adapter.ts:241 — acp-stdio-adapter.buildCopilotAcpArgs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (6 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 · admission-control-schemas.AdmissionQueueEntrySchema (cognitive 28) · ×1
  • admission-control-schemas.AdmissionQueueEntrySchema (cognitive 28) server/src/schemas/admission-control-schemas.ts:531 — admission-control-schemas.AdmissionQueueEntrySchema has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 16, if/else 11, 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 · EgressPolicyService.evaluate (cognitive 28) · ×1
  • EgressPolicyService.evaluate (cognitive 28) server/src/services/egress-policy-service.ts:66 — EgressPolicyService.evaluate has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 9, if/else 8 (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 · GitCompletionEvidenceSource.captureCompletionEvidence (cognitive 28) · ×1
  • GitCompletionEvidenceSource.captureCompletionEvidence (cognitive 28) server/src/services/task-envelope-service.ts:138 — GitCompletionEvidenceSource.captureCompletionEvidence has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 14). Of this number, 16 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 · run-file-execution-policy-service.referenceCandidates (cognitive 28) · ×1
  • run-file-execution-policy-service.referenceCandidates (cognitive 28) server/src/services/run-file-execution-policy-service.ts:296 — run-file-execution-policy-service.referenceCandidates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (25 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 · CommunicationAdapterService.sendBuzz (cognitive 28) · ×1
  • CommunicationAdapterService.sendBuzz (cognitive 28) server/src/services/communication-adapter-service.ts:1315 — CommunicationAdapterService.sendBuzz has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 7, if/else 7, error handling 1 (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuzzDefinitionImportService.previewTeam (cognitive 28) · ×1
  • BuzzDefinitionImportService.previewTeam (cognitive 28) server/src/services/buzz-definition-import-service.ts:1004 — BuzzDefinitionImportService.previewTeam has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8, loops 2, ternaries 2 (nesting depth added 6). 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 · MaintenanceService.buildHealthChecks (cognitive 28) · ×1
  • MaintenanceService.buildHealthChecks (cognitive 28) server/src/services/maintenance-service.ts:425 — MaintenanceService.buildHealthChecks has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 15 (26 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 · AutomationDraftService.validateResolvedFields (cognitive 28) · ×1
  • AutomationDraftService.validateResolvedFields (cognitive 28) REDACTED:318 — AutomationDraftService.validateResolvedFields has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 9, 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 · ArtifactPreviewModal.ArtifactPreviewModal (cognitive 28) · ×1
  • ArtifactPreviewModal.ArtifactPreviewModal (cognitive 28) web/src/components/task/ArtifactPreviewModal.tsx:35 — ArtifactPreviewModal.ArtifactPreviewModal has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 16, if/else 8, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 6 function items inside it that branch (download, openCausalEvent, a function literal at line 55, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · DependenciesSection.DependenciesSection (cognitive 28) · ×1
  • DependenciesSection.DependenciesSection (cognitive 28) web/src/components/task/DependenciesSection.tsx:16 — DependenciesSection.DependenciesSection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, ternaries 4 (5 pts), error handling 2 (nesting depth added 3). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 14 function items inside it that branch (handleAddDependency, a function literal at line 31, a function literal at line 34, …). 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 · TimeTrackingSection.TimeTrackingSection (cognitive 28) · ×1
  • TimeTrackingSection.TimeTrackingSection (cognitive 28) web/src/components/task/TimeTrackingSection.tsx:67 — TimeTrackingSection.TimeTrackingSection has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 8, error handling 4 (5 pts), if/else 5 (nesting depth added 4). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 8 function items inside it that branch (handleStartStop, handleAddEntry, handleDeleteEntry, …). 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 · TaskMetricsPanel.TaskMetricsPanel (cognitive 28) · ×1
  • TaskMetricsPanel.TaskMetricsPanel (cognitive 28) web/src/components/task/TaskMetricsPanel.tsx:240 — TaskMetricsPanel.TaskMetricsPanel has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, ternaries 9 (12 pts), if/else 4 (nesting depth added 3). Of this number, 24 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 · notifications.registerNotificationCommands (cognitive 27) · ×1
  • notifications.registerNotificationCommands (cognitive 27) cli/src/commands/notifications.ts:5 — notifications.registerNotificationCommands has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (14 pts), error handling 5, ternaries 3 (5 pts), boolean chains 3 (nesting depth added 3). None of this is in the body itself: all 27 points belong to 6 function literals inside it that branch (lines 55, 83, 125, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · time.registerTimeCommands (cognitive 27) · ×1
  • time.registerTimeCommands (cognitive 27) cli/src/commands/time.ts:12 — time.registerTimeCommands has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 4, error handling 4, ternaries 1 (3 pts) (nesting depth added 3). None of this is in the body itself: all 27 points belong to 4 function literals inside it that branch (lines 111, 76, 20, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · FileChatRepository.parseSquadMessages (cognitive 27) · ×1
  • FileChatRepository.parseSquadMessages (cognitive 27) server/src/storage/chat-repository.ts:364 — FileChatRepository.parseSquadMessages has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (nesting depth added 12). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceCheckpointAttributionService.loadEventWindow (cognitive 27) · ×1
  • WorkspaceCheckpointAttributionService.loadEventWindow (cognitive 27) server/src/services/workspace-checkpoint-attribution-service.ts:84 — WorkspaceCheckpointAttributionService.loadEventWindow has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 3, 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 · ClawdbotAgentService.handleClaudeCodeJsonLine (cognitive 27) · ×1
  • ClawdbotAgentService.handleClaudeCodeJsonLine (cognitive 27) server/src/services/clawdbot-agent-service.ts:6851 — ClawdbotAgentService.handleClaudeCodeJsonLine has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (17 pts), boolean chains 6, if/else 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 · ClawdbotAgentService.startCodexSdk (cognitive 27) · ×1
  • ClawdbotAgentService.startCodexSdk (cognitive 27) server/src/services/clawdbot-agent-service.ts:7447 — ClawdbotAgentService.startCodexSdk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8, ternaries 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 · AgentHealthClassifierService.classifyAgent (cognitive 27) · ×1
  • AgentHealthClassifierService.classifyAgent (cognitive 27) server/src/services/agent-health-classifier-service.ts:51 — AgentHealthClassifierService.classifyAgent has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 10, ternaries 3 (4 pts) (nesting depth added 1). 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: 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 · BuzzCompatibilityService.probe (cognitive 27) · ×1
  • BuzzCompatibilityService.probe (cognitive 27) server/src/services/buzz-compatibility-service.ts:573 — BuzzCompatibilityService.probe has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (20 pts), ternaries 3, boolean chains 2, error handling 2 (nesting depth added 2). Of this number, 14 points are the body's own statements and 13 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 · CommunicationAdapterService.ingestBuzzEvent (cognitive 27) · ×1
  • CommunicationAdapterService.ingestBuzzEvent (cognitive 27) server/src/services/communication-adapter-service.ts:1008 — CommunicationAdapterService.ingestBuzzEvent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 7 (8 pts), boolean chains 6, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · WorkspaceCapabilitiesTab.WorkspaceCapabilitiesTab (cognitive 27) · ×1
  • WorkspaceCapabilitiesTab.WorkspaceCapabilitiesTab (cognitive 27) web/src/components/settings/tabs/WorkspaceCapabilitiesTab.tsx:31 — WorkspaceCapabilitiesTab.WorkspaceCapabilitiesTab has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 9, if/else 4, error handling 1 (nesting depth added 6). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (handleSubmit, a function literal at line 51, a function literal at line 55, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · BoardSidebar.AgentStatusPanel (cognitive 27) · ×1
  • BoardSidebar.AgentStatusPanel (cognitive 27) web/src/components/board/BoardSidebar.tsx:134 — BoardSidebar.AgentStatusPanel has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 19, if/else 6, ternaries 2. Of this number, 17 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ActivityFeed.StatusHistoryPanel (cognitive 27) · ×1
  • ActivityFeed.StatusHistoryPanel (cognitive 27) web/src/components/activity/ActivityFeed.tsx:142 — ActivityFeed.StatusHistoryPanel has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 16, if/else 8, ternaries 3. Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 244, 170, 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 · AgentComparison.AgentComparison (cognitive 27) · ×1
  • AgentComparison.AgentComparison (cognitive 27) web/src/components/dashboard/AgentComparison.tsx:97 — AgentComparison.AgentComparison has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 9, if/else 6 (nesting depth added 4). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (handleSort, SortHeader, getBestHighlight, …). 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 · CommentsSection.CommentItem (cognitive 27) · ×1
  • CommentsSection.CommentItem (cognitive 27) web/src/components/task/CommentsSection.tsx:52 — CommentsSection.CommentItem has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, ternaries 3 (5 pts), error handling 1 (nesting depth added 10). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 148, a function literal at line 163, handleDelete, …). 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 · sqlite.registerSqliteCommands (cognitive 26) · ×1
  • sqlite.registerSqliteCommands (cognitive 26) cli/src/commands/sqlite.ts:34 — sqlite.registerSqliteCommands has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (16 pts), error handling 4, boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 2). None of this is in the body itself: all 26 points belong to 4 function literals inside it that branch (lines 130, 52, 100, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · workflow.registerWorkflowCommands (cognitive 26) · ×1
  • workflow.registerWorkflowCommands (cognitive 26) cli/src/commands/workflow.ts:13 — workflow.registerWorkflowCommands has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13, error handling 11 (12 pts), boolean chains 1 (nesting depth added 1). None of this is in the body itself: all 26 points belong to 4 function literals inside it that branch (lines 77, 19, 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 · FileWorkProductArtifactRepository.deleteProduct (cognitive 26) · ×1
  • FileWorkProductArtifactRepository.deleteProduct (cognitive 26) server/src/storage/work-product-artifact-repository.ts:286 — FileWorkProductArtifactRepository.deleteProduct has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, error handling 2 (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 · WorkProductArtifactService.registerUnlocked (cognitive 26) · ×1
  • WorkProductArtifactService.registerUnlocked (cognitive 26) server/src/services/work-product-artifact-service.ts:114 — WorkProductArtifactService.registerUnlocked has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 7 (9 pts), boolean chains 5 (nesting depth added 5). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · task-envelope-service.captureCompletionGitState (cognitive 26) · ×1
  • task-envelope-service.captureCompletionGitState (cognitive 26) server/src/services/task-envelope-service.ts:571 — task-envelope-service.captureCompletionGitState has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7, loops 4 (5 pts), ternaries 3 (nesting depth added 6). Of this number, 18 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 · AdmissionControlService.cancelExecutionTree (cognitive 26) · ×1
  • AdmissionControlService.cancelExecutionTree (cognitive 26) server/src/services/admission-control-service.ts:1578 — AdmissionControlService.cancelExecutionTree has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 10). Of this number, 21 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClawdbotAgentService.startHermesCli (cognitive 26) · ×1
  • ClawdbotAgentService.startHermesCli (cognitive 26) server/src/services/clawdbot-agent-service.ts:6990 — ClawdbotAgentService.startHermesCli has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (10 pts), ternaries 2 (nesting depth added 3). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 7074, 7134, 7103, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · QueueIntakeMonitorService.evaluateGates (cognitive 26) · ×1
  • QueueIntakeMonitorService.evaluateGates (cognitive 26) server/src/services/queue-intake-monitor-service.ts:604 — QueueIntakeMonitorService.evaluateGates has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 8 (11 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 · GeneralTab.AddRepoForm (cognitive 26) · ×1
  • GeneralTab.AddRepoForm (cognitive 26) web/src/components/settings/tabs/GeneralTab.tsx:250 — GeneralTab.AddRepoForm has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 6, if/else 5, error handling 1 (nesting depth added 6). Of this number, 19 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 · KanbanColumn.KanbanColumn (cognitive 26) · ×1
  • KanbanColumn.KanbanColumn (cognitive 26) web/src/components/board/KanbanColumn.tsx:50 — KanbanColumn.KanbanColumn has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 11, if/else 2 (nesting depth added 3). Of this number, 18 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ArchiveSidebar.ArchiveSidebar (cognitive 26) · ×1
  • ArchiveSidebar.ArchiveSidebar (cognitive 26) web/src/components/layout/ArchiveSidebar.tsx:143 — ArchiveSidebar.ArchiveSidebar has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, ternaries 3 (6 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 207, handleRestore, handleRestoreFromDetail, …). 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 · useBoardDragDrop.createBoardKeyboardCoordinates.<returned closure> (cognitive 26) · ×1
  • useBoardDragDrop.createBoardKeyboardCoordinates.<returned closure> (cognitive 26) web/src/hooks/useBoardDragDrop.ts:61 — useBoardDragDrop.createBoardKeyboardCoordinates.<returned closure> has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, ternaries 5 (7 pts) (nesting depth added 3). Of this number, 20 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · auth.authenticate (cognitive 25) · ×1
  • auth.authenticate (cognitive 25) REDACTED:587 — auth.authenticate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4, 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 · FileWorkspaceCheckpointRepository.prune (cognitive 25) · ×1
  • FileWorkspaceCheckpointRepository.prune (cognitive 25) server/src/storage/workspace-checkpoint-repository.ts:581 — FileWorkspaceCheckpointRepository.prune has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 5 (6 pts), ternaries 1 (3 pts) (nesting depth added 6). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentProviderAdapterRegistry.stop (cognitive 25) · ×1
  • AgentProviderAdapterRegistry.stop (cognitive 25) REDACTED:199 — AgentProviderAdapterRegistry.stop has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 7, error handling 1 (2 pts), match/switch 1 (nesting depth added 9). Of this number, 15 points are the body's own statements and 10 belong to 3 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · WorkspaceCheckpointRewindPreviewService.preview (cognitive 25) · ×1
  • WorkspaceCheckpointRewindPreviewService.preview (cognitive 25) server/src/services/workspace-checkpoint-rewind-preview-service.ts:55 — WorkspaceCheckpointRewindPreviewService.preview has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 10, ternaries 4, loops 1. Of this number, 18 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · WorkspaceCheckpointRewindService.execute (cognitive 25) · ×1
  • WorkspaceCheckpointRewindService.execute (cognitive 25) server/src/services/workspace-checkpoint-rewind-service.ts:102 — WorkspaceCheckpointRewindService.execute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (10 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowRunService.dispatchQueuedWorkflowStep (cognitive 25) · ×1
  • WorkflowRunService.dispatchQueuedWorkflowStep (cognitive 25) REDACTED:933 — WorkflowRunService.dispatchQueuedWorkflowStep has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 16, if/else 8, boolean chains 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 · ClawdbotAgentService.startAcpStdio (cognitive 25) · ×1
  • ClawdbotAgentService.startAcpStdio (cognitive 25) server/src/services/clawdbot-agent-service.ts:5139 — ClawdbotAgentService.startAcpStdio has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 9, ternaries 5, error handling 1. Of this number, 18 points are the body's own statements and 7 belong to 4 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 · DocsService.search (cognitive 25) · ×1
  • DocsService.search (cognitive 25) server/src/services/docs-service.ts:189 — DocsService.search has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (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 · knowledge-integrity-service.lintSemanticCandidates (cognitive 25) · ×1
  • knowledge-integrity-service.lintSemanticCandidates (cognitive 25) server/src/services/knowledge-integrity-service.ts:352 — knowledge-integrity-service.lintSemanticCandidates has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 11). 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 · SkillRiskDashboardPanel.SkillRiskDashboardPanel (cognitive 25) · ×1
  • SkillRiskDashboardPanel.SkillRiskDashboardPanel (cognitive 25) web/src/components/settings/tabs/SkillRiskDashboardPanel.tsx:93 — SkillRiskDashboardPanel.SkillRiskDashboardPanel has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (20 pts), boolean chains 3, if/else 2 (nesting depth added 9). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 240, a function literal at line 106, a function literal at line 130, …). 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 · WallTimeToggle.WallTimeToggle (cognitive 25) · ×1
  • WallTimeToggle.WallTimeToggle (cognitive 25) web/src/components/dashboard/WallTimeToggle.tsx:30 — WallTimeToggle.WallTimeToggle has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 15 (22 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 · SubtasksSection.SubtasksSection (cognitive 25) · ×1
  • SubtasksSection.SubtasksSection (cognitive 25) web/src/components/task/SubtasksSection.tsx:30 — SubtasksSection.SubtasksSection has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 18, if/else 5, ternaries 2. Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 142, getCriteriaProgress, handleAddSubtask, …). 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 · agent-status.registerAgentStatusCommands (cognitive 24) · ×1
  • agent-status.registerAgentStatusCommands (cognitive 24) cli/src/commands/agent-status.ts:14 — agent-status.registerAgentStatusCommands has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (18 pts), error handling 4, boolean chains 2 (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, 122, 66, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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-code-adapter.normalizeExtraArgs (cognitive 24) · ×1
  • claude-code-adapter.normalizeExtraArgs (cognitive 24) server/src/services/claude-code-adapter.ts:278 — claude-code-adapter.normalizeExtraArgs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 5, 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 · FileChatRepository.listSquadMessages (cognitive 24) · ×1
  • FileChatRepository.listSquadMessages (cognitive 24) server/src/storage/chat-repository.ts:193 — FileChatRepository.listSquadMessages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 6, ternaries 4, loops 2 (3 pts) (nesting depth added 8). Of this number, 22 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · egress-policy-service.classifyAddress (cognitive 24) · ×1
  • egress-policy-service.classifyAddress (cognitive 24) server/src/services/egress-policy-service.ts:277 — egress-policy-service.classifyAddress has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8 (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 · DurableGoalSupervisorService.handleRunCompletion (cognitive 24) · ×1
  • DurableGoalSupervisorService.handleRunCompletion (cognitive 24) server/src/services/durable-goal-supervisor-service.ts:100 — DurableGoalSupervisorService.handleRunCompletion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 5 (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 · AdmissionControlService.executionTreeBreakerEvidence (cognitive 24) · ×1
  • AdmissionControlService.executionTreeBreakerEvidence (cognitive 24) server/src/services/admission-control-service.ts:316 — AdmissionControlService.executionTreeBreakerEvidence has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, loops 3 (4 pts), ternaries 4 (nesting depth added 2). 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: 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 · WorkflowRunService.getStats (cognitive 24) · ×1
  • WorkflowRunService.getStats (cognitive 24) REDACTED:2543 — WorkflowRunService.getStats has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4, boolean chains 3, ternaries 2 (nesting depth added 7). Of this number, 19 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 · AnalyticsService.getMetrics (cognitive 24) · ×1
  • AnalyticsService.getMetrics (cognitive 24) server/src/services/analytics-service.ts:127 — AnalyticsService.getMetrics has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 5 (7 pts), loops 2 (3 pts) (nesting depth added 3). Of this number, 16 points are the body's own statements and 8 belong to 4 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 · pdf-report-service.markdownToHtml (cognitive 24) · ×1
  • pdf-report-service.markdownToHtml (cognitive 24) server/src/services/pdf-report-service.ts:292 — pdf-report-service.markdownToHtml has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 1 (nesting depth added 10). Of this number, 22 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeCollectionService.validateSearchEvidence (cognitive 24) · ×1
  • KnowledgeCollectionService.validateSearchEvidence (cognitive 24) server/src/services/knowledge-collection-service.ts:1287 — KnowledgeCollectionService.validateSearchEvidence has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, ternaries 2 (5 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 · ReviewPanel.ReviewPanel (cognitive 24) · ×1
  • ReviewPanel.ReviewPanel (cognitive 24) web/src/components/task/ReviewPanel.tsx:47 — ReviewPanel.ReviewPanel has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 16, if/else 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 10 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 · TaskDetailsTab.TaskDetailsTab (cognitive 24) · ×1
  • TaskDetailsTab.TaskDetailsTab (cognitive 24) web/src/components/task/detail/TaskDetailsTab.tsx:28 — TaskDetailsTab.TaskDetailsTab has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, ternaries 5 (9 pts), if/else 2, error handling 1 (nesting depth added 4). Of this number, 20 points are the body's own statements and 4 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 · TemplatesPage.TemplatesPage (cognitive 24) · ×1
  • TemplatesPage.TemplatesPage (cognitive 24) web/src/components/templates/TemplatesPage.tsx:30 — TemplatesPage.TemplatesPage has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 15, ternaries 3 (6 pts), if/else 2, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 157, a function literal at line 52, handleDeleteConfirm). 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 · backlog.registerBacklogCommands (cognitive 23) · ×1
  • backlog.registerBacklogCommands (cognitive 23) cli/src/commands/backlog.ts:7 — backlog.registerBacklogCommands has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (15 pts), error handling 6, boolean chains 1, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 23 points belong to 6 function literals inside it that branch (lines 19, 129, 52, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · work-products.registerWorkProductCommands (cognitive 23) · ×1
  • work-products.registerWorkProductCommands (cognitive 23) cli/src/commands/work-products.ts:72 — work-products.registerWorkProductCommands has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, error handling 5, ternaries 2. None of this is in the body itself: all 23 points belong to 5 function literals inside it that branch (lines 140, 164, 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 · StatusHistoryService.getDailySummary (cognitive 23) · ×1
  • StatusHistoryService.getDailySummary (cognitive 23) server/src/services/status-history-service.ts:144 — StatusHistoryService.getDailySummary has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecureWorkProductArtifactSourceReader.read (cognitive 23) · ×1
  • SecureWorkProductArtifactSourceReader.read (cognitive 23) server/src/storage/work-product-artifact-repository.ts:90 — SecureWorkProductArtifactSourceReader.read has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · migrate-legacy-files.migrateLegacyFiles (cognitive 23) · ×1
  • migrate-legacy-files.migrateLegacyFiles (cognitive 23) server/src/utils/migrate-legacy-files.ts:12 — migrate-legacy-files.migrateLegacyFiles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (10 pts), error handling 3 (8 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentRoutingService.getFallback (cognitive 23) · ×1
  • AgentRoutingService.getFallback (cognitive 23) server/src/services/agent-routing-service.ts:437 — AgentRoutingService.getFallback has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 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 · provider-completion-service.evaluateCompletionPolicy (cognitive 23) · ×1
  • provider-completion-service.evaluateCompletionPolicy (cognitive 23) server/src/services/provider-completion-service.ts:288 — provider-completion-service.evaluateCompletionPolicy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 3, ternaries 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider-event-evidence.extractProviderEventHunkRanges · ×1
  • provider-event-evidence.extractProviderEventHunkRanges::visit (cognitive 23) server/src/services/provider-event-evidence.ts:53 — provider-event-evidence.extractProviderEventHunkRanges::visit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (7 pts), loops 3 (5 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 · RunSupervisorService.recover (cognitive 23) · ×1
  • RunSupervisorService.recover (cognitive 23) server/src/services/run-supervisor-service.ts:321 — RunSupervisorService.recover has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, 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 · RunRecoveryCoordinator.planTaskRecovery (cognitive 23) · ×1
  • RunRecoveryCoordinator.planTaskRecovery (cognitive 23) server/src/services/run-recovery-coordinator.ts:482 — RunRecoveryCoordinator.planTaskRecovery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 6 (7 pts), boolean chains 5, 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 · SummaryService.generateStandupText (cognitive 23) · ×1
  • SummaryService.generateStandupText (cognitive 23) server/src/services/summary-service.ts:466 — SummaryService.generateStandupText has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (9 pts), loops 4 (8 pts), if/else 6 (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 · GitHubService.delegateToCodexCloud (cognitive 23) · ×1
  • GitHubService.delegateToCodexCloud (cognitive 23) server/src/services/github-service.ts:231 — GitHubService.delegateToCodexCloud has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, ternaries 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 · ContextProviderHealthService.openClawPrivacyPosture (cognitive 23) · ×1
  • ContextProviderHealthService.openClawPrivacyPosture (cognitive 23) server/src/services/context-provider-health-service.ts:351 — ContextProviderHealthService.openClawPrivacyPosture has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 5 (7 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 · SystemHealthBar.SystemHealthBar (cognitive 23) · ×1
  • SystemHealthBar.SystemHealthBar (cognitive 23) web/src/components/layout/SystemHealthBar.tsx:72 — SystemHealthBar.SystemHealthBar has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 7, boolean chains 6 (nesting depth added 4). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · DocsViewer.DocsViewer (cognitive 23) · ×1
  • DocsViewer.DocsViewer (cognitive 23) web/src/components/docs/DocsViewer.tsx:43 — DocsViewer.DocsViewer has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 4 (6 pts), boolean chains 3 (nesting depth added 6). Of this number, 13 points are the body's own statements and 10 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 · DecisionReviewSessionsSection.DecisionReviewSessionDetail (cognitive 23) · ×1
  • DecisionReviewSessionsSection.DecisionReviewSessionDetail (cognitive 23) web/src/components/task/DecisionReviewSessionsSection.tsx:344 — DecisionReviewSessionsSection.DecisionReviewSessionDetail has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 11 (nesting depth added 5). Of this number, 14 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowDashboard.WorkflowDashboard (cognitive 23) · ×1
  • WorkflowDashboard.WorkflowDashboard (cognitive 23) web/src/components/workflows/WorkflowDashboard.tsx:54 — WorkflowDashboard.WorkflowDashboard has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 6 (7 pts), boolean chains 3 (nesting depth added 6). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 107, 78, 87, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · automation.registerAutomationCommands (cognitive 22) · ×1
  • automation.registerAutomationCommands (cognitive 22) cli/src/commands/automation.ts:8 — automation.registerAutomationCommands has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (17 pts), error handling 4, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 22 points belong to 4 function literals inside it that branch (lines 107, 64, 15, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · tasks.handleTaskTool (cognitive 22) · ×1
  • tasks.handleTaskTool (cognitive 22) mcp/src/tools/tasks.ts:214 — tasks.handleTaskTool has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FileWorkProductArtifactRepository.create (cognitive 22) · ×1
  • FileWorkProductArtifactRepository.create (cognitive 22) server/src/storage/work-product-artifact-repository.ts:187 — FileWorkProductArtifactRepository.create has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, 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 · claude-code-adapter.classifyClaudeCodeStreamRecord (cognitive 22) · ×1
  • claude-code-adapter.classifyClaudeCodeStreamRecord (cognitive 22) server/src/services/claude-code-adapter.ts:359 — claude-code-adapter.classifyClaudeCodeStreamRecord has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (18 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 · workspace-execution-trust-repository.recursiveCandidates · ×1
  • workspace-execution-trust-repository.recursiveCandidates::visit (cognitive 22) server/src/storage/workspace-execution-trust-repository.ts:405 — workspace-execution-trust-repository.recursiveCandidates::visit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, error handling 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 · WorkProductArtifactPreviewService.preview (cognitive 22) · ×1
  • WorkProductArtifactPreviewService.preview (cognitive 22) server/src/services/work-product-artifact-preview-service.ts:87 — WorkProductArtifactPreviewService.preview has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 2 (4 pts), boolean chains 3, 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 · tool-control-plane-service.listAllTools (cognitive 22) · ×1
  • tool-control-plane-service.listAllTools (cognitive 22) server/src/services/tool-control-plane-service.ts:1586 — tool-control-plane-service.listAllTools has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (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 · WorkflowRunService.reconcileWorkflowStepQueue (cognitive 22) · ×1
  • WorkflowRunService.reconcileWorkflowStepQueue (cognitive 22) REDACTED:1231 — WorkflowRunService.reconcileWorkflowStepQueue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgressWatchdogControlService.inspect (cognitive 22) · ×1
  • ProgressWatchdogControlService.inspect (cognitive 22) server/src/services/progress-watchdog-control-service.ts:52 — ProgressWatchdogControlService.inspect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 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 · ExternalTrackerService.validateProfileAgainstSchema (cognitive 22) · ×1
  • ExternalTrackerService.validateProfileAgainstSchema (cognitive 22) server/src/services/external-tracker-service.ts:769 — ExternalTrackerService.validateProfileAgainstSchema has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8, 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 · KnowledgeCollectionService.searchCollection (cognitive 22) · ×1
  • KnowledgeCollectionService.searchCollection (cognitive 22) server/src/services/knowledge-collection-service.ts:1016 — KnowledgeCollectionService.searchCollection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 5 (7 pts), boolean chains 4, error handling 1 (2 pts), loops 2 (nesting depth added 6). Of this number, 17 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 · knowledge-collection-service.buildProposalContradictions (cognitive 22) · ×1
  • knowledge-collection-service.buildProposalContradictions (cognitive 22) server/src/services/knowledge-collection-service.ts:1727 — knowledge-collection-service.buildProposalContradictions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (6 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · knowledge-collection-service.resolvePageCandidates (cognitive 22) · ×1
  • knowledge-collection-service.resolvePageCandidates (cognitive 22) server/src/services/knowledge-collection-service.ts:2013 — knowledge-collection-service.resolvePageCandidates has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (7 pts), boolean chains 3, ternaries 1 (nesting depth added 7). Of this number, 14 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 · ViewContext.ViewProvider (cognitive 22) · ×1
  • ViewContext.ViewProvider (cognitive 22) web/src/contexts/ViewContext.tsx:109 — ViewContext.ViewProvider has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 4 (5 pts), boolean chains 3 (nesting depth added 3). None of this is in the body itself: all 22 points belong to 12 function literals inside it that branch (lines 118, 196, 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 · AgentsTab.AgentsTab (cognitive 22) · ×1
  • AgentsTab.AgentsTab (cognitive 22) web/src/components/settings/tabs/AgentsTab.tsx:119 — AgentsTab.AgentsTab has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 6, if/else 4 (nesting depth added 4). Of this number, 13 points are the body's own statements and 9 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentsTab.BuzzDefinitionImportSection (cognitive 22) · ×1
  • AgentsTab.BuzzDefinitionImportSection (cognitive 22) web/src/components/settings/tabs/AgentsTab.tsx:433 — AgentsTab.BuzzDefinitionImportSection has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 13, ternaries 3 (5 pts), if/else 3 (4 pts) (nesting depth added 3). Of this number, 14 points are the body's own statements and 8 belong to 6 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 · MaintenanceTab.MaintenanceTab (cognitive 22) · ×1
  • MaintenanceTab.MaintenanceTab (cognitive 22) web/src/components/settings/tabs/MaintenanceTab.tsx:201 — MaintenanceTab.MaintenanceTab has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (8 pts), if/else 4 (nesting depth added 1). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 556, 220, 242, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · FilterBar.filterTasks (cognitive 22) · ×1
  • FilterBar.filterTasks (cognitive 22) web/src/components/board/FilterBar.tsx:459 — FilterBar.filterTasks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3 (nesting depth added 8). None of this is in the body itself: all 22 points belong to one function literal inside it that branches (line 460). 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 · DriftMonitor.DriftMonitor (cognitive 22) · ×1
  • DriftMonitor.DriftMonitor (cognitive 22) web/src/components/drift/DriftMonitor.tsx:304 — DriftMonitor.DriftMonitor has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 7, if/else 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 340, a function literal at line 322, a function literal at line 331, …). 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 · ApplyTemplateDialog.ApplyTemplateDialog · ×1
  • ApplyTemplateDialog.ApplyTemplateDialog::handleApply (cognitive 22) web/src/components/task/ApplyTemplateDialog.tsx:237 — ApplyTemplateDialog.ApplyTemplateDialog::handleApply has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (8 pts), error handling 2, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · GitSelectionForm.GitSelectionForm (cognitive 22) · ×1
  • GitSelectionForm.GitSelectionForm (cognitive 22) web/src/components/task/git/GitSelectionForm.tsx:22 — GitSelectionForm.GitSelectionForm has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 18, if/else 4. Of this number, 12 points are the body's own statements and 10 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 · TaskWorkView.getTaskOverviewComposition (cognitive 22) · ×1
  • TaskWorkView.getTaskOverviewComposition (cognitive 22) web/src/components/task/TaskWorkView.tsx:138 — TaskWorkView.getTaskOverviewComposition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, ternaries 2 (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 · useTasks.useUpdateTask (cognitive 22) · ×1
  • useTasks.useUpdateTask (cognitive 22) web/src/hooks/useTasks.ts:263 — useTasks.useUpdateTask has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 4 (6 pts) (nesting depth added 2). None of this is in the body itself: all 22 points belong to 7 function literals inside it that branch (lines 320, 286, 267, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · TelemetryService.getEvents (cognitive 21) · ×1
  • TelemetryService.getEvents (cognitive 21) server/src/services/telemetry-service.ts:222 — TelemetryService.getEvents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (nesting depth added 6). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 241). 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 · url-validation.validateWebhookUrl (cognitive 21) · ×1
  • url-validation.validateWebhookUrl (cognitive 21) server/src/utils/url-validation.ts:260 — url-validation.validateWebhookUrl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, error handling 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 · DelegationService.canApprove (cognitive 21) · ×1
  • DelegationService.canApprove (cognitive 21) server/src/services/delegation-service.ts:104 — DelegationService.canApprove has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, 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 · FileAdmissionReservationRepository.claimMaterialized (cognitive 21) · ×1
  • FileAdmissionReservationRepository.claimMaterialized (cognitive 21) server/src/storage/admission-reservation-repository.ts:199 — FileAdmissionReservationRepository.claimMaterialized has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, ternaries 2 (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 · SqliteAdmissionReservationRepository.claimInTransaction (cognitive 21) · ×1
  • SqliteAdmissionReservationRepository.claimInTransaction (cognitive 21) server/src/storage/sqlite/admission-reservation-repository.ts:387 — SqliteAdmissionReservationRepository.claimInTransaction has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, ternaries 2 (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 · filesystem-sandbox-runtime.assertNoExternalHardLinksRuntime · ×1
  • filesystem-sandbox-runtime.assertNoExternalHardLinksRuntime::scan (cognitive 21) server/src/utils/filesystem-sandbox-runtime.ts:316 — filesystem-sandbox-runtime.assertNoExternalHardLinksRuntime::scan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 2 (3 pts), boolean chains 2, 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, 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 · ClawdbotAgentService.previewAgentLaunch (cognitive 21) · ×1
  • ClawdbotAgentService.previewAgentLaunch (cognitive 21) server/src/services/clawdbot-agent-service.ts:1110 — ClawdbotAgentService.previewAgentLaunch has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9, if/else 8, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ClawdbotAgentService.buildTraceMetadata (cognitive 21) · ×1
  • ClawdbotAgentService.buildTraceMetadata (cognitive 21) server/src/services/clawdbot-agent-service.ts:7928 — ClawdbotAgentService.buildTraceMetadata has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (21 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClawdbotAgentService.normalizeConversationLaunch (cognitive 21) · ×1
  • ClawdbotAgentService.normalizeConversationLaunch (cognitive 21) server/src/services/clawdbot-agent-service.ts:9031 — ClawdbotAgentService.normalizeConversationLaunch has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (8 pts), 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.
D2 · Cognitive Complexity · DiffService.parseUnifiedDiff (cognitive 21) · ×1
  • DiffService.parseUnifiedDiff (cognitive 21) server/src/services/diff-service.ts:167 — DiffService.parseUnifiedDiff has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 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 · DriftService.getDailyMetricValues (cognitive 21) · ×1
  • DriftService.getDailyMetricValues (cognitive 21) server/src/services/drift-service.ts:290 — DriftService.getDailyMetricValues has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 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 · KnowledgeCollectionService.createIngestionProposalInternal (cognitive 21) · ×1
  • KnowledgeCollectionService.createIngestionProposalInternal (cognitive 21) server/src/services/knowledge-collection-service.ts:530 — KnowledgeCollectionService.createIngestionProposalInternal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, ternaries 3 (4 pts) (nesting depth added 3). Of this number, 18 points are the body's own statements and 3 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 · integrity-service.checkTaskFiles (cognitive 21) · ×1
  • integrity-service.checkTaskFiles (cognitive 21) server/src/services/integrity-service.ts:187 — integrity-service.checkTaskFiles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (6 pts), ternaries 2 (6 pts), error handling 3 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeliverablesSection.DeliverableItem (cognitive 21) · ×1
  • DeliverablesSection.DeliverableItem (cognitive 21) web/src/components/task/DeliverablesSection.tsx:61 — DeliverablesSection.DeliverableItem has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (7 pts), error handling 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (handleSaveEdit, handleCancelEdit, handleDelete, …). 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 · WorkflowAuthoringPanel.WorkflowDefinitionEditor (cognitive 21) · ×1
  • WorkflowAuthoringPanel.WorkflowDefinitionEditor (cognitive 21) web/src/components/workflows/WorkflowAuthoringPanel.tsx:762 — WorkflowAuthoringPanel.WorkflowDefinitionEditor has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 11, boolean chains 10. Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 13 function items inside it that branch (updateWorkflowBudgetLimit, updateAgentBudgetLimit, a function literal at line 1021, …). 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 · WorkflowDetailView.WorkflowDetailView (cognitive 21) · ×1
  • WorkflowDetailView.WorkflowDetailView (cognitive 21) web/src/components/workflows/WorkflowDetailView.tsx:60 — WorkflowDetailView.WorkflowDetailView has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (7 pts), if/else 4 (nesting depth added 1). Of this number, 14 points are the body's own statements and 7 belong to 5 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 · SettingsWindowController.open (cognitive 20) · ×1
  • SettingsWindowController.open (cognitive 20) desktop/src/main/settings-window.ts:61 — SettingsWindowController.open has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 7). Of this number, 11 points are the body's own statements and 9 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileRunOutputArtifactRepository.scanWorkspace (cognitive 20) · ×1
  • FileRunOutputArtifactRepository.scanWorkspace (cognitive 20) server/src/storage/run-output-artifact-repository.ts:361 — FileRunOutputArtifactRepository.scanWorkspace has cognitive complexity 20 (threshold 15). Drivers by points: if/else 2 (10 pts), loops 4 (10 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 · FileWorkflowRunRepository.readRun (cognitive 20) · ×1
  • FileWorkflowRunRepository.readRun (cognitive 20) server/src/storage/workflow-run-repository.ts:180 — FileWorkflowRunRepository.readRun has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 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 · filesystem-sandbox-runtime.assertProtectedMetadataPathsRuntime (cognitive 20) · ×1
  • filesystem-sandbox-runtime.assertProtectedMetadataPathsRuntime (cognitive 20) server/src/utils/filesystem-sandbox-runtime.ts:410 — filesystem-sandbox-runtime.assertProtectedMetadataPathsRuntime has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (14 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 · AgentHealthService.checkAuth (cognitive 20) · ×1
  • AgentHealthService.checkAuth (cognitive 20) server/src/services/agent-health-service.ts:120 — AgentHealthService.checkAuth has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, ternaries 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 · ToolControlPlaneService.resolveCredentialTargets (cognitive 20) · ×1
  • ToolControlPlaneService.resolveCredentialTargets (cognitive 20) server/src/services/tool-control-plane-service.ts:1162 — ToolControlPlaneService.resolveCredentialTargets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 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 · RunTerminalService.reconcileAttempt (cognitive 20) · ×1
  • RunTerminalService.reconcileAttempt (cognitive 20) server/src/services/run-terminal-service.ts:548 — RunTerminalService.reconcileAttempt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RunFileExecutionPolicyService.evaluate (cognitive 20) · ×1
  • RunFileExecutionPolicyService.evaluate (cognitive 20) server/src/services/run-file-execution-policy-service.ts:75 — RunFileExecutionPolicyService.evaluate has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 9). 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 · WorkspaceExecutionTrustService.evaluateForLaunch (cognitive 20) · ×1
  • WorkspaceExecutionTrustService.evaluateForLaunch (cognitive 20) server/src/services/workspace-execution-trust-service.ts:71 — WorkspaceExecutionTrustService.evaluateForLaunch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowRunService.reconcileWorkflowRootQueue (cognitive 20) · ×1
  • WorkflowRunService.reconcileWorkflowRootQueue (cognitive 20) REDACTED:1114 — WorkflowRunService.reconcileWorkflowRootQueue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 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 · WorkflowRunService.startRun (cognitive 20) · ×1
  • WorkflowRunService.startRun (cognitive 20) REDACTED:1376 — WorkflowRunService.startRun has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 8 (9 pts), boolean chains 1, error handling 1 (nesting depth added 4). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · run-access-summary-service.projectFilesystem (cognitive 20) · ×1
  • run-access-summary-service.projectFilesystem (cognitive 20) server/src/services/run-access-summary-service.ts:454 — run-access-summary-service.projectFilesystem has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (18 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 · DriftService.buildDailyAggregates (cognitive 20) · ×1
  • DriftService.buildDailyAggregates (cognitive 20) server/src/services/drift-service.ts:236 — DriftService.buildDailyAggregates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuzzDefinitionImportService.importTeam (cognitive 20) · ×1
  • BuzzDefinitionImportService.importTeam (cognitive 20) server/src/services/buzz-definition-import-service.ts:1317 — BuzzDefinitionImportService.importTeam has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 2). None of this is in the body itself: all 20 points belong to 2 function literals inside it that branch (lines 1323, 1327). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · buzz-definition-import-service.findForbiddenMaterial (cognitive 20) · ×1
  • buzz-definition-import-service.findForbiddenMaterial (cognitive 20) server/src/services/buzz-definition-import-service.ts:193 — buzz-definition-import-service.findForbiddenMaterial has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 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 · AutomationActivationService.finishRunClaim (cognitive 20) · ×1
  • AutomationActivationService.finishRunClaim (cognitive 20) server/src/services/automation-activation-service.ts:755 — AutomationActivationService.finishRunClaim has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 4 (5 pts) (nesting depth added 1). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 762). 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 · FileKnowledgeCollectionRepository.readState (cognitive 20) · ×1
  • FileKnowledgeCollectionRepository.readState (cognitive 20) server/src/storage/knowledge-collection-repository.ts:635 — FileKnowledgeCollectionRepository.readState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 7, boolean chains 4, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · knowledge-collection-repository.validateKnowledgePageGraph (cognitive 20) · ×1
  • knowledge-collection-repository.validateKnowledgePageGraph (cognitive 20) server/src/storage/knowledge-collection-repository.ts:865 — knowledge-collection-repository.validateKnowledgePageGraph has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 5 (7 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 · SettingsDialog.SettingsDialog · ×1
  • SettingsDialog.SettingsDialog::renderTab (cognitive 20) web/src/components/settings/SettingsDialog.tsx:518 — SettingsDialog.SettingsDialog::renderTab has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 20. To reduce it, name the conditions: bind each compound test to a 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 · AdmissionQueuePanel.QueueRow (cognitive 20) · ×1
  • AdmissionQueuePanel.QueueRow (cognitive 20) web/src/components/digest/AdmissionQueuePanel.tsx:740 — AdmissionQueuePanel.QueueRow has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · WebSocketIndicator.WebSocketIndicator (cognitive 20) · ×1
  • WebSocketIndicator.WebSocketIndicator (cognitive 20) web/src/components/shared/WebSocketIndicator.tsx:13 — WebSocketIndicator.WebSocketIndicator has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 13 (19 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 · TimeBreakdownPage.TimeBreakdownPage (cognitive 20) · ×1
  • TimeBreakdownPage.TimeBreakdownPage (cognitive 20) web/src/components/time/TimeBreakdownPage.tsx:71 — TimeBreakdownPage.TimeBreakdownPage has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 4 (6 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 95, openSource, a function literal at line 89, …). 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 · MarkdownEditor.MarkdownEditor (cognitive 20) · ×1
  • MarkdownEditor.MarkdownEditor (cognitive 20) web/src/components/ui/MarkdownEditor.tsx:34 — MarkdownEditor.MarkdownEditor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, ternaries 4, match/switch 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 9 function items inside it that branch (handleKeyDown, a function literal at line 48, a function literal at line 70, …). 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 · WorkflowStartDialog.WorkflowStartDialog (cognitive 20) · ×1
  • WorkflowStartDialog.WorkflowStartDialog (cognitive 20) web/src/components/workflows/WorkflowStartDialog.tsx:19 — WorkflowStartDialog.WorkflowStartDialog has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 5, if/else 5, error handling 2 (nesting depth added 4). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (startRun, a function literal at line 27, a function literal at line 34, …). 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 · useAgent.useAgentStream.handleMessage (cognitive 20) · ×1
  • useAgent.useAgentStream.handleMessage (cognitive 20) web/src/hooks/useAgent.ts:370 — useAgent.useAgentStream.handleMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 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 · workspaces.registerWorkspaceCommands (cognitive 19) · ×1
  • workspaces.registerWorkspaceCommands (cognitive 19) cli/src/commands/workspaces.ts:32 — workspaces.registerWorkspaceCommands has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, loops 4 (6 pts), error handling 4, boolean chains 1, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 19 points belong to 4 function literals inside it that branch (lines 42, 83, 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.
D2 · Cognitive Complexity · SqliteStatusHistoryRepository.getDailySummary (cognitive 19) · ×1
  • SqliteStatusHistoryRepository.getDailySummary (cognitive 19) server/src/storage/sqlite/status-history-repository.ts:119 — SqliteStatusHistoryRepository.getDailySummary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, 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 · WorkProductService.list (cognitive 19) · ×1
  • WorkProductService.list (cognitive 19) server/src/services/work-product-service.ts:105 — WorkProductService.list has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8 (nesting depth added 1). 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 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 · workspace-execution-trust-repository.inspectWorkspace (cognitive 19) · ×1
  • workspace-execution-trust-repository.inspectWorkspace (cognitive 19) server/src/storage/workspace-execution-trust-repository.ts:529 — workspace-execution-trust-repository.inspectWorkspace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 1 (3 pts), loops 2, 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 · RunOutputSpillService.prepare (cognitive 19) · ×1
  • RunOutputSpillService.prepare (cognitive 19) server/src/services/run-output-spill-service.ts:206 — RunOutputSpillService.prepare has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 4, if/else 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 · TeamRosterService.resolveRoute (cognitive 19) · ×1
  • TeamRosterService.resolveRoute (cognitive 19) server/src/services/team-roster-service.ts:127 — TeamRosterService.resolveRoute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · egress-policy-service.compileHostRules (cognitive 19) · ×1
  • egress-policy-service.compileHostRules (cognitive 19) server/src/services/egress-policy-service.ts:160 — egress-policy-service.compileHostRules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, loops 1 (nesting depth added 9). 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 · run-egress-gateway-service.handleSocksConnection (cognitive 19) · ×1
  • run-egress-gateway-service.handleSocksConnection (cognitive 19) REDACTED:525 — run-egress-gateway-service.handleSocksConnection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4, 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 · tool-control-plane-service.assertSafeSchema (cognitive 19) · ×1
  • tool-control-plane-service.assertSafeSchema (cognitive 19) server/src/services/tool-control-plane-service.ts:1646 — tool-control-plane-service.assertSafeSchema has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 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 · WorkflowStepExecutor.validateCriterion (cognitive 19) · ×1
  • WorkflowStepExecutor.validateCriterion (cognitive 19) REDACTED:1404 — WorkflowStepExecutor.validateCriterion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 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 · WorkflowRunService.admitWorkflowStep (cognitive 19) · ×1
  • WorkflowRunService.admitWorkflowStep (cognitive 19) REDACTED:569 — WorkflowRunService.admitWorkflowStep has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 4, boolean chains 3, 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 · ClawdbotAgentService.finalizePendingAgent (cognitive 19) · ×1
  • ClawdbotAgentService.finalizePendingAgent (cognitive 19) server/src/services/clawdbot-agent-service.ts:3010 — ClawdbotAgentService.finalizePendingAgent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, error handling 1 (nesting depth added 3). 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 · ClawdbotAgentService.evaluatePendingBudget (cognitive 19) · ×1
  • ClawdbotAgentService.evaluatePendingBudget (cognitive 19) server/src/services/clawdbot-agent-service.ts:4340 — ClawdbotAgentService.evaluatePendingBudget has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5 (nesting depth added 3). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 4359). 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 · ClawdbotAgentService.handleCodexAppServerNotification (cognitive 19) · ×1
  • ClawdbotAgentService.handleCodexAppServerNotification (cognitive 19) server/src/services/clawdbot-agent-service.ts:6287 — ClawdbotAgentService.handleCodexAppServerNotification has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 4, 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 · ClawdbotAgentService.emitJournalOutput (cognitive 19) · ×1
  • ClawdbotAgentService.emitJournalOutput (cognitive 19) server/src/services/clawdbot-agent-service.ts:7863 — ClawdbotAgentService.emitJournalOutput has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 4, 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 · ContextProviderHealthService.openClawProvider (cognitive 19) · ×1
  • ContextProviderHealthService.openClawProvider (cognitive 19) server/src/services/context-provider-health-service.ts:135 — ContextProviderHealthService.openClawProvider has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (13 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 · reflection-consolidation-service.stableDiff (cognitive 19) · ×1
  • reflection-consolidation-service.stableDiff (cognitive 19) server/src/services/reflection-consolidation-service.ts:187 — reflection-consolidation-service.stableDiff has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 8). 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 · knowledge-collection-schemas.KnowledgeIngestionProposalSchema (cognitive 19) · ×1
  • knowledge-collection-schemas.KnowledgeIngestionProposalSchema (cognitive 19) server/src/schemas/knowledge-collection-schemas.ts:595 — knowledge-collection-schemas.KnowledgeIngestionProposalSchema has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, ternaries 2 (3 pts), 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 · server.startServer (cognitive 19) · ×1
  • server.startServer (cognitive 19) REDACTED:1332 — server.startServer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 2, ternaries 2 (nesting depth added 3). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 1333). 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 · QueueMonitorsTab.QueueMonitorsTab (cognitive 19) · ×1
  • QueueMonitorsTab.QueueMonitorsTab (cognitive 19) web/src/components/settings/tabs/QueueMonitorsTab.tsx:33 — QueueMonitorsTab.QueueMonitorsTab has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, ternaries 3 (5 pts), error handling 1, if/else 1 (nesting depth added 2). 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 (a function literal at line 115, mutate). 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 · MultiAgentPanel.MultiAgentPanel (cognitive 19) · ×1
  • MultiAgentPanel.MultiAgentPanel (cognitive 19) web/src/components/board/MultiAgentPanel.tsx:164 — MultiAgentPanel.MultiAgentPanel has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 5, if/else 3 (4 pts), loops 2 (nesting depth added 1). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 190, 236, 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 · SquadChatPanel.SquadMessageBubble (cognitive 19) · ×1
  • SquadChatPanel.SquadMessageBubble (cognitive 19) web/src/components/chat/SquadChatPanel.tsx:526 — SquadChatPanel.SquadMessageBubble has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 15, ternaries 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, name the conditions: bind each compound test to a 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 · AttachmentsSection.AttachmentsSection (cognitive 19) · ×1
  • AttachmentsSection.AttachmentsSection (cognitive 19) web/src/components/task/AttachmentsSection.tsx:218 — AttachmentsSection.AttachmentsSection has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (6 pts), if/else 3, loops 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · useBoardDragDrop.useBoardDragDrop.handleDragOver (cognitive 19) · ×1
  • useBoardDragDrop.useBoardDragDrop.handleDragOver (cognitive 19) web/src/hooks/useBoardDragDrop.ts:315 — useBoardDragDrop.useBoardDragDrop.handleDragOver has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 1, ternaries 1 (nesting depth added 3). 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 324). 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 · GovernanceTraceService.list (cognitive 18) · ×1
  • GovernanceTraceService.list (cognitive 18) server/src/services/governance-trace-service.ts:85 — GovernanceTraceService.list has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 2. Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 104, 120). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · WorktreeService.createWorktree (cognitive 18) · ×1
  • WorktreeService.createWorktree (cognitive 18) server/src/services/worktree-service.ts:229 — WorktreeService.createWorktree has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 2 (4 pts), error handling 2 (nesting depth added 3). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 234). 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 · WorktreeService.deleteWorktree (cognitive 18) · ×1
  • WorktreeService.deleteWorktree (cognitive 18) server/src/services/worktree-service.ts:656 — WorktreeService.deleteWorktree has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 4). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 661). 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 · GitHubSyncService.syncFromGitHub (cognitive 18) · ×1
  • GitHubSyncService.syncFromGitHub (cognitive 18) server/src/services/github-sync-service.ts:164 — GitHubSyncService.syncFromGitHub has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · task-envelope-schemas.parseCompletionResultForEnvelope (cognitive 18) · ×1
  • task-envelope-schemas.parseCompletionResultForEnvelope (cognitive 18) server/src/schemas/task-envelope-schemas.ts:389 — task-envelope-schemas.parseCompletionResultForEnvelope has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 8 (nesting depth added 4). Of this number, 9 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 · workspace-checkpoint-schemas.WorkspaceCheckpointSchema (cognitive 18) · ×1
  • workspace-checkpoint-schemas.WorkspaceCheckpointSchema (cognitive 18) server/src/schemas/workspace-checkpoint-schemas.ts:126 — workspace-checkpoint-schemas.WorkspaceCheckpointSchema has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileWorkspaceCheckpointRepository.prepareSafeWorktreeParent (cognitive 18) · ×1
  • FileWorkspaceCheckpointRepository.prepareSafeWorktreeParent (cognitive 18) server/src/storage/workspace-checkpoint-repository.ts:1206 — FileWorkspaceCheckpointRepository.prepareSafeWorktreeParent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filesystem-sandbox-runtime.inspectGitMetadataRoots (cognitive 18) · ×1
  • filesystem-sandbox-runtime.inspectGitMetadataRoots (cognitive 18) server/src/utils/filesystem-sandbox-runtime.ts:229 — filesystem-sandbox-runtime.inspectGitMetadataRoots has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, error handling 2, 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 · PolicyService.runWebhookCheck (cognitive 18) · ×1
  • PolicyService.runWebhookCheck (cognitive 18) server/src/services/policy-service.ts:590 — PolicyService.runWebhookCheck has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 3, if/else 3, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · OpenClawCompletionService.observe (cognitive 18) · ×1
  • OpenClawCompletionService.observe (cognitive 18) server/src/services/openclaw-completion-service.ts:150 — OpenClawCompletionService.observe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 8). 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 · provider-runtime-resolution.buildProviderRuntimeProbeRequest (cognitive 18) · ×1
  • provider-runtime-resolution.buildProviderRuntimeProbeRequest (cognitive 18) server/src/services/provider-runtime-resolution.ts:33 — provider-runtime-resolution.buildProviderRuntimeProbeRequest has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 4, if/else 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 · RunApprovalBrokerService.decide (cognitive 18) · ×1
  • RunApprovalBrokerService.decide (cognitive 18) server/src/services/run-approval-broker-service.ts:244 — RunApprovalBrokerService.decide has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, loops 1 (2 pts), ternaries 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HttpRpcSession.post (cognitive 18) · ×1
  • HttpRpcSession.post (cognitive 18) server/src/services/tool-control-plane-service.ts:1486 — HttpRpcSession.post has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, 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 · run-file-execution-policy-service.snapshotCandidate (cognitive 18) · ×1
  • run-file-execution-policy-service.snapshotCandidate (cognitive 18) server/src/services/run-file-execution-policy-service.ts:449 — run-file-execution-policy-service.snapshotCandidate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, error handling 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · telemetry-reader.visitSqliteTelemetryEvents (cognitive 18) · ×1
  • telemetry-reader.visitSqliteTelemetryEvents (cognitive 18) server/src/services/metrics/telemetry-reader.ts:186 — telemetry-reader.visitSqliteTelemetryEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, error handling 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 · run-metrics.computeRunMetrics (cognitive 18) · ×1
  • run-metrics.computeRunMetrics (cognitive 18) server/src/services/metrics/run-metrics.ts:21 — run-metrics.computeRunMetrics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (6 pts), boolean chains 3, loops 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 18 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 · dashboard-metrics.computeTaskCost (cognitive 18) · ×1
  • dashboard-metrics.computeTaskCost (cognitive 18) server/src/services/metrics/dashboard-metrics.ts:706 — dashboard-metrics.computeTaskCost has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 3). 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 literal inside it that branches (line 734). 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-intake-monitor-service.scoreCandidate (cognitive 18) · ×1
  • queue-intake-monitor-service.scoreCandidate (cognitive 18) server/src/services/queue-intake-monitor-service.ts:1168 — queue-intake-monitor-service.scoreCandidate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · time-breakdown-service.eventToBlocks (cognitive 18) · ×1
  • time-breakdown-service.eventToBlocks (cognitive 18) server/src/services/time-breakdown-service.ts:80 — time-breakdown-service.eventToBlocks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 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 · lessons.router.get("/") (cognitive 18) · ×1
  • lessons.router.get("/") (cognitive 18) REDACTED:35 — lessons.router.get("/") has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 4, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · automation-draft-service.parseCronField (cognitive 18) · ×1
  • automation-draft-service.parseCronField (cognitive 18) REDACTED:674 — automation-draft-service.parseCronField has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 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 · knowledge-integrity-service.locatorExists (cognitive 18) · ×1
  • knowledge-integrity-service.locatorExists (cognitive 18) server/src/services/knowledge-integrity-service.ts:234 — knowledge-integrity-service.locatorExists has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 1 (2 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 · harness-conformance-schemas.harnessConformanceSuiteSchema (cognitive 18) · ×1
  • harness-conformance-schemas.harnessConformanceSuiteSchema (cognitive 18) server/src/schemas/harness-conformance-schemas.ts:147 — harness-conformance-schemas.harnessConformanceSuiteSchema has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 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 · SortableListItem.SortableListItem (cognitive 18) · ×1
  • SortableListItem.SortableListItem (cognitive 18) web/src/components/settings/SortableListItem.tsx:29 — SortableListItem.SortableListItem has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, ternaries 3 (nesting depth added 3). Of this number, 9 points are the body's own statements and 9 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 · SecurityTab.SecurityTab (cognitive 18) · ×1
  • SecurityTab.SecurityTab (cognitive 18) web/src/components/settings/tabs/SecurityTab.tsx:29 — SecurityTab.SecurityTab has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 6 (7 pts), if/else 3, error handling 1 (nesting depth added 1). Of this number, 9 points are the body's own statements and 9 belong to 6 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 · WorkflowAuthoringPanel.DryRunResultPanel (cognitive 18) · ×1
  • WorkflowAuthoringPanel.DryRunResultPanel (cognitive 18) web/src/components/workflows/WorkflowAuthoringPanel.tsx:1402 — WorkflowAuthoringPanel.DryRunResultPanel has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 5 (nesting depth added 3). Of this number, 12 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · sqlite-ownership-lock.acquireSqliteOwnershipLease (cognitive 17) · ×1
  • sqlite-ownership-lock.acquireSqliteOwnershipLease (cognitive 17) server/src/storage/sqlite/sqlite-ownership-lock.ts:142 — sqlite-ownership-lock.acquireSqliteOwnershipLease has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (3 pts), error handling 2, 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 · IdentityService.resolveExternalIdentity (cognitive 17) · ×1
  • IdentityService.resolveExternalIdentity (cognitive 17) server/src/services/identity-service.ts:103 — IdentityService.resolveExternalIdentity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 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.
D2 · Cognitive Complexity · CodexAppServerRpcClient.acceptRecord (cognitive 17) · ×1
  • CodexAppServerRpcClient.acceptRecord (cognitive 17) server/src/services/codex-app-server-adapter.ts:455 — CodexAppServerRpcClient.acceptRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, ternaries 2 (6 pts), error handling 2 (4 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 · frontmatter.parseMarkdownFrontmatter (cognitive 17) · ×1
  • frontmatter.parseMarkdownFrontmatter (cognitive 17) server/src/utils/frontmatter.ts:26 — frontmatter.parseMarkdownFrontmatter has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (5 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 · ChatService.sendSquadMessage (cognitive 17) · ×1
  • ChatService.sendSquadMessage (cognitive 17) server/src/services/chat-service.ts:332 — ChatService.sendSquadMessage has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (5 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 · url-validation.validateResolvedHostname (cognitive 17) · ×1
  • url-validation.validateResolvedHostname (cognitive 17) server/src/utils/url-validation.ts:334 — url-validation.validateResolvedHostname has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, 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 · transition-hooks-service.executeAction (cognitive 17) · ×1
  • transition-hooks-service.executeAction (cognitive 17) server/src/services/transition-hooks-service.ts:285 — transition-hooks-service.executeAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, error handling 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 · response-envelope.normalizeErrorBody (cognitive 17) · ×1
  • response-envelope.normalizeErrorBody (cognitive 17) server/src/middleware/response-envelope.ts:74 — response-envelope.normalizeErrorBody has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 3 (5 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 · FileRunOutputArtifactRepository.cleanup (cognitive 17) · ×1
  • FileRunOutputArtifactRepository.cleanup (cognitive 17) server/src/storage/run-output-artifact-repository.ts:183 — FileRunOutputArtifactRepository.cleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), boolean chains 2, ternaries 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 · SqliteOperationalProvenanceRepository.baseQuery (cognitive 17) · ×1
  • SqliteOperationalProvenanceRepository.baseQuery (cognitive 17) server/src/storage/sqlite/provenance-repository.ts:95 — SqliteOperationalProvenanceRepository.baseQuery has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 14 (17 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 · workspace-checkpoint-repository.validResolvedPreview (cognitive 17) · ×1
  • workspace-checkpoint-repository.validResolvedPreview (cognitive 17) server/src/storage/workspace-checkpoint-repository.ts:1876 — workspace-checkpoint-repository.validResolvedPreview 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). 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 · DecisionService.list (cognitive 17) · ×1
  • DecisionService.list (cognitive 17) server/src/services/decision-service.ts:119 — DecisionService.list has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 2. Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 133). 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 · task-envelope-service.readIndexBlobHashes (cognitive 17) · ×1
  • task-envelope-service.readIndexBlobHashes (cognitive 17) server/src/services/task-envelope-service.ts:779 — task-envelope-service.readIndexBlobHashes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 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 · ToolControlPlaneService.acpConfig (cognitive 17) · ×1
  • ToolControlPlaneService.acpConfig (cognitive 17) server/src/services/tool-control-plane-service.ts:832 — ToolControlPlaneService.acpConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (6 pts), loops 1 (nesting depth added 9). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RunLaunchCompiler.buildRunLaunchEnvironment (cognitive 17) · ×1
  • RunLaunchCompiler.buildRunLaunchEnvironment (cognitive 17) server/src/services/run-launch-compiler.ts:1058 — RunLaunchCompiler.buildRunLaunchEnvironment has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 4, if/else 4 (nesting depth added 4). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AttemptLifecycleCoordinator.assertCompletionBinding (cognitive 17) · ×1
  • AttemptLifecycleCoordinator.assertCompletionBinding (cognitive 17) server/src/services/attempt-lifecycle-coordinator.ts:162 — AttemptLifecycleCoordinator.assertCompletionBinding has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 14, if/else 2, 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 · provider-event-evidence.extractProviderEventToolName · ×1
  • provider-event-evidence.extractProviderEventToolName::visit (cognitive 17) server/src/services/provider-event-evidence.ts:99 — provider-event-evidence.extractProviderEventToolName::visit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), boolean chains 3, 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 · admission-queue-scheduler.orderAdmissionQueueEntries (cognitive 17) · ×1
  • admission-queue-scheduler.orderAdmissionQueueEntries (cognitive 17) server/src/services/admission-queue-scheduler.ts:53 — admission-queue-scheduler.orderAdmissionQueueEntries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). Of this number, 9 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 · WorkflowStepExecutor.recordWorkflowGateTrace (cognitive 17) · ×1
  • WorkflowStepExecutor.recordWorkflowGateTrace (cognitive 17) REDACTED:1919 — WorkflowStepExecutor.recordWorkflowGateTrace has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · WorkflowRunService.dispatchQueuedWorkflowRoot (cognitive 17) · ×1
  • WorkflowRunService.dispatchQueuedWorkflowRoot (cognitive 17) REDACTED:855 — WorkflowRunService.dispatchQueuedWorkflowRoot has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 12, if/else 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ClawdbotAgentService.handleCodexSdkAdapterError (cognitive 17) · ×1
  • ClawdbotAgentService.handleCodexSdkAdapterError (cognitive 17) server/src/services/clawdbot-agent-service.ts:4819 — ClawdbotAgentService.handleCodexSdkAdapterError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, ternaries 2 (3 pts), error handling 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 · SummaryService.generateMemoryMarkdown (cognitive 17) · ×1
  • SummaryService.generateMemoryMarkdown (cognitive 17) server/src/services/summary-service.ts:185 — SummaryService.generateMemoryMarkdown has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 205, 197, 218, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · BroadcastStorageService.list (cognitive 17) · ×1
  • BroadcastStorageService.list (cognitive 17) server/src/services/broadcast-storage-service.ts:74 — BroadcastStorageService.list has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, 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 · AnalyticsService.getTimeline (cognitive 17) · ×1
  • AnalyticsService.getTimeline (cognitive 17) server/src/services/analytics-service.ts:43 — AnalyticsService.getTimeline has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5 (6 pts), boolean chains 3 (nesting depth added 2). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · AnalyticsService.calculateAgentUtilization (cognitive 17) · ×1
  • AnalyticsService.calculateAgentUtilization (cognitive 17) server/src/services/analytics-service.ts:421 — AnalyticsService.calculateAgentUtilization has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkflowAuthoringService.lintOutputTargets (cognitive 17) · ×1
  • WorkflowAuthoringService.lintOutputTargets (cognitive 17) server/src/services/workflow-authoring-service.ts:1639 — WorkflowAuthoringService.lintOutputTargets 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). 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 · automation-draft-service.validateBudgets (cognitive 17) · ×1
  • automation-draft-service.validateBudgets (cognitive 17) REDACTED:763 — automation-draft-service.validateBudgets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutomationActivationService.apply (cognitive 17) · ×1
  • AutomationActivationService.apply (cognitive 17) server/src/services/automation-activation-service.ts:254 — AutomationActivationService.apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 1 (nesting depth added 2). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · AcpJsonRpcPeer.acceptRecord (cognitive 17) · ×1
  • AcpJsonRpcPeer.acceptRecord (cognitive 17) shared/src/utils/acp-json-rpc-peer.ts:100 — AcpJsonRpcPeer.acceptRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toaster.Toaster (cognitive 17) · ×1
  • toaster.Toaster (cognitive 17) web/src/components/ui/toaster.tsx:6 — toaster.Toaster has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (7 pts), loops 2, boolean chains 1 (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 15). 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 · AgentsTab.RoutingRulesSection (cognitive 17) · ×1
  • AgentsTab.RoutingRulesSection (cognitive 17) web/src/components/settings/tabs/AgentsTab.tsx:2382 — AgentsTab.RoutingRulesSection has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 4, if/else 3. Of this number, 10 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · NativeSettingsWindow.NativeSettingsWindow (cognitive 17) · ×1
  • NativeSettingsWindow.NativeSettingsWindow (cognitive 17) web/src/components/settings/NativeSettingsWindow.tsx:10 — NativeSettingsWindow.NativeSettingsWindow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, error handling 1 (2 pts), ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 20, 18, 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 · ScoreExplorer.ScoreExplorer (cognitive 17) · ×1
  • ScoreExplorer.ScoreExplorer (cognitive 17) web/src/components/scoring/ScoreExplorer.tsx:30 — ScoreExplorer.ScoreExplorer has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (7 pts), if/else 1 (nesting depth added 1). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 53, 97, 210, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AgentRunTimelinePanel.EventRow (cognitive 17) · ×1
  • AgentRunTimelinePanel.EventRow (cognitive 17) web/src/components/task/AgentRunTimelinePanel.tsx:953 — AgentRunTimelinePanel.EventRow has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, ternaries 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 · prompts.planPromptTemplateImport (cognitive 16) · ×1
  • prompts.planPromptTemplateImport (cognitive 16) cli/src/commands/prompts.ts:339 — prompts.planPromptTemplateImport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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 · queue-monitors.registerQueueMonitorCommands (cognitive 16) · ×1
  • queue-monitors.registerQueueMonitorCommands (cognitive 16) cli/src/commands/queue-monitors.ts:12 — queue-monitors.registerQueueMonitorCommands has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 2 (5 pts), error handling 3, loops 2 (nesting depth added 3). None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 83, 24, 60). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · BOARD-COLOR-EXPLORATION-1301.html.cardMarkup (cognitive 16) · ×1
  • BOARD-COLOR-EXPLORATION-1301.html.cardMarkup (cognitive 16) docs/design/BOARD-COLOR-EXPLORATION-1301.html:486 — BOARD-COLOR-EXPLORATION-1301.html.cardMarkup has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (13 pts), if/else 2, 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 · claude-code-adapter.buildClaudeCodeArgs (cognitive 16) · ×1
  • claude-code-adapter.buildClaudeCodeArgs (cognitive 16) server/src/services/claude-code-adapter.ts:202 — claude-code-adapter.buildClaudeCodeArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · codex-app-server-adapter.collectResourceScope · ×1
  • codex-app-server-adapter.collectResourceScope::visit (cognitive 16) server/src/services/codex-app-server-adapter.ts:867 — codex-app-server-adapter.collectResourceScope::visit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 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 · WorktreeService.adoptLegacyWorktree (cognitive 16) · ×1
  • WorktreeService.adoptLegacyWorktree (cognitive 16) server/src/services/worktree-service.ts:364 — WorktreeService.adoptLegacyWorktree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 1. None of this is in the body itself: all 16 points belong to 5 function literals inside it that branch (lines 375, 366, 435, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into 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 · FileAdmissionReservationRepository.claimOrEnqueue (cognitive 16) · ×1
  • FileAdmissionReservationRepository.claimOrEnqueue (cognitive 16) server/src/storage/admission-reservation-repository.ts:74 — FileAdmissionReservationRepository.claimOrEnqueue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). 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 82, 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 · FileWorkspaceCheckpointRepository.inspectCurrentFile (cognitive 16) · ×1
  • FileWorkspaceCheckpointRepository.inspectCurrentFile (cognitive 16) server/src/storage/workspace-checkpoint-repository.ts:1378 — FileWorkspaceCheckpointRepository.inspectCurrentFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, 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 · filesystem-sandbox-runtime.runtimePackageRoot (cognitive 16) · ×1
  • filesystem-sandbox-runtime.runtimePackageRoot (cognitive 16) server/src/utils/filesystem-sandbox-runtime.ts:450 — filesystem-sandbox-runtime.runtimePackageRoot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 2, error handling 1 (2 pts), loops 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 · RunEventJournalService.append (cognitive 16) · ×1
  • RunEventJournalService.append (cognitive 16) server/src/services/run-event-journal-service.ts:242 — RunEventJournalService.append has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (9 pts), error handling 1 (3 pts), loops 1 (2 pts), boolean chains 1, if/else 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 · RunEventJournalService.subscribe (cognitive 16) · ×1
  • RunEventJournalService.subscribe (cognitive 16) server/src/services/run-event-journal-service.ts:345 — RunEventJournalService.subscribe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (4 pts), boolean chains 1, error handling 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch 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-egress-gateway-service.forwardHeaders (cognitive 16) · ×1
  • run-egress-gateway-service.forwardHeaders (cognitive 16) REDACTED:964 — run-egress-gateway-service.forwardHeaders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · task-envelope-service.parseGitNameStatus (cognitive 16) · ×1
  • task-envelope-service.parseGitNameStatus (cognitive 16) server/src/services/task-envelope-service.ts:707 — task-envelope-service.parseGitNameStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (5 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 · provider-launch-credential-plan-service.compileProviderLaunchCredentialPlan (cognitive 16) · ×1
  • provider-launch-credential-plan-service.compileProviderLaunchCredentialPlan (cognitive 16) server/src/services/provider-launch-credential-plan-service.ts:42 — provider-launch-credential-plan-service.compileProviderLaunchCredentialPlan has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 2, if/else 1 (2 pts), loops 1 (nesting depth added 2). 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: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · RunLaunchManifestService.compile (cognitive 16) · ×1
  • RunLaunchManifestService.compile (cognitive 16) server/src/services/run-launch-manifest-service.ts:109 — RunLaunchManifestService.compile has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 4 (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 · run-approval-broker-service.canonicalizeExactAction (cognitive 16) · ×1
  • run-approval-broker-service.canonicalizeExactAction (cognitive 16) server/src/services/run-approval-broker-service.ts:534 — run-approval-broker-service.canonicalizeExactAction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function 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 · CredentialBrokerService.withCredential (cognitive 16) · ×1
  • CredentialBrokerService.withCredential (cognitive 16) server/src/services/credential-broker-service.ts:555 — CredentialBrokerService.withCredential has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 4 (5 pts), error handling 2, boolean chains 1 (nesting depth added 1). Of this number, 8 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ToolControlPlaneService.compileCredentialBindings (cognitive 16) · ×1
  • ToolControlPlaneService.compileCredentialBindings (cognitive 16) server/src/services/tool-control-plane-service.ts:1105 — ToolControlPlaneService.compileCredentialBindings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider-event-evidence.extractProviderEventPaths · ×1
  • provider-event-evidence.extractProviderEventPaths::visit (cognitive 16) server/src/services/provider-event-evidence.ts:24 — provider-event-evidence.extractProviderEventPaths::visit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, 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 · workspace-checkpoint-diff-service.parseWorkspaceCheckpointUnifiedDiff (cognitive 16) · ×1
  • workspace-checkpoint-diff-service.parseWorkspaceCheckpointUnifiedDiff (cognitive 16) server/src/services/workspace-checkpoint-diff-service.ts:177 — workspace-checkpoint-diff-service.parseWorkspaceCheckpointUnifiedDiff has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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 · RunRecoveryPolicyService.classify (cognitive 16) · ×1
  • RunRecoveryPolicyService.classify (cognitive 16) server/src/services/run-recovery-policy-service.ts:79 — RunRecoveryPolicyService.classify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. 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 · RunRecoveryCoordinator.reconcilePendingRecoveries (cognitive 16) · ×1
  • RunRecoveryCoordinator.reconcilePendingRecoveries (cognitive 16) server/src/services/run-recovery-coordinator.ts:343 — RunRecoveryCoordinator.reconcilePendingRecoveries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 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 · ClawdbotAgentService.persistRestartedProviderCompletion (cognitive 16) · ×1
  • ClawdbotAgentService.persistRestartedProviderCompletion (cognitive 16) server/src/services/clawdbot-agent-service.ts:2846 — ClawdbotAgentService.persistRestartedProviderCompletion has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 4, 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 · ClawdbotAgentService.recordCodexEvent (cognitive 16) · ×1
  • ClawdbotAgentService.recordCodexEvent (cognitive 16) server/src/services/clawdbot-agent-service.ts:7968 — ClawdbotAgentService.recordCodexEvent has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 6, if/else 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 · ChangesService.getChangesSince (cognitive 16) · ×1
  • ChangesService.getChangesSince (cognitive 16) server/src/services/changes-service.ts:18 — ChangesService.getChangesSince has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 2 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillSecurityService.auditWorkflowSkills (cognitive 16) · ×1
  • SkillSecurityService.auditWorkflowSkills (cognitive 16) server/src/services/skill-security-service.ts:961 — SkillSecurityService.auditWorkflowSkills has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 6, boolean chains 2, loops 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 975). 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-security-service.extractSkillReferences · ×1
  • skill-security-service.extractSkillReferences::collect (cognitive 16) server/src/services/skill-security-service.ts:590 — skill-security-service.extractSkillReferences::collect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 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 · buzz-communication-service.parseBuzzInboundEvent (cognitive 16) · ×1
  • buzz-communication-service.parseBuzzInboundEvent (cognitive 16) server/src/services/buzz-communication-service.ts:155 — buzz-communication-service.parseBuzzInboundEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 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 · SqlitePortabilityService.writeHumanReadableBundle (cognitive 16) · ×1
  • SqlitePortabilityService.writeHumanReadableBundle (cognitive 16) server/src/services/sqlite-portability-service.ts:2009 — SqlitePortabilityService.writeHumanReadableBundle has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (11 pts), error handling 1 (2 pts), loops 2, 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 · SqliteKnowledgeCollectionRepository.transitionProposal (cognitive 16) · ×1
  • SqliteKnowledgeCollectionRepository.transitionProposal (cognitive 16) server/src/storage/sqlite/knowledge-collection-repository.ts:487 — SqliteKnowledgeCollectionRepository.transitionProposal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, loops 3, error handling 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeCollectionService.transitionClaim (cognitive 16) · ×1
  • KnowledgeCollectionService.transitionClaim (cognitive 16) server/src/services/knowledge-collection-service.ts:395 — KnowledgeCollectionService.transitionClaim has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FeatureSettingsWrites.flush (cognitive 16) · ×1
  • FeatureSettingsWrites.flush (cognitive 16) web/src/lib/feature-settings-writes.ts:128 — FeatureSettingsWrites.flush has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 1 (2 pts), 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 · UserMenu.UserMenu (cognitive 16) · ×1
  • UserMenu.UserMenu (cognitive 16) web/src/components/layout/UserMenu.tsx:30 — UserMenu.UserMenu has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 2. Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (formatExpiry, a function literal at line 86, handleMenuKeyDown). 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 · useToast.reducer (cognitive 16) · ×1
  • useToast.reducer (cognitive 16) web/src/hooks/useToast.tsx:70 — useToast.reducer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 7). Of this number, 8 points are the body's own statements and 8 belong to 3 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DesktopBottomPanel.DesktopBottomPanel (cognitive 16) · ×1
  • DesktopBottomPanel.DesktopBottomPanel (cognitive 16) web/src/components/layout/DesktopBottomPanel.tsx:38 — DesktopBottomPanel.DesktopBottomPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 5 (7 pts), boolean chains 2 (nesting depth added 2). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (handleResizeKeyDown, handleResizePointerMove, handleResizePointerEnd, …). 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 · AgentsTab.RoutingRuleItem (cognitive 16) · ×1
  • AgentsTab.RoutingRuleItem (cognitive 16) web/src/components/settings/tabs/AgentsTab.tsx:2636 — AgentsTab.RoutingRuleItem has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4, 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 · TemplateComponents.AddTemplateForm (cognitive 16) · ×1
  • TemplateComponents.AddTemplateForm (cognitive 16) web/src/components/settings/tabs/TemplateComponents.tsx:31 — TemplateComponents.AddTemplateForm has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, ternaries 2, if/else 1. 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 (handleSubmit, a function literal at line 114). 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 · ExportDialog.ExportDialog · ×1
  • ExportDialog.ExportDialog::handleExport (cognitive 16) web/src/components/dashboard/ExportDialog.tsx:66 — ExportDialog.ExportDialog::handleExport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 1 (2 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 · ArtifactPreviewModal.PreviewBody (cognitive 16) · ×1
  • ArtifactPreviewModal.PreviewBody (cognitive 16) web/src/components/task/ArtifactPreviewModal.tsx:242 — ArtifactPreviewModal.PreviewBody has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 5, boolean chains 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlockedReasonSection.BlockedReasonSection (cognitive 16) · ×1
  • BlockedReasonSection.BlockedReasonSection (cognitive 16) web/src/components/task/BlockedReasonSection.tsx:45 — BlockedReasonSection.BlockedReasonSection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 3). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (handleNoteChange, handleCategoryChange, 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 · DecisionReviewSessionsSection.DecisionReviewSessionsSection (cognitive 16) · ×1
  • DecisionReviewSessionsSection.DecisionReviewSessionsSection (cognitive 16) web/src/components/task/DecisionReviewSessionsSection.tsx:71 — DecisionReviewSessionsSection.DecisionReviewSessionsSection has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4, ternaries 3 (4 pts) (nesting depth added 1). Of this number, 9 points are the body's own statements and 7 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 · TaskMetricsPanel.AttemptRow (cognitive 16) · ×1
  • TaskMetricsPanel.AttemptRow (cognitive 16) web/src/components/task/TaskMetricsPanel.tsx:123 — TaskMetricsPanel.AttemptRow has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, if/else 2, ternaries 1. 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.
D2 · Cognitive Complexity · useBoardDragDrop.useBoardDragDrop.handleDragEnd (cognitive 16) · ×1
  • useBoardDragDrop.useBoardDragDrop.handleDragEnd (cognitive 16) web/src/hooks/useBoardDragDrop.ts:387 — useBoardDragDrop.useBoardDragDrop.handleDragEnd has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (6 pts), boolean chains 5, if/else 4, 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 · desktop-task-links.desktopTaskLink (cognitive 16) · ×1
  • desktop-task-links.desktopTaskLink (cognitive 16) web/src/lib/desktop-task-links.ts:9 — desktop-task-links.desktopTaskLink has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: migrations.ts → file-storage.ts, interfaces.ts, sqlite-storage.ts server/src/storage/sqlite/migrations.ts — `server/src/storage/sqlite/migrations.ts` changes together with 3 other files — `server/src/storage/file-storage.ts`, `server/src/storage/interfaces.ts`, `server/src/storage/sqlite/sqlite-storage.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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: AuditFileRepository (LCOM4 4) server/src/storage/audit-file-repository.ts:26 — AuditFileRepository's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
IC1 · Incompleteness & stubs · Hollow method · ×1
  • Hollow method — returns a constant without doing the work server/src/services/clawdbot-agent-service.ts:540 — `revokeRun` 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 · Duplication concentrated across 7 sibling directories (87 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (87 clone groups) server/src/types/workflow.ts:10 — 87 duplicated blocks under the repository root have copies in at least two of the sibling directories cli, desktop, mcp, scripts, server, shared (+1 more sibling(s) not listed) — 34 of them are reported below, and 53 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 87 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 87 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 87 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 22 sibling directories (85 clone groups) · ×1
  • Duplication concentrated across 22 sibling directories (85 clone groups) web/src/components/archive/ArchivePage.tsx:272 — 85 duplicated blocks under web/src/components/ have copies in at least two of the sibling directories activity, archive, auth, backlog, board, chat (+16 more sibling(s) not listed) — 48 of them are reported below, and 37 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 85 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 85 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 85 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 6 sibling directories (83 clone groups) · ×1
  • Duplication concentrated across 6 sibling directories (83 clone groups) server/src/services/telemetry-service.ts:164 — 83 duplicated blocks under server/src/ have copies in at least two of the sibling directories config, routes, schemas, services, storage, utils — 51 of them are reported below, and 32 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 83 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 83 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 83 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 (10 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (10 clone groups) web/src/components/layout/DesktopShellContext.tsx:387 — 10 duplicated blocks under web/src/ have copies in at least two of the sibling directories components, contexts, hooks, lib — 6 of them are reported below, and 4 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 10 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 10 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 10 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 2 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 2 sibling directories (5 clone groups) scripts/docs-media/run.mjs:33 — 5 duplicated blocks under scripts/ have copies in at least two of the sibling directories docs-media, native-ui — 4 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 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 · Duplicated block with local edits (248 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (248 matched lines × 2 locations) server/src/types/workflow.ts:10 — server/src/types/workflow.ts:10 · shared/src/types/workflow.ts:8 — the two spans are one implementation copied and then locally edited — 1261 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 (159 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (159 matched lines × 2 locations) web/src/components/dashboard/Dashboard.tsx:279 — web/src/components/dashboard/Dashboard.tsx:279 · web/src/components/dashboard/DashboardPage.tsx:199 — the two spans are one implementation copied and then locally edited — 1095 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 (136 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (136 matched lines × 2 locations) web/src/components/settings/tabs/QueueMonitorsTab.tsx:41 — web/src/components/settings/tabs/QueueMonitorsTab.tsx:41 · web/src/components/settings/tabs/SchedulerTab.tsx:57 — the two spans are one implementation copied and then locally edited — 859 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 (135 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (135 matched lines × 2 locations) web/src/components/archive/ArchivePage.tsx:272 — web/src/components/archive/ArchivePage.tsx:272 · web/src/components/backlog/BacklogPage.tsx:222 — the two spans are one implementation copied and then locally edited — 707 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 (123 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (123 matched lines × 2 locations) server/src/storage/durable-goal-repository.ts:17 — server/src/storage/durable-goal-repository.ts:17 · server/src/storage/run-supervisor-repository.ts:17 — the two spans are one implementation copied and then locally edited — 1084 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 (114 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (114 matched lines × 2 locations) server/src/storage/knowledge-collection-repository.ts:305 — server/src/storage/knowledge-collection-repository.ts:305 · server/src/storage/sqlite/knowledge-collection-repository.ts:332 — the two spans are one implementation copied and then locally edited — 610 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 (108 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (108 matched lines × 2 locations) server/src/storage/run-output-artifact-repository.ts:33 — server/src/storage/run-output-artifact-repository.ts:33 · server/src/storage/sqlite/run-output-artifact-repository.ts:30 — the two spans are one implementation copied and then locally edited — 681 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 (106 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (106 matched lines × 2 locations) server/src/storage/sqlite/api-token-repository.ts:14 — server/src/storage/sqlite/api-token-repository.ts:14 · server/src/storage/sqlite/device-session-repository.ts:63 — the two spans are one implementation copied and then locally edited — 558 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 (104 lines × 2 locations) · ×1
  • Duplicated block (104 lines × 2 locations) server/src/storage/credential-broker-state-lock.ts:17 — server/src/storage/credential-broker-state-lock.ts:17 · server/src/storage/worktree-manifest-lock.ts:17 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block with local edits (101 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (101 matched lines × 2 locations) web/src/components/archive/ArchivePage.tsx:103 — web/src/components/archive/ArchivePage.tsx:103 · web/src/components/backlog/BacklogPage.tsx:67 — the two spans are one implementation copied and then locally edited — 609 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 (100 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (100 matched lines × 2 locations) web/src/components/ui/dialog.tsx:116 — web/src/components/ui/dialog.tsx:116 · web/src/components/ui/sheet.tsx:114 — the two spans are one implementation copied and then locally edited — 485 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 (96 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (96 matched lines × 2 locations) REDACTED:81 — REDACTED:81 · server/src/services/template-service.ts:44 — the two spans are one implementation copied and then locally edited — 626 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 (90 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (90 matched lines × 2 locations) cli/src/commands/backlog.ts:7 — cli/src/commands/backlog.ts:7 · cli/src/commands/sprints.ts:27 — the two spans are one implementation copied and then locally edited — 583 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 (89 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (89 matched lines × 2 locations) server/src/services/telemetry-service.ts:164 — server/src/services/telemetry-service.ts:164 · server/src/storage/sqlite/telemetry-repository.ts:62 — the two spans are one implementation copied and then locally edited — 694 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 (89 lines × 2 locations) · ×1
  • Duplicated block (89 lines × 2 locations) web/src/components/ui/alert-dialog.tsx:12 — web/src/components/ui/alert-dialog.tsx:12 · web/src/components/ui/dialog.tsx:13 — 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 (86 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (86 matched lines × 2 locations) web/src/components/settings/tabs/GeneralTab.tsx:278 — web/src/components/settings/tabs/GeneralTab.tsx:278 · web/src/components/settings/tabs/TemplateComponents.tsx:68 — the two spans are one implementation copied and then locally edited — 417 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 (85 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (85 matched lines × 2 locations) server/src/services/metrics/run-metrics.ts:16 — server/src/services/metrics/run-metrics.ts:16 · server/src/services/metrics/token-metrics.ts:9 — the two spans are one implementation copied and then locally edited — 441 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 (84 lines × 2 locations) · ×1
  • Duplicated block (84 lines × 2 locations) web/src/components/auth/LoginScreen.tsx:53 — web/src/components/auth/LoginScreen.tsx:53 · web/src/components/auth/SetupScreen.tsx:87 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block with local edits (80 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (80 matched lines × 2 locations) web/src/components/dashboard/DurationDrillDown.tsx:65 — web/src/components/dashboard/DurationDrillDown.tsx:65 · web/src/components/dashboard/TokensDrillDown.tsx:67 — the two spans are one implementation copied and then locally edited — 408 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 (78 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (78 matched lines × 2 locations) server/src/storage/sqlite/durable-goal-repository.ts:11 — server/src/storage/sqlite/durable-goal-repository.ts:11 · server/src/storage/sqlite/run-supervisor-repository.ts:11 — the two spans are one implementation copied and then locally edited — 517 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 (75 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (75 matched lines × 2 locations) web/src/components/settings/shared/SettingsErrorBoundary.tsx:8 — web/src/components/settings/shared/SettingsErrorBoundary.tsx:8 · web/src/components/shared/FeatureErrorBoundary.tsx:7 — the two spans are one implementation copied and then locally edited — 374 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 (74 lines × 2 locations) · ×1
  • Duplicated block (74 lines × 2 locations) server/src/services/digest-service.ts:76 — server/src/services/digest-service.ts:76 · web/src/lib/api/digest.ts:4 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
R10 · Code Duplication · Duplicated block with local edits (71 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (71 matched lines × 2 locations) REDACTED:286 — REDACTED:286 · REDACTED:124 — the two spans are one implementation copied and then locally edited — 490 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 (70 lines × 2 locations) · ×1
  • Duplicated block (70 lines × 2 locations) web/src/components/dashboard/Dashboard.tsx:40 — web/src/components/dashboard/Dashboard.tsx:40 · web/src/components/dashboard/DashboardPage.tsx:42 — 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 (69 lines × 2 locations) · ×1
  • Duplicated block (69 lines × 2 locations) REDACTED:307 — REDACTED:307 · REDACTED:579 — 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 (69 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (69 matched lines × 2 locations) server/src/services/status-history-service.ts:144 — server/src/services/status-history-service.ts:144 · server/src/storage/sqlite/status-history-repository.ts:119 — the two spans are one implementation copied and then locally edited — 415 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 (66 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (66 matched lines × 2 locations) web/src/components/board/BoardSidebar.tsx:88 — web/src/components/board/BoardSidebar.tsx:88 · web/src/components/shared/AgentStatusIndicator.tsx:136 — the two spans are one implementation copied and then locally edited — 558 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 startReservedAgent (cyclomatic 152, cognitive 192) · ×1
  • Complex function startReservedAgent (cyclomatic 152, cognitive 192) server/src/services/clawdbot-agent-service.ts:1384 — startReservedAgent has cyclomatic complexity 152 and cognitive complexity 192; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 buildNeedsAttentionItems (cyclomatic 134, cognitive 191) · ×1
  • Complex function buildNeedsAttentionItems (cyclomatic 134, cognitive 191) web/src/components/dashboard/NeedsAttentionQueue.tsx:283 — buildNeedsAttentionItems has cyclomatic complexity 134 and cognitive complexity 191; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 compile (cyclomatic 126, cognitive 125) · ×1
  • Complex function compile (cyclomatic 126, cognitive 125) server/src/services/run-launch-compiler.ts:138 — compile has cyclomatic complexity 126 and cognitive complexity 125; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 TaskCard (cyclomatic 100, cognitive 79) · ×1
  • Complex function TaskCard (cyclomatic 100, cognitive 79) web/src/components/task/TaskCard.tsx:195 — TaskCard has cyclomatic complexity 100 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 98, cognitive 174) · ×1
  • Complex function (anonymous) (cyclomatic 98, cognitive 174) server/src/services/task-service.ts:908 — (anonymous) has cyclomatic complexity 98 and cognitive complexity 174; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 TaskWorkView (cyclomatic 90, cognitive 68) · ×1
  • Complex function TaskWorkView (cyclomatic 90, cognitive 68) web/src/components/task/TaskWorkView.tsx:425 — TaskWorkView has cyclomatic complexity 90 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 project (cyclomatic 87, cognitive 72) · ×1
  • Complex function project (cyclomatic 87, cognitive 72) server/src/services/run-access-summary-service.ts:164 — project has cyclomatic complexity 87 and cognitive complexity 72; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 buildAgentRunTimelineEvents (cyclomatic 85, cognitive 116) · ×1
  • Complex function buildAgentRunTimelineEvents (cyclomatic 85, cognitive 116) web/src/components/task/AgentRunTimelinePanel.tsx:531 — buildAgentRunTimelineEvents has cyclomatic complexity 85 and cognitive complexity 116; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 areTaskCardPropsEqual (cyclomatic 84, cognitive 136) · ×1
  • Complex function areTaskCardPropsEqual (cyclomatic 84, cognitive 136) web/src/components/task/TaskCard.tsx:84 — areTaskCardPropsEqual has cyclomatic complexity 84 and cognitive complexity 136; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 AgentPanel (cyclomatic 84, cognitive 64) · ×1
  • Complex function AgentPanel (cyclomatic 84, cognitive 64) web/src/components/task/AgentPanel.tsx:77 — AgentPanel has cyclomatic complexity 84 and cognitive complexity 64; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 74, cognitive 96) · ×1
  • Complex function main (cyclomatic 74, cognitive 96) scripts/validate-release.mjs:469 — main has cyclomatic complexity 74 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function admitInternal (cyclomatic 74, cognitive 81) · ×1
  • Complex function admitInternal (cyclomatic 74, cognitive 81) server/src/services/admission-control-service.ts:698 — admitInternal has cyclomatic complexity 74 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 mediaEvidenceFailures (cyclomatic 71, cognitive 83) · ×1
  • Complex function mediaEvidenceFailures (cyclomatic 71, cognitive 83) scripts/docs-media/verify.mjs:62 — mediaEvidenceFailures has cyclomatic complexity 71 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function evidenceFailures (cyclomatic 68, cognitive 81) · ×1
  • Complex function evidenceFailures (cyclomatic 68, cognitive 81) scripts/native-ui/contract.mjs:229 — evidenceFailures has cyclomatic complexity 68 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 AgentRunTimelinePanel (cyclomatic 65, cognitive 52) · ×1
  • Complex function AgentRunTimelinePanel (cyclomatic 65, cognitive 52) web/src/components/task/AgentRunTimelinePanel.tsx:1094 — AgentRunTimelinePanel has cyclomatic complexity 65 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 rewindLocked (cyclomatic 61, cognitive 42) · ×1
  • Complex function rewindLocked (cyclomatic 61, cognitive 42) server/src/storage/workspace-checkpoint-repository.ts:701 — rewindLocked has cyclomatic complexity 61 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 58, cognitive 59) · ×1
  • Complex function (anonymous) (cyclomatic 58, cognitive 59) server/src/services/automation-activation-service.ts:497 — (anonymous) has cyclomatic complexity 58 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function NotificationsTab (cyclomatic 55, cognitive 51) · ×1
  • Complex function NotificationsTab (cyclomatic 55, cognitive 51) web/src/components/settings/tabs/NotificationsTab.tsx:179 — NotificationsTab has cyclomatic complexity 55 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 exercise (cyclomatic 54, cognitive 92) · ×1
  • Complex function exercise (cyclomatic 54, cognitive 92) scripts/native-ui/run.mjs:275 — exercise has cyclomatic complexity 54 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleStepFailure (cyclomatic 54, cognitive 70) · ×1
  • Complex function handleStepFailure (cyclomatic 54, cognitive 70) REDACTED:1849 — handleStepFailure has cyclomatic complexity 54 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 runDoctorChecks (cyclomatic 54, cognitive 68) · ×1
  • Complex function runDoctorChecks (cyclomatic 54, cognitive 68) cli/src/commands/doctor.ts:697 — runDoctorChecks has cyclomatic complexity 54 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 classifyCodexAppServerServerRequest (cyclomatic 52, cognitive 82) · ×1
  • Complex function classifyCodexAppServerServerRequest (cyclomatic 52, cognitive 82) server/src/services/codex-app-server-adapter.ts:622 — classifyCodexAppServerServerRequest has cyclomatic complexity 52 and cognitive complexity 82; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 TaskDetailPanel (cyclomatic 51, cognitive 37) · ×1
  • Complex function TaskDetailPanel (cyclomatic 51, cognitive 37) web/src/components/task/TaskDetailPanel.tsx:81 — TaskDetailPanel has cyclomatic complexity 51 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 evaluateHarnessSupportStatus (cyclomatic 50, cognitive 48) · ×1
  • Complex function evaluateHarnessSupportStatus (cyclomatic 50, cognitive 48) server/src/services/harness-support-service.ts:66 — evaluateHarnessSupportStatus has cyclomatic complexity 50 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 50, cognitive 45) · ×1
  • Complex function (anonymous) (cyclomatic 50, cognitive 45) server/src/schemas/run-launch-manifest-schemas.ts:429 — (anonymous) has cyclomatic complexity 50 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 WorktreeStatus (cyclomatic 50, cognitive 43) · ×1
  • Complex function WorktreeStatus (cyclomatic 50, cognitive 43) web/src/components/task/git/WorktreeStatus.tsx:37 — WorktreeStatus has cyclomatic complexity 50 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 RunSessionShareView (cyclomatic 49, cognitive 41) · ×1
  • Complex function RunSessionShareView (cyclomatic 49, cognitive 41) web/src/components/task/RunSessionSharesSection.tsx:212 — RunSessionShareView has cyclomatic complexity 49 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 validateCoveragePolicy (cyclomatic 48, cognitive 68) · ×1
  • Complex function validateCoveragePolicy (cyclomatic 48, cognitive 68) scripts/check-coverage-policy.mjs:56 — validateCoveragePolicy has cyclomatic complexity 48 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 lintDefinition (cyclomatic 47, cognitive 65) · ×1
  • Complex function lintDefinition (cyclomatic 47, cognitive 65) server/src/services/workflow-authoring-service.ts:1096 — lintDefinition has cyclomatic complexity 47 and cognitive complexity 65; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function normalizeHarnessSupportProfile (cyclomatic 47, cognitive 56) · ×1
  • Complex function normalizeHarnessSupportProfile (cyclomatic 47, cognitive 56) server/src/services/harness-support-profile-registry.ts:301 — normalizeHarnessSupportProfile has cyclomatic complexity 47 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 handleKeyDown (cyclomatic 47, cognitive 36) · ×1
  • Complex function handleKeyDown (cyclomatic 47, cognitive 36) web/src/hooks/useKeyboard.tsx:119 — handleKeyDown has cyclomatic complexity 47 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 aggregateMetrics (cyclomatic 46, cognitive 66) · ×1
  • Complex function aggregateMetrics (cyclomatic 46, cognitive 66) web/src/hooks/useTaskMetrics.ts:52 — aggregateMetrics has cyclomatic complexity 46 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function Header (cyclomatic 45, cognitive 44) · ×1
  • Complex function Header (cyclomatic 45, cognitive 44) web/src/components/layout/Header.tsx:141 — Header has cyclomatic complexity 45 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 buildDefaultChecks (cyclomatic 45, cognitive 41) · ×1
  • Complex function buildDefaultChecks (cyclomatic 45, cognitive 41) shared/src/utils/task-readiness.ts:56 — buildDefaultChecks has cyclomatic complexity 45 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 KanbanBoard (cyclomatic 45, cognitive 37) · ×1
  • Complex function KanbanBoard (cyclomatic 45, cognitive 37) web/src/components/board/KanbanBoard.tsx:111 — KanbanBoard has cyclomatic complexity 45 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 executeRun (cyclomatic 44, cognitive 94) · ×1
  • Complex function executeRun (cyclomatic 44, cognitive 94) REDACTED:1553 — executeRun has cyclomatic complexity 44 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 is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 44, cognitive 70) · ×1
  • Complex function (anonymous) (cyclomatic 44, cognitive 70) server/src/services/worktree-service.ts:799 — (anonymous) has cyclomatic complexity 44 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 capture (cyclomatic 41, cognitive 55) · ×1
  • Complex function capture (cyclomatic 41, cognitive 55) server/src/storage/workspace-checkpoint-repository.ts:204 — capture has cyclomatic complexity 41 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 planTaskRecovery (cyclomatic 41, cognitive 39) · ×1
  • Complex function planTaskRecovery (cyclomatic 41, cognitive 39) server/src/services/run-recovery-coordinator.ts:482 — planTaskRecovery has cyclomatic complexity 41 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 itemKind (cyclomatic 40, cognitive 34) · ×1
  • Complex function itemKind (cyclomatic 40, cognitive 34) server/src/services/provider-run-event-mappers.ts:119 — itemKind has cyclomatic complexity 40 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 · server/src/services/clawdbot-agent-service.ts · ×1
  • server/src/services/clawdbot-agent-service.ts: 9225 lines of code server/src/services/clawdbot-agent-service.ts:1 — server/src/services/clawdbot-agent-service.ts has 9225 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 · web/src/components/settings/tabs/AgentsTab.tsx · ×1
  • web/src/components/settings/tabs/AgentsTab.tsx: 2987 lines of code web/src/components/settings/tabs/AgentsTab.tsx:1 — web/src/components/settings/tabs/AgentsTab.tsx has 2987 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: 2639 lines of code REDACTED:1 — REDACTED has 2639 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 · server/src/services/communication-adapter-service.ts · ×1
  • server/src/services/communication-adapter-service.ts: 2333 lines of code server/src/services/communication-adapter-service.ts:1 — server/src/services/communication-adapter-service.ts has 2333 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · server/src/services/knowledge-collection-service.ts · ×1
  • server/src/services/knowledge-collection-service.ts: 2202 lines of code server/src/services/knowledge-collection-service.ts:1 — server/src/services/knowledge-collection-service.ts has 2202 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 · server/src/services/admission-control-service.ts · ×1
  • server/src/services/admission-control-service.ts: 2177 lines of code server/src/services/admission-control-service.ts:1 — server/src/services/admission-control-service.ts has 2177 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 · server/src/services/sqlite-portability-service.ts · ×1
  • server/src/services/sqlite-portability-service.ts: 2078 lines of code server/src/services/sqlite-portability-service.ts:1 — server/src/services/sqlite-portability-service.ts has 2078 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: 2036 lines of code REDACTED:1 — REDACTED has 2036 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 · server/src/services/task-service.ts · ×1
  • server/src/services/task-service.ts: 2011 lines of code server/src/services/task-service.ts:1 — server/src/services/task-service.ts has 2011 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 · server/src/services/worktree-service.ts · ×1
  • server/src/services/worktree-service.ts: 1953 lines of code server/src/services/worktree-service.ts:1 — server/src/services/worktree-service.ts has 1953 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 · server/src/storage/workspace-checkpoint-repository.ts · ×1
  • server/src/storage/workspace-checkpoint-repository.ts: 1943 lines of code server/src/storage/workspace-checkpoint-repository.ts:1 — server/src/storage/workspace-checkpoint-repository.ts has 1943 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 · server/src/services/workflow-authoring-service.ts · ×1
  • server/src/services/workflow-authoring-service.ts: 1833 lines of code server/src/services/workflow-authoring-service.ts:1 — server/src/services/workflow-authoring-service.ts has 1833 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: 1799 lines of code REDACTED:1 — REDACTED has 1799 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 · server/src/services/tool-control-plane-service.ts · ×1
  • server/src/services/tool-control-plane-service.ts: 1753 lines of code server/src/services/tool-control-plane-service.ts:1 — server/src/services/tool-control-plane-service.ts has 1753 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 · web/src/components/task/AgentRunTimelinePanel.tsx · ×1
  • web/src/components/task/AgentRunTimelinePanel.tsx: 1735 lines of code web/src/components/task/AgentRunTimelinePanel.tsx:1 — web/src/components/task/AgentRunTimelinePanel.tsx has 1735 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 · server/src/services/credential-broker-service.ts · ×1
  • server/src/services/credential-broker-service.ts: 1614 lines of code server/src/services/credential-broker-service.ts:1 — server/src/services/credential-broker-service.ts has 1614 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 · server/src/storage/sqlite/migrations.ts · ×1
  • server/src/storage/sqlite/migrations.ts: 1477 lines of code server/src/storage/sqlite/migrations.ts:1 — server/src/storage/sqlite/migrations.ts has 1477 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 · web/src/components/workflows/WorkflowAuthoringPanel.tsx · ×1
  • web/src/components/workflows/WorkflowAuthoringPanel.tsx: 1464 lines of code web/src/components/workflows/WorkflowAuthoringPanel.tsx:1 — web/src/components/workflows/WorkflowAuthoringPanel.tsx has 1464 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 · server/src/services/buzz-definition-import-service.ts · ×1
  • server/src/services/buzz-definition-import-service.ts: 1352 lines of code server/src/services/buzz-definition-import-service.ts:1 — server/src/services/buzz-definition-import-service.ts has 1352 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 · server/src/services/queue-intake-monitor-service.ts · ×1
  • server/src/services/queue-intake-monitor-service.ts: 1337 lines of code server/src/services/queue-intake-monitor-service.ts:1 — server/src/services/queue-intake-monitor-service.ts has 1337 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 · server/src/services/search-service.ts · ×1
  • server/src/services/search-service.ts: 1316 lines of code server/src/services/search-service.ts:1 — server/src/services/search-service.ts has 1316 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: 1263 lines of code REDACTED:1 — REDACTED has 1263 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 · server/src/services/run-launch-compiler.ts · ×1
  • server/src/services/run-launch-compiler.ts: 1209 lines of code server/src/services/run-launch-compiler.ts:1 — server/src/services/run-launch-compiler.ts has 1209 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 · web/src/components/settings/tabs/MultiUserTab.tsx · ×1
  • web/src/components/settings/tabs/MultiUserTab.tsx: 1206 lines of code web/src/components/settings/tabs/MultiUserTab.tsx:1 — web/src/components/settings/tabs/MultiUserTab.tsx has 1206 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 · cli/src/commands/agents.ts · ×1
  • cli/src/commands/agents.ts: 1188 lines of code cli/src/commands/agents.ts:1 — cli/src/commands/agents.ts has 1188 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 · server/src/services/run-terminal-service.ts · ×1
  • server/src/services/run-terminal-service.ts: 1164 lines of code server/src/services/run-terminal-service.ts:1 — server/src/services/run-terminal-service.ts has 1164 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: 1134 lines of code REDACTED:1 — REDACTED has 1134 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: 1110 lines of code REDACTED:1 — REDACTED has 1110 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 · server/src/storage/sqlite/journal-maintenance-service.ts · ×1
  • server/src/storage/sqlite/journal-maintenance-service.ts: 1110 lines of code server/src/storage/sqlite/journal-maintenance-service.ts:1 — server/src/storage/sqlite/journal-maintenance-service.ts has 1110 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 · server/src/services/automation-activation-service.ts · ×1
  • server/src/services/automation-activation-service.ts: 1088 lines of code server/src/services/automation-activation-service.ts:1 — server/src/services/automation-activation-service.ts has 1088 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 · server/src/storage/knowledge-collection-repository.ts · ×1
  • server/src/storage/knowledge-collection-repository.ts: 1088 lines of code server/src/storage/knowledge-collection-repository.ts:1 — server/src/storage/knowledge-collection-repository.ts has 1088 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 · web/src/components/dashboard/NeedsAttentionQueue.tsx · ×1
  • web/src/components/dashboard/NeedsAttentionQueue.tsx: 1086 lines of code web/src/components/dashboard/NeedsAttentionQueue.tsx:1 — web/src/components/dashboard/NeedsAttentionQueue.tsx has 1086 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 · server/src/services/skill-security-service.ts · ×1
  • server/src/services/skill-security-service.ts: 1081 lines of code server/src/services/skill-security-service.ts:1 — server/src/services/skill-security-service.ts has 1081 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 · server/src/services/filesystem-sandbox-service.ts · ×1
  • server/src/services/filesystem-sandbox-service.ts: 1076 lines of code server/src/services/filesystem-sandbox-service.ts:1 — server/src/services/filesystem-sandbox-service.ts has 1076 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 · server/src/services/digest-service.ts · ×1
  • server/src/services/digest-service.ts: 1072 lines of code server/src/services/digest-service.ts:1 — server/src/services/digest-service.ts has 1072 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/src/components/task/TaskWorkView.tsx · ×1
  • web/src/components/task/TaskWorkView.tsx: 1061 lines of code web/src/components/task/TaskWorkView.tsx:1 — web/src/components/task/TaskWorkView.tsx has 1061 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: 1040 lines of code REDACTED:1 — REDACTED has 1040 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 · server/src/services/scheduler-service.ts · ×1
  • server/src/services/scheduler-service.ts: 996 lines of code server/src/services/scheduler-service.ts:1 — server/src/services/scheduler-service.ts has 996 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 · web/src/components/policies/PolicyManager.tsx · ×1
  • web/src/components/policies/PolicyManager.tsx: 979 lines of code web/src/components/policies/PolicyManager.tsx:1 — web/src/components/policies/PolicyManager.tsx has 979 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: 970 lines of code REDACTED:1 — REDACTED has 970 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~579 LoC) · ×1
  • Dead file (~579 LoC) shared/src/types/task.types.ts — no import path from any entry point (269 application, 61 tooling, 661 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 (~53 LoC) · ×1
  • Dead file (~53 LoC) scripts/desktop-after-pack.mjs — no import path from any entry point (269 application, 61 tooling, 661 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (desktop/scripts/desktop-after-pack.mjs) — 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 (~19 LoC) · ×1
  • Dead file (~19 LoC) server/src/schemas/index.ts — no import path from any entry point (269 application, 61 tooling, 661 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 (~1 LoC) · ×1
  • Dead file (~1 LoC) desktop/scripts/desktop-after-pack.mjs — no import path from any entry point (269 application, 61 tooling, 661 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
S1 · Web-Security Posture · Weak hash algorithm · ×1
  • Weak hash algorithm server/src/services/skill-security-service.ts:709 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
X14 · Bypassable address classification · IP classification is bypassable through an IPv4-in-IPv6 embedding · ×1
  • IP classification is bypassable through an IPv4-in-IPv6 embedding server/src/services/egress-policy-service.ts:300 — This function unwraps IPv4-MAPPED IPv6 (`::ffff:`, line 283) and then rejects `10.0.0.0/8` on its IPv4 path — but the IPv6 decision at line 300 classifies the address as written, and IPv4 reaches IPv6 through three MORE embeddings this function never mentions: IPv4-compatible (`::a.b.c.d`), 6to4 (`2002::/16`) and NAT64 (`64:ff9b::/96`). So `::10.0.0.1`, `2002:0a00:0001::` and `64:ff9b::10.0.0.0` all name a host inside `10.0.0.0/8` — the range this same function declares non-public — and all reach the IPv6 decision un-unwrapped, taking the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright.
X2 · Cancellation propagation · Async function without AbortSignal · ×1
  • Async function without AbortSignal: waitForReady desktop/src/main/runtime.ts:130 — `waitForReady` 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 })`.
X25 · Inert configuration knob · Option is kept and never read · ×1
  • Option is kept and never read server/src/services/activity-service.ts:84 — `ActivityService` accepts `options.activityFile` from the caller and keeps it in `this.activityFile` on line 84, where only it can read the value — but nothing ever reads `this.activityFile`. Setting `options.activityFile` therefore changes nothing: every caller gets the same behaviour whatever they pass, and nothing reports that the option was ignored. Read `this.activityFile` where the behaviour it configures is decided — or, if the behaviour genuinely is fixed, remove `options.activityFile` from the accepted options so callers stop setting a knob that does nothing.
Minor — 300 finding(s)
D24 · Comment Value · redundant comment · ×100
  • redundant comment cli/src/commands/agent-status.ts:17 — "Get current agent status" repeats the code it sits on: 4 of its 4 words (get, current, agent, status) are already in `agent`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/agent-status.ts:61 — "Set working status" repeats the code it sits on: 3 of its 3 words (set, working, status) are already in `agent`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/agent-status.ts:94 — "Set idle status" repeats the code it sits on: 3 of its 3 words (set, idle, status) are already in `agent`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/agent-status.ts:117 — "Set sub-agent status" repeats the code it sits on: 4 of its 4 words (set, sub, agent, status) are already in `agent`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/agents.ts:206 — "Start agent on task" repeats the code it sits on: 3 of its 3 words (start, agent, task) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/agents.ts:1209 — "Get agent status for a task" repeats the code it sits on: 4 of its 4 words (get, agent, status, task) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/automation.ts:9 — "List pending automation tasks" repeats the code it sits on: 4 of its 4 words (list, pending, automation, tasks) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/automation.ts:33 — "List running automation tasks" repeats the code it sits on: 4 of its 4 words (list, running, automation, tasks) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/automation.ts:57 — "Start automation task (for Veritas to call)" repeats the code it sits on: 5 of its 5 words (start, automation, task, veritas, call) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/automation.ts:99 — "Complete automation task" repeats the code it sits on: 3 of its 3 words (complete, automation, task) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/backlog.ts:10 — 6 comments in this file only repeat the code they sit on (lines 10, 43, 77, 100, 123, 153), for example "List backlog tasks". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/github.ts:31 — "vk github sync — trigger manual sync" repeats the code it sits on: 4 of its 5 words (github, sync, trigger, manual) are already in `github`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/github.ts:58 — "vk github status — show sync status" repeats the code it sits on: 4 of its 5 words (github, status, show, sync) are already in `github`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/github.ts:86 — "vk github config — show or update sync configuration" repeats the code it sits on: 6 of its 7 words (github, config, show, update, sync, configuration) are already in `github`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/notifications.ts:77 — "Get pending notifications" repeats the code it sits on: 3 of its 3 words (get, pending, notifications) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/sprints.ts:170 — "Show sprints ready to archive" repeats the code it sits on: 4 of its 4 words (show, sprints, ready, archive) are already in `sprint`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/sprints.ts:199 — "Close sprint (archive all done tasks)" repeats the code it sits on: 4 of its 4 words (close, sprint, archive, tasks) are already in `sprint`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/summary.ts:105 — "Get memory-formatted summary" repeats the code it sits on: 4 of its 4 words (get, memory, formatted, summary) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/tasks.ts:54 — "Show task details" repeats the code it sits on: 3 of its 3 words (show, task, details) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/time.ts:71 — "Add manual time entry" repeats the code it sits on: 4 of its 4 words (add, manual, time, entry) are already in `time`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/time.ts:106 — "Show time tracking data" repeats the code it sits on: 4 of its 4 words (show, time, tracking, data) are already in `time`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/workflow.ts:14 — "vk begin <id> — Start working on a task" repeats the code it sits on: 5 of its 6 words (begin, id, start, working, task) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/workflow.ts:72 — "vk done <id> "summary" — Complete a task" repeats the code it sits on: 4 of its 5 words (id, summary, complete, task) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment cli/src/commands/workflow.ts:144 — "vk block <id> "reason" — Block a task" repeats the code it sits on: 4 of its 5 words (block, id, reason, task) are already in `program`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment e2e/settings.spec.ts:76 — "Click on the Board tab" repeats the code it sits on: 3 of its 3 words (click, board, tab) are already in `await dialog.getByRole('tab', { name: 'Board' }).click();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 75 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate server/src/storage/run-output-artifact-repository.ts:129 — `!Number.isInteger(query.length) || query.length < 1 || query.length > MAX_RANGE_BYTES` appears character-identically in 2 files — server/src/storage/run-output-artifact-repository.ts, server/src/storage/sqlite/run-output-artifact-repository.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 server/src/storage/run-output-artifact-repository.ts:126 — `!Number.isInteger(query.offset) || query.offset < 0` appears character-identically in 2 files — server/src/storage/run-output-artifact-repository.ts, server/src/storage/sqlite/run-output-artifact-repository.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 server/src/services/run-approval-broker-service.ts:545 — `!candidate || typeof candidate !== 'object'` appears character-identically in 2 files — server/src/services/run-approval-broker-service.ts, server/src/services/run-output-spill-service.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 server/src/storage/admission-reservation-repository.ts:578 — `!current || snapshot.revision > current.revision` appears character-identically in 5 files — server/src/storage/admission-reservation-repository.ts, server/src/storage/durable-goal-repository.ts, server/src/storage/reflection-extraction-job-repository.ts, server/src/storage/run-approval-repository.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 web/src/lib/template-schema.js:90 — `!data.blueprint || data.blueprint.length === 0` appears character-identically in 2 files — web/src/lib/template-schema.js, web/src/lib/template-schema.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 server/src/storage/dependency-circuit-override-repository.ts:63 — `!directoryStat.isDirectory() || directoryStat.isSymbolicLink()` appears character-identically in 2 files — server/src/storage/dependency-circuit-override-repository.ts, server/src/storage/dependency-circuit-state-repository.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 server/src/storage/reflection-state-repository.ts:75 — `!directoryStats.isDirectory() || directoryStats.isSymbolicLink()` appears character-identically in 2 files — server/src/storage/reflection-state-repository.ts, server/src/storage/transition-hooks-config-repository.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 server/src/services/api-token-service.ts:251 — `!membership || membership.status !== 'active' || membership.disabledAt` appears character-identically in 2 files — server/src/services/api-token-service.ts, server/src/services/device-session-service.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 server/src/services/run-output-artifact-service.ts:139 — `!metadata || metadata.state !== 'available'` appears character-identically in 3 files — server/src/services/run-output-artifact-service.ts, server/src/storage/run-output-artifact-repository.ts, server/src/storage/work-product-artifact-repository.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 server/src/services/acp-stdio-adapter.ts:801 — `!normalized || normalized.length > maxLength || containsControlCharacter` appears character-identically in 3 files — server/src/services/acp-stdio-adapter.ts, server/src/services/claude-code-adapter.ts, server/src/services/codex-app-server-adapter.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 cli/src/commands/scheduler.ts:351 — `!parsed || typeof parsed !== 'object' || Array.isArray(parsed)` appears character-identically in 5 files — cli/src/commands/scheduler.ts, server/src/services/claude-code-adapter.ts, server/src/services/clawdbot-agent-service.ts, server/src/services/codex-app-server-adapter.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 server/src/services/agent-budget-service.ts:98 — `!policy || policy.enabled === false || !policy.limits` appears character-identically in 2 files — server/src/services/agent-budget-service.ts, server/src/services/run-launch-compiler.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 server/src/services/clawdbot-agent-service.ts:9364 — `!policy || policy.enabled === false || !policy.limits || Object.keys(policy.limits).length === 0` appears character-identically in 2 files — server/src/services/clawdbot-agent-service.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 server/src/services/feedback-service.ts:190 — `!query.category || item.categories.includes(query.category)` appears character-identically in 2 files — server/src/services/feedback-service.ts, server/src/storage/sqlite/governance-repositories.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 server/src/services/admission-control-service.ts:1180 — `!query.workspaceId || entry.request.workspaceId === query.workspaceId` appears character-identically in 2 files — server/src/services/admission-control-service.ts, server/src/storage/admission-reservation-repository.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 server/runtime/run-tool-bridge.mjs:72 — `!record || typeof record !== 'object' || Array.isArray(record)` appears character-identically in 2 files — server/runtime/run-tool-bridge.mjs, server/src/services/tool-control-plane-service.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 server/src/services/filesystem-sandbox-service.ts:886 — `!relative || relative.startsWith('..') || path.isAbsolute(relative)` appears character-identically in 2 files — server/src/services/filesystem-sandbox-service.ts, server/src/utils/filesystem-sandbox-runtime.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 server/src/services/provider-event-evidence.ts:159 — `!segment || segment === '.' || segment === '..'` appears character-identically in 4 files — server/src/services/provider-event-evidence.ts, server/src/services/run-file-provenance-service.ts, server/src/services/work-product-artifact-service.ts, server/src/storage/work-product-artifact-repository.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 server/src/storage/admission-reservation-repository.ts:438 — `!stat.isDirectory() || stat.isSymbolicLink()` appears character-identically in 10 files — server/src/storage/admission-reservation-repository.ts, server/src/storage/durable-goal-repository.ts, server/src/storage/knowledge-collection-repository.ts, server/src/storage/phase-transition-repository.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 server/src/storage/durable-goal-repository.ts:52 — `!stateFilter || stateFilter.has(record.state)` appears character-identically in 2 files — server/src/storage/durable-goal-repository.ts, server/src/storage/run-supervisor-repository.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 server/src/storage/agent-permission-repository.ts:107 — `!stats.isDirectory() || stats.isSymbolicLink()` appears character-identically in 13 files — server/src/storage/agent-permission-repository.ts, server/src/storage/broadcast-repository.ts, server/src/storage/ceremony-state-repository.ts, server/src/storage/chat-repository.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 server/src/storage/workflow-definition-repository.ts:182 — `!stats.isFile() || stats.size > maximumBytes` appears character-identically in 2 files — server/src/storage/workflow-definition-repository.ts, server/src/storage/workflow-execution-file-repository.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 server/src/services/clawdbot-agent-service.ts:4964 — `!task || task.attempt?.id !== binding.attemptId || task.attempt.completionResult || task.attempt.status !== 'running'` appears character-identically in 2 files — server/src/services/clawdbot-agent-service.ts, server/src/services/openclaw-completion-service.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 server/src/storage/knowledge-collection-repository.ts:443 — `!upsertIds.has(page.id) && !deleteIds.has(page.id)` appears character-identically in 2 files — server/src/storage/knowledge-collection-repository.ts, server/src/storage/sqlite/knowledge-collection-repository.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 server/runtime/run-tool-bridge.mjs:187 — `!value || typeof value !== 'object' || Array.isArray(value)` appears character-identically in 4 files — server/runtime/run-tool-bridge.mjs, server/src/services/acp-stdio-adapter.ts, server/src/storage/scheduler-state-repository.ts, server/src/utils/frontmatter.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.
X4 · Structured logging · Interpolated log message defeats structured logging · ×34
  • Interpolated log message defeats structured logging REDACTED:164 — `info` at line 164 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:577 — `info` at line 577 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:1378 — `warn` at line 1378 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:1388 — `warn` at line 1388 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/utils/migrate-legacy-files.ts:44 — `info` at line 44 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/utils/migrate-legacy-files.ts:48 — `warn` at line 48 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/storage/append-activity-repository.ts:315 — `debug` at line 315 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/agent-registry-service.ts:243 — `info` at line 243 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/agent-routing-service.ts:331 — `info` at line 331 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/agent-routing-service.ts:377 — `info` at line 377 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/agent-routing-service.ts:459 — `warn` at line 459 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/agent-routing-service.ts:486 — `warn` at line 486 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/agent-routing-service.ts:492 — `info` at line 492 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/attachment-service.ts:66 — `error` at line 66 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/clawdbot-agent-service.ts:2639 — `info` at line 2639 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/diff-service.ts:249 — `warn` at line 249 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/failure-alert-service.ts:133 — `info` at line 133 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/failure-alert-service.ts:167 — `info` at line 167 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/failure-alert-service.ts:173 — `error` at line 173 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/failure-alert-service.ts:232 — `warn` at line 232 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/migration-service.ts:62 — `info` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/project-service.ts:103 — `info` at line 103 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:178 — `error` at line 178 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:380 — `error` at line 380 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging server/src/services/sprint-service.ts:87 — `info` at line 87 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • + 9 more in this group — see findings.md.
X7 · Silent fallback defaults · Pending state with no failure state · ×19
  • Pending state with no failure state web/src/components/task/DecisionReviewSessionsSection.tsx:241 — The view draws `Loading decision reviews...` 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 web/src/components/task/GitSection.tsx:29 — The view draws `Git Integration Loading...` under `configLoading`, but `configLoading` 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 web/src/components/task/RunModeGateSection.tsx:245 — The view draws `<Loader2 class="h-3 w-3 animate-spin"/>` under `isSaving`, but `isSaving` 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 web/src/components/task/RunModeGateSection.tsx:267 — The view draws `<Loader2 class="h-3 w-3 animate-spin"/>` under `isSaving`, but `isSaving` 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 web/src/components/task/git/GitSelectionForm.tsx:133 — The view draws `Loading branches...` under `branchesLoading`, but `branchesLoading` 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 web/src/components/task/detail/ProgressTab.tsx:49 — The view draws `<Center h= class="text-muted-foreground">` 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 web/src/components/settings/tabs/DelegationTab.tsx:117 — The view draws `Loading delegation settings...` 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 web/src/components/settings/tabs/ManageTab.tsx:374 — The view draws `Loading...` under `templatesLoading`, but `templatesLoading` 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 web/src/components/scoring/ScoreExplorer.tsx:204 — The view draws `Loading evaluation history…` 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 web/src/components/scoring/ScoringProfiles.tsx:407 — The view draws `Loading profiles…` 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 web/src/components/prompts/PromptRegistry.tsx:55 — The view draws `Loading templates...` 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 web/src/components/layout/ArchiveSidebar.tsx:326 — The view draws `Loading archived tasks...` 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 web/src/components/layout/WorkspaceSwitcher.tsx:59 — The view draws `<Loader2 class="h-3 w-3 animate-spin" aria-hidden="true"/>` under `isSwitching`, but `isSwitching` 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 web/src/components/decisions/DecisionDetail.tsx:50 — The view draws `Loading decision details...` 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 web/src/components/decisions/DecisionExplorer.tsx:317 — The view draws `Loading decisions...` 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 web/src/components/decisions/DecisionExplorer.tsx:345 — The view draws `Loading governance traces...` under `tracesLoading`, but `tracesLoading` 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 web/src/components/decisions/GovernanceTraceDetail.tsx:37 — The view draws `Loading governance trace...` 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 web/src/components/board/ArchiveSuggestionBanner.tsx:70 — The view draws `<Loader2 class="h-4 w-4 animate-spin"/>` under `archiveSprint . isPending && confirmSprint === suggestion . sprint`, but `confirmSprint` 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 web/src/components/board/SprintArchiveSuggestion.tsx:82 — The view draws `<Loader2 class="h-4 w-4 mr-1 animate-spin"/>` under `archivingSprint === sprint . name`, but `archivingSprint` 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.
X7 · Silent fallback defaults · Silent fallback default in catch · ×13
  • Silent fallback default in catch cli/src/commands/doctor.ts:260 — `redactUrlForMessage` swallows every exception into `return '[redacted url]'` — 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 cli/src/commands/snapshot.ts:251 — `redactUrl` swallows every exception into `return '[redacted-url]'` — 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 cli/src/commands/snapshot.ts:334 — `defaultCliVersion` swallows every exception into `return '0.0.0'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch scripts/dev-process-ownership.mjs:21 — `sourcePath` 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 scripts/wait-for-desktop-ready.mjs:50 — `commandOutput` 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 server/src/storage/append-activity-repository.ts:366 — `getFileSize` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch server/src/storage/broadcast-repository.ts:160 — `parseJsonArray` 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 server/src/storage/trace-file-repository.ts:22 — `list` 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 server/src/services/clawdbot-agent-service.ts:8198 — `readOptionalFile` 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 server/src/services/run-access-summary-service.ts:812 — `safeTargetLabel` swallows every exception into `return '[redacted-target]'` — 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 server/src/services/cost-prediction-service.ts:385 — `getProjectCostAdjustment` swallows every exception into `return 1.0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch web/src/components/settings/tabs/NotificationsTab.tsx:52 — `redactDestination` swallows every exception into `return '[redacted destination]'` — 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 web/src/components/dashboard/NeedsAttentionQueue.tsx:706 — `readDismissedItems` 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.
D12 · Dependency Hygiene · Deprecated · ×9
  • Deprecated: @ungap/structured-clone REDACTED:1686 — @ungap/structured-clone 1.3.0 is resolved in REDACTED and is marked deprecated by its publisher: "Potential CWE-502 - Update to 1.3.1 or higher". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: boolean REDACTED:1967 — boolean 3.2.0 is resolved in REDACTED and is marked deprecated by its publisher: "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: fstream REDACTED:2847 — fstream 1.0.12 is resolved in REDACTED and is marked deprecated by its publisher: "This package is no longer supported.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: glob REDACTED:2902 — glob 11.1.0 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: glob REDACTED:2908 — glob 7.2.3 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: inflight REDACTED:3076 — inflight 1.0.6 is resolved in REDACTED and is marked deprecated by its publisher: "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: lodash.isequal REDACTED:3563 — lodash.isequal 4.5.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: rimraf REDACTED:4458 — rimraf 2.6.3 is resolved in REDACTED and is marked deprecated by its publisher: "Rimraf versions prior to v4 are no longer supported". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: rimraf REDACTED:4463 — rimraf 2.7.1 is resolved in REDACTED and is marked deprecated by its publisher: "Rimraf versions prior to v4 are no longer supported". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
IC1 · Incompleteness & stubs · Empty method body · ×8
  • Empty method body web/src/hooks/useBulkActions.tsx:90 — `toggleSelecting` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body web/src/hooks/useBulkActions.tsx:91 — `toggleSelect` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body web/src/hooks/useBulkActions.tsx:92 — `selectAll` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body web/src/hooks/useBulkActions.tsx:93 — `toggleGroup` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body web/src/hooks/useBulkActions.tsx:94 — `clearSelection` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body web/src/hooks/useIdentity.tsx:139 — `switchWorkspace` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body web/src/theme/MantineRoot.tsx:31 — `subscribe` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body web/src/theme/MantineRoot.tsx:32 — `unsubscribe` has an empty body — confirm it's an intentional no-op and not an unfinished method.
D10 · Test Quality · Mock-dominated test · ×6
  • Mock-dominated test: applies a saved board view from the saved view selector web/src/__tests__/board-chrome-mantine.test.tsx:293 — 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: uses the actual %ipx toolbar height without changing Home navigation web/src/__tests__/mobile-board-scroll.test.tsx:19 — This test sets up 4 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: announces import completion only after persistence and reports failed saves web/src/__tests__/settings-dialog-mantine.test.tsx:139 — This test sets up 4 test doubles (for example `vi.spyOn`) against 3 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: auto-starts and stops time tracking when enabled server/src/__tests__/enforcement.test.ts:234 — This test sets up 3 test doubles (for example `vi.spyOn`) 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: passes configured Codex executable overrides to SDK sessions server/src/__tests__/workflow-step-executor-codex.test.ts:677 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) 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: preserves the original parent when an old operation is retried server/src/__tests__/workspace-checkpoint-service.test.ts:207 — This test sets up 4 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.
D8 · Code Coverage · Tests reach code only in some runs · ×5
  • Tests reach code only in some runs: server/src/services/acp-stdio-adapter.ts server/src/services/acp-stdio-adapter.ts:408 — 1 line(s) (408) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: server/src/services/admission-control-service.ts server/src/services/admission-control-service.ts:2121 — 1 line(s) (2121) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: server/src/services/clawdbot-agent-service.ts server/src/services/clawdbot-agent-service.ts:8146 — 1 line(s) (8146) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: server/src/services/metrics/prometheus.ts server/src/services/metrics/prometheus.ts:363 — 6 line(s) (363, 365-369) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
  • Tests reach code only in some runs: server/src/storage/admission-reservation-repository.ts server/src/storage/admission-reservation-repository.ts:359 — 1 line(s) (359) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
D27 · Navigability · Pass-through layer · ×4
  • Pass-through layer server/src/storage/file-storage.ts:172 — FileActivityRepository: all 3 public methods forward their arguments unchanged to service and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call service directly, or give the layer a job.
  • Pass-through layer server/src/storage/file-storage.ts:203 — FileTemplateRepository: all 5 public methods forward their arguments unchanged to service and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call service directly, or give the layer a job.
  • Pass-through layer server/src/storage/file-storage.ts:235 — FilePromptRegistryRepository: all 11 public methods forward their arguments unchanged to service and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call service directly, or give the layer a job.
  • Pass-through layer server/src/storage/file-storage.ts:304 — FileStatusHistoryRepository: all 6 public methods forward their arguments unchanged to service and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call service directly, or give the layer a job.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×3
  • Projects may be oversized for their cohesion server/package.json:1 — `server` (176308 LoC, 1439 module-visible types across 15 directories) overshoots its size bounds. 3 of 7 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 1.4/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 web/package.json:1 — `web` (80322 LoC, 564 module-visible types across 40 directories) overshoots its size bounds. 3 of 7 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 1.4/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 shared/package.json:1 — `shared` (14621 LoC, 1308 module-visible types across 2 directories) overshoots its size bounds. 3 of 7 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 1.4/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.
AX6 · Interface segregation · Fat interface · ×2
  • Fat interface: VeritasDesktopApi (24 required operations) desktop/src/preload/index.ts:71 — `VeritasDesktopApi` declares 24 required operations: `getAppInfo`, `getConnectionStatus`, `getSetupDiagnostics`, `validateConnectionConfig`, `restartLocalServer`, `getSupportSnapshot`, `getUpdateStatus`, `dispatchCommand`, `pickUploadFiles`, `createDiagnosticsBundle`, `performNotificationAction`, `exportWorkProduct`, `openExternal`, `performTitlebarAction`, `onSetupProgress`, `onCommunicationCheck`, `onServerStatus`, `onRunProgress`, `onUpdateStatus`, `onNotificationAction`, `onMenuCommand`, `onUploadProgress`, `onWorkProductExportProgress`, `onExternalDeliveryVerification`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: KnowledgeCollectionRepository (18 required operations) server/src/storage/knowledge-collection-repository.ts:62 — `KnowledgeCollectionRepository` declares 18 required operations: `createCollection`, `getCollection`, `listCollections`, `createSource`, `getSource`, `listSources`, `readSourceContent`, `getPage`, `listPages`, `applyPageBatch`, `createProposal`, `getProposal`, `listProposals`, `transitionProposal`, `listKnowledgeActivity`, `syncIntegrityFindings`, `listIntegrityFindings`, `transitionIntegrityFinding`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D20 · ADR Quality · ADR has no Context section · ×2
  • ADR has no Context section docs/architecture/ADR-0002-v5-remote-server-security-posture.md:1 — docs/architecture/ADR-0002-v5-remote-server-security-posture.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
  • ADR has no Context section docs/architecture/ADR-0004-post-ga-cloud-sync-hosted-saas.md:1 — docs/architecture/ADR-0004-post-ga-cloud-sync-hosted-saas.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D34 · Knowledge Freshness · Orphaned file · ×2
  • Orphaned file web/src/components/layout/SystemHealthBar.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/src/components/dashboard/EnforcementIndicator.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
P2 · Observability · Console output used as the logging channel · ×2
  • Console output used as the logging channel REDACTED:269 — `REDACTED` reports through `console.*` at line 269 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 server/src/config/security.ts:436 — `server/src/config/security.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.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×2
  • Hand-rolled JSON/XML parsing via regex server/src/services/agent-health-service.ts:144 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex server/src/services/agent-health-service.ts:198 — 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.
D21 · Naming Consistency · `extractJSON` spells `JSON` where 74 names in the project spell it `Json` · ×1
  • `extractJSON` spells `JSON` where 74 names in the project spell it `Json` server/src/services/text-extraction-service.ts:194 — 74 of 76 names in project veritas-kanban spell the token `Json` (74 of 76; unit: names in project veritas-kanban containing `Json`). Peers: doctor.requestJson (cli/src/commands/doctor.ts:265); goals.parseJson (cli/src/commands/goals.ts:277); goals.printJson (cli/src/commands/goals.ts:305); prompts.requestJson (cli/src/commands/prompts.ts:425); snapshot.requestJson (cli/src/commands/snapshot.ts:339). Rename to `extractJson`. [rule N6]
D21 · Naming Consistency · `toJSON` spells `JSON` where 74 names in the project spell it `Json` · ×1
  • `toJSON` spells `JSON` where 74 names in the project spell it `Json` shared/src/utils/api-errors.ts:56 — 74 of 76 names in project veritas-kanban spell the token `Json` (74 of 76; unit: names in project veritas-kanban containing `Json`). Peers: doctor.requestJson (cli/src/commands/doctor.ts:265); goals.parseJson (cli/src/commands/goals.ts:277); goals.printJson (cli/src/commands/goals.ts:305); prompts.requestJson (cli/src/commands/prompts.ts:425); snapshot.requestJson (cli/src/commands/snapshot.ts:339). Rename to `toJson`. [rule N6]
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 2 of 817 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 817 of the 1091 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: web/src/components/layout/SystemHealthBar.tsx, web/src/components/dashboard/EnforcementIndicator.tsx. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
DM9 · Scattered domain decisions · Rule about [retryable, terminal] decided in 2 places · ×1
  • Rule about [retryable, terminal] decided in 2 places — server.src.storage.execution-tree-budget.ExecutionTreeBudgetLimits's [retryable, terminal] are judged in server.src.storage.admission-reservation-repository.FileAdmissionReservationRepository, server.src.storage.sqlite.admission-reservation-repository.SqliteAdmissionReservationRepository — 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 [collectionId, workspaceId] decided in 2 places · ×1
  • Rule about [collectionId, workspaceId] decided in 2 places — server.src.storage.knowledge-collection-repository.KnowledgeProposalTransitionBatch's [collectionId, workspaceId] are judged in server.src.storage.knowledge-collection-repository.FileKnowledgeCollectionRepository, server.src.storage.sqlite.knowledge-collection-repository.SqliteKnowledgeCollectionRepository — 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.
GD1 · Unfinished & placeholder code · Placeholder literal left in code · ×1
  • Placeholder literal left in code REDACTED:241 — A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 1/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `cli`, `desktop`, `mcp`.
R7 · Dead Code · Unused export 'DESKTOP_PROTOCOL' · ×1
  • Unused export 'DESKTOP_PROTOCOL' desktop/src/main/app-metadata.ts:3 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'env' · ×1
  • Unused export 'env' server/src/config/env.ts:229 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'default' · ×1
  • Unused export 'default' server/src/lib/logger.ts:57 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'AgentBudgetPolicyInput' · ×1
  • Unused export 'AgentBudgetPolicyInput' server/src/schemas/agent-budget-schemas.ts:44 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'AgentProfileLaunchBodySchema' · ×1
  • Unused export 'AgentProfileLaunchBodySchema' server/src/schemas/agent-profile-package-schemas.ts:159 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'StartAgentBody' · ×1
  • Unused export 'StartAgentBody' server/src/schemas/agent-schemas.ts:19 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'CompleteAgentBody' · ×1
  • Unused export 'CompleteAgentBody' server/src/schemas/agent-schemas.ts:30 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'ReportTokensBody' · ×1
  • Unused export 'ReportTokensBody' server/src/schemas/agent-schemas.ts:45 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'AnalyticsError' · ×1
  • Unused export 'AnalyticsError' server/src/schemas/analytics-schemas.ts:133 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'BulkArchiveBody' · ×1
  • Unused export 'BulkArchiveBody' server/src/schemas/archive-schemas.ts:10 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'ChangesQueryInput' · ×1
  • Unused export 'ChangesQueryInput' server/src/schemas/changes-schemas.ts:36 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ValidTelemetryEventType' · ×1
  • Unused export 'ValidTelemetryEventType' server/src/schemas/common.ts:88 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'ValidMetricsPeriod' · ×1
  • Unused export 'ValidMetricsPeriod' server/src/schemas/common.ts:109 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'SetDefaultAgentBody' · ×1
  • Unused export 'SetDefaultAgentBody' server/src/schemas/config-schemas.ts:10 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'ValidateRepoPathBody' · ×1
  • Unused export 'ValidateRepoPathBody' server/src/schemas/config-schemas.ts:19 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'SetDelegationRequest' · ×1
  • Unused export 'SetDelegationRequest' server/src/schemas/delegation-schemas.ts:22 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'AddDeliverableBody' · ×1
  • Unused export 'AddDeliverableBody' server/src/schemas/deliverable-schemas.ts:23 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'UpdateDeliverableBody' · ×1
  • Unused export 'UpdateDeliverableBody' server/src/schemas/deliverable-schemas.ts:40 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'phaseTransitionResultSchema' · ×1
  • Unused export 'phaseTransitionResultSchema' server/src/schemas/phase-capability-schemas.ts:366 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'policyTypeSchema' · ×1
  • Unused export 'policyTypeSchema' server/src/schemas/policy-schemas.ts:15 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'PolicyInput' · ×1
  • Unused export 'PolicyInput' server/src/schemas/policy-schemas.ts:103 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'PolicyEvaluationInput' · ×1
  • Unused export 'PolicyEvaluationInput' server/src/schemas/policy-schemas.ts:104 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'PolicyParams' · ×1
  • Unused export 'PolicyParams' server/src/schemas/policy-schemas.ts:105 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'CreateRunSessionShareBody' · ×1
  • Unused export 'CreateRunSessionShareBody' server/src/schemas/run-session-schemas.ts:57 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'RunSessionShareListQuery' · ×1
  • Unused export 'RunSessionShareListQuery' server/src/schemas/run-session-schemas.ts:58 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'RunSessionShareParams' · ×1
  • Unused export 'RunSessionShareParams' server/src/schemas/run-session-schemas.ts:59 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'UpdateRunSessionShareBody' · ×1
  • Unused export 'UpdateRunSessionShareBody' server/src/schemas/run-session-schemas.ts:60 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'RevokeRunSessionShareBody' · ×1
  • Unused export 'RevokeRunSessionShareBody' server/src/schemas/run-session-schemas.ts:61 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'SendRunSessionMessageBody' · ×1
  • Unused export 'SendRunSessionMessageBody' server/src/schemas/run-session-schemas.ts:62 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'RunSessionApprovalResponseBody' · ×1
  • Unused export 'RunSessionApprovalResponseBody' server/src/schemas/run-session-schemas.ts:63 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ForkRunSessionBody' · ×1
  • Unused export 'ForkRunSessionBody' server/src/schemas/run-session-schemas.ts:64 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'SandboxPolicyPresetInput' · ×1
  • Unused export 'SandboxPolicyPresetInput' server/src/schemas/sandbox-policy-schemas.ts:110 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'SandboxPolicyDryRunInput' · ×1
  • Unused export 'SandboxPolicyDryRunInput' server/src/schemas/sandbox-policy-schemas.ts:111 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ReorderTasksBody' · ×1
  • Unused export 'ReorderTasksBody' server/src/schemas/task-mutation-schemas.ts:16 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'MoveTaskBody' · ×1
  • Unused export 'MoveTaskBody' server/src/schemas/task-mutation-schemas.ts:31 — Nothing ultimately consumes this binding: its only referrer is the re-export in server/src/schemas/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in server/src/schemas/index.ts in the same commit, or the barrel will import a name that no longer exists.
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 9/10 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 — ~0.2 `!` null assertions per 1k TypeScript source lines — 49 assertion(s) across the 310808 source line(s) of the 1068 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: web/src/hooks/useDiff.ts (5), server/src/services/credential-broker-service.ts (4), REDACTED (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Minor — 34 finding(s)
D12 · Dependency Hygiene · Outdated (npm) · ×21
  • Outdated (npm): @mantine/core — @mantine/core is pinned at 9.7.3; registry.npmjs.org publishes 9.8.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): @mantine/hooks — @mantine/hooks is pinned at 9.7.3; registry.npmjs.org publishes 9.8.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): @mantine/modals — @mantine/modals is pinned at 9.7.3; registry.npmjs.org publishes 9.8.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): @mantine/notifications — @mantine/notifications is pinned at 9.7.3; registry.npmjs.org publishes 9.8.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): @modelcontextprotocol/sdk — @modelcontextprotocol/sdk is pinned at 1.32.1; registry.npmjs.org publishes 1.32.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): @openai/codex-sdk — @openai/codex-sdk is pinned at 0.163.0; registry.npmjs.org publishes 0.169.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): @tanstack/react-query — @tanstack/react-query is pinned at 5.104.5; registry.npmjs.org publishes 5.107.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): commander — commander is pinned at 15.0.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): dompurify — dompurify is pinned at 3.4.17; registry.npmjs.org publishes 3.4.18 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): dotenv — dotenv is pinned at 17.4.2; registry.npmjs.org publishes 18.0.10 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): electron-updater — electron-updater is pinned at 6.8.9; registry.npmjs.org publishes 6.8.11 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): express-rate-limit — express-rate-limit is pinned at 8.7.1; registry.npmjs.org publishes 8.7.4 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): file-type — file-type is pinned at 22.2.0; registry.npmjs.org publishes 22.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): jose — jose is pinned at 6.2.9; registry.npmjs.org publishes 6.2.17 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.61.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): nostr-tools — nostr-tools is pinned at 2.25.2; registry.npmjs.org publishes 2.26.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): sanitize-filename — sanitize-filename is pinned at 1.6.4; registry.npmjs.org publishes 1.6.5 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): sanitize-html — sanitize-html is pinned at 2.18.1; registry.npmjs.org publishes 2.18.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): simple-git — simple-git is pinned at 4.0.2; registry.npmjs.org publishes 4.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): unpdf — unpdf is pinned at 1.9.1; registry.npmjs.org publishes 2.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): ws — ws is pinned at 8.22.0; registry.npmjs.org publishes 8.23.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.
D10 · Test Quality · Skipped (documented) · ×9
  • Skipped (documented): (unnamed test) server/src/__tests__/codex-provider-service.test.ts:1068 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
  • Skipped (documented): (unnamed test) server/src/__tests__/dependency-circuit-control-service.test.ts:198 — 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) server/src/__tests__/dependency-circuit-registry-service.test.ts:155 — 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) server/src/__tests__/filesystem-sandbox-service.test.ts:894 — 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) server/src/__tests__/run-event-journal-service.test.ts:256 — 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) server/src/__tests__/run-file-execution-policy-service.test.ts:189 — 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) server/src/__tests__/run-output-artifact-repository.test.ts:211 — 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) server/src/__tests__/run-terminal-service.test.ts:561 — 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) server/src/__tests__/sqlite-journal-maintenance-service.test.ts:148 — Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
D24 · Comment Value · doc comments repeat the names · ×3
  • doc comments repeat the names server/src/config/env.ts:135 — 0 of 25 documented parameters and 33 of 1151 summaries in `@veritas-kanban/server` only repeat the member or parameter name (e.g. "Days after which telemetry is compressed" for `TELEMETRY_COMPRESS_DAYS`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names shared/src/types/config.types.ts:113 — 0 of 10 documented parameters and 8 of 297 summaries in `@veritas-kanban/shared` only repeat the member or parameter name (e.g. "Default routing config" for `DEFAULT_ROUTING_CONFIG`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names web/src/hooks/useAttachments.ts:36 — 0 of 1 documented parameters and 18 of 289 summaries in `@veritas-kanban/web` only repeat the member or parameter name (e.g. "Delete an attachment" for `useDeleteAttachment`). Delete the restating tags, or add what the name does not say.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: @veritas-kanban/shared — @veritas-kanban/shared: abstractness 0.17, instability 0.00, distance 0.83 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

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-3703d78f7ef843519a6d6e577d1d7f7e/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-3703d78f7ef843519a6d6e577d1d7f7e/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=1000" --report-format json --report-path /tmp/watchdog-gitleaks-3703d78f7ef843519a6d6e577d1d7f7e/history-2.json --exit-code 0 --source .2artifacts/raw/gitleaks-history-2.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-3703d78f7ef843519a6d6e577d1d7f7e/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude web/src/components/health .642artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .5artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .3artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 41 file(s) — `cli/src/commands/tool-servers.ts`, `desktop/src/shared/desktop-bridge-contracts.ts`, `server/src/services/acp-stdio-adapter.ts`, `server/src/services/api-token-service.ts`, `server/src/services/automation-activation-service.ts`, … (+36 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1e950-c852-72d1-bb9f-2fbedb6d1c3d · 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