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 reportMeasured 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 scoreAdequate
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 critical2411 serious334 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
Canine 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.
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 forThe 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.
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 problem
Standard, 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.
Size
Large: 298,397 lines of product code
What it is not
Not 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.
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.
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.
shared.src.types.run-launch-manifest_types uses shared.src.types.agent-budget_types, so a change to shared.src.types.agent-budget_types can break shared.src.types.run-launch-manifest_types, while a change to shared.src.types.run-launch-manifest_types can't break shared.src.types.agent-budget_types.
Position
Below the diagonal: shared.src.types.run-launch-manifest_types uses a module listed above it, which is the healthy direction.
shared.src.types.run-launch-manifest_types uses shared.src.types.phase-capability_types, so a change to shared.src.types.phase-capability_types can break shared.src.types.run-launch-manifest_types, while a change to shared.src.types.run-launch-manifest_types can't break shared.src.types.phase-capability_types.
Position
Below the diagonal: shared.src.types.run-launch-manifest_types uses a module listed above it, which is the healthy direction.
shared.src.types.run-launch-manifest_types uses shared.src.types.provider-runtime_types, so a change to shared.src.types.provider-runtime_types can break shared.src.types.run-launch-manifest_types, while a change to shared.src.types.run-launch-manifest_types can't break shared.src.types.provider-runtime_types.
Position
Below the diagonal: shared.src.types.run-launch-manifest_types uses a module listed above it, which is the healthy direction.
shared.src.types.task_types uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break shared.src.types.task_types, while a change to shared.src.types.task_types can't break mcp.src.tools.projects.
Position
Below the diagonal: shared.src.types.task_types uses a module listed above it, which is the healthy direction.
web.src.components.dashboard uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break web.src.components.dashboard, while a change to web.src.components.dashboard can't break mcp.src.tools.projects.
Position
Below the diagonal: web.src.components.dashboard uses a module listed above it, which is the healthy direction.
web.src.components.dashboard uses server.src.services.metrics.types, so a change to server.src.services.metrics.types can break web.src.components.dashboard, while a change to web.src.components.dashboard can't break server.src.services.metrics.types.
Position
Below the diagonal: web.src.components.dashboard uses a module listed above it, which is the healthy direction.
shared.src.types.admission-control_types uses shared.src.types.agent-budget_types, so a change to shared.src.types.agent-budget_types can break shared.src.types.admission-control_types, while a change to shared.src.types.admission-control_types can't break shared.src.types.agent-budget_types.
Position
Below the diagonal: shared.src.types.admission-control_types uses a module listed above it, which is the healthy direction.
shared.src.types.admission-control_types uses shared.src.types.task_types, so a change to shared.src.types.task_types can break shared.src.types.admission-control_types, while a change to shared.src.types.admission-control_types can't break shared.src.types.task_types.
Position
Below the diagonal: shared.src.types.admission-control_types uses a module listed above it, which is the healthy direction.
shared.src.types.telemetry_types uses shared.src.types.provider-runtime_types, so a change to shared.src.types.provider-runtime_types can break shared.src.types.telemetry_types, while a change to shared.src.types.telemetry_types can't break shared.src.types.provider-runtime_types.
Position
Below the diagonal: shared.src.types.telemetry_types uses a module listed above it, which is the healthy direction.
shared.src.types.telemetry_types uses shared.src.types.sandbox-policy_types, so a change to shared.src.types.sandbox-policy_types can break shared.src.types.telemetry_types, while a change to shared.src.types.telemetry_types can't break shared.src.types.sandbox-policy_types.
Position
Below the diagonal: shared.src.types.telemetry_types uses a module listed above it, which is the healthy direction.
shared.src.types.telemetry_types uses shared.src.types.task_types, so a change to shared.src.types.task_types can break shared.src.types.telemetry_types, while a change to shared.src.types.telemetry_types can't break shared.src.types.task_types.
Position
Below the diagonal: shared.src.types.telemetry_types uses a module listed above it, which is the healthy direction.
shared.src.types.template_types uses shared.src.types.task_types, so a change to shared.src.types.task_types can break shared.src.types.template_types, while a change to shared.src.types.template_types can't break shared.src.types.task_types.
Position
Below the diagonal: shared.src.types.template_types uses a module listed above it, which is the healthy direction.
cli.src.commands uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break cli.src.commands, while a change to cli.src.commands can't break mcp.src.tools.projects.
Position
Below the diagonal: cli.src.commands uses a module listed above it, which is the healthy direction.
cli.src.commands uses shared.src.types.phase-capability_types, so a change to shared.src.types.phase-capability_types can break cli.src.commands, while a change to cli.src.commands can't break shared.src.types.phase-capability_types.
Position
Below the diagonal: cli.src.commands uses a module listed above it, which is the healthy direction.
cli.src.commands uses shared.src.types.run-event_types, so a change to shared.src.types.run-event_types can break cli.src.commands, while a change to cli.src.commands can't break shared.src.types.run-event_types.
Position
Below the diagonal: cli.src.commands uses a module listed above it, which is the healthy direction.
cli.src.commands uses shared.src.types.work-product_types, so a change to shared.src.types.work-product_types can break cli.src.commands, while a change to cli.src.commands can't break shared.src.types.work-product_types.
Position
Below the diagonal: cli.src.commands uses a module listed above it, which is the healthy direction.
cli.src.commands uses shared.src.types.admission-control_types, so a change to shared.src.types.admission-control_types can break cli.src.commands, while a change to cli.src.commands can't break shared.src.types.admission-control_types.
Position
Below the diagonal: cli.src.commands uses a module listed above it, which is the healthy direction.
server.src.services.workflow-run-service uses server.src.storage.sqlite.database, so a change to server.src.storage.sqlite.database can break server.src.services.workflow-run-service, while a change to server.src.services.workflow-run-service can't break server.src.storage.sqlite.database.
Position
Below the diagonal: server.src.services.workflow-run-service uses a module listed above it, which is the healthy direction.
server.src.services.workflow-run-service uses server.src.types.workflow, so a change to server.src.types.workflow can break server.src.services.workflow-run-service, while a change to server.src.services.workflow-run-service can't break server.src.types.workflow.
Position
Below the diagonal: server.src.services.workflow-run-service uses a module listed above it, which is the healthy direction.
server.src.services.workflow-run-service uses shared.src.types.agent-budget_types, so a change to shared.src.types.agent-budget_types can break server.src.services.workflow-run-service, while a change to server.src.services.workflow-run-service can't break shared.src.types.agent-budget_types.
Position
Below the diagonal: server.src.services.workflow-run-service uses a module listed above it, which is the healthy direction.
server.src.services.workflow-run-service uses shared.src.types.admission-control_types, so a change to shared.src.types.admission-control_types can break server.src.services.workflow-run-service, while a change to server.src.services.workflow-run-service can't break shared.src.types.admission-control_types.
Position
Below the diagonal: server.src.services.workflow-run-service uses a module listed above it, which is the healthy direction.
server.src.storage uses server.src.types.workflow, so a change to server.src.types.workflow can break server.src.storage, while a change to server.src.storage can't break server.src.types.workflow.
Position
Below the diagonal: server.src.storage uses a module listed above it, which is the healthy direction.
server.src.storage uses shared.src.types.agent-budget_types, so a change to shared.src.types.agent-budget_types can break server.src.storage, while a change to server.src.storage can't break shared.src.types.agent-budget_types.
Position
Below the diagonal: server.src.storage uses a module listed above it, which is the healthy direction.
server.src.storage uses shared.src.types.phase-capability_types, so a change to shared.src.types.phase-capability_types can break server.src.storage, while a change to server.src.storage can't break shared.src.types.phase-capability_types.
Position
Below the diagonal: server.src.storage uses a module listed above it, which is the healthy direction.
server.src.storage uses shared.src.types.work-product_types, so a change to shared.src.types.work-product_types can break server.src.storage, while a change to server.src.storage can't break shared.src.types.work-product_types.
Position
Below the diagonal: server.src.storage uses a module listed above it, which is the healthy direction.
server.src.storage uses shared.src.types.admission-control_types, so a change to shared.src.types.admission-control_types can break server.src.storage, while a change to server.src.storage can't break shared.src.types.admission-control_types.
Position
Below the diagonal: server.src.storage uses a module listed above it, which is the healthy direction.
shared.src.types.config_types uses shared.src.types.agent-budget_types, so a change to shared.src.types.agent-budget_types can break shared.src.types.config_types, while a change to shared.src.types.config_types can't break shared.src.types.agent-budget_types.
Position
Below the diagonal: shared.src.types.config_types uses a module listed above it, which is the healthy direction.
shared.src.types.config_types uses shared.src.types.provider-runtime_types, so a change to shared.src.types.provider-runtime_types can break shared.src.types.config_types, while a change to shared.src.types.config_types can't break shared.src.types.provider-runtime_types.
Position
Below the diagonal: shared.src.types.config_types uses a module listed above it, which is the healthy direction.
shared.src.types.config_types uses shared.src.types.task_types, so a change to shared.src.types.task_types can break shared.src.types.config_types, while a change to shared.src.types.config_types can't break shared.src.types.task_types.
Position
Below the diagonal: shared.src.types.config_types uses a module listed above it, which is the healthy direction.
shared.src.types.config_types uses shared.src.types.admission-control_types, so a change to shared.src.types.admission-control_types can break shared.src.types.config_types, while a change to shared.src.types.config_types can't break shared.src.types.admission-control_types.
Position
Below the diagonal: shared.src.types.config_types uses a module listed above it, which is the healthy direction.
shared.src.types.config_types uses shared.src.types.telemetry_types, so a change to shared.src.types.telemetry_types can break shared.src.types.config_types, while a change to shared.src.types.config_types can't break shared.src.types.telemetry_types.
Position
Below the diagonal: shared.src.types.config_types uses a module listed above it, which is the healthy direction.
web.src.components.task uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break web.src.components.task, while a change to web.src.components.task can't break mcp.src.tools.projects.
Position
Below the diagonal: web.src.components.task uses a module listed above it, which is the healthy direction.
web.src.components.task uses server.src.types.workflow, so a change to server.src.types.workflow can break web.src.components.task, while a change to web.src.components.task can't break server.src.types.workflow.
Position
Below the diagonal: web.src.components.task uses a module listed above it, which is the healthy direction.
web.src.components.task uses shared.src.types.work-product_types, so a change to shared.src.types.work-product_types can break web.src.components.task, while a change to web.src.components.task can't break shared.src.types.work-product_types.
Position
Below the diagonal: web.src.components.task uses a module listed above it, which is the healthy direction.
web.src.components.task uses shared.src.types.task_types, so a change to shared.src.types.task_types can break web.src.components.task, while a change to web.src.components.task can't break shared.src.types.task_types.
Position
Below the diagonal: web.src.components.task uses a module listed above it, which is the healthy direction.
web.src.components.task uses shared.src.types.telemetry_types, so a change to shared.src.types.telemetry_types can break web.src.components.task, while a change to web.src.components.task can't break shared.src.types.telemetry_types.
Position
Below the diagonal: web.src.components.task uses a module listed above it, which is the healthy direction.
web.src.hooks uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break web.src.hooks, while a change to web.src.hooks can't break mcp.src.tools.projects.
Position
Below the diagonal: web.src.hooks uses a module listed above it, which is the healthy direction.
web.src.hooks uses server.src.services.metrics.types, so a change to server.src.services.metrics.types can break web.src.hooks, while a change to web.src.hooks can't break server.src.services.metrics.types.
Position
Below the diagonal: web.src.hooks uses a module listed above it, which is the healthy direction.
web.src.hooks uses shared.src.types.admission-control_types, so a change to shared.src.types.admission-control_types can break web.src.hooks, while a change to web.src.hooks can't break shared.src.types.admission-control_types.
Position
Below the diagonal: web.src.hooks uses a module listed above it, which is the healthy direction.
web.src.hooks uses shared.src.types.template_types, so a change to shared.src.types.template_types can break web.src.hooks, while a change to web.src.hooks can't break shared.src.types.template_types.
Position
Below the diagonal: web.src.hooks uses a module listed above it, which is the healthy direction.
server.src.services.agent-provider-adapter-registry uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break server.src.services.agent-provider-adapter-registry, while a change to server.src.services.agent-provider-adapter-registry can't break mcp.src.tools.projects.
Position
Below the diagonal: server.src.services.agent-provider-adapter-registry uses a module listed above it, which is the healthy direction.
server.src.services.agent-provider-adapter-registry uses shared.src.types.provider-runtime_types, so a change to shared.src.types.provider-runtime_types can break server.src.services.agent-provider-adapter-registry, while a change to server.src.services.agent-provider-adapter-registry can't break shared.src.types.provider-runtime_types.
Position
Below the diagonal: server.src.services.agent-provider-adapter-registry uses a module listed above it, which is the healthy direction.
server.src.services.agent-provider-adapter-registry uses shared.src.types.sandbox-policy_types, so a change to shared.src.types.sandbox-policy_types can break server.src.services.agent-provider-adapter-registry, while a change to server.src.services.agent-provider-adapter-registry can't break shared.src.types.sandbox-policy_types.
Position
Below the diagonal: server.src.services.agent-provider-adapter-registry uses a module listed above it, which is the healthy direction.
server.src.services.agent-provider-adapter-registry uses shared.src.types.run-launch-manifest_types, so a change to shared.src.types.run-launch-manifest_types can break server.src.services.agent-provider-adapter-registry, while a change to server.src.services.agent-provider-adapter-registry can't break shared.src.types.run-launch-manifest_types.
Position
Below the diagonal: server.src.services.agent-provider-adapter-registry uses a module listed above it, which is the healthy direction.
server.src.services.agent-provider-adapter-registry uses shared.src.types.task_types, so a change to shared.src.types.task_types can break server.src.services.agent-provider-adapter-registry, while a change to server.src.services.agent-provider-adapter-registry can't break shared.src.types.task_types.
Position
Below the diagonal: server.src.services.agent-provider-adapter-registry uses a module listed above it, which is the healthy direction.
server.src.services.agent-provider-adapter-registry uses shared.src.types.config_types, so a change to shared.src.types.config_types can break server.src.services.agent-provider-adapter-registry, while a change to server.src.services.agent-provider-adapter-registry can't break shared.src.types.config_types.
Position
Below the diagonal: server.src.services.agent-provider-adapter-registry uses a module listed above it, which is the healthy direction.
server.src.services.config-service uses server.src.storage.sqlite.database, so a change to server.src.storage.sqlite.database can break server.src.services.config-service, while a change to server.src.services.config-service can't break server.src.storage.sqlite.database.
Position
Below the diagonal: server.src.services.config-service uses a module listed above it, which is the healthy direction.
server.src.services.config-service uses shared.src.types.task_types, so a change to shared.src.types.task_types can break server.src.services.config-service, while a change to server.src.services.config-service can't break shared.src.types.task_types.
Position
Below the diagonal: server.src.services.config-service uses a module listed above it, which is the healthy direction.
server.src.services.config-service uses shared.src.types.config_types, so a change to shared.src.types.config_types can break server.src.services.config-service, while a change to server.src.services.config-service can't break shared.src.types.config_types.
Position
Below the diagonal: server.src.services.config-service uses a module listed above it, which is the healthy direction.
server.src.services.queue-intake-monitor-service uses server.src.services.workflow-run-service, so a change to server.src.services.workflow-run-service can break server.src.services.queue-intake-monitor-service, while a change to server.src.services.queue-intake-monitor-service can't break server.src.services.workflow-run-service.
Position
Below the diagonal: server.src.services.queue-intake-monitor-service uses a module listed above it, which is the healthy direction.
server.src.storage.interfaces uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break server.src.storage.interfaces, while a change to server.src.storage.interfaces can't break mcp.src.tools.projects.
Position
Below the diagonal: server.src.storage.interfaces uses a module listed above it, which is the healthy direction.
server.src.storage.interfaces uses shared.src.types.phase-capability_types, so a change to shared.src.types.phase-capability_types can break server.src.storage.interfaces, while a change to server.src.storage.interfaces can't break shared.src.types.phase-capability_types.
Position
Below the diagonal: server.src.storage.interfaces uses a module listed above it, which is the healthy direction.
server.src.storage.interfaces uses shared.src.types.run-event_types, so a change to shared.src.types.run-event_types can break server.src.storage.interfaces, while a change to server.src.storage.interfaces can't break shared.src.types.run-event_types.
Position
Below the diagonal: server.src.storage.interfaces uses a module listed above it, which is the healthy direction.
server.src.storage.interfaces uses shared.src.types.admission-control_types, so a change to shared.src.types.admission-control_types can break server.src.storage.interfaces, while a change to server.src.storage.interfaces can't break shared.src.types.admission-control_types.
Position
Below the diagonal: server.src.storage.interfaces uses a module listed above it, which is the healthy direction.
server.src.storage.interfaces uses shared.src.types.telemetry_types, so a change to shared.src.types.telemetry_types can break server.src.storage.interfaces, while a change to server.src.storage.interfaces can't break shared.src.types.telemetry_types.
Position
Below the diagonal: server.src.storage.interfaces uses a module listed above it, which is the healthy direction.
server.src.storage.interfaces uses shared.src.types.template_types, so a change to shared.src.types.template_types can break server.src.storage.interfaces, while a change to server.src.storage.interfaces can't break shared.src.types.template_types.
Position
Below the diagonal: server.src.storage.interfaces uses a module listed above it, which is the healthy direction.
server.src.storage.interfaces uses shared.src.types.config_types, so a change to shared.src.types.config_types can break server.src.storage.interfaces, while a change to server.src.storage.interfaces can't break shared.src.types.config_types.
Position
Below the diagonal: server.src.storage.interfaces uses a module listed above it, which is the healthy direction.
server.src.storage.sqlite uses server.src.storage.sqlite.database, so a change to server.src.storage.sqlite.database can break server.src.storage.sqlite, while a change to server.src.storage.sqlite can't break server.src.storage.sqlite.database.
Position
Below the diagonal: server.src.storage.sqlite uses a module listed above it, which is the healthy direction.
server.src.storage.sqlite uses shared.src.types.phase-capability_types, so a change to shared.src.types.phase-capability_types can break server.src.storage.sqlite, while a change to server.src.storage.sqlite can't break shared.src.types.phase-capability_types.
Position
Below the diagonal: server.src.storage.sqlite uses a module listed above it, which is the healthy direction.
server.src.storage.sqlite uses shared.src.types.work-product_types, so a change to shared.src.types.work-product_types can break server.src.storage.sqlite, while a change to server.src.storage.sqlite can't break shared.src.types.work-product_types.
Position
Below the diagonal: server.src.storage.sqlite uses a module listed above it, which is the healthy direction.
server.src.storage.sqlite uses shared.src.types.config_types, so a change to shared.src.types.config_types can break server.src.storage.sqlite, while a change to server.src.storage.sqlite can't break shared.src.types.config_types.
Position
Below the diagonal: server.src.storage.sqlite uses a module listed above it, which is the healthy direction.
server.src.utils uses server.src.types.workflow, so a change to server.src.types.workflow can break server.src.utils, while a change to server.src.utils can't break server.src.types.workflow.
Position
Below the diagonal: server.src.utils uses a module listed above it, which is the healthy direction.
server.src.utils uses shared.src.types.provider-runtime_types, so a change to shared.src.types.provider-runtime_types can break server.src.utils, while a change to server.src.utils can't break shared.src.types.provider-runtime_types.
Position
Below the diagonal: server.src.utils uses a module listed above it, which is the healthy direction.
server.src.utils uses shared.src.types.task-envelope_types, so a change to shared.src.types.task-envelope_types can break server.src.utils, while a change to server.src.utils can't break shared.src.types.task-envelope_types.
Position
Below the diagonal: server.src.utils uses a module listed above it, which is the healthy direction.
server.src.utils uses shared.src.types.run-launch-manifest_types, so a change to shared.src.types.run-launch-manifest_types can break server.src.utils, while a change to server.src.utils can't break shared.src.types.run-launch-manifest_types.
Position
Below the diagonal: server.src.utils uses a module listed above it, which is the healthy direction.
server.src.utils uses shared.src.types.template_types, so a change to shared.src.types.template_types can break server.src.utils, while a change to server.src.utils can't break shared.src.types.template_types.
Position
Below the diagonal: server.src.utils uses a module listed above it, which is the healthy direction.
server.src.utils uses shared.src.types.config_types, so a change to shared.src.types.config_types can break server.src.utils, while a change to server.src.utils can't break shared.src.types.config_types.
Position
Below the diagonal: server.src.utils uses a module listed above it, which is the healthy direction.
web.src.components.settings.tabs uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break web.src.components.settings.tabs, while a change to web.src.components.settings.tabs can't break mcp.src.tools.projects.
Position
Below the diagonal: web.src.components.settings.tabs uses a module listed above it, which is the healthy direction.
web.src.components.settings.tabs uses shared.src.types.agent-budget_types, so a change to shared.src.types.agent-budget_types can break web.src.components.settings.tabs, while a change to web.src.components.settings.tabs can't break shared.src.types.agent-budget_types.
Position
Below the diagonal: web.src.components.settings.tabs uses a module listed above it, which is the healthy direction.
web.src.components.settings.tabs uses shared.src.types.sandbox-policy_types, so a change to shared.src.types.sandbox-policy_types can break web.src.components.settings.tabs, while a change to web.src.components.settings.tabs can't break shared.src.types.sandbox-policy_types.
Position
Below the diagonal: web.src.components.settings.tabs uses a module listed above it, which is the healthy direction.
web.src.components.settings.tabs uses shared.src.types.config_types, so a change to shared.src.types.config_types can break web.src.components.settings.tabs, while a change to web.src.components.settings.tabs can't break shared.src.types.config_types.
Position
Below the diagonal: web.src.components.settings.tabs uses a module listed above it, which is the healthy direction.
server.src.services.run-event-journal-service uses shared.src.types.run-event_types, so a change to shared.src.types.run-event_types can break server.src.services.run-event-journal-service, while a change to server.src.services.run-event-journal-service can't break shared.src.types.run-event_types.
Position
Below the diagonal: server.src.services.run-event-journal-service uses a module listed above it, which is the healthy direction.
server.src.services.run-event-journal-service uses server.src.storage.interfaces, so a change to server.src.storage.interfaces can break server.src.services.run-event-journal-service, while a change to server.src.services.run-event-journal-service can't break server.src.storage.interfaces.
Position
Below the diagonal: server.src.services.run-event-journal-service uses a module listed above it, which is the healthy direction.
server.src.services.task-service uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break server.src.services.task-service, while a change to server.src.services.task-service can't break mcp.src.tools.projects.
Position
Below the diagonal: server.src.services.task-service uses a module listed above it, which is the healthy direction.
server.src.services.task-service uses server.src.storage.sqlite.database, so a change to server.src.storage.sqlite.database can break server.src.services.task-service, while a change to server.src.services.task-service can't break server.src.storage.sqlite.database.
Position
Below the diagonal: server.src.services.task-service uses a module listed above it, which is the healthy direction.
server.src.services.task-service uses shared.src.types.task_types, so a change to shared.src.types.task_types can break server.src.services.task-service, while a change to server.src.services.task-service can't break shared.src.types.task_types.
Position
Below the diagonal: server.src.services.task-service uses a module listed above it, which is the healthy direction.
server.src.services.task-service uses server.src.services.config-service, so a change to server.src.services.config-service can break server.src.services.task-service, while a change to server.src.services.task-service can't break server.src.services.config-service.
Position
Below the diagonal: server.src.services.task-service uses a module listed above it, which is the healthy direction.
server.src.services.run-approval-broker-service uses shared.src.types.phase-capability_types, so a change to shared.src.types.phase-capability_types can break server.src.services.run-approval-broker-service, while a change to server.src.services.run-approval-broker-service can't break shared.src.types.phase-capability_types.
Position
Below the diagonal: server.src.services.run-approval-broker-service uses a module listed above it, which is the healthy direction.
server.src.services.run-approval-broker-service uses shared.src.types.run-event_types, so a change to shared.src.types.run-event_types can break server.src.services.run-approval-broker-service, while a change to server.src.services.run-approval-broker-service can't break shared.src.types.run-event_types.
Position
Below the diagonal: server.src.services.run-approval-broker-service uses a module listed above it, which is the healthy direction.
server.src.services.run-approval-broker-service uses server.src.storage.interfaces, so a change to server.src.storage.interfaces can break server.src.services.run-approval-broker-service, while a change to server.src.services.run-approval-broker-service can't break server.src.storage.interfaces.
Position
Below the diagonal: server.src.services.run-approval-broker-service uses a module listed above it, which is the healthy direction.
server.src.services.run-approval-broker-service uses server.src.services.run-event-journal-service, so a change to server.src.services.run-event-journal-service can break server.src.services.run-approval-broker-service, while a change to server.src.services.run-approval-broker-service can't break server.src.services.run-event-journal-service.
Position
Below the diagonal: server.src.services.run-approval-broker-service uses a module listed above it, which is the healthy direction.
server.src.services.run-recovery-coordinator uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break server.src.services.run-recovery-coordinator, while a change to server.src.services.run-recovery-coordinator can't break mcp.src.tools.projects.
Position
Below the diagonal: server.src.services.run-recovery-coordinator uses a module listed above it, which is the healthy direction.
server.src.services.run-recovery-coordinator uses shared.src.types.run-event_types, so a change to shared.src.types.run-event_types can break server.src.services.run-recovery-coordinator, while a change to server.src.services.run-recovery-coordinator can't break shared.src.types.run-event_types.
Position
Below the diagonal: server.src.services.run-recovery-coordinator uses a module listed above it, which is the healthy direction.
server.src.services.run-recovery-coordinator uses shared.src.types.task-envelope_types, so a change to shared.src.types.task-envelope_types can break server.src.services.run-recovery-coordinator, while a change to server.src.services.run-recovery-coordinator can't break shared.src.types.task-envelope_types.
Position
Below the diagonal: server.src.services.run-recovery-coordinator uses a module listed above it, which is the healthy direction.
server.src.services.run-recovery-coordinator uses shared.src.types.task_types, so a change to shared.src.types.task_types can break server.src.services.run-recovery-coordinator, while a change to server.src.services.run-recovery-coordinator can't break shared.src.types.task_types.
Position
Below the diagonal: server.src.services.run-recovery-coordinator uses a module listed above it, which is the healthy direction.
server.src.services.run-recovery-coordinator uses server.src.services.run-event-journal-service, so a change to server.src.services.run-event-journal-service can break server.src.services.run-recovery-coordinator, while a change to server.src.services.run-recovery-coordinator can't break server.src.services.run-event-journal-service.
Position
Below the diagonal: server.src.services.run-recovery-coordinator uses a module listed above it, which is the healthy direction.
server.src.services.run-recovery-coordinator uses server.src.services.task-service, so a change to server.src.services.task-service can break server.src.services.run-recovery-coordinator, while a change to server.src.services.run-recovery-coordinator can't break server.src.services.task-service.
Position
Below the diagonal: server.src.services.run-recovery-coordinator uses a module listed above it, which is the healthy direction.
35→37 server.src.services.run-recovery-coordinator uses server.src.services.clawdbot-agent-servicepart of a loop✕
Connections
2 pairs of types, where a type in server.src.services.run-recovery-coordinator uses a type in server.src.services.clawdbot-agent-service.
server.src.services.run-recovery-coordinator uses server.src.services.clawdbot-agent-service, so a change to server.src.services.clawdbot-agent-service can break server.src.services.run-recovery-coordinator, while a change to server.src.services.run-recovery-coordinator can't break server.src.services.clawdbot-agent-service.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
server.src.storage.file-storage uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break server.src.storage.file-storage, while a change to server.src.storage.file-storage can't break mcp.src.tools.projects.
Position
Below the diagonal: server.src.storage.file-storage uses a module listed above it, which is the healthy direction.
server.src.storage.file-storage uses shared.src.types.telemetry_types, so a change to shared.src.types.telemetry_types can break server.src.storage.file-storage, while a change to server.src.storage.file-storage can't break shared.src.types.telemetry_types.
Position
Below the diagonal: server.src.storage.file-storage uses a module listed above it, which is the healthy direction.
server.src.storage.file-storage uses shared.src.types.template_types, so a change to shared.src.types.template_types can break server.src.storage.file-storage, while a change to server.src.storage.file-storage can't break shared.src.types.template_types.
Position
Below the diagonal: server.src.storage.file-storage uses a module listed above it, which is the healthy direction.
server.src.storage.file-storage uses shared.src.types.config_types, so a change to shared.src.types.config_types can break server.src.storage.file-storage, while a change to server.src.storage.file-storage can't break shared.src.types.config_types.
Position
Below the diagonal: server.src.storage.file-storage uses a module listed above it, which is the healthy direction.
server.src.storage.file-storage uses server.src.services.config-service, so a change to server.src.services.config-service can break server.src.storage.file-storage, while a change to server.src.storage.file-storage can't break server.src.services.config-service.
Position
Below the diagonal: server.src.storage.file-storage uses a module listed above it, which is the healthy direction.
server.src.storage.file-storage uses server.src.storage.interfaces, so a change to server.src.storage.interfaces can break server.src.storage.file-storage, while a change to server.src.storage.file-storage can't break server.src.storage.interfaces.
Position
Below the diagonal: server.src.storage.file-storage uses a module listed above it, which is the healthy direction.
server.src.storage.file-storage uses server.src.services.task-service, so a change to server.src.services.task-service can break server.src.storage.file-storage, while a change to server.src.storage.file-storage can't break server.src.services.task-service.
Position
Below the diagonal: server.src.storage.file-storage uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break mcp.src.tools.projects.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.agent-budget_types, so a change to shared.src.types.agent-budget_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.agent-budget_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.phase-capability_types, so a change to shared.src.types.phase-capability_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.phase-capability_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.provider-runtime_types, so a change to shared.src.types.provider-runtime_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.provider-runtime_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.run-event_types, so a change to shared.src.types.run-event_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.run-event_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.sandbox-policy_types, so a change to shared.src.types.sandbox-policy_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.sandbox-policy_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.task-envelope_types, so a change to shared.src.types.task-envelope_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.task-envelope_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.run-launch-manifest_types, so a change to shared.src.types.run-launch-manifest_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.run-launch-manifest_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.task_types, so a change to shared.src.types.task_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.task_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.admission-control_types, so a change to shared.src.types.admission-control_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.admission-control_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.telemetry_types, so a change to shared.src.types.telemetry_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.telemetry_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses shared.src.types.config_types, so a change to shared.src.types.config_types can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break shared.src.types.config_types.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses server.src.services.agent-provider-adapter-registry, so a change to server.src.services.agent-provider-adapter-registry can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break server.src.services.agent-provider-adapter-registry.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses server.src.services.config-service, so a change to server.src.services.config-service can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break server.src.services.config-service.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses server.src.storage.interfaces, so a change to server.src.storage.interfaces can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break server.src.storage.interfaces.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses server.src.services.run-event-journal-service, so a change to server.src.services.run-event-journal-service can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break server.src.services.run-event-journal-service.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses server.src.services.task-service, so a change to server.src.services.task-service can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break server.src.services.task-service.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses server.src.services.run-approval-broker-service, so a change to server.src.services.run-approval-broker-service can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break server.src.services.run-approval-broker-service.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.services.clawdbot-agent-service uses server.src.services.run-recovery-coordinator, so a change to server.src.services.run-recovery-coordinator can break server.src.services.clawdbot-agent-service, while a change to server.src.services.clawdbot-agent-service can't break server.src.services.run-recovery-coordinator.
Position
Below the diagonal: server.src.services.clawdbot-agent-service uses a module listed above it, which is the healthy direction.
server.src.storage.sqlite.sqlite-storage uses server.src.storage.sqlite.database, so a change to server.src.storage.sqlite.database can break server.src.storage.sqlite.sqlite-storage, while a change to server.src.storage.sqlite.sqlite-storage can't break server.src.storage.sqlite.database.
Position
Below the diagonal: server.src.storage.sqlite.sqlite-storage uses a module listed above it, which is the healthy direction.
server.src.storage.sqlite.sqlite-storage uses server.src.storage.interfaces, so a change to server.src.storage.interfaces can break server.src.storage.sqlite.sqlite-storage, while a change to server.src.storage.sqlite.sqlite-storage can't break server.src.storage.interfaces.
Position
Below the diagonal: server.src.storage.sqlite.sqlite-storage uses a module listed above it, which is the healthy direction.
server.src.storage.sqlite.sqlite-storage uses server.src.storage.file-storage, so a change to server.src.storage.file-storage can break server.src.storage.sqlite.sqlite-storage, while a change to server.src.storage.sqlite.sqlite-storage can't break server.src.storage.file-storage.
Position
Below the diagonal: server.src.storage.sqlite.sqlite-storage uses a module listed above it, which is the healthy direction.
server.src.routes uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break server.src.routes, while a change to server.src.routes can't break mcp.src.tools.projects.
Position
Below the diagonal: server.src.routes uses a module listed above it, which is the healthy direction.
server.src.routes uses shared.src.types.work-product_types, so a change to shared.src.types.work-product_types can break server.src.routes, while a change to server.src.routes can't break shared.src.types.work-product_types.
Position
Below the diagonal: server.src.routes uses a module listed above it, which is the healthy direction.
server.src.routes uses shared.src.types.task_types, so a change to shared.src.types.task_types can break server.src.routes, while a change to server.src.routes can't break shared.src.types.task_types.
Position
Below the diagonal: server.src.routes uses a module listed above it, which is the healthy direction.
server.src.routes uses shared.src.types.config_types, so a change to shared.src.types.config_types can break server.src.routes, while a change to server.src.routes can't break shared.src.types.config_types.
Position
Below the diagonal: server.src.routes uses a module listed above it, which is the healthy direction.
server.src.routes uses server.src.services.config-service, so a change to server.src.services.config-service can break server.src.routes, while a change to server.src.routes can't break server.src.services.config-service.
Position
Below the diagonal: server.src.routes uses a module listed above it, which is the healthy direction.
server.src.routes uses server.src.services.clawdbot-agent-service, so a change to server.src.services.clawdbot-agent-service can break server.src.routes, while a change to server.src.routes can't break server.src.services.clawdbot-agent-service.
Position
Below the diagonal: server.src.routes uses a module listed above it, which is the healthy direction.
server.src.services uses mcp.src.tools.projects, so a change to mcp.src.tools.projects can break server.src.services, while a change to server.src.services can't break mcp.src.tools.projects.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses server.src.types.workflow, so a change to server.src.types.workflow can break server.src.services, while a change to server.src.services can't break server.src.types.workflow.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.agent-budget_types, so a change to shared.src.types.agent-budget_types can break server.src.services, while a change to server.src.services can't break shared.src.types.agent-budget_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.phase-capability_types, so a change to shared.src.types.phase-capability_types can break server.src.services, while a change to server.src.services can't break shared.src.types.phase-capability_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.provider-runtime_types, so a change to shared.src.types.provider-runtime_types can break server.src.services, while a change to server.src.services can't break shared.src.types.provider-runtime_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.run-event_types, so a change to shared.src.types.run-event_types can break server.src.services, while a change to server.src.services can't break shared.src.types.run-event_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.sandbox-policy_types, so a change to shared.src.types.sandbox-policy_types can break server.src.services, while a change to server.src.services can't break shared.src.types.sandbox-policy_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.task-envelope_types, so a change to shared.src.types.task-envelope_types can break server.src.services, while a change to server.src.services can't break shared.src.types.task-envelope_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.work-product_types, so a change to shared.src.types.work-product_types can break server.src.services, while a change to server.src.services can't break shared.src.types.work-product_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.run-launch-manifest_types, so a change to shared.src.types.run-launch-manifest_types can break server.src.services, while a change to server.src.services can't break shared.src.types.run-launch-manifest_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.task_types, so a change to shared.src.types.task_types can break server.src.services, while a change to server.src.services can't break shared.src.types.task_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.admission-control_types, so a change to shared.src.types.admission-control_types can break server.src.services, while a change to server.src.services can't break shared.src.types.admission-control_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.telemetry_types, so a change to shared.src.types.telemetry_types can break server.src.services, while a change to server.src.services can't break shared.src.types.telemetry_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.template_types, so a change to shared.src.types.template_types can break server.src.services, while a change to server.src.services can't break shared.src.types.template_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses server.src.services.workflow-run-service, so a change to server.src.services.workflow-run-service can break server.src.services, while a change to server.src.services can't break server.src.services.workflow-run-service.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses shared.src.types.config_types, so a change to shared.src.types.config_types can break server.src.services, while a change to server.src.services can't break shared.src.types.config_types.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses server.src.services.config-service, so a change to server.src.services.config-service can break server.src.services, while a change to server.src.services can't break server.src.services.config-service.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses server.src.services.queue-intake-monitor-service, so a change to server.src.services.queue-intake-monitor-service can break server.src.services, while a change to server.src.services can't break server.src.services.queue-intake-monitor-service.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses server.src.storage.interfaces, so a change to server.src.storage.interfaces can break server.src.services, while a change to server.src.services can't break server.src.storage.interfaces.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses server.src.services.run-event-journal-service, so a change to server.src.services.run-event-journal-service can break server.src.services, while a change to server.src.services can't break server.src.services.run-event-journal-service.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses server.src.services.task-service, so a change to server.src.services.task-service can break server.src.services, while a change to server.src.services can't break server.src.services.task-service.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses server.src.services.run-approval-broker-service, so a change to server.src.services.run-approval-broker-service can break server.src.services, while a change to server.src.services can't break server.src.services.run-approval-broker-service.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
server.src.services uses server.src.services.clawdbot-agent-service, so a change to server.src.services.clawdbot-agent-service can break server.src.services, while a change to server.src.services can't break server.src.services.clawdbot-agent-service.
Position
Below the diagonal: server.src.services uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 50.0 · Adequate · gated by D1, D2, R3 ·
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 category
Findings
Severity
A05:2025 — Injection
641
High / Critical
A03:2025 — Software Supply Chain Failures
9
Medium
A07:2025 — Authentication Failures
3
High / Critical
A02:2025 — Security Misconfiguration
3
Medium
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 this
Helps
Effort
Dimension
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
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.
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.
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.
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.
File
Score
Band
Worst signal
REDACTED
0.0
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
0.0
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
0.6
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.6
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.7
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.2
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.3
Mixed
Static 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
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
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.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
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.
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.
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.
+ 369 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
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.
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.
+ 433 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
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.
Do you agree with this assessment?
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.
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).
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).
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.
Do you agree with this assessment?
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.
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.
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.
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.
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.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
What 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.
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.
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
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).
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.
Do you agree with this assessment?
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.
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
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).
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).
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.
Do you agree with this assessment?
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.
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
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.
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.
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.
Resolve the 9 Deprecated finding(s) in Dependency Hygiene — start with REDACTED (9). — One of this dimension's main actionable groups (9 recommendation-level).
Resolve the 1 Deprecated finding(s) in Dependency Hygiene — start with package.json. — One of this dimension's main actionable groups (1 warning-level).
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.
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.
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.
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.
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.
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.
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)
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).
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.
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.
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.
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.
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.
Do you agree with this assessment?
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.
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
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.
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.
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
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).
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.
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.
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.
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.
doc comments repeat the names · ×3server/src/config/env.ts:135
What to do
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.
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
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.
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.
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.
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.
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
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
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.
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).
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
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).
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).
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.
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.
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.
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.
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.
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.
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.
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).
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).
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.
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.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
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).
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.
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.
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.
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.
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
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.
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.
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.
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.
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.
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.
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.
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.
Do you agree with this assessment?
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.
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.
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.
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.
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.
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.
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.
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.
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
P2 · Observability7.8 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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.
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.
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.
Do you agree with this assessment?
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.
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.
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
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.
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
Do you agree with this assessment?
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.
Do you agree with this assessment?
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
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
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.
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.
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.
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.
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.
Do you agree with this assessment?
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.
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.
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.
Do you agree with this assessment?
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.
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.
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.
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.
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.
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.
Do you agree with this assessment?
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.
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
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
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
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 `?`).
Do you agree with this assessment?
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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
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
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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]
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
Issues: 56 · Warnings: 2411 · Recommendations: 300 · Info: 34 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 11:42 UTC.
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.